aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
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
parent0af3ff804c0d71c76fd63f0a2a152cac7de64863 (diff)
downloadgsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.gz
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.bz2
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.lz
gsoc2013-evolution-d47adb5922a262effdd14c1c50bb0a3660088798.tar.xz
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')
-rw-r--r--widgets/misc/e-canvas-utils.c11
-rw-r--r--widgets/table/e-cell-combo.c4
-rw-r--r--widgets/table/e-cell-date-edit.c6
-rw-r--r--widgets/table/e-table-field-chooser.c7
-rw-r--r--widgets/table/e-table-header-item.c18
-rw-r--r--widgets/table/e-table.c64
-rw-r--r--widgets/table/e-tree.c73
-rw-r--r--widgets/text/e-reflow.c23
8 files changed, 107 insertions, 99 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);
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 6e1eb5ca80..c06e5450e8 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 005f7a63e4..31d63d97cf 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 f0e3ece84c..374507e1ee 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 7fda0066af..1c97826ef2 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 4dc13bfb1a..952bf900b8 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 8d718b0235..f19a9a7cfc 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 bb8691c80b..5eb31cae8b 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);