diff options
author | Benjamin Otte <otte@redhat.com> | 2010-12-20 23:43:04 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-21 12:07:07 -0500 |
commit | 4848bf2719a2159ee2fc8ba309b649115efb7f17 (patch) | |
tree | 16622181663138c3df367245a41c2048b7fa0518 /gdk/x11/gdkx11display.h | |
parent | eba45292464da5334cef8d4e36e01bb70256b549 (diff) | |
download | gtk+-4848bf2719a2159ee2fc8ba309b649115efb7f17.tar.gz |
x11: typedef GdkX11Display to GdkDisplay
This is for compatibility reasons. We want to change APIs that operate
on X11 objects to take the X11 objects as arguments. However, this would
break a lot of APIs and we'd like to avoid this, so we play this little
trick (we will use the same trick for the other X11 objects). Also,
gobject-introspection and other bindings can correctly attach the
functions to the correct types as it is the same scheme that GDK2 used
for pixmaps, windows and drawables.
For GTK 4, we will remove this trick, so apps should properly cast their
objects right now.
Unfortunately, I don't think there is a way to use
GDK_DISABLE_DEPRECATED or similar macros to check for proper type casts
while compiling ensure compatibility with future GDK versions. I'm free
to consider them though.
Diffstat (limited to 'gdk/x11/gdkx11display.h')
-rw-r--r-- | gdk/x11/gdkx11display.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/x11/gdkx11display.h b/gdk/x11/gdkx11display.h index 70e8a140d5..b544ac47bc 100644 --- a/gdk/x11/gdkx11display.h +++ b/gdk/x11/gdkx11display.h @@ -38,7 +38,11 @@ G_BEGIN_DECLS +#ifdef GDK_COMPILATION typedef struct _GdkX11Display GdkX11Display; +#else +typedef GdkDisplay GdkX11Display; +#endif typedef struct _GdkX11DisplayClass GdkX11DisplayClass; #define GDK_TYPE_X11_DISPLAY (gdk_x11_display_get_type()) |