summaryrefslogtreecommitdiff
path: root/mate-dictionary/libgdict
diff options
context:
space:
mode:
Diffstat (limited to 'mate-dictionary/libgdict')
-rw-r--r--mate-dictionary/libgdict/gdict-database-chooser.c28
-rw-r--r--mate-dictionary/libgdict/gdict-defbox.c168
-rw-r--r--mate-dictionary/libgdict/gdict-source-chooser.c55
-rw-r--r--mate-dictionary/libgdict/gdict-speller.c46
-rw-r--r--mate-dictionary/libgdict/gdict-strategy-chooser.c48
-rw-r--r--mate-dictionary/libgdict/mate-dict.pc.in2
6 files changed, 5 insertions, 342 deletions
diff --git a/mate-dictionary/libgdict/gdict-database-chooser.c b/mate-dictionary/libgdict/gdict-database-chooser.c
index 22c9aadb..37572abe 100644
--- a/mate-dictionary/libgdict/gdict-database-chooser.c
+++ b/mate-dictionary/libgdict/gdict-database-chooser.c
@@ -190,11 +190,7 @@ gdict_database_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;
}
@@ -338,17 +334,8 @@ gdict_database_chooser_constructor (GType type,
chooser = GDICT_DATABASE_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-database-chooser-scrolled-window");
-#endif
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -364,9 +351,6 @@ gdict_database_chooser_constructor (GType type,
"weight", DB_COLUMN_CURRENT,
NULL);
priv->treeview = gtk_tree_view_new ();
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_composite_name (priv->treeview, "gdict-database-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);
@@ -379,11 +363,7 @@ gdict_database_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->buttons_box = hbox;
priv->refresh_button = gtk_button_new ();
@@ -413,10 +393,6 @@ gdict_database_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;
}
@@ -733,15 +709,11 @@ lookup_start_cb (GdictContext *context,
GdictDatabaseChooserPrivate *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);
diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c
index 7ce0cb57..29c304f9 100644
--- a/mate-dictionary/libgdict/gdict-defbox.c
+++ b/mate-dictionary/libgdict/gdict-defbox.c
@@ -52,10 +52,6 @@
#define QUERY_MARGIN 48
#define ERROR_MARGIN 24
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gdk_cursor_unref g_object_unref
-#endif
-
typedef struct
{
GdictDefinition *definition;
@@ -63,11 +59,6 @@ typedef struct
gint begin;
} Definition;
-#if !GTK_CHECK_VERSION(3,0,0)
-#define GDICT_DEFBOX_GET_PRIVATE(obj) \
-(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_DEFBOX, GdictDefboxPrivate))
-#endif
-
struct _GdictDefboxPrivate
{
GtkWidget *text_view;
@@ -131,16 +122,8 @@ enum
};
static guint gdict_defbox_signals[LAST_SIGNAL] = { 0 };
-#if GTK_CHECK_VERSION(3,0,0)
-G_DEFINE_TYPE_WITH_PRIVATE (GdictDefbox, gdict_defbox, GTK_TYPE_BOX)
-#else
-static GdkColor default_link_color = { 0, 0, 0, 0xeeee };
-static GdkColor default_visited_link_color = { 0, 0x5555, 0x1a1a, 0x8b8b };
-
-
-G_DEFINE_TYPE (GdictDefbox, gdict_defbox, GTK_TYPE_BOX);
-#endif
+G_DEFINE_TYPE_WITH_PRIVATE (GdictDefbox, gdict_defbox, GTK_TYPE_BOX)
static Definition *
definition_new (void)
@@ -201,19 +184,19 @@ gdict_defbox_dispose (GObject *gobject)
if (priv->busy_cursor)
{
- gdk_cursor_unref (priv->busy_cursor);
+ g_object_unref (priv->busy_cursor);
priv->busy_cursor = NULL;
}
if (priv->hand_cursor)
{
- gdk_cursor_unref (priv->hand_cursor);
+ g_object_unref (priv->hand_cursor);
priv->hand_cursor = NULL;
}
if (priv->regular_cursor)
{
- gdk_cursor_unref (priv->regular_cursor);
+ g_object_unref (priv->regular_cursor);
priv->regular_cursor = NULL;
}
@@ -1309,18 +1292,10 @@ create_find_pane (GdictDefbox *defbox)
priv = defbox->priv;
-#if GTK_CHECK_VERSION (3, 0, 0)
find_pane = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- find_pane = gtk_hbox_new (FALSE, 0);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (find_pane), 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- hbox1 = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (find_pane), hbox1, TRUE, TRUE, 0);
gtk_widget_show (hbox1);
@@ -1334,11 +1309,7 @@ create_find_pane (GdictDefbox *defbox)
gtk_box_pack_start (GTK_BOX (hbox1), button, FALSE, FALSE, 0);
gtk_widget_show (button);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- hbox2 = gtk_hbox_new (FALSE, 12);
-#endif
gtk_box_pack_start (GTK_BOX (hbox1), hbox2, TRUE, TRUE, 0);
gtk_widget_show (hbox2);
@@ -1351,11 +1322,7 @@ create_find_pane (GdictDefbox *defbox)
gtk_box_pack_start (GTK_BOX (hbox2), priv->find_entry, TRUE, TRUE, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry);
-#if GTK_CHECK_VERSION (3, 0, 0)
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
-#else
- sep = gtk_vseparator_new ();
-#endif
gtk_box_pack_start (GTK_BOX (hbox1), sep, FALSE, FALSE, 0);
gtk_widget_show (sep);
@@ -1387,9 +1354,6 @@ static void
gdict_defbox_init_tags (GdictDefbox *defbox)
{
GdictDefboxPrivate *priv = defbox->priv;
-#if !GTK_CHECK_VERSION(3,0,0)
- GdkColor *link_color, *visited_link_color;
-#endif
g_assert (GTK_IS_TEXT_BUFFER (priv->buffer));
@@ -1410,7 +1374,6 @@ gdict_defbox_init_tags (GdictDefbox *defbox)
"scale", PANGO_SCALE_SMALL,
NULL);
-#if GTK_CHECK_VERSION(3,0,0)
{
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (defbox));
gboolean prefer_dark = FALSE;
@@ -1443,35 +1406,6 @@ gdict_defbox_init_tags (GdictDefbox *defbox)
"foreground-rgba", &rgba,
NULL);
}
-#else
- link_color = visited_link_color = NULL;
- gtk_widget_style_get (GTK_WIDGET (defbox),
- "link-color", &link_color,
- "visited-link-color", &visited_link_color,
- NULL);
- if (!link_color)
- link_color = &default_link_color;
-
- if (!visited_link_color)
- visited_link_color = &default_visited_link_color;
-
- priv->link_tag =
- gtk_text_buffer_create_tag (priv->buffer, "link",
- "underline", PANGO_UNDERLINE_SINGLE,
- "foreground-gdk", link_color,
- NULL);
- priv->visited_link_tag =
- gtk_text_buffer_create_tag (priv->buffer, "visited-link",
- "underline", PANGO_UNDERLINE_SINGLE,
- "foreground-gdk", visited_link_color,
- NULL);
-
- if (link_color != &default_link_color)
- gdk_color_free (link_color);
-
- if (visited_link_color != &default_visited_link_color)
- gdk_color_free (visited_link_color);
-#endif
gtk_text_buffer_create_tag (priv->buffer, "phonetic",
"foreground", "dark gray",
@@ -1594,24 +1528,16 @@ set_cursor_if_appropriate (GdictDefbox *defbox,
priv = defbox->priv;
if (!priv->hand_cursor)
-#if GTK_CHECK_VERSION(3,0,0)
{
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (defbox));
priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
}
-#else
- priv->hand_cursor = gdk_cursor_new (GDK_HAND2);
-#endif
if (!priv->regular_cursor)
-#if GTK_CHECK_VERSION(3,0,0)
{
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (defbox));
priv->regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
}
-#else
- priv->regular_cursor = gdk_cursor_new (GDK_XTERM);
-#endif
gtk_text_view_get_iter_at_location (text_view, &iter, x, y);
@@ -1667,10 +1593,6 @@ defbox_motion_notify_cb (GtkWidget *text_view,
set_cursor_if_appropriate (defbox, GTK_TEXT_VIEW (text_view), bx, by);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
-#endif
-
return FALSE;
}
@@ -1679,22 +1601,16 @@ defbox_visibility_notify_cb (GtkWidget *text_view,
GdkEventVisibility *event,
GdictDefbox *defbox)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *pointer;
-#endif
gint wx, wy;
gint bx, by;
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_window_get_display (event->window);
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
gdk_window_get_device_position (gtk_widget_get_window (text_view), pointer, &wx, &wy, NULL);
-#else
- gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
-#endif
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
@@ -1722,17 +1638,8 @@ gdict_defbox_constructor (GType type,
defbox = GDICT_DEFBOX (object);
priv = defbox->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-defbox-scrolled-window");
-#endif
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -1745,18 +1652,12 @@ gdict_defbox_constructor (GType type,
gdict_defbox_init_tags (defbox);
priv->text_view = gtk_text_view_new_with_buffer (priv->buffer);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_composite_name (priv->text_view, "gdict-defbox-text-view");
-#endif
gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->text_view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (priv->text_view), 4);
gtk_container_add (GTK_CONTAINER (sw), priv->text_view);
gtk_widget_show (priv->text_view);
priv->find_pane = create_find_pane (defbox);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_composite_name (priv->find_pane, "gdict-defbox-find-pane");
-#endif
gtk_box_pack_end (GTK_BOX (defbox), priv->find_pane, FALSE, FALSE, 0);
/* stuff to make the link machinery work */
@@ -1770,51 +1671,9 @@ gdict_defbox_constructor (GType type,
G_CALLBACK (defbox_visibility_notify_cb),
defbox);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_pop_composite_child ();
-#endif
-
return object;
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static void
-gdict_defbox_style_set (GtkWidget *widget,
- GtkStyle *old_style)
-{
- GdictDefboxPrivate *priv = GDICT_DEFBOX (widget)->priv;
- GdkColor *link_color, *visited_link_color;
-
- if (GTK_WIDGET_CLASS (gdict_defbox_parent_class)->style_set)
- GTK_WIDGET_CLASS (gdict_defbox_parent_class)->style_set (widget, old_style);
-
- link_color = visited_link_color = NULL;
- gtk_widget_style_get (widget,
- "link-color", &link_color,
- "visited-link-color", &visited_link_color,
- NULL);
- if (!link_color)
- link_color = &default_link_color;
-
- if (!visited_link_color)
- visited_link_color = &default_visited_link_color;
-
- g_object_set (G_OBJECT (priv->link_tag),
- "foreground-gdk", link_color,
- NULL);
-
- g_object_set (G_OBJECT (priv->visited_link_tag),
- "foreground-gdk", visited_link_color,
- NULL);
-
- if (link_color != &default_link_color)
- gdk_color_free (link_color);
-
- if (visited_link_color != &default_visited_link_color)
- gdk_color_free (visited_link_color);
-}
-#endif
-
/* we override the GtkWidget::show_all method since we have widgets
* we don't want to show, such as the find pane
*/
@@ -1884,9 +1743,6 @@ gdict_defbox_class_init (GdictDefboxClass *klass)
gobject_class->finalize = gdict_defbox_finalize;
widget_class->show_all = gdict_defbox_show_all;
-#if !GTK_CHECK_VERSION(3,0,0)
- widget_class->style_set = gdict_defbox_style_set;
-#endif
/**
* GdictDefbox:word:
@@ -2011,10 +1867,6 @@ gdict_defbox_class_init (GdictDefboxClass *klass)
GDK_KEY_Escape, 0,
"hide-find",
0);
-
-#if !GTK_CHECK_VERSION(3,0,0)
- g_type_class_add_private (klass, sizeof (GdictDefboxPrivate));
-#endif
}
static void
@@ -2025,11 +1877,7 @@ gdict_defbox_init (GdictDefbox *defbox)
gtk_orientable_set_orientation (GTK_ORIENTABLE (defbox), GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing (GTK_BOX (defbox), 6);
-#if GTK_CHECK_VERSION(3,0,0)
priv = gdict_defbox_get_instance_private (defbox);
-#else
- priv = GDICT_DEFBOX_GET_PRIVATE (defbox);
-#endif
defbox->priv = priv;
priv->context = NULL;
@@ -2262,14 +2110,10 @@ lookup_start_cb (GdictContext *context,
priv->is_searching = TRUE;
if (!priv->busy_cursor)
-#if GTK_CHECK_VERSION(3,0,0)
{
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (defbox));
priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
}
-#else
- priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
-#endif
window = gtk_text_view_get_window (GTK_TEXT_VIEW (priv->text_view),
GTK_TEXT_WINDOW_WIDGET);
@@ -2975,11 +2819,7 @@ gdict_defbox_set_font_name (GdictDefbox *defbox,
else
font_desc = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_override_font (priv->text_view, font_desc);
-#else
- gtk_widget_modify_font (priv->text_view, font_desc);
-#endif
if (font_desc)
pango_font_description_free (font_desc);
diff --git a/mate-dictionary/libgdict/gdict-source-chooser.c b/mate-dictionary/libgdict/gdict-source-chooser.c
index 217bf412..54b77f4e 100644
--- a/mate-dictionary/libgdict/gdict-source-chooser.c
+++ b/mate-dictionary/libgdict/gdict-source-chooser.c
@@ -47,13 +47,6 @@
#include "gdict-enum-types.h"
#include "gdict-marshal.h"
-#if !GTK_CHECK_VERSION(3,0,0)
-#define GDICT_SOURCE_CHOOSER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GDICT_TYPE_SOURCE_CHOOSER, \
- GdictSourceChooserPrivate))
-#endif
-
struct _GdictSourceChooserPrivate
{
GtkListStore *store;
@@ -65,10 +58,6 @@ struct _GdictSourceChooserPrivate
GdictSourceLoader *loader;
gint n_sources;
-#if !GTK_CHECK_VERSION(3,0,0)
- GdkCursor *busy_cursor;
-#endif
-
gchar *current_source;
};
@@ -100,11 +89,7 @@ enum
static guint source_chooser_signals[LAST_SIGNAL] = { 0, };
-#if GTK_CHECK_VERSION(3,0,0)
G_DEFINE_TYPE_WITH_PRIVATE (GdictSourceChooser, gdict_source_chooser, GTK_TYPE_BOX)
-#else
-G_DEFINE_TYPE (GdictSourceChooser, gdict_source_chooser, GTK_TYPE_BOX);
-#endif
static void
gdict_source_chooser_finalize (GObject *gobject)
@@ -135,14 +120,6 @@ gdict_source_chooser_dispose (GObject *gobject)
priv->loader = NULL;
}
-#if !GTK_CHECK_VERSION(3,0,0)
- if (priv->busy_cursor)
- {
- gdk_cursor_unref (priv->busy_cursor);
- priv->busy_cursor = NULL;
- }
-#endif
-
G_OBJECT_CLASS (gdict_source_chooser_parent_class)->dispose (gobject);
}
@@ -260,17 +237,8 @@ gdict_source_chooser_constructor (GType gtype,
chooser = GDICT_SOURCE_CHOOSER (retval);
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-source-chooser-scrolled-window");
-#endif
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@@ -286,9 +254,6 @@ gdict_source_chooser_constructor (GType gtype,
"weight", SOURCE_CURRENT,
NULL);
priv->treeview = gtk_tree_view_new ();
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_composite_name (priv->treeview, "gdict-source-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);
@@ -302,11 +267,7 @@ gdict_source_chooser_constructor (GType gtype,
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, 6);
-#else
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
priv->buttons_box = hbox;
priv->refresh_button = gtk_button_new ();
@@ -324,10 +285,6 @@ gdict_source_chooser_constructor (GType gtype,
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 retval;
}
@@ -336,10 +293,6 @@ gdict_source_chooser_class_init (GdictSourceChooserClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-#if !GTK_CHECK_VERSION(3,0,0)
- g_type_class_add_private (klass, sizeof (GdictSourceChooserPrivate));
-#endif
-
gobject_class->finalize = gdict_source_chooser_finalize;
gobject_class->dispose = gdict_source_chooser_dispose;
gobject_class->set_property = gdict_source_chooser_set_property;
@@ -423,11 +376,7 @@ gdict_source_chooser_init (GdictSourceChooser *chooser)
{
GdictSourceChooserPrivate *priv;
-#if GTK_CHECK_VERSION(3,0,0)
chooser->priv = priv = gdict_source_chooser_get_instance_private (chooser);
-#else
- chooser->priv = priv = GDICT_SOURCE_CHOOSER_GET_PRIVATE (chooser);
-#endif
gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL);
@@ -439,10 +388,6 @@ gdict_source_chooser_init (GdictSourceChooser *chooser)
priv->loader = NULL;
priv->n_sources = -1;
-
-#if !GTK_CHECK_VERSION(3,0,0)
- priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
-#endif
}
/**
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);
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);
diff --git a/mate-dictionary/libgdict/mate-dict.pc.in b/mate-dictionary/libgdict/mate-dict.pc.in
index 8168de2d..0be2fede 100644
--- a/mate-dictionary/libgdict/mate-dict.pc.in
+++ b/mate-dictionary/libgdict/mate-dict.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: gdict-1.0
Description: MATE Dictionary Protocol client library
-Requires: gtk+-@GTK_API_VERSION@ >= @GTK_REQUIRED@
+Requires: gtk+-3.0 >= @GTK_REQUIRED@
Version: @GDICT_VERSION@
Libs: -L${libdir} -lmatedict
Cflags: -I${includedir}/mate-dict