From 80bc7035be2d07d14e60b09a624147f6e92d1dc6 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 17:16:57 -0500 Subject: Fudge GtkScrollable for gtk2. Yes, the GtkScrollable interface is implemented by more than just GtkLayout, but it turns out GtkLayout is the only thing Evolution uses the GtkScrollable API for on the gtk3 branch. --- widgets/misc/e-canvas-utils.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-canvas-utils.c') diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c index 8189dc1240..bbf10b60af 100644 --- a/widgets/misc/e-canvas-utils.c +++ b/widgets/misc/e-canvas-utils.c @@ -23,6 +23,9 @@ #include "e-canvas-utils.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + void e_canvas_item_move_absolute (GnomeCanvasItem *item, gdouble dx, gdouble dy) { @@ -75,7 +78,7 @@ e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdo g_return_if_fail (canvas != NULL); g_return_if_fail (GNOME_IS_CANVAS (canvas)); - h = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas)); + h = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)); page_size = gtk_adjustment_get_page_size (h); lower = gtk_adjustment_get_lower (h); upper = gtk_adjustment_get_upper (h); @@ -84,7 +87,7 @@ e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdo if (dx) gtk_adjustment_set_value (h, CLAMP (value + dx, lower, upper - page_size)); - v = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas)); + v = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)); page_size = gtk_adjustment_get_page_size (v); lower = gtk_adjustment_get_lower (v); upper = gtk_adjustment_get_upper (v); @@ -119,7 +122,7 @@ e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gd g_return_val_if_fail (canvas != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS (canvas), FALSE); - h = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas)); + h = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)); page_size = gtk_adjustment_get_page_size (h); lower = gtk_adjustment_get_lower (h); upper = gtk_adjustment_get_upper (h); @@ -128,7 +131,7 @@ e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gd if (CLAMP (value + dx, lower, upper - page_size) - value != 0) return FALSE; - v = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas)); + v = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)); page_size = gtk_adjustment_get_page_size (v); lower = gtk_adjustment_get_lower (v); upper = gtk_adjustment_get_upper (v); -- cgit