[evolution/gtk3: 10/47] Adapt EReflow to latest gtk+-3.0 API.



commit 90a89f8681a6e523d2627bb8422b521201e1f20e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Nov 9 10:39:14 2010 -0500

    Adapt EReflow to latest gtk+-3.0 API.

 widgets/text/e-reflow.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index bb8691c..7f891c4 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,
@@ -1259,8 +1260,6 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
 			running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH;
 		}
 	}
-
-        cairo_destroy (cr);
 }
 
 static void



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