From 0ea8ddb0d7f34a22da6467fb4688b321735c601d Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 1 Sep 2015 20:06:15 +0200 Subject: Gtk3: Remove deprecated GtkVBox/GtkHBox usage The GtkHBox and GtkVBox have been deprecated by now. Also be consistent with the other properties declarations and use PROP_0 instead of PROP = 1. taken from: https://git.gnome.org/browse/eog/commit/?id=81cb068 --- src/eom-print-preview.c | 3 ++- src/eom-sidebar.c | 9 +++++++++ src/eom-sidebar.h | 8 ++++++++ src/eom-thumb-nav.c | 12 +++++++++++- src/eom-thumb-nav.h | 8 ++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index a985a7f..0f5f484 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -83,7 +83,8 @@ enum { static guint preview_signals [SIGNAL_LAST] = { 0 }; enum { - PROP_IMAGE = 1, + PROP_0, + PROP_IMAGE, PROP_IMAGE_X_ALIGN, PROP_IMAGE_Y_ALIGN, PROP_IMAGE_SCALE, diff --git a/src/eom-sidebar.c b/src/eom-sidebar.c index 0b031f2..b6eaa8d 100644 --- a/src/eom-sidebar.c +++ b/src/eom-sidebar.c @@ -64,7 +64,11 @@ struct _EomSidebarPrivate { GtkTreeModel *page_model; }; +#if GTK_CHECK_VERSION (3, 2, 0) +G_DEFINE_TYPE (EomSidebar, eom_sidebar, GTK_TYPE_BOX) +#else G_DEFINE_TYPE (EomSidebar, eom_sidebar, GTK_TYPE_VBOX) +#endif #define EOM_SIDEBAR_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_SIDEBAR, EomSidebarPrivate)) @@ -399,6 +403,11 @@ eom_sidebar_init (EomSidebar *eom_sidebar) GtkWidget *arrow; GtkWidget *image; +#if GTK_CHECK_VERSION (3, 2, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (eom_sidebar), + GTK_ORIENTATION_VERTICAL); +#endif + eom_sidebar->priv = EOM_SIDEBAR_GET_PRIVATE (eom_sidebar); /* data model */ diff --git a/src/eom-sidebar.h b/src/eom-sidebar.h index 7e2f15d..88851b6 100644 --- a/src/eom-sidebar.h +++ b/src/eom-sidebar.h @@ -42,13 +42,21 @@ typedef struct _EomSidebarPrivate EomSidebarPrivate; #define EOM_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EOM_TYPE_SIDEBAR, EomSidebarClass)) struct _EomSidebar { +#if GTK_CHECK_VERSION (3, 2, 0) + GtkBox base_instance; +#else GtkVBox base_instance; +#endif EomSidebarPrivate *priv; }; struct _EomSidebarClass { +#if GTK_CHECK_VERSION (3, 2, 0) + GtkBoxClass base_class; +#else GtkVBoxClass base_class; +#endif void (* page_added) (EomSidebar *eom_sidebar, GtkWidget *main_widget); diff --git a/src/eom-thumb-nav.c b/src/eom-thumb-nav.c index 24c2431..11fd211 100644 --- a/src/eom-thumb-nav.c +++ b/src/eom-thumb-nav.c @@ -36,7 +36,11 @@ #define EOM_THUMB_NAV_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EOM_TYPE_THUMB_NAV, EomThumbNavPrivate)) +#if GTK_CHECK_VERSION (3, 2, 0) +G_DEFINE_TYPE (EomThumbNav, eom_thumb_nav, GTK_TYPE_BOX); +#else G_DEFINE_TYPE (EomThumbNav, eom_thumb_nav, GTK_TYPE_HBOX); +#endif #define EOM_THUMB_NAV_SCROLL_INC 20 #define EOM_THUMB_NAV_SCROLL_MOVE 20 @@ -44,7 +48,8 @@ G_DEFINE_TYPE (EomThumbNav, eom_thumb_nav, GTK_TYPE_HBOX); enum { - PROP_SHOW_BUTTONS = 1, + PROP_0, + PROP_SHOW_BUTTONS, PROP_THUMB_VIEW, PROP_MODE }; @@ -345,6 +350,11 @@ eom_thumb_nav_init (EomThumbNav *nav) EomThumbNavPrivate *priv; GtkWidget *arrow; +#if GTK_CHECK_VERSION (3, 2, 0) + gtk_orientable_set_orientation (GTK_ORIENTABLE (nav), + GTK_ORIENTATION_HORIZONTAL); +#endif + nav->priv = EOM_THUMB_NAV_GET_PRIVATE (nav); priv = nav->priv; diff --git a/src/eom-thumb-nav.h b/src/eom-thumb-nav.h index 89e8785..ab376a5 100644 --- a/src/eom-thumb-nav.h +++ b/src/eom-thumb-nav.h @@ -49,13 +49,21 @@ typedef enum { } EomThumbNavMode; struct _EomThumbNav { +#if GTK_CHECK_VERSION (3, 2, 0) + GtkBox base_instance; +#else GtkHBox base_instance; +#endif EomThumbNavPrivate *priv; }; struct _EomThumbNavClass { +#if GTK_CHECK_VERSION (3, 2, 0) + GtkBoxClass parent_class; +#else GtkHBoxClass parent_class; +#endif }; GType eom_thumb_nav_get_type (void) G_GNUC_CONST; -- cgit v1.2.1