From 3967123299f476612b6d546b0b31c9293b3d5f26 Mon Sep 17 00:00:00 2001 From: monsta Date: Fri, 22 Jan 2016 15:10:28 +0300 Subject: [GTK+3] dictionary: (almost) fix deprecated usage of Gtk{H,V}Box --- mate-dictionary/libgdict/gdict-database-chooser.c | 7 ++++++- mate-dictionary/libgdict/gdict-database-chooser.h | 4 ++-- mate-dictionary/libgdict/gdict-defbox.c | 15 ++++++++++++++- mate-dictionary/libgdict/gdict-defbox.h | 4 ++-- mate-dictionary/libgdict/gdict-source-chooser.c | 7 ++++++- mate-dictionary/libgdict/gdict-source-chooser.h | 4 ++-- mate-dictionary/libgdict/gdict-speller.c | 11 ++++++++--- mate-dictionary/libgdict/gdict-speller.h | 4 ++-- mate-dictionary/libgdict/gdict-strategy-chooser.c | 7 ++++++- mate-dictionary/libgdict/gdict-strategy-chooser.h | 4 ++-- mate-dictionary/src/gdict-applet.c | 14 +++++++++++++- mate-dictionary/src/gdict-sidebar.c | 11 ++++++++++- mate-dictionary/src/gdict-sidebar.h | 4 ++-- 13 files changed, 75 insertions(+), 21 deletions(-) (limited to 'mate-dictionary') diff --git a/mate-dictionary/libgdict/gdict-database-chooser.c b/mate-dictionary/libgdict/gdict-database-chooser.c index aac4e41c..2a4eb73f 100644 --- a/mate-dictionary/libgdict/gdict-database-chooser.c +++ b/mate-dictionary/libgdict/gdict-database-chooser.c @@ -111,7 +111,7 @@ static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (GdictDatabaseChooser, gdict_database_chooser, - GTK_TYPE_VBOX); + GTK_TYPE_BOX); static void @@ -370,7 +370,11 @@ 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 (); @@ -493,6 +497,7 @@ gdict_database_chooser_init (GdictDatabaseChooser *chooser) { GdictDatabaseChooserPrivate *priv; + gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL); chooser->priv = priv = GDICT_DATABASE_CHOOSER_GET_PRIVATE (chooser); priv->results = -1; diff --git a/mate-dictionary/libgdict/gdict-database-chooser.h b/mate-dictionary/libgdict/gdict-database-chooser.h index 809e2d6b..c1d7316f 100644 --- a/mate-dictionary/libgdict/gdict-database-chooser.h +++ b/mate-dictionary/libgdict/gdict-database-chooser.h @@ -44,7 +44,7 @@ typedef struct _GdictDatabaseChooserClass GdictDatabaseChooserClass; struct _GdictDatabaseChooser { /*< private >*/ - GtkVBox parent_instance; + GtkBox parent_instance; GdictDatabaseChooserPrivate *priv; }; @@ -52,7 +52,7 @@ struct _GdictDatabaseChooser struct _GdictDatabaseChooserClass { /*< private >*/ - GtkVBoxClass parent_class; + GtkBoxClass parent_class; /*< public >*/ void (*database_activated) (GdictDatabaseChooser *chooser, diff --git a/mate-dictionary/libgdict/gdict-defbox.c b/mate-dictionary/libgdict/gdict-defbox.c index acef2f96..c85efdd2 100644 --- a/mate-dictionary/libgdict/gdict-defbox.c +++ b/mate-dictionary/libgdict/gdict-defbox.c @@ -133,7 +133,7 @@ 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_VBOX); +G_DEFINE_TYPE (GdictDefbox, gdict_defbox, GTK_TYPE_BOX); static Definition * @@ -1303,10 +1303,18 @@ 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); @@ -1320,7 +1328,11 @@ 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); @@ -1920,6 +1932,7 @@ gdict_defbox_init (GdictDefbox *defbox) { GdictDefboxPrivate *priv; + gtk_orientable_set_orientation (GTK_ORIENTABLE (defbox), GTK_ORIENTATION_VERTICAL); gtk_box_set_spacing (GTK_BOX (defbox), 6); priv = GDICT_DEFBOX_GET_PRIVATE (defbox); diff --git a/mate-dictionary/libgdict/gdict-defbox.h b/mate-dictionary/libgdict/gdict-defbox.h index afe9241f..b9f773e1 100644 --- a/mate-dictionary/libgdict/gdict-defbox.h +++ b/mate-dictionary/libgdict/gdict-defbox.h @@ -39,14 +39,14 @@ typedef struct _GdictDefboxPrivate GdictDefboxPrivate; struct _GdictDefbox { /*< private >*/ - GtkVBox parent_instance; + GtkBox parent_instance; GdictDefboxPrivate *priv; }; struct _GdictDefboxClass { - GtkVBoxClass parent_class; + GtkBoxClass parent_class; /* these are all RUN_ACTION signals for key bindings */ void (*show_find) (GdictDefbox *defbox); diff --git a/mate-dictionary/libgdict/gdict-source-chooser.c b/mate-dictionary/libgdict/gdict-source-chooser.c index 32379d47..4990ae2f 100644 --- a/mate-dictionary/libgdict/gdict-source-chooser.c +++ b/mate-dictionary/libgdict/gdict-source-chooser.c @@ -96,7 +96,7 @@ enum static guint source_chooser_signals[LAST_SIGNAL] = { 0, }; -G_DEFINE_TYPE (GdictSourceChooser, gdict_source_chooser, GTK_TYPE_VBOX); +G_DEFINE_TYPE (GdictSourceChooser, gdict_source_chooser, GTK_TYPE_BOX); static void gdict_source_chooser_finalize (GObject *gobject) @@ -287,7 +287,11 @@ 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 (); @@ -400,6 +404,7 @@ gdict_source_chooser_init (GdictSourceChooser *chooser) { GdictSourceChooserPrivate *priv; + gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL); chooser->priv = priv = GDICT_SOURCE_CHOOSER_GET_PRIVATE (chooser); priv->store = gtk_list_store_new (SOURCE_N_COLUMNS, diff --git a/mate-dictionary/libgdict/gdict-source-chooser.h b/mate-dictionary/libgdict/gdict-source-chooser.h index 291e0a0c..eebcff28 100644 --- a/mate-dictionary/libgdict/gdict-source-chooser.h +++ b/mate-dictionary/libgdict/gdict-source-chooser.h @@ -39,7 +39,7 @@ typedef struct _GdictSourceChooserClass GdictSourceChooserClass; struct _GdictSourceChooser { /*< private >*/ - GtkVBox parent_instance; + GtkBox parent_instance; GdictSourceChooserPrivate *priv; }; @@ -47,7 +47,7 @@ struct _GdictSourceChooser struct _GdictSourceChooserClass { /*< private >*/ - GtkVBoxClass parent_class; + GtkBoxClass parent_class; /*< public >*/ void (*source_activated) (GdictSourceChooser *chooser, diff --git a/mate-dictionary/libgdict/gdict-speller.c b/mate-dictionary/libgdict/gdict-speller.c index fc16112a..9b151994 100644 --- a/mate-dictionary/libgdict/gdict-speller.c +++ b/mate-dictionary/libgdict/gdict-speller.c @@ -108,7 +108,7 @@ enum static guint speller_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (GdictSpeller, gdict_speller, GTK_TYPE_VBOX); +G_DEFINE_TYPE (GdictSpeller, gdict_speller, GTK_TYPE_BOX); static void @@ -343,7 +343,11 @@ 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), @@ -416,6 +420,7 @@ gdict_speller_init (GdictSpeller *speller) { GdictSpellerPrivate *priv; + gtk_orientable_set_orientation (GTK_ORIENTABLE (speller), GTK_ORIENTATION_VERTICAL); speller->priv = priv = GDICT_SPELLER_GET_PRIVATE (speller); priv->database = NULL; @@ -467,8 +472,8 @@ gdict_speller_new_with_context (GdictContext *context) g_return_val_if_fail (GDICT_IS_CONTEXT (context), NULL); return g_object_new (GDICT_TYPE_SPELLER, - "context", context, - NULL); + "context", context, + NULL); } /** diff --git a/mate-dictionary/libgdict/gdict-speller.h b/mate-dictionary/libgdict/gdict-speller.h index 91b79207..51c46aad 100644 --- a/mate-dictionary/libgdict/gdict-speller.h +++ b/mate-dictionary/libgdict/gdict-speller.h @@ -38,7 +38,7 @@ typedef struct _GdictSpellerClass GdictSpellerClass; struct _GdictSpeller { - GtkVBox parent_instance; + GtkBox parent_instance; /*< private >*/ GdictSpellerPrivate *priv; @@ -46,7 +46,7 @@ struct _GdictSpeller struct _GdictSpellerClass { - GtkVBoxClass parent_class; + GtkBoxClass parent_class; void (*word_activated) (GdictSpeller *speller, const gchar *word, diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.c b/mate-dictionary/libgdict/gdict-strategy-chooser.c index 98467a77..d78ef1b4 100644 --- a/mate-dictionary/libgdict/gdict-strategy-chooser.c +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.c @@ -108,7 +108,7 @@ static guint db_chooser_signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (GdictStrategyChooser, gdict_strategy_chooser, - GTK_TYPE_VBOX); + GTK_TYPE_BOX); static void @@ -354,7 +354,11 @@ 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), @@ -441,6 +445,7 @@ gdict_strategy_chooser_init (GdictStrategyChooser *chooser) { GdictStrategyChooserPrivate *priv; + gtk_orientable_set_orientation (GTK_ORIENTABLE (chooser), GTK_ORIENTATION_VERTICAL); chooser->priv = priv = GDICT_STRATEGY_CHOOSER_GET_PRIVATE (chooser); priv->results = -1; diff --git a/mate-dictionary/libgdict/gdict-strategy-chooser.h b/mate-dictionary/libgdict/gdict-strategy-chooser.h index 64df74f3..522a9b44 100644 --- a/mate-dictionary/libgdict/gdict-strategy-chooser.h +++ b/mate-dictionary/libgdict/gdict-strategy-chooser.h @@ -43,14 +43,14 @@ typedef struct _GdictStrategyChooserClass GdictStrategyChooserClass; struct _GdictStrategyChooser { - GtkVBox parent_instance; + GtkBox parent_instance; GdictStrategyChooserPrivate *priv; }; struct _GdictStrategyChooserClass { - GtkVBoxClass parent_class; + GtkBoxClass parent_class; void (*strategy_activated) (GdictStrategyChooser *chooser, const gchar *name, diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c index 726ad85f..009e1502 100644 --- a/mate-dictionary/src/gdict-applet.c +++ b/mate-dictionary/src/gdict-applet.c @@ -333,8 +333,12 @@ gdict_applet_build_window (GdictApplet *applet) gtk_container_add (GTK_CONTAINER (window), frame); gtk_widget_show (frame); priv->frame = frame; - + +#if GTK_CHECK_VERSION (3, 0, 0) + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); +#else vbox = gtk_vbox_new (FALSE, 12); +#endif gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); @@ -512,6 +516,9 @@ gdict_applet_draw (GdictApplet *applet) if (priv->box) gtk_widget_destroy (priv->box); +#if GTK_CHECK_VERSION (3, 0, 0) + box = gtk_box_new (priv->orient, 0); +#else switch (priv->orient) { case GTK_ORIENTATION_VERTICAL: @@ -524,6 +531,7 @@ gdict_applet_draw (GdictApplet *applet) g_assert_not_reached (); break; } +#endif gtk_container_add (GTK_CONTAINER (applet), box); gtk_widget_show (box); @@ -546,7 +554,11 @@ gdict_applet_draw (GdictApplet *applet) gtk_box_pack_start (GTK_BOX (box), priv->toggle, FALSE, FALSE, 0); gtk_widget_show (priv->toggle); +#if GTK_CHECK_VERSION (3, 0, 0) + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else hbox = gtk_hbox_new (FALSE, 0); +#endif gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); gtk_container_add (GTK_CONTAINER (priv->toggle), hbox); gtk_widget_show (hbox); diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c index 38828a76..ae05a2ea 100644 --- a/mate-dictionary/src/gdict-sidebar.c +++ b/mate-dictionary/src/gdict-sidebar.c @@ -73,7 +73,7 @@ enum static guint sidebar_signals[LAST_SIGNAL] = { 0 }; static GQuark sidebar_page_id_quark = 0; -G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_VBOX); +G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX); SidebarPage * sidebar_page_new (const gchar *id, @@ -315,6 +315,7 @@ gdict_sidebar_init (GdictSidebar *sidebar) GtkWidget *close_button; GtkWidget *arrow; + gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar), GTK_ORIENTATION_VERTICAL); sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar); /* we store all the pages inside the list, but we keep @@ -327,7 +328,11 @@ gdict_sidebar_init (GdictSidebar *sidebar) priv->pages_by_id = g_hash_table_new (g_str_hash, g_str_equal); /* top option menu */ +#if GTK_CHECK_VERSION (3, 0, 0) + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else hbox = gtk_hbox_new (FALSE, 0); +#endif gtk_box_pack_start (GTK_BOX (sidebar), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); priv->hbox = hbox; @@ -342,7 +347,11 @@ gdict_sidebar_init (GdictSidebar *sidebar) sidebar); priv->select_button = select_button; +#if GTK_CHECK_VERSION (3, 0, 0) + select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); +#else select_hbox = gtk_hbox_new (FALSE, 0); +#endif priv->label = gtk_label_new (NULL); #if GTK_CHECK_VERSION (3, 16, 0) diff --git a/mate-dictionary/src/gdict-sidebar.h b/mate-dictionary/src/gdict-sidebar.h index ee0f1b38..4d9b0512 100644 --- a/mate-dictionary/src/gdict-sidebar.h +++ b/mate-dictionary/src/gdict-sidebar.h @@ -39,14 +39,14 @@ typedef struct _GdictSidebarClass GdictSidebarClass; struct _GdictSidebar { - GtkVBox parent_instance; + GtkBox parent_instance; GdictSidebarPrivate *priv; }; struct _GdictSidebarClass { - GtkVBoxClass parent_class; + GtkBoxClass parent_class; void (*page_changed) (GdictSidebar *sidebar); void (*closed) (GdictSidebar *sidebar); -- cgit v1.2.1