summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-09-04 17:52:46 +0200
committerAlexander Larsson <alexl@redhat.com>2009-09-04 17:59:17 +0200
commitd0ac27fe5f95a92af8cb40ed3db6d35e1874851f (patch)
tree6f3b744269e9eff424e4ff47f1322f455bd080c5
parent0c7830aa42d3e6cd89b42b1c7d42aeaa14fccc7e (diff)
downloadgtk+-d0ac27fe5f95a92af8cb40ed3db6d35e1874851f.tar.gz
Add function accessors for x11 window/pixmap impl
-rw-r--r--gdk/gdk.symbols2
-rw-r--r--gdk/x11/gdkdrawable-x11.c11
-rw-r--r--gdk/x11/gdkdrawable-x11.h2
-rw-r--r--gdk/x11/gdkx.h6
4 files changed, 19 insertions, 2 deletions
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 22226a6467..593059a7a4 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -1219,6 +1219,8 @@ gdk_x11_display_get_startup_notification_id
#if IN_FILE(__GDK_DRAWABLE_X11_C__)
gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid
+gdk_x11_window_get_drawable_impl
+gdk_x11_pixmap_get_drawable_impl
#endif
#if IN_FILE(__GDK_FONT_X11_C__)
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index b2cac294c3..ab98b7fcd2 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -956,6 +956,17 @@ gdk_x11_drawable_get_xid (GdkDrawable *drawable)
return ((GdkDrawableImplX11 *)impl)->xid;
}
+GdkDrawable *
+gdk_x11_window_get_drawable_impl (GdkWindow *window)
+{
+ return ((GdkWindowObject *)window)->impl;
+}
+GdkDrawable *
+gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap)
+{
+ return ((GdkPixmapObject *)pixmap)->impl;
+}
+
/* Code for accelerated alpha compositing using the RENDER extension.
* It's a bit long because there are lots of possibilities for
* what's the fastest depending on the available picture formats,
diff --git a/gdk/x11/gdkdrawable-x11.h b/gdk/x11/gdkdrawable-x11.h
index 7ff60085a1..2b885366f0 100644
--- a/gdk/x11/gdkdrawable-x11.h
+++ b/gdk/x11/gdkdrawable-x11.h
@@ -92,6 +92,8 @@ void _gdk_x11_convert_to_format (guchar *src_buf,
/* Note that the following take GdkDrawableImplX11, not the wrapper drawable */
void _gdk_x11_drawable_finish (GdkDrawable *drawable);
void _gdk_x11_drawable_update_size (GdkDrawable *drawable);
+GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
+GdkDrawable *gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap);
G_END_DECLS
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index baa395d392..d8aa42c843 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -40,6 +40,8 @@ extern Display *gdk_display;
Display *gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable);
XID gdk_x11_drawable_get_xid (GdkDrawable *drawable);
+GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
+GdkDrawable *gdk_x11_pixmap_get_drawable_impl (GdkPixmap *pixmap);
Display *gdk_x11_image_get_xdisplay (GdkImage *image);
XImage *gdk_x11_image_get_ximage (GdkImage *image);
Display *gdk_x11_colormap_get_xdisplay (GdkColormap *colormap);
@@ -105,10 +107,10 @@ gint gdk_x11_get_default_screen (void);
#define GDK_DISPLAY_XDISPLAY(display) (gdk_x11_display_get_xdisplay (display))
-#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (((GdkWindowObject *)win)->impl))
+#define GDK_WINDOW_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (gdk_x11_window_get_drawable_impl (win)))
#define GDK_WINDOW_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_WINDOW_XWINDOW(win) (gdk_x11_drawable_get_xid (win))
-#define GDK_PIXMAP_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (((GdkPixmapObject *)win)->impl))
+#define GDK_PIXMAP_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (gdk_x11_pixmap_get_drawable_impl (win)))
#define GDK_PIXMAP_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_DRAWABLE_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win))
#define GDK_DRAWABLE_XID(win) (gdk_x11_drawable_get_xid (win))