From ea481767c4e3ec19136a5b61ad46f244a9a5ffa7 Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 22 Nov 2016 15:49:16 +0300 Subject: move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option and require mate-panel >= 1.17 --- mate-dictionary/libgdict/gdict-strategy-chooser.c | 48 ----------------------- 1 file changed, 48 deletions(-) (limited to 'mate-dictionary/libgdict/gdict-strategy-chooser.c') diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.c b/mate-dictionary/libgdict/gdict-strategy-chooser.c index 9e6d0b1c..4b6f1ecd 100644 --- a/mate-dictionary/libgdict/gdict-strategy-chooser.c +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.c @@ -45,11 +45,6 @@ #include "gdict-enum-types.h" #include "gdict-marshal.h" -#if !GTK_CHECK_VERSION(3,0,0) -#define GDICT_STRATEGY_CHOOSER_GET_PRIVATE(obj) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_STRATEGY_CHOOSER, GdictStrategyChooserPrivate)) -#endif - struct _GdictStrategyChooserPrivate { GtkListStore *store; @@ -108,16 +103,9 @@ enum static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; -#if GTK_CHECK_VERSION(3,0,0) G_DEFINE_TYPE_WITH_PRIVATE (GdictStrategyChooser, gdict_strategy_chooser, GTK_TYPE_BOX); -#else -G_DEFINE_TYPE (GdictStrategyChooser, - gdict_strategy_chooser, - GTK_TYPE_BOX); -#endif - static void set_gdict_context (GdictStrategyChooser *chooser, @@ -184,11 +172,7 @@ gdict_strategy_chooser_dispose (GObject *gobject) if (priv->busy_cursor) { -#if GTK_CHECK_VERSION (3, 0, 0) g_object_unref (priv->busy_cursor); -#else - gdk_cursor_unref (priv->busy_cursor); -#endif priv->busy_cursor = NULL; } @@ -333,17 +317,8 @@ gdict_strategy_chooser_constructor (GType type, chooser = GDICT_STRATEGY_CHOOSER (object); priv = chooser->priv; -#if !GTK_CHECK_VERSION(3,0,0) - gtk_widget_push_composite_child (); -#endif - sw = gtk_scrolled_window_new (NULL, NULL); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_vexpand (sw, TRUE); -#endif -#if !GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_composite_name (sw, "gdict-strategy-chooser-scrolled-window"); -#endif gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -359,9 +334,6 @@ gdict_strategy_chooser_constructor (GType type, "weight", STRAT_COLUMN_CURRENT, NULL); priv->treeview = gtk_tree_view_new (); -#if !GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_composite_name (priv->treeview, "gdict-strategy-chooser-treeview"); -#endif gtk_tree_view_set_model (GTK_TREE_VIEW (priv->treeview), GTK_TREE_MODEL (priv->store)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->treeview), FALSE); @@ -371,11 +343,7 @@ gdict_strategy_chooser_constructor (GType type, gtk_container_add (GTK_CONTAINER (sw), priv->treeview); gtk_widget_show (priv->treeview); -#if GTK_CHECK_VERSION (3, 0, 0) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); -#else - hbox = gtk_hbox_new (FALSE, 0); -#endif priv->refresh_button = gtk_button_new (); gtk_button_set_image (GTK_BUTTON (priv->refresh_button), @@ -404,10 +372,6 @@ gdict_strategy_chooser_constructor (GType type, gtk_box_pack_end (GTK_BOX (chooser), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); -#if !GTK_CHECK_VERSION(3,0,0) - gtk_widget_pop_composite_child (); -#endif - return object; } @@ -455,10 +419,6 @@ gdict_strategy_chooser_class_init (GdictStrategyChooserClass *klass) G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); - -#if !GTK_CHECK_VERSION(3,0,0) - g_type_class_add_private (gobject_class, sizeof (GdictStrategyChooserPrivate)); -#endif } static void @@ -466,11 +426,7 @@ gdict_strategy_chooser_init (GdictStrategyChooser *chooser) { GdictStrategyChooserPrivate *priv; -#if GTK_CHECK_VERSION(3,0,0) chooser->priv = priv = gdict_strategy_chooser_get_instance_private (chooser); -#else - chooser->priv = priv = GDICT_STRATEGY_CHOOSER_GET_PRIVATE (chooser); -#endif gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL); @@ -696,14 +652,10 @@ lookup_start_cb (GdictContext *context, GdictStrategyChooserPrivate *priv = chooser->priv; if (!priv->busy_cursor) -#if GTK_CHECK_VERSION(3,0,0) { GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (chooser)); priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH); } -#else - priv->busy_cursor = gdk_cursor_new (GDK_WATCH); -#endif if (gtk_widget_get_window (GTK_WIDGET (chooser))) gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (chooser)), priv->busy_cursor); -- cgit v1.2.1