summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkx11utils.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-01-28 15:11:44 +0100
committerBenjamin Otte <otte@redhat.com>2011-01-28 17:06:07 +0100
commitbd4ef49af9eb68fea7fb2f87fdb01198287da099 (patch)
treea1a40a792926cd5b4f8ad4cf76880ee2018737d5 /gdk/x11/gdkx11utils.h
parente1f6a24da9f9a41f3857c6c7090812a9cbd82406 (diff)
downloadgtk+-bd4ef49af9eb68fea7fb2f87fdb01198287da099.tar.gz
API: x11: Add GDK_POINTER_TO_XID() and GDK_XID_TO_POINTER()
Previously people used GDK_GPOINTER_TO_NATIVE_WINDOW() for this, but native windows are going away, so we need a replacement.
Diffstat (limited to 'gdk/x11/gdkx11utils.h')
-rw-r--r--gdk/x11/gdkx11utils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdk/x11/gdkx11utils.h b/gdk/x11/gdkx11utils.h
index f00ee5b653..de7ffd36cf 100644
--- a/gdk/x11/gdkx11utils.h
+++ b/gdk/x11/gdkx11utils.h
@@ -52,6 +52,23 @@ Display *gdk_x11_get_default_xdisplay (void);
#define GDK_ROOT_WINDOW() (gdk_x11_get_default_root_xwindow ())
#endif
+/**
+ * GDK_XID_TO_POINTER:
+ *
+ * Converts an XID into a @gpointer. This is useful with data structures
+ * that use pointer arguments such as #GHashTable. Use GDK_POINTER_TO_XID()
+ * to convert the argument back to an XID.
+ */
+#define GDK_XID_TO_POINTER(pointer) GUINT_TO_POINTER(pointer)
+
+/**
+ * GDK_POINTER_TO_XID:
+ *
+ * Converts a @gpointer back to an XID that was previously converted
+ * using GDK_XID_TO_POINTER().
+ */
+#define GDK_POINTER_TO_XID(pointer) GPOINTER_TO_UINT(pointer)
+
#ifndef GDK_MULTIHEAD_SAFE
void gdk_x11_grab_server (void);
void gdk_x11_ungrab_server (void);