summaryrefslogtreecommitdiff
path: root/mate-dictionary/libgdict/gdict-speller.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-22 15:49:16 +0300
committermonsta <[email protected]>2016-11-22 15:49:16 +0300
commitea481767c4e3ec19136a5b61ad46f244a9a5ffa7 (patch)
treebbcceb1d2a0be587e7127109f57e41e9e9b43f98 /mate-dictionary/libgdict/gdict-speller.c
parent8f9a34f003061d7c5e6cfe8a8cb64ec6e98d7c4a (diff)
downloadmate-utils-ea481767c4e3ec19136a5b61ad46f244a9a5ffa7.tar.bz2
mate-utils-ea481767c4e3ec19136a5b61ad46f244a9a5ffa7.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17
Diffstat (limited to 'mate-dictionary/libgdict/gdict-speller.c')
-rw-r--r--mate-dictionary/libgdict/gdict-speller.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/mate-dictionary/libgdict/gdict-speller.c b/mate-dictionary/libgdict/gdict-speller.c
index 1333894c..14bdb0c6 100644
--- a/mate-dictionary/libgdict/gdict-speller.c
+++ b/mate-dictionary/libgdict/gdict-speller.c
@@ -45,11 +45,6 @@
#include "gdict-debug.h"
#include "gdict-private.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define GDICT_SPELLER_GET_PRIVATE(obj) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SPELLER, GdictSpellerPrivate))
-#endif
-
struct _GdictSpellerPrivate
{
GdictContext *context;
@@ -110,12 +105,7 @@ enum
static guint speller_signals[LAST_SIGNAL] = { 0 };
-#if GTK_CHECK_VERSION(3,0,0)
G_DEFINE_TYPE_WITH_PRIVATE (GdictSpeller, gdict_speller, GTK_TYPE_BOX)
-#else
-G_DEFINE_TYPE (GdictSpeller, gdict_speller, GTK_TYPE_BOX);
-#endif
-
static void
set_gdict_context (GdictSpeller *speller,
@@ -179,11 +169,7 @@ gdict_speller_finalize (GObject *gobject)
set_gdict_context (speller, NULL);
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
g_free (priv->strategy);
g_free (priv->database);
@@ -320,17 +306,8 @@ gdict_speller_constructor (GType type,
speller = GDICT_SPELLER (object);
priv = speller->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-speller-scrolled-window");
-#endif
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -346,9 +323,6 @@ gdict_speller_constructor (GType type,
NULL);
priv->treeview = gtk_tree_view_new ();
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_composite_name (priv->treeview, "gdict-speller-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);
@@ -358,11 +332,7 @@ gdict_speller_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->clear_button = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (priv->clear_button),
@@ -379,10 +349,6 @@ gdict_speller_constructor (GType type,
gtk_box_pack_end (GTK_BOX (speller), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_pop_composite_child ();
-#endif
-
return object;
}
@@ -428,10 +394,6 @@ gdict_speller_class_init (GdictSpellerClass *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 (GdictSpellerPrivate));
-#endif
}
static void
@@ -439,11 +401,7 @@ gdict_speller_init (GdictSpeller *speller)
{
GdictSpellerPrivate *priv;
-#if GTK_CHECK_VERSION(3,0,0)
speller->priv = priv = gdict_speller_get_instance_private (speller);
-#else
- speller->priv = priv = GDICT_SPELLER_GET_PRIVATE (speller);
-#endif
gtk_orientable_set_orientation (GTK_ORIENTABLE (speller), GTK_ORIENTATION_VERTICAL);
@@ -664,14 +622,10 @@ lookup_start_cb (GdictContext *context,
GdictSpellerPrivate *priv = speller->priv;
if (!priv->busy_cursor)
-#if GTK_CHECK_VERSION(3,0,0)
{
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (speller));
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 (speller)))
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (speller)), priv->busy_cursor);