[gnome-shell] Add compatibility with GTK+ 2.18



commit 6318c8e95b6fa9ad4ac77efa5ccd6fd6a794e62b
Author: Florian Müllner <fmuellner src gnome org>
Date:   Mon May 10 17:57:05 2010 +0200

    Add compatibility with GTK+ 2.18
    
    To replace all calls to deprecated code, GTK+ 2.20 is required - add
    some basic compatibility code, so that is still possible to build the
    shell with GTK+ 2.18 when not using -DGSEAL_ENABLE.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=618258

 configure.ac                |    2 +-
 src/Makefile-tray.am        |    1 +
 src/Makefile.am             |    1 +
 src/gtk-compat.h            |   19 +++++++++++++++++++
 src/shell-embedded-window.c |    1 +
 src/shell-gtk-embed.c       |    1 +
 src/tray/na-tray-child.c    |    1 +
 src/tray/na-tray-manager.c  |    1 +
 8 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2dc651e..ef833dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ CLUTTER_MIN_VERSION=1.2.0
 GOBJECT_INTROSPECTION_MIN_VERSION=0.6.9
 GJS_MIN_VERSION=0.6
 MUTTER_MIN_VERSION=2.29.1
-GTK_MIN_VERSION=2.20.0
+GTK_MIN_VERSION=2.18.0
 
 # Collect more than 20 libraries for a prize!
 PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-unix-2.0 dbus-glib-1
diff --git a/src/Makefile-tray.am b/src/Makefile-tray.am
index 86e41cc..64e397f 100644
--- a/src/Makefile-tray.am
+++ b/src/Makefile-tray.am
@@ -15,6 +15,7 @@ TRAY_STAMP_FILES = stamp-na-marshal.h
 
 # please, keep this sorted alphabetically
 tray_source =			\
+	gtk-compat.h		\
 	tray/na-tray-child.c	\
 	tray/na-tray-child.h	\
 	tray/na-tray-manager.c	\
diff --git a/src/Makefile.am b/src/Makefile.am
index a78d10e..7fc7a56 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -82,6 +82,7 @@ libgnome_shell_la_SOURCES =		\
 	$(shell_built_sources)		\
 	$(shell_public_headers_h)	\
 	gnome-shell-plugin.c		\
+	gtk-compat.h			\
 	shell-app.c			\
 	shell-app-private.h		\
 	shell-app-system.c		\
diff --git a/src/gtk-compat.h b/src/gtk-compat.h
new file mode 100644
index 0000000..9515205
--- /dev/null
+++ b/src/gtk-compat.h
@@ -0,0 +1,19 @@
+#ifndef __GTK_COMPAT_H__
+#define __GTK_COMPAT_H__
+
+#include <gtk/gtk.h>
+
+/* Provide a compatibility layer for accessor functions introduced
+ * in GTK+ 2.20 which we need to build with GSEAL_ENABLE.
+ * That way it is still possible to build with GTK+ 2.18 when not
+ * using GSEAL_ENABLE
+ */
+
+#if !GTK_CHECK_VERSION(2, 20, 0)
+
+#define gtk_widget_get_realized(w) GTK_WIDGET_REALIZED (w)
+#define gtk_widget_get_mapped(w)   GTK_WIDGET_MAPPED (w)
+
+#endif /* GTK_CHECK_VERSION(2, 20, 0) */
+
+#endif /* __GTK_COMPAT_H__ */
diff --git a/src/shell-embedded-window.c b/src/shell-embedded-window.c
index 1f11780..ce084fb 100644
--- a/src/shell-embedded-window.c
+++ b/src/shell-embedded-window.c
@@ -6,6 +6,7 @@
 #include <clutter/x11/clutter-x11.h>
 
 #include "shell-embedded-window-private.h"
+#include "gtk-compat.h"
 
 /* This type is a subclass of GtkWindow that ties the window to a
  * ShellGtkEmbed; the window is reparented into the stage
diff --git a/src/shell-gtk-embed.c b/src/shell-gtk-embed.c
index 7057347..0f763bf 100644
--- a/src/shell-gtk-embed.c
+++ b/src/shell-gtk-embed.c
@@ -3,6 +3,7 @@
 #include "config.h"
 
 #include "shell-embedded-window-private.h"
+#include "gtk-compat.h"
 
 #include <clutter/glx/clutter-glx.h>
 #include <clutter/x11/clutter-x11.h>
diff --git a/src/tray/na-tray-child.c b/src/tray/na-tray-child.c
index 19a3073..be0a616 100644
--- a/src/tray/na-tray-child.c
+++ b/src/tray/na-tray-child.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "na-tray-child.h"
+#include "gtk-compat.h"
 
 #include <glib/gi18n-lib.h>
 #include <gdk/gdk.h>
diff --git a/src/tray/na-tray-manager.c b/src/tray/na-tray-manager.c
index cebc7ad..4dee409 100644
--- a/src/tray/na-tray-manager.c
+++ b/src/tray/na-tray-manager.c
@@ -25,6 +25,7 @@
 #include <libintl.h>
 
 #include "na-tray-manager.h"
+#include "gtk-compat.h"
 
 #include <gdkconfig.h>
 #include <glib/gi18n-lib.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]