[evolution-data-server] Add compatibility with GTK+ 2.20



commit 4a6d9fbbc5d70056435d8795f01b55c447e616c2
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jun 3 12:41:44 2010 +0200

    Add compatibility with GTK+ 2.20
    
    The upcoming Gdk 2.22/3.0 will be sealed. Accessor functions are
    available, but it raises the required minimum version to 2.22 - add
    some basic compatibility code, so that it is still possible to build
    with an unsealed GDK.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=620466

 configure.ac                         |    2 +-
 libedataserverui/Makefile.am         |    3 ++-
 libedataserverui/e-source-selector.c |    1 +
 libedataserverui/gtk-compat.h        |   19 +++++++++++++++++++
 4 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 68dd648..0796e0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl Required Package Versions
 m4_define([glib_minimum_version], [2.16.1])
-m4_define([gtk_minimum_version], [2.22.0])
+m4_define([gtk_minimum_version], [2.20.0])
 m4_define([gconf_minimum_version], [2.0.0])		dnl XXX Just a Guess
 m4_define([libxml_minimum_version], [2.0.0])		dnl XXX Just a Guess
 m4_define([libsoup_minimum_version], [2.3.0])
diff --git a/libedataserverui/Makefile.am b/libedataserverui/Makefile.am
index 4bc5c74..0759d58 100644
--- a/libedataserverui/Makefile.am
+++ b/libedataserverui/Makefile.am
@@ -37,7 +37,8 @@ libedataserverui_1_2_la_SOURCES =	\
 	e-source-selector-dialog.c	\
 	e-source-combo-box.c		\
 	e-tree-model-generator.c	\
-	e-cell-renderer-color.c
+	e-cell-renderer-color.c		\
+	gtk-compat.h
 
 libedataserverui_1_2_la_LIBADD = 				\
 	$(top_builddir)/addressbook/libebook/libebook-1.2.la	\
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index ea93e73..5423117 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -29,6 +29,7 @@
 
 #include "e-data-server-ui-marshal.h"
 #include "e-source-selector.h"
+#include "gtk-compat.h"
 
 #define E_SOURCE_SELECTOR_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/libedataserverui/gtk-compat.h b/libedataserverui/gtk-compat.h
new file mode 100644
index 0000000..8580f8e
--- /dev/null
+++ b/libedataserverui/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.22 which we need to build with sealed GDK.
+ * That way it is still possible to build with GTK+ 2.20.
+ */
+
+#if !GTK_CHECK_VERSION(2, 21, 0)
+
+#define gdk_drag_context_get_actions(context)          (context)->actions
+#define gdk_drag_context_get_suggested_action(context) (context)->suggested_action
+#define gdk_drag_context_get_selected_action(context)  (context)->action
+
+#endif /* GTK_CHECK_VERSION(2, 21, 0) */
+
+#endif /* __GTK_COMPAT_H__ */



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