Alexandre Julliard : gdi32: Replace the SelectVisRgn Wine-specific export by a private entry point.

Alexandre Julliard julliard at winehq.org
Mon Jul 26 13:22:39 CDT 2010


Module: wine
Branch: master
Commit: 1472f35e823f84721d867494148f721d72f9dc7d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1472f35e823f84721d867494148f721d72f9dc7d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul 26 15:28:02 2010 +0200

gdi32: Replace the SelectVisRgn Wine-specific export by a private entry point.

---

 dlls/gdi32/clipping.c   |   20 +++++++++-----------
 dlls/gdi32/gdi32.spec   |    2 +-
 dlls/user32/painting.c  |    5 +----
 dlls/user32/sysparams.c |    2 --
 include/wingdi.h        |    5 ++++-
 5 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c
index a942fe1..e865656 100644
--- a/dlls/gdi32/clipping.c
+++ b/dlls/gdi32/clipping.c
@@ -156,26 +156,24 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode )
 }
 
 /***********************************************************************
- *           SelectVisRgn   (GDI32.@)
- *
- * Note: not exported on Windows, only the 16-bit version is exported.
+ *           __wine_set_visible_region   (GDI32.@)
  */
-INT WINAPI SelectVisRgn( HDC hdc, HRGN hrgn )
+void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect )
 {
-    int retval;
     DC * dc;
 
-    if (!hrgn) return ERROR;
-    if (!(dc = get_dc_ptr( hdc ))) return ERROR;
+    if (!(dc = get_dc_ptr( hdc ))) return;
 
-    TRACE("%p %p\n", hdc, hrgn );
+    TRACE( "%p %p %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect) );
 
-    dc->dirty = 0;
+    /* map region to DC coordinates */
+    OffsetRgn( hrgn, -vis_rect->left, -vis_rect->top );
 
-    retval = CombineRgn( dc->hVisRgn, hrgn, 0, RGN_COPY );
+    DeleteObject( dc->hVisRgn );
+    dc->dirty = 0;
+    dc->hVisRgn = hrgn;
     CLIPPING_UpdateGCRegion( dc );
     release_dc_ptr( dc );
-    return retval;
 }
 
 
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index d3843e6..f66e7d5 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -514,7 +514,6 @@
 # Wine extensions: Win16 functions that are needed by other dlls
 #
 @ stdcall GetDCHook(long ptr)
-@ stdcall SelectVisRgn(long long)
 @ stdcall SetDCHook(long ptr long)
 @ stdcall SetHookFlags(long long)
 
@@ -526,3 +525,4 @@
 
 # GDI objects
 @ cdecl __wine_make_gdi_object_system(long long)
+@ cdecl __wine_set_visible_region(long long ptr)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index cd096cd..969c63e 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -160,10 +160,7 @@ static void update_visible_region( struct dce *dce )
     if (dce->clip_rgn) CombineRgn( vis_rgn, vis_rgn, dce->clip_rgn,
                                    (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
 
-    /* map region to DC coordinates */
-    OffsetRgn( vis_rgn, -win_rect.left, -win_rect.top );
-    SelectVisRgn( dce->hdc, vis_rgn );
-    DeleteObject( vis_rgn );
+    __wine_set_visible_region( dce->hdc, vis_rgn, &win_rect );
 }
 
 
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 3d4075f..8c6367e 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -384,8 +384,6 @@ static const WORD wPattern55AA[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xa
 
 HBRUSH SYSCOLOR_55AABrush = 0;
 
-extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
-
 
 static void SYSPARAMS_LogFont16To32W( const LOGFONT16 *font16, LPLOGFONTW font32 )
 {
diff --git a/include/wingdi.h b/include/wingdi.h
index 53db856..3f5058f 100644
--- a/include/wingdi.h
+++ b/include/wingdi.h
@@ -3790,7 +3790,10 @@ typedef BOOL (CALLBACK *DCHOOKPROC)(HDC,WORD,DWORD_PTR,LPARAM);
 WINGDIAPI DWORD_PTR WINAPI GetDCHook(HDC,DCHOOKPROC*);
 WINGDIAPI BOOL      WINAPI SetDCHook(HDC,DCHOOKPROC,DWORD_PTR);
 WINGDIAPI WORD      WINAPI SetHookFlags(HDC,WORD);
-WINGDIAPI INT       WINAPI SelectVisRgn(HDC,HRGN);
+
+extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
+extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect );
+
 #endif /* __WINESRC__ */
 
 #ifdef __cplusplus




More information about the wine-cvs mailing list