aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-canvas-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-14 06:16:57 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-15 03:58:30 +0800
commitd47adb5922a262effdd14c1c50bb0a3660088798 (patch)
treee5e35815f8feea8d7fbf46a46d7e82f1b8ed3d6a /widgets/misc/e-canvas-utils.c
parent0af3ff804c0d71c76fd63f0a2a152cac7de64863 (diff)
downloadgsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.gz
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.zst
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.zip
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.
Diffstat (limited to 'widgets/misc/e-canvas-utils.c')
-rw-r--r--widgets/misc/e-canvas-utils.c11
1 files changed, 7 insertions, 4 deletions
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);