aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-09 23:39:14 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-26 21:49:12 +0800
commit1e11afde4d2b2f98ab5d84264ac1faad414da7f5 (patch)
tree9dc8383557600c23a4e8f092ae9071f7da895550
parent954b68a5c801e5c5e4ddcb857f7c3199c8f2538c (diff)
downloadgsoc2013-evolution-1e11afde4d2b2f98ab5d84264ac1faad414da7f5.tar.gz
gsoc2013-evolution-1e11afde4d2b2f98ab5d84264ac1faad414da7f5.tar.zst
gsoc2013-evolution-1e11afde4d2b2f98ab5d84264ac1faad414da7f5.zip
Adapt EReflow to latest gtk+-3.0 API.
-rw-r--r--widgets/text/e-reflow.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index 465cf0330f..04572d9cce 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -40,7 +40,7 @@
static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_reflow_realize (GnomeCanvasItem *item);
static void e_reflow_unrealize (GnomeCanvasItem *item);
-static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
+static void e_reflow_draw (GnomeCanvasItem *item, cairo_t *cr,
gint x, gint y, gint width, gint height);
static void e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags);
static GnomeCanvasItem *e_reflow_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy);
@@ -1174,8 +1174,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event)
return FALSE;
}
-static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
- gint x, gint y, gint width, gint height)
+static void
+e_reflow_draw (GnomeCanvasItem *item,
+ cairo_t *cr,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
{
GtkStyle *style;
gint x_rect, y_rect, width_rect, height_rect;
@@ -1183,12 +1188,9 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
EReflow *reflow = E_REFLOW (item);
gint i;
gdouble column_width;
- cairo_t *cr;
-
- cr = gdk_cairo_create (drawable);
if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw)
- GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw (item, drawable, x, y, width, height);
+ GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw (item, cr, x, y, width, height);
column_width = reflow->column_width;
running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
y_rect = E_REFLOW_BORDER_WIDTH;
@@ -1207,10 +1209,9 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
break;
x_rect = running_width;
gtk_paint_flat_box (style,
- drawable,
+ cr,
GTK_STATE_ACTIVE,
GTK_SHADOW_NONE,
- NULL,
GTK_WIDGET (item->canvas),
"reflow",
x_rect - x,
@@ -1244,6 +1245,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
i /= column_width + E_REFLOW_FULL_GUTTER;
running_width += i * (column_width + E_REFLOW_FULL_GUTTER);
+ cairo_save (cr);
gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
for (; i < reflow->column_count; i++) {
@@ -1258,9 +1260,8 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
cairo_fill (cr);
running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
}
+ cairo_restore (cr);
}
-
- cairo_destroy (cr);
}
static void