Alexandre Julliard : winex11: Use GetDCHook to retrieve the dce pointer instead of storing it in the physdev structure .

Alexandre Julliard julliard at winehq.org
Mon Feb 18 08:50:32 CST 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Feb 18 11:25:14 2008 +0100

winex11: Use GetDCHook to retrieve the dce pointer instead of storing it in the physdev structure.

---

 dlls/winex11.drv/dce.c    |   20 ++------------------
 dlls/winex11.drv/init.c   |   13 +------------
 dlls/winex11.drv/x11drv.h |    6 ++----
 3 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/dlls/winex11.drv/dce.c b/dlls/winex11.drv/dce.c
index a60ddb1..9c223b6 100644
--- a/dlls/winex11.drv/dce.c
+++ b/dlls/winex11.drv/dce.c
@@ -222,7 +222,6 @@ static void delete_clip_rgn( struct dce *dce )
  */
 static struct dce *alloc_cache_dce(void)
 {
-    struct x11drv_escape_set_dce escape;
     struct dce *dce;
 
     if (!(dce = HeapAlloc( GetProcessHeap(), 0, sizeof(*dce) ))) return NULL;
@@ -245,11 +244,6 @@ static struct dce *alloc_cache_dce(void)
     EnterCriticalSection( &dce_section );
     list_add_head( &dce_list, &dce->entry );
     LeaveCriticalSection( &dce_section );
-
-    escape.code = X11DRV_SET_DCE;
-    escape.dce  = dce;
-    ExtEscape( dce->hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL );
-
     return dce;
 }
 
@@ -261,7 +255,6 @@ static struct dce *alloc_cache_dce(void)
  */
 void alloc_window_dce( struct x11drv_win_data *data )
 {
-    struct x11drv_escape_set_dce escape;
     struct dce *dce;
     void *class_ptr = NULL;
     LONG style = GetClassLongW( data->hwnd, GCL_STYLE );
@@ -320,10 +313,6 @@ void alloc_window_dce( struct x11drv_win_data *data )
     list_add_tail( &dce_list, &dce->entry );
     LeaveCriticalSection( &dce_section );
     data->dce = dce;
-
-    escape.code = X11DRV_SET_DCE;
-    escape.dce  = dce;
-    ExtEscape( dce->hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL );
 }
 
 
@@ -579,15 +568,13 @@ HDC X11DRV_GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
  */
 INT X11DRV_ReleaseDC( HWND hwnd, HDC hdc, BOOL end_paint )
 {
-    enum x11drv_escape_codes escape = X11DRV_GET_DCE;
     struct dce *dce;
     BOOL ret = FALSE;
 
     TRACE("%p %p\n", hwnd, hdc );
 
     EnterCriticalSection( &dce_section );
-    if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
-                    sizeof(dce), (LPSTR)&dce )) dce = NULL;
+    dce = (struct dce *)GetDCHook( hdc, NULL );
     if (dce && dce->count)
     {
         if (end_paint || (dce->flags & DCX_CACHE)) delete_clip_rgn( dce );
@@ -653,14 +640,11 @@ static BOOL CALLBACK dc_hook( HDC hDC, WORD code, DWORD_PTR data, LPARAM lParam
  */
 HWND X11DRV_WindowFromDC( HDC hdc )
 {
-    enum x11drv_escape_codes escape = X11DRV_GET_DCE;
     struct dce *dce;
     HWND hwnd = 0;
 
     EnterCriticalSection( &dce_section );
-    if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
-                    sizeof(dce), (LPSTR)&dce )) dce = NULL;
-    if (dce) hwnd = dce->hwnd;
+    if ((dce = (struct dce *)GetDCHook( hdc, NULL ))) hwnd = dce->hwnd;
     LeaveCriticalSection( &dce_section );
     return hwnd;
 }
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index bcf60e5..ebd9dde 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -408,19 +408,8 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
                 }
                 break;
             case X11DRV_GET_DCE:
-                if (out_count >= sizeof(struct dce *))
-                {
-                    *(struct dce **)out_data = physDev->dce;
-                    return TRUE;
-                }
-                break;
             case X11DRV_SET_DCE:
-                if (in_count >= sizeof(struct x11drv_escape_set_dce))
-                {
-                    const struct x11drv_escape_set_dce *data = (const struct x11drv_escape_set_dce *)in_data;
-                    physDev->dce = data->dce;
-                    return TRUE;
-                }
+                FIXME( "%x escape no longer supported\n", *(const enum x11drv_escape_codes *)in_data );
                 break;
             case X11DRV_GET_GLX_DRAWABLE:
                 if (out_count >= sizeof(Drawable))
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index d7fb478..2451e0b 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -65,7 +65,6 @@ typedef int Status;
 #define MAX_DASHLEN 16
 
 struct tagCURSORICONINFO;
-struct dce;
 
 extern void wine_tsx11_lock(void);
 extern void wine_tsx11_unlock(void);
@@ -137,7 +136,6 @@ typedef struct
     int           textPixel;
     int           depth;       /* bit depth of the DC */
     int           exposures;   /* count of graphics exposures operations */
-    struct dce   *dce;         /* opaque pointer to DCE */
     int           current_pf;
     Drawable      gl_drawable;
     Pixmap        pixmap;      /* Pixmap for a GLXPixmap gl_drawable */
@@ -476,8 +474,8 @@ enum x11drv_escape_codes
     X11DRV_SET_DRAWABLE,     /* set current drawable for a DC */
     X11DRV_START_EXPOSURES,  /* start graphics exposures */
     X11DRV_END_EXPOSURES,    /* end graphics exposures */
-    X11DRV_GET_DCE,          /* get the DCE pointer */
-    X11DRV_SET_DCE,          /* set the DCE pointer */
+    X11DRV_GET_DCE,          /* no longer used */
+    X11DRV_SET_DCE,          /* no longer used */
     X11DRV_GET_GLX_DRAWABLE, /* get current glx drawable for a DC */
     X11DRV_SYNC_PIXMAP,      /* sync the dibsection to its pixmap */
     X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */




More information about the wine-cvs mailing list