From 9d785e0f9ea5e08bd9bf0aac5edae3fe51482e31 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Thu, 23 Jul 2015 20:28:39 +0200 Subject: GTK3: EomPrintImageSetup, Derive from GtkTable instead of GtkGrid GtkTable has been deprecated in favor of GtkGrid. taken from: https://git.gnome.org/browse/eog/commit/?id=7fd3bcf --- src/eom-print-image-setup.c | 21 +++++++++++++++++++++ src/eom-print-image-setup.h | 8 ++++++++ 2 files changed, 29 insertions(+) (limited to 'src') diff --git a/src/eom-print-image-setup.c b/src/eom-print-image-setup.c index 6aa965b..8330e67 100644 --- a/src/eom-print-image-setup.c +++ b/src/eom-print-image-setup.c @@ -56,7 +56,11 @@ #define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) #endif +#if GTK_CHECK_VERSION (3, 4, 0) +G_DEFINE_TYPE (EomPrintImageSetup, eom_print_image_setup, GTK_TYPE_GRID); +#else G_DEFINE_TYPE (EomPrintImageSetup, eom_print_image_setup, GTK_TYPE_TABLE); +#endif struct _EomPrintImageSetupPrivate { GtkWidget *left; @@ -873,9 +877,13 @@ eom_print_image_setup_init (EomPrintImageSetup *setup) gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); frame = wrap_in_frame (_("Position"), table); +#if GTK_CHECK_VERSION (3, 4, 0) + gtk_grid_attach (GTK_GRID (setup), frame, 0, 0, 1, 1); +#else gtk_table_attach (GTK_TABLE (setup), frame, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); +#endif priv->left = table_attach_spin_button_with_label (table, _("_Left:"), 0, 0); priv->right = table_attach_spin_button_with_label (table, _("_Right:"), 0, 1); @@ -910,9 +918,13 @@ eom_print_image_setup_init (EomPrintImageSetup *setup) gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); frame = wrap_in_frame (_("Size"), table); +#if GTK_CHECK_VERSION (3, 4, 0) + gtk_grid_attach (GTK_GRID (setup), frame, 0, 1, 1, 1); +#else gtk_table_attach (GTK_TABLE (setup), frame, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); +#endif priv->width = table_attach_spin_button_with_label (table, _("_Width:"), 0, 0); @@ -970,9 +982,14 @@ eom_print_image_setup_init (EomPrintImageSetup *setup) gtk_widget_set_size_request (priv->preview, 250, 250); frame = wrap_in_frame (_("Preview"), priv->preview); +#if GTK_CHECK_VERSION (3, 4, 0) + /* The preview widget needs to span the whole grid height */ + gtk_grid_attach (GTK_GRID (setup), frame, 1, 0, 1, 2); +#else gtk_table_attach (GTK_TABLE (setup), frame, 1, 2, 0, 2, GTK_FILL, GTK_FILL, 0, 0); +#endif gtk_widget_show_all (GTK_WIDGET (setup)); } @@ -997,9 +1014,13 @@ eom_print_image_setup_new (EomImage *image, GtkPageSetup *page_setup) GtkWidget *preview; setup = g_object_new (EOM_TYPE_PRINT_IMAGE_SETUP, +#if GTK_CHECK_VERSION (3, 4, 0) + "orientation", GTK_ORIENTATION_VERTICAL, +#else "n-rows", 2, "n-columns", 2, "homogeneous", FALSE, +#endif "row-spacing", 18, "column-spacing", 18, "border-width", 12, diff --git a/src/eom-print-image-setup.h b/src/eom-print-image-setup.h index 8b8e3e6..6915fcf 100644 --- a/src/eom-print-image-setup.h +++ b/src/eom-print-image-setup.h @@ -38,13 +38,21 @@ typedef struct _EomPrintImageSetupPrivate EomPrintImageSetupPrivate; #define EOM_PRINT_IMAGE_SETUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EOM_TYPE_PRINT_IMAGE_SETUP, EomPrintImageSetupClass)) struct _EomPrintImageSetup { +#if GTK_CHECK_VERSION (3, 4, 0) + GtkGrid parent_instance; +#else GtkTable parent_instance; +#endif EomPrintImageSetupPrivate *priv; }; struct _EomPrintImageSetupClass { +#if GTK_CHECK_VERSION (3, 4, 0) + GtkGridClass parent_class; +#else GtkTableClass parent_class; +#endif }; G_GNUC_INTERNAL -- cgit v1.2.1