[evolution-data-server/gtk3-rebased: 2/8] Drop backward-compatibility cruft.



commit 93ecccc527370f8f29b0a040f4b629b05b300cb1
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jan 9 11:54:10 2011 -0500

    Drop backward-compatibility cruft.

 docs/reference/libedataserverui/Makefile.am |    3 +-
 libedataserverui/Makefile.am                |    3 +-
 libedataserverui/e-categories-dialog.c      |    3 --
 libedataserverui/e-name-selector-dialog.c   |   10 ------
 libedataserverui/e-name-selector-entry.c    |    3 --
 libedataserverui/e-name-selector-list.c     |    3 --
 libedataserverui/e-passwords.c              |    3 --
 libedataserverui/e-source-selector-dialog.c |    3 --
 libedataserverui/e-source-selector.c        |   22 +++++++-----
 libedataserverui/gtk-compat.h               |   46 ---------------------------
 10 files changed, 15 insertions(+), 84 deletions(-)
---
diff --git a/docs/reference/libedataserverui/Makefile.am b/docs/reference/libedataserverui/Makefile.am
index 419e830..2b208ea 100644
--- a/docs/reference/libedataserverui/Makefile.am
+++ b/docs/reference/libedataserverui/Makefile.am
@@ -15,8 +15,7 @@ HFILE_GLOB = $(top_srcdir)/libedataserverui/*.h
 CFILE_GLOB = $(top_srcdir)/libedataserverui/*.c
 
 IGNORE_HFILES = 			\
-	e-data-server-ui-marshal.h	\
-	gtk-compat.h
+	e-data-server-ui-marshal.h
 
 GTKDOC_CFLAGS  =					\
 	-I$(top_srcdir)/libedataserverui		\
diff --git a/libedataserverui/Makefile.am b/libedataserverui/Makefile.am
index 3bc959b..b3db0c0 100644
--- a/libedataserverui/Makefile.am
+++ b/libedataserverui/Makefile.am
@@ -56,8 +56,7 @@ libedataserverui_3_0_la_SOURCES =	\
 	e-source-selector-dialog.c	\
 	e-source-combo-box.c		\
 	e-tree-model-generator.c	\
-	e-cell-renderer-color.c		\
-	gtk-compat.h
+	e-cell-renderer-color.c
 
 libedataserverui_3_0_la_CPPFLAGS = $(CPPFLAGS)
 
diff --git a/libedataserverui/e-categories-dialog.c b/libedataserverui/e-categories-dialog.c
index 8f14dd5..09260f6 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -30,9 +30,6 @@
 #include "e-categories-dialog.h"
 #include "e-category-completion.h"
 
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
 #define E_CATEGORIES_DIALOG_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_CATEGORIES_DIALOG, ECategoriesDialogPrivate))
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index a24410e..b153687 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -35,17 +35,10 @@
 #include "e-name-selector-dialog.h"
 #include "e-name-selector-entry.h"
 
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
 #define E_NAME_SELECTOR_DIALOG_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_NAME_SELECTOR_DIALOG, ENameSelectorDialogPrivate))
 
-#if !GTK_CHECK_VERSION (2,23,0)
-	ENSURE_GTK_COMBO_BOX_TEXT_TYPE
-#endif
-
 typedef struct {
 	gchar        *name;
 
@@ -408,9 +401,6 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 	gtk_window_set_modal            (GTK_WINDOW (name_selector_dialog), TRUE);
 	gtk_window_set_default_size     (GTK_WINDOW (name_selector_dialog), 700, -1);
 	gtk_window_set_resizable        (GTK_WINDOW (name_selector_dialog), TRUE);
-#if !GTK_CHECK_VERSION(2,90,7)
-	g_object_set (name_selector_dialog, "has-separator", FALSE, NULL);
-#endif
 	gtk_container_set_border_width  (GTK_CONTAINER (name_selector_dialog), 4);
 	gtk_window_set_title            (GTK_WINDOW (name_selector_dialog), _("Select Contacts from Address Book"));
 	gtk_widget_grab_focus (search);
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index 0340fba..4048bde 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -34,9 +34,6 @@
 
 #include "e-name-selector-entry.h"
 
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
 #define E_NAME_SELECTOR_ENTRY_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryPrivate))
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index 19612f3..dd61f02 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -37,9 +37,6 @@
 #include <libedataserverui/e-name-selector-entry.h>
 #include "e-name-selector-list.h"
 
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
 #define E_NAME_SELECTOR_LIST_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_NAME_SELECTOR_LIST, ENameSelectorListPrivate))
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 1bafc73..6688f31 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -724,9 +724,6 @@ ep_ask_password (EPassMsg *msg)
 		GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 		GTK_STOCK_OK, GTK_RESPONSE_OK,
 		NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
-	g_object_set (widget, "has-separator", FALSE, NULL);
-#endif
 	gtk_dialog_set_default_response (
 		GTK_DIALOG (widget), GTK_RESPONSE_OK);
 	gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
diff --git a/libedataserverui/e-source-selector-dialog.c b/libedataserverui/e-source-selector-dialog.c
index 5082170..54d2e28 100644
--- a/libedataserverui/e-source-selector-dialog.c
+++ b/libedataserverui/e-source-selector-dialog.c
@@ -99,9 +99,6 @@ e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
 	/* prepare the dialog */
 	gtk_window_set_title (GTK_WINDOW (dialog), _("Select destination"));
 	gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240);
-#if !GTK_CHECK_VERSION(2,90,7)
-	g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
 	gtk_widget_ensure_style (GTK_WIDGET (dialog));
 	gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
 	gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index 9952f69..f0fb5a5 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -30,9 +30,6 @@
 #include "e-data-server-ui-marshal.h"
 #include "e-source-selector.h"
 
-/* backward-compatibility cruft */
-#include "gtk-compat.h"
-
 #define E_SOURCE_SELECTOR_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_SOURCE_SELECTOR, ESourceSelectorPrivate))
@@ -101,14 +98,21 @@ safe_toggle_activate (GtkCellRenderer      *cell,
 		      GtkCellRendererState  flags)
 {
 	if (event->type == GDK_BUTTON_PRESS && cell_area) {
-		GdkRegion *reg = gdk_region_rectangle (cell_area);
+		cairo_region_t *region;
+		gboolean contains_point;
 
-		if (!gdk_region_point_in (reg, event->button.x, event->button.y)) {
-			gdk_region_destroy (reg);
-			return FALSE;
-		}
+		if (cell_area->width > 0 && cell_area->height > 0)
+			region = cairo_region_create_rectangle (cell_area);
+		else
+			region = cairo_region_create ();
 
-		gdk_region_destroy (reg);
+		contains_point = cairo_region_contains_point (
+			region, event->button.x, event->button.y);
+
+		cairo_region_destroy (region);
+
+		if (!contains_point)
+			return FALSE;
 	}
 
 	return GTK_CELL_RENDERER_CLASS (e_cell_renderer_safe_toggle_parent_class)->activate (cell, event, widget, path, background_area, cell_area, flags);
diff --git a/libedataserverui/gtk-compat.h b/libedataserverui/gtk-compat.h
index 21d861b..c24f8c6 100644
--- a/libedataserverui/gtk-compat.h
+++ b/libedataserverui/gtk-compat.h
@@ -5,50 +5,4 @@
 
 /* Provide a GTK+ compatibility layer. */
 
-#if !GTK_CHECK_VERSION (2,23,0)
-#define gtk_combo_box_text_new			gtk_combo_box_new_text
-#define gtk_combo_box_text_append_text		gtk_combo_box_append_text
-#define gtk_combo_box_text_get_active_text	gtk_combo_box_get_active_text
-#define GTK_COMBO_BOX_TEXT			GTK_COMBO_BOX
-
-/* The below can be used only once in sources */
-#define ENSURE_GTK_COMBO_BOX_TEXT_TYPE						\
-	GType gtk_combo_box_text_get_type (void);				\
-	typedef struct _GtkComboBoxText GtkComboBoxText;			\
-	typedef struct _GtkComboBoxTextClass GtkComboBoxTextClass;		\
-										\
-	struct _GtkComboBoxText {						\
-		GtkComboBox parent;						\
-	};									\
-										\
-	struct _GtkComboBoxTextClass {						\
-		GtkComboBoxClass parent_class;					\
-	};									\
-										\
-										\
-	G_DEFINE_TYPE (GtkComboBoxText, gtk_combo_box_text, GTK_TYPE_COMBO_BOX)	\
-										\
-	static void gtk_combo_box_text_init (GtkComboBoxText *cbt) {}		\
-	static void gtk_combo_box_text_class_init (GtkComboBoxTextClass *kl) {}
-
-#endif
-
-#if GTK_CHECK_VERSION (2,90,5)
-
-/* Recreate GdkRegion until we drop GTK2 compatibility. */
-
-#define GdkRegion cairo_region_t
-
-#define gdk_region_destroy(region) \
-	(cairo_region_destroy (region))
-
-#define gdk_region_point_in(region, x, y) \
-	(cairo_region_contains_point ((region), (x), (y)))
-
-#define gdk_region_rectangle(rectangle) \
-	(((rectangle)->width <= 0 || (rectangle->height <= 0)) ? \
-	cairo_region_create () : cairo_region_create_rectangle (rectangle))
-
-#endif
-
 #endif /* __GTK_COMPAT_H__ */



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