aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-09 21:48:33 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-25 23:28:26 +0800
commit753c60fc67a0a56a5f119c14ffa54ea9af95c208 (patch)
tree68b53c740bcbd3cff0f863ba72a5a2b3d49f3e56 /e-util
parentdfc28aa9cefad63fb0fc926ce725f7cad8125cb0 (diff)
downloadgsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar.gz
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar.bz2
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar.lz
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar.xz
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.tar.zst
gsoc2013-evolution-753c60fc67a0a56a5f119c14ffa54ea9af95c208.zip
Drop backward-compatibility cruft.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/Makefile.am1
-rw-r--r--e-util/e-alert-dialog.c4
-rw-r--r--e-util/e-datetime-format.c30
-rw-r--r--e-util/e-plugin-util.c3
-rw-r--r--e-util/e-text-event-processor-emacs-like.c3
-rw-r--r--e-util/e-unicode.c3
-rw-r--r--e-util/e-util.c8
-rw-r--r--e-util/gtk-compat.h176
8 files changed, 10 insertions, 218 deletions
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 3f4388ebe1..a92f615263 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -136,7 +136,6 @@ libeutil_la_SOURCES = \
e-util-private.h \
e-xml-utils.c \
gconf-bridge.c \
- gtk-compat.h \
$(PLATFORM_SOURCES)
libeutil_la_LDFLAGS = $(NO_UNDEFINED)
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 81a84746f6..df5ec1dbcb 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -129,10 +129,6 @@ alert_dialog_constructed (GObject *object)
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-#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 (action_area), 12);
gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index 39f0e36e0f..471ca29700 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -25,9 +25,6 @@
#include "e-datetime-format.h"
#include "e-util.h"
-/* backward-compatibility cruft */
-#include "e-util/gtk-compat.h"
-
#define KEYS_FILENAME "datetime-formats.ini"
#define KEYS_GROUPNAME "formats"
@@ -497,6 +494,7 @@ unref_setup_keyfile (gpointer ptr)
void
e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *component, const gchar *part, DTFormatKind kind, const gchar *caption)
{
+ GtkListStore *store;
GtkWidget *label, *combo, *preview, *align;
gchar *key;
@@ -508,23 +506,15 @@ e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *com
key = gen_key (component, part, kind);
label = gtk_label_new_with_mnemonic (caption ? caption : _("Format:"));
-#if GTK_CHECK_VERSION(2,23,0)
- /* FIXME Rewrite this when removing the version check. */
- {
- GtkListStore *store;
-
- store = gtk_list_store_new (1, G_TYPE_STRING);
- combo = g_object_new (
- GTK_TYPE_COMBO_BOX_TEXT,
- "model", store,
- "has-entry", TRUE,
- "entry-text-column", 0,
- NULL);
- g_object_unref (store);
- }
-#else
- combo = gtk_combo_box_entry_new_text ();
-#endif
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+ combo = g_object_new (
+ GTK_TYPE_COMBO_BOX_TEXT,
+ "model", store,
+ "has-entry", TRUE,
+ "entry-text-column", 0,
+ NULL);
+ g_object_unref (store);
fill_combo_formats (combo, key, kind);
gtk_label_set_mnemonic_widget ((GtkLabel *)label, combo);
diff --git a/e-util/e-plugin-util.c b/e-util/e-plugin-util.c
index 8ff3b28778..4e04bc3c18 100644
--- a/e-util/e-plugin-util.c
+++ b/e-util/e-plugin-util.c
@@ -25,9 +25,6 @@
#include "e-plugin-util.h"
-/* backward-compatibility cruft */
-#include "e-util/gtk-compat.h"
-
/* name of a property on a widget with corresponding property name for an ESource */
#define EPU_SP_NAME "e-source-property-name"
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
index 3851590f0f..d69c53aa8d 100644
--- a/e-util/e-text-event-processor-emacs-like.c
+++ b/e-util/e-text-event-processor-emacs-like.c
@@ -29,9 +29,6 @@
#include "e-text-event-processor-emacs-like.h"
#include "e-util.h"
-/* backward-compatibility cruft */
-#include "e-util/gtk-compat.h"
-
static gint e_text_event_processor_emacs_like_event
(ETextEventProcessor *tep,
ETextEventProcessorEvent *event);
diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c
index 59e94aa25e..46d6a6c996 100644
--- a/e-util/e-unicode.c
+++ b/e-util/e-unicode.c
@@ -39,9 +39,6 @@
#include <glib/gi18n.h>
#include "e-unicode.h"
-/* backward-compatibility cruft */
-#include "e-util/gtk-compat.h"
-
#define d(x)
#define FONT_TESTING
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 4c2764de4b..88fcfaebfb 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -57,14 +57,6 @@
#include "e-util.h"
#include "e-util-private.h"
-#include "gtk-compat.h"
-
-#if !GTK_CHECK_VERSION (2,23,0)
- #undef GtkComboBoxText
- ENSURE_GTK_COMBO_BOX_TEXT_TYPE
-#else
- ENSURE_GTK_COMBO_BOX_ENTRY_TYPE
-#endif
/**
* e_get_gnome2_user_dir:
diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h
deleted file mode 100644
index 7e4ab693c9..0000000000
--- a/e-util/gtk-compat.h
+++ /dev/null
@@ -1,176 +0,0 @@
-#ifndef __GTK_COMPAT_H__
-#define __GTK_COMPAT_H__
-
-#include <gtk/gtk.h>
-
-/* Provide a GTK+ compatibility layer. */
-
-#if !GTK_CHECK_VERSION (2,91,0) /* approximately; who cares at this point */
-
-#define gtk_widget_get_preferred_size(widget, minimum_size, natural_size) \
- (gtk_widget_size_request ((widget), ((minimum_size))))
-
-/* XXX Yes, the GtkScrollable interface is implemented by more than just
- * GtkLayout, but it turns out GtkLayout is the only thing Evolution
- * uses the GtkScrollable API for on the gtk3 branch. */
-#define GtkScrollable GtkLayout
-#define GTK_SCROLLABLE GTK_LAYOUT
-#define gtk_scrollable_get_hadjustment gtk_layout_get_hadjustment
-#define gtk_scrollable_set_hadjustment gtk_layout_set_hadjustment
-#define gtk_scrollable_get_vadjustment gtk_layout_get_vadjustment
-#define gtk_scrollable_set_vadjustment gtk_layout_set_vadjustment
-
-#endif
-
-#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_prepend_text gtk_combo_box_prepend_text
-#define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
-#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
-#define GTK_IS_COMBO_BOX_TEXT GTK_IS_COMBO_BOX
-#define GtkComboBoxText GtkComboBox
-
-/* 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) {}
-
-static inline gint
-gdk_window_get_width (GdkWindow *window)
-{
- gint width, height;
-
- gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
-
- return width;
-}
-
-static inline gint
-gdk_window_get_height (GdkWindow *window)
-{
- gint width, height;
-
- gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
-
- return height;
-}
-#endif
-
-#if GTK_CHECK_VERSION (2,23,0)
-#define GTK_COMBO_BOX_ENTRY GTK_COMBO_BOX
-
-#define ENSURE_GTK_COMBO_BOX_ENTRY_TYPE \
- GType gtk_combo_box_entry_get_type (void); \
- typedef struct _GtkComboBoxEntry GtkComboBoxEntry; \
- typedef struct _GtkComboBoxEntryClass GtkComboBoxEntryClass; \
- \
- struct _GtkComboBoxEntry { \
- GtkComboBoxText parent; \
- }; \
- \
- struct _GtkComboBoxEntryClass { \
- GtkComboBoxTextClass parent_class; \
- }; \
- \
- G_DEFINE_TYPE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX_TEXT)\
- \
- static GObject * \
- gtk_combo_box_entry_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) \
- { \
- GObjectConstructParam *params = g_new0 (GObjectConstructParam, n_construct_properties + 1);\
- GValue val = {0}; \
- GObject *res; \
- gint ii; \
- \
- for (ii = 0; ii < n_construct_properties; ii++) { \
- params[ii] = construct_properties[ii]; \
- } \
- \
- g_value_init (&val, G_TYPE_BOOLEAN); \
- g_value_set_boolean (&val, TRUE); \
- \
- params[n_construct_properties].pspec = g_object_class_find_property (G_OBJECT_CLASS (gtk_combo_box_entry_parent_class), "has-entry");\
- params[n_construct_properties].value = &val; \
- \
- res = G_OBJECT_CLASS (gtk_combo_box_entry_parent_class)->constructor (type, n_construct_properties + 1, params);\
- \
- g_free (params); \
- return res; \
- } \
- static void gtk_combo_box_entry_init (GtkComboBoxEntry *cbt) {} \
- static void gtk_combo_box_entry_class_init (GtkComboBoxEntryClass *kl) \
- { \
- GObjectClass *object_class = G_OBJECT_CLASS (kl); \
- object_class->constructor = gtk_combo_box_entry_constructor; \
- }
-#else
-#define gtk_combo_box_set_entry_text_column \
- gtk_combo_box_entry_set_text_column
-#endif
-
-#if GTK_CHECK_VERSION (2,90,5)
-
-/* Recreate GdkRegion until we drop GTK2 compatibility. */
-#define GdkOverlapType cairo_region_overlap_t
-#define GDK_OVERLAP_RECTANGLE_IN CAIRO_REGION_OVERLAP_IN
-#define GDK_OVERLAP_RECTANGLE_OUT CAIRO_REGION_OVERLAP_OUT
-#define GDK_OVERLAP_RECTANGLE_PART CAIRO_REGION_OVERLAP_PART
-
-#define GdkRegion cairo_region_t
-
-#define gdk_region_new() \
- (cairo_region_create ())
-
-#define gdk_region_destroy(region) \
- (cairo_region_destroy (region))
-
-#define gdk_region_intersect(source1, source2) \
- (cairo_region_intersect ((source1), (source2)))
-
-#define gdk_region_rect_in(region, rectangle) \
- (cairo_region_contains_rectangle ((region), (rectangle)))
-
-#define gdk_region_rectangle(rectangle) \
- (((rectangle)->width <= 0 || (rectangle)->height <= 0) ? \
- cairo_region_create () : cairo_region_create_rectangle (rectangle))
-
-#define gdk_region_get_rectangles(region, rectangles, n_rectangles) \
- G_STMT_START { \
- GdkRectangle *__rects; \
- gint __i, __nrects; \
- \
- __nrects = cairo_region_num_rectangles (region); \
- __rects = g_new (GdkRectangle, __nrects); \
- \
- for (__i = 0; __i < __nrects; __i++) \
- cairo_region_get_rectangle ((region), __i, &__rects[__i]); \
- \
- *(n_rectangles) = __nrects; \
- *(rectangles) = __rects; \
- } G_STMT_END
-
-#define gdk_region_union_with_rect(region, rect) \
- G_STMT_START { \
- if ((rect)->width > 0 && (rect)->height > 0) \
- cairo_region_union_rectangle ((region), (rect)); \
- } G_STMT_END
-
-#endif
-
-#endif /* __GTK_COMPAT_H__ */