[gimp/gtk3-port: 5/336] libgimpwidgets: port virtual functions to GTK+ 3.0



commit 502ade031da104f1c389f23e2c600c63904f06a4
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 15 10:25:40 2010 +0200

    libgimpwidgets: port virtual functions to GTK+ 3.0

 libgimpwidgets/gimpcellrenderercolor.c |   65 +++++++++++++++-----------------
 1 files changed, 30 insertions(+), 35 deletions(-)
---
diff --git a/libgimpwidgets/gimpcellrenderercolor.c b/libgimpwidgets/gimpcellrenderercolor.c
index b667281..16322ca 100644
--- a/libgimpwidgets/gimpcellrenderercolor.c
+++ b/libgimpwidgets/gimpcellrenderercolor.c
@@ -54,27 +54,26 @@ enum
 };
 
 
-static void gimp_cell_renderer_color_get_property (GObject         *object,
-                                                   guint            param_id,
-                                                   GValue          *value,
-                                                   GParamSpec      *pspec);
-static void gimp_cell_renderer_color_set_property (GObject         *object,
-                                                   guint            param_id,
-                                                   const GValue    *value,
-                                                   GParamSpec      *pspec);
-static void gimp_cell_renderer_color_get_size     (GtkCellRenderer *cell,
-                                                   GtkWidget       *widget,
-                                                   GdkRectangle    *rectangle,
-                                                   gint            *x_offset,
-                                                   gint            *y_offset,
-                                                   gint            *width,
-                                                   gint            *height);
-static void gimp_cell_renderer_color_render       (GtkCellRenderer *cell,
-                                                   GdkWindow       *window,
-                                                   GtkWidget       *widget,
-                                                   GdkRectangle    *background_area,
-                                                   GdkRectangle    *cell_area,
-                                                   GdkRectangle    *expose_area,
+static void gimp_cell_renderer_color_get_property (GObject            *object,
+                                                   guint               param_id,
+                                                   GValue             *value,
+                                                   GParamSpec         *pspec);
+static void gimp_cell_renderer_color_set_property (GObject            *object,
+                                                   guint               param_id,
+                                                   const GValue       *value,
+                                                   GParamSpec         *pspec);
+static void gimp_cell_renderer_color_get_size     (GtkCellRenderer    *cell,
+                                                   GtkWidget          *widget,
+                                                   const GdkRectangle *rectangle,
+                                                   gint               *x_offset,
+                                                   gint               *y_offset,
+                                                   gint               *width,
+                                                   gint               *height);
+static void gimp_cell_renderer_color_render       (GtkCellRenderer    *cell,
+                                                   cairo_t            *cr,
+                                                   GtkWidget          *widget,
+                                                   const GdkRectangle *background_area,
+                                                   const GdkRectangle *cell_area,
                                                    GtkCellRendererState flags);
 
 
@@ -181,13 +180,13 @@ gimp_cell_renderer_color_set_property (GObject      *object,
 }
 
 static void
-gimp_cell_renderer_color_get_size (GtkCellRenderer *cell,
-                                   GtkWidget       *widget,
-                                   GdkRectangle    *cell_area,
-                                   gint            *x_offset,
-                                   gint            *y_offset,
-                                   gint            *width,
-                                   gint            *height)
+gimp_cell_renderer_color_get_size (GtkCellRenderer    *cell,
+                                   GtkWidget          *widget,
+                                   const GdkRectangle *cell_area,
+                                   gint               *x_offset,
+                                   gint               *y_offset,
+                                   gint               *width,
+                                   gint               *height)
 {
   GimpCellRendererColor *color = GIMP_CELL_RENDERER_COLOR (cell);
   gint                   calc_width;
@@ -233,11 +232,10 @@ gimp_cell_renderer_color_get_size (GtkCellRenderer *cell,
 
 static void
 gimp_cell_renderer_color_render (GtkCellRenderer      *cell,
-                                 GdkWindow            *window,
+                                 cairo_t              *cr,
                                  GtkWidget            *widget,
-                                 GdkRectangle         *background_area,
-                                 GdkRectangle         *cell_area,
-                                 GdkRectangle         *expose_area,
+                                 const GdkRectangle   *background_area,
+                                 const GdkRectangle   *cell_area,
                                  GtkCellRendererState  flags)
 {
   GimpCellRendererColor *color = GIMP_CELL_RENDERER_COLOR (cell);
@@ -260,7 +258,6 @@ gimp_cell_renderer_color_render (GtkCellRenderer      *cell,
 
   if (rect.width > 2 && rect.height > 2)
     {
-      cairo_t      *cr    = gdk_cairo_create (window);
       GtkStyle     *style = gtk_widget_get_style (widget);
       GtkStateType  state;
 
@@ -311,8 +308,6 @@ gimp_cell_renderer_color_render (GtkCellRenderer      *cell,
       cairo_set_line_width (cr, 1);
       gdk_cairo_set_source_color (cr, &style->fg[state]);
       cairo_stroke_preserve (cr);
-
-      cairo_destroy (cr);
     }
 }
 


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