[gtk+] Add function accessors for x11 window/pixmap impl
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Add function accessors for x11 window/pixmap impl
- Date: Fri, 4 Sep 2009 15:59:56 +0000 (UTC)
commit d0ac27fe5f95a92af8cb40ed3db6d35e1874851f
Author: Alexander Larsson <alexl redhat com>
Date: Fri Sep 4 17:52:46 2009 +0200
Add function accessors for x11 window/pixmap impl
gdk/gdk.symbols | 2 ++
gdk/x11/gdkdrawable-x11.c | 11 +++++++++++
gdk/x11/gdkdrawable-x11.h | 2 ++
gdk/x11/gdkx.h | 6 ++++--
4 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 22226a6..593059a 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 b2cac29..ab98b7f 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 7ff6008..2b88536 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 baa395d..d8aa42c 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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]