From 45eeae314d6d20df7629f85eda49a89c122d9112 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 3 Dec 2013 16:30:14 -0800 Subject: Remove {GTK,GLIB}_CHECK_VERSION This removes all conditionally compiled parts for GTK < 3.10 and GLib < 2.38. [endlessm/eos-sdk#420] --- endless/eosflexygrid.c | 17 +---------------- endless/eosflexygridcell.c | 17 +---------------- endless/eoswindow.c | 32 +------------------------------- 3 files changed, 3 insertions(+), 63 deletions(-) (limited to 'endless') diff --git a/endless/eosflexygrid.c b/endless/eosflexygrid.c index d831163..81cf3ba 100644 --- a/endless/eosflexygrid.c +++ b/endless/eosflexygrid.c @@ -63,22 +63,11 @@ enum LAST_SIGNAL }; -#if GLIB_CHECK_VERSION (2, 37, 5) - -# define EOS_FLEXY_GRID_GET_PRIV(obj) \ +#define EOS_FLEXY_GRID_GET_PRIV(obj) \ ((EosFlexyGridPrivate *) eos_flexy_grid_get_instance_private ((EosFlexyGrid *) (obj))) G_DEFINE_TYPE_WITH_PRIVATE (EosFlexyGrid, eos_flexy_grid, GTK_TYPE_CONTAINER) -#else - -# define EOS_FLEXY_GRID_GET_PRIV(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EOS_TYPE_FLEXY_GRID, EosFlexyGridPrivate)) - -G_DEFINE_TYPE (EosFlexyGrid, eos_flexy_grid, GTK_TYPE_CONTAINER) - -#endif /* GLIB_CHECK_VERSION (2, 37, 5) */ - static guint grid_signals[LAST_SIGNAL] = { 0, }; static GParamSpec *grid_props[LAST_PROP] = { NULL, }; @@ -852,10 +841,6 @@ eos_flexy_grid_finalize (GObject *gobject) static void eos_flexy_grid_class_init (EosFlexyGridClass *klass) { -#if !GLIB_CHECK_VERSION (2, 37, 5) - g_type_class_add_private (klass, sizeof (EosFlexyGridPrivate)); -#endif - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->finalize = eos_flexy_grid_finalize; gobject_class->set_property = eos_flexy_grid_set_property; diff --git a/endless/eosflexygridcell.c b/endless/eosflexygridcell.c index 4091f06..726c7f1 100644 --- a/endless/eosflexygridcell.c +++ b/endless/eosflexygridcell.c @@ -21,22 +21,11 @@ typedef struct { guint selected : 1; } EosFlexyGridCellPrivate; -#if GLIB_CHECK_VERSION (2, 37, 5) - -# define EOS_FLEXY_GRID_CELL_GET_PRIV(obj) \ +#define EOS_FLEXY_GRID_CELL_GET_PRIV(obj) \ ((EosFlexyGridCellPrivate *) eos_flexy_grid_cell_get_instance_private ((EosFlexyGridCell *) (obj))) G_DEFINE_TYPE_WITH_PRIVATE (EosFlexyGridCell, eos_flexy_grid_cell, GTK_TYPE_BIN) -#else - -# define EOS_FLEXY_GRID_CELL_GET_PRIV(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EOS_TYPE_FLEXY_GRID_CELL, EosFlexyGridCellPrivate)) - -G_DEFINE_TYPE (EosFlexyGridCell, eos_flexy_grid_cell, GTK_TYPE_BIN) - -#endif /* GLIB_CHECK_VERSION (2, 37, 5) */ - enum { PROP_0, @@ -90,10 +79,6 @@ eos_flexy_grid_cell_get_property (GObject *gobject, static void eos_flexy_grid_cell_class_init (EosFlexyGridCellClass *klass) { -#if !GLIB_CHECK_VERSION (2, 37, 6) - g_type_class_add_private (klass, sizeof (EosFlexyGridCellPrivate)); -#endif - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = eos_flexy_grid_cell_set_property; gobject_class->get_property = eos_flexy_grid_cell_get_property; diff --git a/endless/eoswindow.c b/endless/eoswindow.c index 35547bb..cd0fe68 100644 --- a/endless/eoswindow.c +++ b/endless/eoswindow.c @@ -571,36 +571,6 @@ eos_window_class_init (EosWindowClass *klass) g_object_class_install_properties (object_class, NPROPS, eos_window_props); } -#if GTK_CHECK_VERSION (3, 10, 0) -#define our_window_close(w) gtk_window_close (w) -#else -static gboolean -queue_close (gpointer user_data) -{ - GtkWidget *window = user_data; - - GdkEvent *event = gdk_event_new (GDK_DELETE); - - event->any.window = gtk_widget_get_window (window); - event->any.send_event = TRUE; - - gtk_main_do_event (event); - - gdk_event_free (event); - - return G_SOURCE_REMOVE; -} - -static void -our_window_close (GtkWindow *window) -{ - if (!gtk_widget_get_realized (GTK_WIDGET (window))) - return; - - gdk_threads_add_idle (queue_close, window); -} -#endif /* GTK_CHECK_VERSION (3, 10, 0) */ - static void on_minimize_clicked_cb (GtkWidget* top_bar) { @@ -614,7 +584,7 @@ on_close_clicked_cb (GtkWidget* top_bar) { GtkWidget *window = gtk_widget_get_toplevel (top_bar); - our_window_close (GTK_WINDOW (window)); + gtk_window_close (GTK_WINDOW (window)); } /* Make sure that the edge finishing does not catch input events */ -- cgit v1.2.3