Alexandre Julliard : winex11: Add a GET_DRAWABLE escape to mirror the SET_DRAWABLE one.

Alexandre Julliard julliard at winehq.org
Wed Jun 27 19:14:00 CDT 2012


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jun 27 13:57:26 2012 +0200

winex11: Add a GET_DRAWABLE escape to mirror the SET_DRAWABLE one.

---

 dlls/winex11.drv/init.c   |    8 ++++++++
 dlls/winex11.drv/opengl.c |   10 ++++++++++
 dlls/winex11.drv/x11drv.h |   11 +++++++++++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 46204d8..cf4d10c 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -362,6 +362,14 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
                     return TRUE;
                 }
                 break;
+            case X11DRV_GET_DRAWABLE:
+                if (out_count >= sizeof(struct x11drv_escape_get_drawable))
+                {
+                    struct x11drv_escape_get_drawable *data = out_data;
+                    data->drawable = physDev->drawable;
+                    return TRUE;
+                }
+                break;
             case X11DRV_START_EXPOSURES:
                 wine_tsx11_lock();
                 XSetGraphicsExposures( gdi_display, physDev->gc, True );
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b49fd07..aa7faa8 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3436,6 +3436,16 @@ static INT glxdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
                        dev->hdc, physdev->drawable, physdev->pixel_format, physdev->type );
             }
             break;
+        case X11DRV_GET_DRAWABLE:
+            if (out_count >= sizeof(struct x11drv_escape_get_drawable))
+            {
+                struct x11drv_escape_get_drawable *data = out_data;
+                data->pixel_format = physdev->pixel_format;
+                data->gl_type      = physdev->type;
+                data->gl_drawable  = physdev->drawable;
+                data->pixmap       = physdev->pixmap;
+            }
+            break;
         case X11DRV_FLUSH_GL_DRAWABLE:
             flush_gl_drawable( physdev );
             return TRUE;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 1adecd8..df01379 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -289,6 +289,7 @@ extern void X11DRV_PALETTE_ComputeColorShifts(ColorShifts *shifts, unsigned long
 enum x11drv_escape_codes
 {
     X11DRV_SET_DRAWABLE,     /* set current drawable for a DC */
+    X11DRV_GET_DRAWABLE,     /* get current drawable for a DC */
     X11DRV_START_EXPOSURES,  /* start graphics exposures */
     X11DRV_END_EXPOSURES,    /* end graphics exposures */
     X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */
@@ -307,6 +308,16 @@ struct x11drv_escape_set_drawable
     enum dc_gl_type          gl_type;      /* type of GL device context */
 };
 
+struct x11drv_escape_get_drawable
+{
+    enum x11drv_escape_codes code;         /* escape code (X11DRV_GET_DRAWABLE) */
+    Drawable                 drawable;     /* X drawable */
+    Drawable                 gl_drawable;  /* GL drawable */
+    Pixmap                   pixmap;       /* Pixmap for a GLXPixmap gl_drawable */
+    int                      pixel_format; /* internal GL pixel format */
+    enum dc_gl_type          gl_type;      /* type of GL device context */
+};
+
 /**************************************************************************
  * X11 USER driver
  */




More information about the wine-cvs mailing list