[evolution] Fudge GtkScrollable for gtk2.



commit d47adb5922a262effdd14c1c50bb0a3660088798
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jan 13 17:16:57 2011 -0500

    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.

 calendar/gui/e-day-view.c             |   56 +++++++++++++-------------
 calendar/gui/e-meeting-time-sel.c     |   26 ++++++------
 e-util/gtk-compat.h                   |   14 ++++++-
 libgnomecanvas/gailcanvas.c           |    4 +-
 libgnomecanvas/gnome-canvas.c         |   73 +++++++++++++++++----------------
 widgets/misc/e-canvas-utils.c         |   11 +++--
 widgets/table/e-cell-combo.c          |    4 +-
 widgets/table/e-cell-date-edit.c      |    6 +-
 widgets/table/e-table-field-chooser.c |    7 ++-
 widgets/table/e-table-header-item.c   |   18 ++++----
 widgets/table/e-table.c               |   64 ++++++++++++++--------------
 widgets/table/e-tree.c                |   73 ++++++++++++++++-----------------
 widgets/text/e-reflow.c               |   23 ++++++-----
 13 files changed, 200 insertions(+), 179 deletions(-)
---
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index e50e1c2..e762bda 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -919,7 +919,7 @@ e_day_view_init (EDayView *day_view)
 	gint day;
 	GnomeCanvasGroup *canvas_group;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GtkWidget *w;
 
 	gtk_widget_set_can_focus (GTK_WIDGET (day_view), TRUE);
@@ -1170,10 +1170,10 @@ e_day_view_init (EDayView *day_view)
 	 * Times Canvas
 	 */
 	day_view->time_canvas = e_canvas_new ();
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
-	layout = GTK_LAYOUT (day_view->time_canvas);
-	gtk_layout_set_vadjustment (layout, adjustment);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
+	scrollable = GTK_SCROLLABLE (day_view->time_canvas);
+	gtk_scrollable_set_vadjustment (scrollable, adjustment);
 	gtk_table_attach (GTK_TABLE (day_view), day_view->time_canvas,
 			  0, 1, 1, 2,
 			  GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -1192,21 +1192,21 @@ e_day_view_init (EDayView *day_view)
 	/*
 	 * Scrollbar.
 	 */
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_hadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	day_view->mc_hscrollbar = gtk_hscrollbar_new (adjustment);
 	gtk_table_attach (GTK_TABLE (day_view), day_view->mc_hscrollbar, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
 	gtk_widget_show (day_view->mc_hscrollbar);
 
-	layout = GTK_LAYOUT (day_view->top_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	day_view->tc_vscrollbar = gtk_vscrollbar_new (adjustment);
 	gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar,
 			  2, 3, 0, 1, 0, GTK_FILL, 0, 0);
 	/* gtk_widget_show (day_view->tc_vscrollbar); */
 
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	day_view->vscrollbar = gtk_vscrollbar_new (adjustment);
 	gtk_table_attach (GTK_TABLE (day_view), day_view->vscrollbar,
 			  2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -1582,7 +1582,7 @@ e_day_view_style_set (GtkWidget *widget,
 		MAX (day_view->row_height,
 		E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2);
 
-	adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (day_view->main_canvas));
+	adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->main_canvas));
 	gtk_adjustment_set_step_increment (adjustment, day_view->row_height);
 
 	day_view->top_row_height =
@@ -1595,7 +1595,7 @@ e_day_view_style_set (GtkWidget *widget,
 		E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2 +
 		E_DAY_VIEW_TOP_CANVAS_Y_GAP);
 
-	adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (day_view->top_canvas));
+	adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->top_canvas));
 	gtk_adjustment_set_step_increment (adjustment, day_view->top_row_height);
 	gtk_widget_set_size_request (day_view->top_dates_canvas, -1, day_view->top_row_height - 2);
 
@@ -5899,16 +5899,16 @@ static void
 e_day_view_scroll	(EDayView	*day_view,
 			 gfloat		 pages_to_scroll)
 {
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	gdouble new_value;
 	gdouble page_size;
 	gdouble lower;
 	gdouble upper;
 	gdouble value;
 
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
@@ -5924,16 +5924,16 @@ static void
 e_day_view_top_scroll	(EDayView	*day_view,
 			 gfloat		 pages_to_scroll)
 {
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	gdouble new_value;
 	gdouble page_size;
 	gdouble lower;
 	gdouble upper;
 	gdouble value;
 
-	layout = GTK_LAYOUT (day_view->top_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
@@ -5950,15 +5950,15 @@ e_day_view_ensure_rows_visible (EDayView *day_view,
 				gint start_row,
 				gint end_row)
 {
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	gdouble max_value;
 	gdouble min_value;
 	gdouble page_size;
 	gdouble value;
 
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	value = gtk_adjustment_get_value (adjustment);
 	page_size = gtk_adjustment_get_page_size (adjustment);
@@ -6615,11 +6615,11 @@ e_day_view_on_editing_started (EDayView *day_view,
 						       &start_day, &end_day,
 						       &item_x, &item_y,
 						       &item_w, &item_h)) {
-			GtkLayout *layout;
 			GtkAdjustment *adjustment;
+			GtkScrollable *scrollable;
 
-			layout = GTK_LAYOUT (day_view->top_canvas);
-			adjustment = gtk_layout_get_vadjustment (layout);
+			scrollable = GTK_SCROLLABLE (day_view->top_canvas);
+			adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 			/* and ensure it's visible too */
 			/*item_y = (event_num * (day_view->top_row_height + 1)) - 1;*/
@@ -6953,7 +6953,7 @@ e_day_view_auto_scroll_handler (gpointer data)
 	ECalendarViewPosition pos;
 	gint scroll_x, scroll_y, new_scroll_y, canvas_x, canvas_y, row, day;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble step_increment;
 	gdouble page_size;
 	gdouble upper;
@@ -6973,8 +6973,8 @@ e_day_view_auto_scroll_handler (gpointer data)
 	gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas),
 					 &scroll_x, &scroll_y);
 
-	layout = GTK_LAYOUT (day_view->main_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (day_view->main_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	step_increment = gtk_adjustment_get_step_increment (adjustment);
 	page_size = gtk_adjustment_get_page_size (adjustment);
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 8b6f36d..14f05c5 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -399,7 +399,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
 	GtkWidget *alignment, *child_hbox, *arrow, *menuitem;
 	GtkWidget *child;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GSList *group;
 	guint accel_key;
 	time_t meeting_start_time;
@@ -508,13 +508,13 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
 	g_signal_connect (mts->display_main, "scroll-event",
 			  G_CALLBACK (e_meeting_time_selector_on_canvas_scroll_event), mts);
 
-	layout = GTK_LAYOUT (mts->display_main);
+	scrollable = GTK_SCROLLABLE (mts->display_main);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	gtk_scrolled_window_set_vadjustment (
 		GTK_SCROLLED_WINDOW (sw), adjustment);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	mts->hscrollbar = gtk_hscrollbar_new (adjustment);
 	gtk_adjustment_set_step_increment (adjustment, mts->day_width);
 	gtk_table_attach (
@@ -522,7 +522,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
 		1, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0);
 	gtk_widget_show (mts->hscrollbar);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	mts->vscrollbar = gtk_vscrollbar_new (adjustment);
 	gtk_adjustment_set_step_increment (adjustment, mts->row_height);
 	gtk_table_attach (
@@ -842,12 +842,12 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em
 	e_meeting_time_selector_alloc_named_color (mts, "orange4", &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]);
 
 	/* Connect handlers to the adjustments  scroll the other items. */
-	layout = GTK_LAYOUT (mts->display_main);
-	adjustment = gtk_layout_get_hadjustment (layout);
+	scrollable = GTK_SCROLLABLE (mts->display_main);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	g_signal_connect (
 		adjustment, "value_changed",
 		G_CALLBACK (e_meeting_time_selector_hadjustment_changed), mts);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	g_signal_connect (
 		adjustment, "value_changed",
 		G_CALLBACK (e_meeting_time_selector_vadjustment_changed), mts);
@@ -1182,10 +1182,10 @@ style_change_idle_func (EMeetingTimeSelector *mts)
 
 	widget = mts->display_main;
 
-	adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (widget));
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
 	gtk_adjustment_set_step_increment (adjustment, mts->day_width);
 
-	adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
+	adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
 	gtk_adjustment_set_step_increment (adjustment, mts->row_height);
 
 	g_object_unref (layout);
@@ -1256,11 +1256,11 @@ e_meeting_time_selector_hadjustment_changed (GtkAdjustment *adjustment,
 					     EMeetingTimeSelector *mts)
 {
 	GtkAdjustment *hadjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble value;
 
-	layout = GTK_LAYOUT (mts->display_top);
-	hadjustment = gtk_layout_get_hadjustment (layout);
+	scrollable = GTK_SCROLLABLE (mts->display_top);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
 
 	value = gtk_adjustment_get_value (adjustment);
 	gtk_adjustment_set_value (hadjustment, value);
diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h
index f67a9e2..7e4ab69 100644
--- a/e-util/gtk-compat.h
+++ b/e-util/gtk-compat.h
@@ -5,9 +5,21 @@
 
 /* Provide a GTK+ compatibility layer. */
 
-#if !GTK_CHECK_VERSION (2,91,0)  /* approximately  */
+#if !GTK_CHECK_VERSION (2,91,0)  /* approximately; who cares at this point */
+
 #define gtk_widget_get_preferred_size(widget, minimum_size, natural_size) \
 	(gtk_widget_size_request ((widget), ((minimum_size))))
+
+/* XXX 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. */
+#define GtkScrollable				GtkLayout
+#define GTK_SCROLLABLE				GTK_LAYOUT
+#define gtk_scrollable_get_hadjustment		gtk_layout_get_hadjustment
+#define gtk_scrollable_set_hadjustment		gtk_layout_set_hadjustment
+#define gtk_scrollable_get_vadjustment		gtk_layout_get_vadjustment
+#define gtk_scrollable_set_vadjustment		gtk_layout_set_vadjustment
+
 #endif
 
 #if !GTK_CHECK_VERSION (2,23,0)
diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c
index 6857f12..e1776ff 100644
--- a/libgnomecanvas/gailcanvas.c
+++ b/libgnomecanvas/gailcanvas.c
@@ -182,13 +182,13 @@ gail_canvas_real_initialize (AtkObject *obj,
 
   canvas = GNOME_CANVAS (data);
 
-  adj = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas));
+  adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
   g_signal_connect (adj,
                     "value_changed",
                     G_CALLBACK (adjustment_changed),
                     canvas);
 
-  adj = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas));
+  adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
   g_signal_connect (adj,
                     "value_changed",
                     G_CALLBACK (adjustment_changed),
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index cd2ffaa..5d6ba83 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -1877,8 +1877,8 @@ gnome_canvas_init (GnomeCanvas *canvas)
 	 */
 	canvas->center_scroll_region = TRUE;
 
-	gtk_layout_set_hadjustment (GTK_LAYOUT (canvas), NULL);
-	gtk_layout_set_vadjustment (GTK_LAYOUT (canvas), NULL);
+	gtk_scrollable_set_hadjustment (GTK_SCROLLABLE (canvas), NULL);
+	gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (canvas), NULL);
 
 	/* Disable the gtk+ gdouble buffering since the canvas uses it's own. */
 	gtk_widget_set_double_buffered (GTK_WIDGET (canvas), FALSE);
@@ -2067,8 +2067,8 @@ static void
 scroll_to (GnomeCanvas *canvas, gint cx, gint cy)
 {
 	GtkWidget *widget;
-	GtkLayout *layout;
 	GtkAllocation allocation;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	guint layout_width, layout_height;
@@ -2080,10 +2080,11 @@ scroll_to (GnomeCanvas *canvas, gint cx, gint cy)
 	widget = GTK_WIDGET (canvas);
 	gtk_widget_get_allocation (widget, &allocation);
 
-	layout = GTK_LAYOUT (canvas);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
-	gtk_layout_get_size (layout, &layout_width, &layout_height);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
+
+	gtk_layout_get_size (GTK_LAYOUT (canvas), &layout_width, &layout_height);
 
 	canvas_width = allocation.width;
 	canvas_height = allocation.height;
@@ -2163,7 +2164,7 @@ scroll_to (GnomeCanvas *canvas, gint cx, gint cy)
 static void
 gnome_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 {
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 
@@ -2173,9 +2174,9 @@ gnome_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 	if (GTK_WIDGET_CLASS (canvas_parent_class)->size_allocate)
 		(* GTK_WIDGET_CLASS (canvas_parent_class)->size_allocate) (widget, allocation);
 
-	layout = GTK_LAYOUT (widget);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (widget);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	/* Recenter the view, if appropriate */
 
@@ -2670,9 +2671,9 @@ static void
 gnome_canvas_paint_rect (GnomeCanvas *canvas, gint x0, gint y0, gint x1, gint y1)
 {
 	GtkWidget *widget;
-	GtkLayout *layout;
 	GdkWindow *bin_window;
 	GtkAllocation allocation;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	gint draw_x1, draw_y1;
@@ -2687,11 +2688,11 @@ gnome_canvas_paint_rect (GnomeCanvas *canvas, gint x0, gint y0, gint x1, gint y1
 
 	widget = GTK_WIDGET (canvas);
 	gtk_widget_get_allocation (widget, &allocation);
+	bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (canvas));
 
-	layout = GTK_LAYOUT (canvas);
-	bin_window = gtk_layout_get_bin_window (layout);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	hadjustment_value = gtk_adjustment_get_value (hadjustment);
 	vadjustment_value = gtk_adjustment_get_value (vadjustment);
@@ -2915,7 +2916,7 @@ gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
                                 gdouble x2,
                                 gdouble y2)
 {
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	gdouble hadjustment_value;
@@ -2925,9 +2926,9 @@ gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
 
 	g_return_if_fail (GNOME_IS_CANVAS (canvas));
 
-	layout = GTK_LAYOUT (canvas);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	hadjustment_value = gtk_adjustment_get_value (hadjustment);
 	vadjustment_value = gtk_adjustment_get_value (vadjustment);
@@ -3008,7 +3009,7 @@ void
 gnome_canvas_set_center_scroll_region (GnomeCanvas *canvas,
                                        gboolean center_scroll_region)
 {
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	gdouble hadjustment_value;
@@ -3016,9 +3017,9 @@ gnome_canvas_set_center_scroll_region (GnomeCanvas *canvas,
 
 	g_return_if_fail (GNOME_IS_CANVAS (canvas));
 
-	layout = GTK_LAYOUT (canvas);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	hadjustment_value = gtk_adjustment_get_value (hadjustment);
 	vadjustment_value = gtk_adjustment_get_value (vadjustment);
@@ -3064,7 +3065,7 @@ gnome_canvas_get_center_scroll_region (GnomeCanvas *canvas)
 void
 gnome_canvas_set_pixels_per_unit (GnomeCanvas *canvas, gdouble n)
 {
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	gdouble ax, ay;
@@ -3074,9 +3075,9 @@ gnome_canvas_set_pixels_per_unit (GnomeCanvas *canvas, gdouble n)
 	g_return_if_fail (GNOME_IS_CANVAS (canvas));
 	g_return_if_fail (n > GNOME_CANVAS_EPSILON);
 
-	layout = GTK_LAYOUT (canvas);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	if (canvas->center_scroll_region) {
 		GtkAllocation allocation;
@@ -3153,20 +3154,20 @@ gnome_canvas_scroll_to (GnomeCanvas *canvas, gint cx, gint cy)
 void
 gnome_canvas_get_scroll_offsets (GnomeCanvas *canvas, gint *cx, gint *cy)
 {
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 
 	g_return_if_fail (GNOME_IS_CANVAS (canvas));
 
-	layout = GTK_LAYOUT (canvas);
+	scrollable = GTK_SCROLLABLE (canvas);
 
 	if (cx) {
-		adjustment = gtk_layout_get_hadjustment (layout);
+		adjustment = gtk_scrollable_get_hadjustment (scrollable);
 		*cx = (gint) gtk_adjustment_get_value (adjustment);
 	}
 
 	if (cy) {
-		adjustment = gtk_layout_get_vadjustment (layout);
+		adjustment = gtk_scrollable_get_vadjustment (scrollable);
 		*cy = (gint) gtk_adjustment_get_value (adjustment);
 	}
 }
@@ -3216,8 +3217,8 @@ gnome_canvas_request_update_real (GnomeCanvas *canvas)
 static inline void
 get_visible_rect (GnomeCanvas *canvas, GdkRectangle *visible)
 {
-	GtkLayout *layout;
 	GtkAllocation allocation;
+	GtkScrollable *scrollable;
 	GtkAdjustment *hadjustment;
 	GtkAdjustment *vadjustment;
 	gdouble hadjustment_value;
@@ -3225,9 +3226,9 @@ get_visible_rect (GnomeCanvas *canvas, GdkRectangle *visible)
 
 	gtk_widget_get_allocation (GTK_WIDGET (canvas), &allocation);
 
-	layout = GTK_LAYOUT (canvas);
-	hadjustment = gtk_layout_get_hadjustment (layout);
-	vadjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (canvas);
+	hadjustment = gtk_scrollable_get_hadjustment (scrollable);
+	vadjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	hadjustment_value = gtk_adjustment_get_value (hadjustment);
 	vadjustment_value = gtk_adjustment_get_value (vadjustment);
diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c
index 8189dc1..bbf10b6 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);
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 6e1eb5c..c06e545 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -426,8 +426,8 @@ e_cell_combo_get_popup_pos		(ECellCombo	*ecc,
 	/* The ETable positions don't include the grid lines, I think, so we add 1. */
 	*y += y1 + 1
 		- (gint)gtk_adjustment_get_value (
-			gtk_layout_get_vadjustment (
-			&((GnomeCanvas *)canvas)->layout))
+			gtk_scrollable_get_vadjustment (
+			GTK_SCROLLABLE (&((GnomeCanvas *)canvas)->layout)))
 		+ ((GnomeCanvas *)canvas)->zoom_yofs;
 
 	widget = gtk_scrolled_window_get_vscrollbar (popup);
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 005f7a6..31d63d9 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -648,7 +648,7 @@ e_cell_date_edit_get_popup_pos		(ECellDateEdit	*ecde,
 	GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas);
 	GtkRequisition popup_requisition;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	GdkWindow *window;
 	gint avail_height, screen_width, column_width, row_height;
 	gdouble x1, y1, wx, wy;
@@ -677,8 +677,8 @@ e_cell_date_edit_get_popup_pos		(ECellDateEdit	*ecde,
 	*x += x1;
 	/* The ETable positions don't include the grid lines, I think, so we
 	   add 1. */
-	layout = &GNOME_CANVAS (canvas)->layout;
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (&GNOME_CANVAS (canvas)->layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	value = (gint) gtk_adjustment_get_value (adjustment);
 	*y += y1 + 1 - value + ((GnomeCanvas *)canvas)->zoom_yofs;
 
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
index f0e3ece..374507e 100644
--- a/widgets/table/e-table-field-chooser.c
+++ b/widgets/table/e-table-field-chooser.c
@@ -34,6 +34,9 @@
 #include "e-table-field-chooser.h"
 #include "e-table-field-chooser-item.h"
 
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
 static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
 static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
 static void e_table_field_chooser_dispose (GObject *object);
@@ -86,8 +89,8 @@ ensure_nonzero_step_increments (ETableFieldChooser *etfc)
 {
 	GtkAdjustment *va, *ha;
 
-	va = gtk_layout_get_vadjustment (GTK_LAYOUT (etfc->canvas));
-	ha = gtk_layout_get_hadjustment (GTK_LAYOUT (etfc->canvas));
+	va = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (etfc->canvas));
+	ha = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (etfc->canvas));
 
 	/*
 	  it looks pretty complicated to get height of column header
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 7fda006..1c97826 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -506,10 +506,10 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate)
 	window = gtk_widget_get_window (GTK_WIDGET (canvas));
 	gdk_window_get_origin (window, &rx, &ry);
 
-	adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (canvas));
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas));
 	rx -= gtk_adjustment_get_value (adjustment);
 
-	adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (canvas));
+	adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas));
 	ry -= gtk_adjustment_get_value (adjustment);
 
 	gtk_window_move (
@@ -625,8 +625,8 @@ scroll_timeout (gpointer data)
 {
 	ETableHeaderItem *ethi = data;
 	gint dx = 0;
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	gdouble hadjustment_value;
 	gdouble vadjustment_value;
 	gdouble page_size;
@@ -639,17 +639,17 @@ scroll_timeout (gpointer data)
 	if (ethi->scroll_direction & ET_SCROLL_LEFT)
 		dx -= 20;
 
-	layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (ethi)->canvas);
+	scrollable = GTK_SCROLLABLE (GNOME_CANVAS_ITEM (ethi)->canvas);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	hadjustment_value = gtk_adjustment_get_value (adjustment);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	vadjustment_value = gtk_adjustment_get_value (adjustment);
 
 	value = hadjustment_value;
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
 	upper = gtk_adjustment_get_upper (adjustment);
@@ -759,10 +759,10 @@ ethi_drag_motion (GtkWidget *widget,
 	ethi->last_drop_context = context;
 	context_connect (ethi, context);
 
-	adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (widget));
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (widget));
 	hadjustment_value = gtk_adjustment_get_value (adjustment);
 
-	adjustment = gtk_layout_get_vadjustment (GTK_LAYOUT (widget));
+	adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget));
 	vadjustment_value = gtk_adjustment_get_value (adjustment);
 
 	do_drag_motion (
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 4dc13bf..952bf90 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -838,13 +838,13 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *
 	GdkEventKey *key = (GdkEventKey *) event;
 	gint y, row_local, col_local;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble page_size;
 	gdouble upper;
 	gdouble value;
 
-	layout = GTK_LAYOUT (et->table_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (et->table_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	switch (key->keyval) {
 	case GDK_KEY_Page_Down:
@@ -1607,8 +1607,8 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
 	gint row = 0;
 	gint col_count, i;
 	GValue *val;
-	GtkLayout *layout;
 	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 
 	val = g_new0 (GValue, 1);
 	g_value_init (val, G_TYPE_OBJECT);
@@ -1689,12 +1689,12 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
 	e_table_setup_table (e_table, e_table->full_header, e_table->header, etm);
 	e_table_fill_table (e_table, etm);
 
-	layout = GTK_LAYOUT (e_table->table_canvas);
+	scrollable = GTK_SCROLLABLE (e_table->table_canvas);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	gtk_adjustment_set_step_increment (adjustment, 20);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	gtk_adjustment_set_step_increment (adjustment, 20);
 
 	if (!specification->no_headers) {
@@ -2331,15 +2331,15 @@ set_scroll_adjustments   (ETable *table,
 		gtk_adjustment_set_step_increment (hadjustment, 20);
 
 	if (table->table_canvas != NULL) {
-		gtk_layout_set_hadjustment (
-			GTK_LAYOUT (table->table_canvas), hadjustment);
-		gtk_layout_set_vadjustment (
-			GTK_LAYOUT (table->table_canvas), vadjustment);
+		gtk_scrollable_set_hadjustment (
+			GTK_SCROLLABLE (table->table_canvas), hadjustment);
+		gtk_scrollable_set_vadjustment (
+			GTK_SCROLLABLE (table->table_canvas), vadjustment);
 	}
 
 	if (table->header_canvas != NULL)
-		gtk_layout_set_hadjustment (
-			GTK_LAYOUT (table->header_canvas), hadjustment);
+		gtk_scrollable_set_hadjustment (
+			GTK_SCROLLABLE (table->header_canvas), hadjustment);
 }
 
 /**
@@ -2469,7 +2469,7 @@ e_table_get_cell_at (ETable *table,
 		     gint *row_return, gint *col_return)
 {
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 
 	g_return_if_fail (E_IS_TABLE (table));
 	g_return_if_fail (row_return != NULL);
@@ -2478,12 +2478,12 @@ e_table_get_cell_at (ETable *table,
 	/* FIXME it would be nice if it could handle a NULL row_return or
 	 * col_return gracefully.  */
 
-	layout = GTK_LAYOUT (table->table_canvas);
+	scrollable = GTK_SCROLLABLE (table->table_canvas);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	x += gtk_adjustment_get_value (adjustment);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	y += gtk_adjustment_get_value (adjustment);
 
 	e_table_group_compute_location (
@@ -2511,26 +2511,26 @@ e_table_get_cell_geometry (ETable *table,
 			   gint *x_return, gint *y_return,
 			   gint *width_return, gint *height_return)
 {
-	GtkAdjustment *adjustment;
 	GtkAllocation allocation;
-	GtkLayout *layout;
+	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 
 	g_return_if_fail (E_IS_TABLE (table));
 
-	layout = GTK_LAYOUT (table->table_canvas);
+	scrollable = GTK_SCROLLABLE (table->table_canvas);
 
 	e_table_group_get_cell_geometry (
 		table->group, &row, &col, x_return, y_return,
 		width_return, height_return);
 
 	if (x_return && table->table_canvas) {
-		adjustment = gtk_layout_get_hadjustment (layout);
+		adjustment = gtk_scrollable_get_hadjustment (scrollable);
 		(*x_return) -= gtk_adjustment_get_value (adjustment);
 	}
 
 	if (y_return) {
 		if (table->table_canvas) {
-			adjustment = gtk_layout_get_vadjustment (layout);
+			adjustment = gtk_scrollable_get_vadjustment (scrollable);
 			(*y_return) -= gtk_adjustment_get_value (adjustment);
 		}
 
@@ -2692,16 +2692,16 @@ e_table_drag_highlight (ETable *table,
 			gint     row,
 			gint     col)
 {
-	GtkAdjustment *adjustment;
 	GtkAllocation allocation;
-	GtkLayout *layout;
+	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	GtkStyle *style;
 
 	g_return_if_fail (E_IS_TABLE (table));
 
-	layout = GTK_LAYOUT (table->table_canvas);
+	scrollable = GTK_SCROLLABLE (table->table_canvas);
 	style = gtk_widget_get_style (GTK_WIDGET (table));
-	gtk_widget_get_allocation (GTK_WIDGET (layout), &allocation);
+	gtk_widget_get_allocation (GTK_WIDGET (scrollable), &allocation);
 
 	if (row != -1) {
 		gint x, y, width, height;
@@ -2711,11 +2711,11 @@ e_table_drag_highlight (ETable *table,
 			width = allocation.width;
 		} else {
 			e_table_get_cell_geometry (table, row, col, &x, &y, &width, &height);
-			adjustment = gtk_layout_get_hadjustment (layout);
+			adjustment = gtk_scrollable_get_hadjustment (scrollable);
 			x += gtk_adjustment_get_value (adjustment);
 		}
 
-		adjustment = gtk_layout_get_vadjustment (layout);
+		adjustment = gtk_scrollable_get_vadjustment (scrollable);
 		y += gtk_adjustment_get_value (adjustment);
 
 		if (table->drop_highlight == NULL) {
@@ -3025,7 +3025,7 @@ scroll_timeout (gpointer data)
 	ETable *et = data;
 	gint dx = 0, dy = 0;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble old_h_value;
 	gdouble new_h_value;
 	gdouble old_v_value;
@@ -3044,9 +3044,9 @@ scroll_timeout (gpointer data)
 	if (et->scroll_direction & ET_SCROLL_LEFT)
 		dx -= 20;
 
-	layout = GTK_LAYOUT (et->table_canvas);
+	scrollable = GTK_SCROLLABLE (et->table_canvas);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 
 	lower = gtk_adjustment_get_lower (adjustment);
 	upper = gtk_adjustment_get_upper (adjustment);
@@ -3057,7 +3057,7 @@ scroll_timeout (gpointer data)
 
 	gtk_adjustment_set_value (adjustment, new_h_value);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	lower = gtk_adjustment_get_lower (adjustment);
 	upper = gtk_adjustment_get_upper (adjustment);
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 8d718b0..f19a9a7 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -759,7 +759,7 @@ scroll_to_cursor (ETree *e_tree)
 {
 	ETreePath path;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gint x, y, w, h;
 	gdouble page_size;
 	gdouble lower;
@@ -779,8 +779,8 @@ scroll_to_cursor (ETree *e_tree)
 				&row, &col, &x, &y, &w, &h);
 	}
 
-	layout = GTK_LAYOUT (e_tree->priv->table_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (e_tree->priv->table_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
@@ -928,13 +928,13 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et)
 	ETreePath path;
 	gint y, row_local, col_local;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble page_size;
 	gdouble upper;
 	gdouble value;
 
-	layout = GTK_LAYOUT (et->priv->table_canvas);
-	adjustment = gtk_layout_get_vadjustment (layout);
+	scrollable = GTK_SCROLLABLE (et->priv->table_canvas);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	upper = gtk_adjustment_get_upper (adjustment);
@@ -1514,7 +1514,7 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
 		   ETableSpecification *specification, ETableState *state)
 {
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gint row = 0;
 
 	if (ete)
@@ -1566,12 +1566,12 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete,
 	}
 	e_tree_setup_table (e_tree);
 
-	layout = GTK_LAYOUT (e_tree->priv->table_canvas);
+	scrollable = GTK_SCROLLABLE (e_tree->priv->table_canvas);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	gtk_adjustment_set_step_increment (adjustment, 20);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	gtk_adjustment_set_step_increment (adjustment, 20);
 
 	if (!specification->no_headers) {
@@ -2036,17 +2036,16 @@ set_scroll_adjustments   (ETree *tree,
 		gtk_adjustment_set_step_increment (hadjustment, 20);
 
 	if (tree->priv) {
-		GtkLayout *layout;
+		GtkScrollable *scrollable;
 
-		layout = GTK_LAYOUT (tree->priv->table_canvas);
+		scrollable = GTK_SCROLLABLE (tree->priv->table_canvas);
+		gtk_scrollable_set_hadjustment (scrollable, hadjustment);
+		gtk_scrollable_set_vadjustment (scrollable, vadjustment);
 
-		gtk_layout_set_hadjustment (layout, hadjustment);
-		gtk_layout_set_vadjustment (layout, vadjustment);
-
-		if (tree->priv->header_canvas != NULL)
-			gtk_layout_set_hadjustment (
-				GTK_LAYOUT (tree->priv->header_canvas),
-				hadjustment);
+		if (tree->priv->header_canvas != NULL) {
+			scrollable = GTK_SCROLLABLE (tree->priv->header_canvas);
+			gtk_scrollable_set_hadjustment (scrollable, hadjustment);
+		}
 	}
 }
 
@@ -2485,16 +2484,16 @@ e_tree_drag_highlight (ETree *tree,
 		       gint     row,
 		       gint     col)
 {
-	GtkAdjustment *adjustment;
 	GtkAllocation allocation;
-	GtkLayout *layout;
+	GtkAdjustment *adjustment;
+	GtkScrollable *scrollable;
 	GtkStyle *style;
 
 	g_return_if_fail (E_IS_TREE (tree));
 
-	layout = GTK_LAYOUT (tree->priv->table_canvas);
+	scrollable = GTK_SCROLLABLE (tree->priv->table_canvas);
 	style = gtk_widget_get_style (GTK_WIDGET (tree));
-	gtk_widget_get_allocation (GTK_WIDGET (layout), &allocation);
+	gtk_widget_get_allocation (GTK_WIDGET (scrollable), &allocation);
 
 	if (row != -1) {
 		gint x, y, width, height;
@@ -2504,11 +2503,11 @@ e_tree_drag_highlight (ETree *tree,
 			width = allocation.width;
 		} else {
 			e_tree_get_cell_geometry (tree, row, col, &x, &y, &width, &height);
-			adjustment = gtk_layout_get_hadjustment (layout);
+			adjustment = gtk_scrollable_get_hadjustment (scrollable);
 			x += gtk_adjustment_get_value (adjustment);
 		}
 
-		adjustment = gtk_layout_get_vadjustment (layout);
+		adjustment = gtk_scrollable_get_vadjustment (scrollable);
 		y += gtk_adjustment_get_value (adjustment);
 
 		if (tree->priv->drop_highlight == NULL) {
@@ -2731,7 +2730,7 @@ e_tree_get_cell_at (ETree *tree,
 		     gint *row_return, gint *col_return)
 {
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 
 	g_return_if_fail (E_IS_TREE (tree));
 	g_return_if_fail (row_return != NULL);
@@ -2745,12 +2744,12 @@ e_tree_get_cell_at (ETree *tree,
 	if (col_return)
 		*col_return = -1;
 
-	layout = GTK_LAYOUT (tree->priv->table_canvas);
+	scrollable = GTK_SCROLLABLE (tree->priv->table_canvas);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 	x += gtk_adjustment_get_value (adjustment);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 	y += gtk_adjustment_get_value (adjustment);
 
 	e_table_item_compute_location (
@@ -2779,7 +2778,7 @@ e_tree_get_cell_geometry (ETree *tree,
 			  gint *width_return, gint *height_return)
 {
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 
 	g_return_if_fail (E_IS_TREE (tree));
 	g_return_if_fail (row >= 0);
@@ -2793,15 +2792,15 @@ e_tree_get_cell_geometry (ETree *tree,
 		&row, &col, x_return, y_return,
 		width_return, height_return);
 
-	layout = GTK_LAYOUT (tree->priv->table_canvas);
+	scrollable = GTK_SCROLLABLE (tree->priv->table_canvas);
 
 	if (x_return) {
-		adjustment = gtk_layout_get_hadjustment (layout);
+		adjustment = gtk_scrollable_get_hadjustment (scrollable);
 		(*x_return) -= gtk_adjustment_get_value (adjustment);
 	}
 
 	if (y_return) {
-		adjustment = gtk_layout_get_vadjustment (layout);
+		adjustment = gtk_scrollable_get_vadjustment (scrollable);
 		(*y_return) -= gtk_adjustment_get_value (adjustment);
 	}
 }
@@ -2915,7 +2914,7 @@ scroll_timeout (gpointer data)
 	ETree *et = data;
 	gint dx = 0, dy = 0;
 	GtkAdjustment *adjustment;
-	GtkLayout *layout;
+	GtkScrollable *scrollable;
 	gdouble old_h_value;
 	gdouble new_h_value;
 	gdouble old_v_value;
@@ -2934,9 +2933,9 @@ scroll_timeout (gpointer data)
 	if (et->priv->scroll_direction & ET_SCROLL_LEFT)
 		dx -= 20;
 
-	layout = GTK_LAYOUT (et->priv->table_canvas);
+	scrollable = GTK_SCROLLABLE (et->priv->table_canvas);
 
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
@@ -2947,7 +2946,7 @@ scroll_timeout (gpointer data)
 
 	gtk_adjustment_set_value (adjustment, new_h_value);
 
-	adjustment = gtk_layout_get_vadjustment (layout);
+	adjustment = gtk_scrollable_get_vadjustment (scrollable);
 
 	page_size = gtk_adjustment_get_page_size (adjustment);
 	lower = gtk_adjustment_get_lower (adjustment);
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index bb8691c..5eb31ca 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -37,6 +37,9 @@
 #include "e-reflow.h"
 #include "misc/e-selection-model-simple.h"
 
+/* backward-compatibility cruft */
+#include "e-util/gtk-compat.h"
+
 static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event);
 static void e_reflow_realize (GnomeCanvasItem *item);
 static void e_reflow_unrealize (GnomeCanvasItem *item);
@@ -180,7 +183,7 @@ do_adjustment (gpointer user_data)
 		return FALSE;
 
 	layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas);
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 
 	value = gtk_adjustment_get_value (adjustment);
 	page_size = gtk_adjustment_get_page_size (adjustment);
@@ -254,7 +257,7 @@ incarnate (EReflow *reflow)
 	gdouble page_size;
 
 	layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas);
-	adjustment = gtk_layout_get_hadjustment (layout);
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 
 	value = gtk_adjustment_get_value (adjustment);
 	page_size = gtk_adjustment_get_page_size (adjustment);
@@ -758,7 +761,7 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar
 			gdouble page_size;
 
 			layout = GTK_LAYOUT (item->canvas);
-			adjustment = gtk_layout_get_hadjustment (layout);
+			adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 			page_size = gtk_adjustment_get_page_size (adjustment);
 
 			reflow->column_width = g_value_get_double (value);
@@ -882,7 +885,7 @@ e_reflow_realize (GnomeCanvasItem *item)
 	reflow->need_reflow_columns = TRUE;
 	e_canvas_item_request_reflow (item);
 
-	adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (item->canvas));
+	adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (item->canvas));
 
 #if 0
 	connect_set_adjustment (reflow);
@@ -1011,7 +1014,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
 						gdouble new_value;
 
 						layout = GTK_LAYOUT (item->canvas);
-						adjustment = gtk_layout_get_hadjustment (layout);
+						adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 						new_value = gtk_adjustment_get_value (adjustment);
 						new_value -= gtk_adjustment_get_step_increment (adjustment);
 						gtk_adjustment_set_value (adjustment, new_value);
@@ -1026,7 +1029,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
 						gdouble upper;
 
 						layout = GTK_LAYOUT (item->canvas);
-						adjustment = gtk_layout_get_hadjustment (layout);
+						adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 						new_value = gtk_adjustment_get_value (adjustment);
 						new_value += gtk_adjustment_get_step_increment (adjustment);
 						upper = gtk_adjustment_get_upper (adjustment);
@@ -1047,7 +1050,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
 				gdouble value;
 
 				layout = GTK_LAYOUT (item->canvas);
-				adjustment = gtk_layout_get_hadjustment (layout);
+				adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 				value = gtk_adjustment_get_value (adjustment);
 
 				reflow->temp_column_width = reflow->column_width +
@@ -1087,7 +1090,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
 				gdouble value;
 
 				layout = GTK_LAYOUT (item->canvas);
-				adjustment = gtk_layout_get_hadjustment (layout);
+				adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 				value = gtk_adjustment_get_value (adjustment);
 
 				reflow->temp_column_width = reflow->column_width +
@@ -1226,7 +1229,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
 		gint start_line;
 
 		layout = GTK_LAYOUT (item->canvas);
-		adjustment = gtk_layout_get_hadjustment (layout);
+		adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 		value = gtk_adjustment_get_value (adjustment);
 
 		start_line = e_reflow_pick_line (reflow, value);
@@ -1312,7 +1315,7 @@ e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags)
 		gdouble value;
 
 		layout = GTK_LAYOUT (item->canvas);
-		adjustment = gtk_layout_get_hadjustment (layout);
+		adjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
 		value = gtk_adjustment_get_value (adjustment);
 		start_line = e_reflow_pick_line (reflow, value);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]