GTk3: don't use deprecated GTK_TYPE_{V/H}BOX

This commit is contained in:
Wolfgang Ulbrich 2015-11-19 21:13:51 +01:00
parent 9994dd399a
commit dc6b2065db
16 changed files with 144 additions and 0 deletions

View File

@ -240,8 +240,13 @@ static void on_action_filter_binary (GtkAction * action,
static void on_action_bookmark_open (GtkAction * action, static void on_action_bookmark_open (GtkAction * action,
PlumaFileBrowserWidget * obj); PlumaFileBrowserWidget * obj);
#if GTK_CHECK_VERSION (3, 0, 0)
PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget,
GTK_TYPE_BOX)
#else
PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget, PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget,
GTK_TYPE_VBOX) GTK_TYPE_VBOX)
#endif
static void static void
free_name_icon (gpointer data) free_name_icon (gpointer data)
@ -1260,6 +1265,10 @@ pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj)
free_name_icon); free_name_icon);
gtk_box_set_spacing (GTK_BOX (obj), 3); gtk_box_set_spacing (GTK_BOX (obj), 3);
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (obj),
GTK_ORIENTATION_VERTICAL);
#endif
obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH); obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
} }

View File

@ -48,14 +48,22 @@ gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj,
struct _PlumaFileBrowserWidget struct _PlumaFileBrowserWidget
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkVBox parent; GtkVBox parent;
#endif
PlumaFileBrowserWidgetPrivate *priv; PlumaFileBrowserWidgetPrivate *priv;
}; };
struct _PlumaFileBrowserWidgetClass struct _PlumaFileBrowserWidgetClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
/* Signals */ /* Signals */
void (*uri_activated) (PlumaFileBrowserWidget * widget, void (*uri_activated) (PlumaFileBrowserWidget * widget,

View File

@ -69,7 +69,11 @@ struct _PlumaTaglistPluginPanelPrivate
gchar *data_dir; gchar *data_dir;
}; };
#if GTK_CHECK_VERSION (3, 0, 0)
PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_BOX)
#else
PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_VBOX) PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_VBOX)
#endif
enum enum
{ {
@ -675,6 +679,11 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel)
panel->priv = PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel); panel->priv = PLUMA_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel);
panel->priv->data_dir = NULL; panel->priv->data_dir = NULL;
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (panel),
GTK_ORIENTATION_VERTICAL);
#endif
/* Build the window content */ /* Build the window content */
panel->priv->tag_groups_combo = gtk_combo_box_text_new (); panel->priv->tag_groups_combo = gtk_combo_box_text_new ();
gtk_box_pack_start (GTK_BOX (panel), gtk_box_pack_start (GTK_BOX (panel),

View File

@ -58,7 +58,11 @@ typedef struct _PlumaTaglistPluginPanel PlumaTaglistPluginPanel;
struct _PlumaTaglistPluginPanel struct _PlumaTaglistPluginPanel
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox; GtkVBox vbox;
#endif
/*< private > */ /*< private > */
PlumaTaglistPluginPanelPrivate *priv; PlumaTaglistPluginPanelPrivate *priv;
@ -71,7 +75,11 @@ typedef struct _PlumaTaglistPluginPanelClass PlumaTaglistPluginPanelClass;
struct _PlumaTaglistPluginPanelClass struct _PlumaTaglistPluginPanelClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
}; };
/* /*

View File

@ -53,7 +53,11 @@ struct _PlumaDocumentsPanelPrivate
guint is_reodering : 1; guint is_reodering : 1;
}; };
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE(PlumaDocumentsPanel, pluma_documents_panel, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE(PlumaDocumentsPanel, pluma_documents_panel, GTK_TYPE_VBOX) G_DEFINE_TYPE(PlumaDocumentsPanel, pluma_documents_panel, GTK_TYPE_VBOX)
#endif
enum enum
{ {
@ -749,6 +753,11 @@ pluma_documents_panel_init (PlumaDocumentsPanel *panel)
panel->priv->adding_tab = FALSE; panel->priv->adding_tab = FALSE;
panel->priv->is_reodering = FALSE; panel->priv->is_reodering = FALSE;
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (panel),
GTK_ORIENTATION_VERTICAL);
#endif
/* Create the scrolled window */ /* Create the scrolled window */
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);

View File

@ -57,7 +57,11 @@ typedef struct _PlumaDocumentsPanel PlumaDocumentsPanel;
struct _PlumaDocumentsPanel struct _PlumaDocumentsPanel
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox; GtkVBox vbox;
#endif
/*< private > */ /*< private > */
PlumaDocumentsPanelPrivate *priv; PlumaDocumentsPanelPrivate *priv;
@ -70,7 +74,11 @@ typedef struct _PlumaDocumentsPanelClass PlumaDocumentsPanelClass;
struct _PlumaDocumentsPanelClass struct _PlumaDocumentsPanelClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
}; };
/* /*

View File

@ -90,7 +90,11 @@ static GObject *pluma_panel_constructor (GType type,
GObjectConstructParam *construct_properties); GObjectConstructParam *construct_properties);
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE(PlumaPanel, pluma_panel, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE(PlumaPanel, pluma_panel, GTK_TYPE_VBOX) G_DEFINE_TYPE(PlumaPanel, pluma_panel, GTK_TYPE_VBOX)
#endif
static void static void
pluma_panel_finalize (GObject *obj) pluma_panel_finalize (GObject *obj)
@ -191,8 +195,13 @@ pluma_panel_class_init (PlumaPanelClass *klass)
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_ORIENTATION, PROP_ORIENTATION,
#if GTK_CHECK_VERSION (3, 0, 0)
g_param_spec_enum ("panel-orientation",
"Panel Orientation",
#else
g_param_spec_enum ("orientation", g_param_spec_enum ("orientation",
"Orientation", "Orientation",
#endif
"The panel's orientation", "The panel's orientation",
GTK_TYPE_ORIENTATION, GTK_TYPE_ORIENTATION,
GTK_ORIENTATION_VERTICAL, GTK_ORIENTATION_VERTICAL,
@ -406,6 +415,11 @@ static void
pluma_panel_init (PlumaPanel *panel) pluma_panel_init (PlumaPanel *panel)
{ {
panel->priv = PLUMA_PANEL_GET_PRIVATE (panel); panel->priv = PLUMA_PANEL_GET_PRIVATE (panel);
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (panel),
GTK_ORIENTATION_VERTICAL);
#endif
} }
static void static void

View File

@ -55,7 +55,11 @@ typedef struct _PlumaPanel PlumaPanel;
struct _PlumaPanel struct _PlumaPanel
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox; GtkVBox vbox;
#endif
/*< private > */ /*< private > */
PlumaPanelPrivate *priv; PlumaPanelPrivate *priv;
@ -68,7 +72,11 @@ typedef struct _PlumaPanelClass PlumaPanelClass;
struct _PlumaPanelClass struct _PlumaPanelClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
void (* item_added) (PlumaPanel *panel, void (* item_added) (PlumaPanel *panel,
GtkWidget *item); GtkWidget *item);

View File

@ -70,7 +70,11 @@ struct _PlumaPluginManagerPrivate
GtkWidget *popup_menu; GtkWidget *popup_menu;
}; };
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE(PlumaPluginManager, pluma_plugin_manager, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE(PlumaPluginManager, pluma_plugin_manager, GTK_TYPE_VBOX) G_DEFINE_TYPE(PlumaPluginManager, pluma_plugin_manager, GTK_TYPE_VBOX)
#endif
static PlumaPluginInfo *plugin_manager_get_selected_plugin (PlumaPluginManager *pm); static PlumaPluginInfo *plugin_manager_get_selected_plugin (PlumaPluginManager *pm);
static void plugin_manager_toggle_active (PlumaPluginManager *pm, GtkTreeIter *iter, GtkTreeModel *model); static void plugin_manager_toggle_active (PlumaPluginManager *pm, GtkTreeIter *iter, GtkTreeModel *model);
@ -790,6 +794,11 @@ pluma_plugin_manager_init (PlumaPluginManager *pm)
pm->priv = PLUMA_PLUGIN_MANAGER_GET_PRIVATE (pm); pm->priv = PLUMA_PLUGIN_MANAGER_GET_PRIVATE (pm);
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (pm),
GTK_ORIENTATION_VERTICAL);
#endif
/* /*
* Always we create the manager, firstly we rescan the plugins directory * Always we create the manager, firstly we rescan the plugins directory
*/ */
@ -817,7 +826,11 @@ pluma_plugin_manager_init (PlumaPluginManager *pm)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), pm->priv->tree); gtk_label_set_mnemonic_widget (GTK_LABEL (label), pm->priv->tree);
#if GTK_CHECK_VERSION (3, 0, 0)
hbuttonbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
#else
hbuttonbox = gtk_hbutton_box_new (); hbuttonbox = gtk_hbutton_box_new ();
#endif
gtk_box_pack_start (GTK_BOX (pm), hbuttonbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (pm), hbuttonbox, FALSE, FALSE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END);
gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8); gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8);

View File

@ -55,7 +55,11 @@ typedef struct _PlumaPluginManager PlumaPluginManager;
struct _PlumaPluginManager struct _PlumaPluginManager
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox; GtkVBox vbox;
#endif
/*< private > */ /*< private > */
PlumaPluginManagerPrivate *priv; PlumaPluginManagerPrivate *priv;
@ -68,7 +72,11 @@ typedef struct _PlumaPluginManagerClass PlumaPluginManagerClass;
struct _PlumaPluginManagerClass struct _PlumaPluginManagerClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
}; };
/* /*

View File

@ -87,7 +87,11 @@ struct _PlumaPrintPreviewPrivate
guint cur_page; guint cur_page;
}; };
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (PlumaPrintPreview, pluma_print_preview, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE (PlumaPrintPreview, pluma_print_preview, GTK_TYPE_VBOX) G_DEFINE_TYPE (PlumaPrintPreview, pluma_print_preview, GTK_TYPE_VBOX)
#endif
static void static void
pluma_print_preview_get_property (GObject *object, pluma_print_preview_get_property (GObject *object,
@ -1001,6 +1005,11 @@ pluma_print_preview_init (PlumaPrintPreview *preview)
priv->context = NULL; priv->context = NULL;
priv->gtk_preview = NULL; priv->gtk_preview = NULL;
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (preview),
GTK_ORIENTATION_VERTICAL);
#endif
create_bar (preview); create_bar (preview);
create_preview_layout (preview); create_preview_layout (preview);

View File

@ -48,13 +48,21 @@ typedef struct _PlumaPrintPreviewClass PlumaPrintPreviewClass;
struct _PlumaPrintPreview struct _PlumaPrintPreview
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkVBox parent; GtkVBox parent;
#endif
PlumaPrintPreviewPrivate *priv; PlumaPrintPreviewPrivate *priv;
}; };
struct _PlumaPrintPreviewClass struct _PlumaPrintPreviewClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
void (* close) (PlumaPrintPreview *preview); void (* close) (PlumaPrintPreview *preview);
}; };

View File

@ -63,7 +63,11 @@ struct _PlumaTabLabelPrivate
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (PlumaTabLabel, pluma_tab_label, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE (PlumaTabLabel, pluma_tab_label, GTK_TYPE_HBOX) G_DEFINE_TYPE (PlumaTabLabel, pluma_tab_label, GTK_TYPE_HBOX)
#endif
static void static void
pluma_tab_label_finalize (GObject *object) pluma_tab_label_finalize (GObject *object)
@ -265,6 +269,10 @@ pluma_tab_label_init (PlumaTabLabel *tab_label)
tab_label->priv->close_button_sensitive = TRUE; tab_label->priv->close_button_sensitive = TRUE;
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (tab_label),
GTK_ORIENTATION_HORIZONTAL);
#endif
ebox = gtk_event_box_new (); ebox = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
gtk_box_pack_start (GTK_BOX (tab_label), ebox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (tab_label), ebox, TRUE, TRUE, 0);

View File

@ -41,13 +41,21 @@ typedef struct _PlumaTabLabelClass PlumaTabLabelClass;
typedef struct _PlumaTabLabelPrivate PlumaTabLabelPrivate; typedef struct _PlumaTabLabelPrivate PlumaTabLabelPrivate;
struct _PlumaTabLabel { struct _PlumaTabLabel {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox parent;
#else
GtkHBox parent; GtkHBox parent;
#endif
PlumaTabLabelPrivate *priv; PlumaTabLabelPrivate *priv;
}; };
struct _PlumaTabLabelClass { struct _PlumaTabLabelClass {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkHBoxClass parent_class; GtkHBoxClass parent_class;
#endif
void (* close_clicked) (PlumaTabLabel *tab_label); void (* close_clicked) (PlumaTabLabel *tab_label);
}; };

View File

@ -82,7 +82,11 @@ struct _PlumaTabPrivate
gint ask_if_externally_modified : 1; gint ask_if_externally_modified : 1;
}; };
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE(PlumaTab, pluma_tab, GTK_TYPE_BOX)
#else
G_DEFINE_TYPE(PlumaTab, pluma_tab, GTK_TYPE_VBOX) G_DEFINE_TYPE(PlumaTab, pluma_tab, GTK_TYPE_VBOX)
#endif
enum enum
{ {
@ -1481,6 +1485,11 @@ pluma_tab_init (PlumaTab *tab)
tab->priv->save_flags = 0; tab->priv->save_flags = 0;
tab->priv->ask_if_externally_modified = TRUE; tab->priv->ask_if_externally_modified = TRUE;
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_orientable_set_orientation (GTK_ORIENTABLE (tab),
GTK_ORIENTATION_VERTICAL);
#endif
/* Create the scrolled window */ /* Create the scrolled window */
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);

View File

@ -77,7 +77,11 @@ typedef struct _PlumaTab PlumaTab;
struct _PlumaTab struct _PlumaTab
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBox vbox;
#else
GtkVBox vbox; GtkVBox vbox;
#endif
/*< private > */ /*< private > */
PlumaTabPrivate *priv; PlumaTabPrivate *priv;
@ -90,7 +94,11 @@ typedef struct _PlumaTabClass PlumaTabClass;
struct _PlumaTabClass struct _PlumaTabClass
{ {
#if GTK_CHECK_VERSION (3, 0, 0)
GtkBoxClass parent_class;
#else
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
#endif
}; };
/* /*