[gimp/gtk3-port: 4/137] libgimpwidgets: port virtual functions to GTK+ 3.0



commit a869b806294bc1f04f2e3dae2a23d223ea11ead6
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 dc1f66a..2144784 100644
--- a/libgimpwidgets/gimpcellrenderercolor.c
+++ b/libgimpwidgets/gimpcellrenderercolor.c
@@ -53,27 +53,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);
 
 
@@ -175,13 +174,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;
@@ -227,11 +226,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);
@@ -254,7 +252,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;
 
@@ -312,8 +309,6 @@ gimp_cell_renderer_color_render (GtkCellRenderer      *cell,
           gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
           cairo_stroke (cr);
         }
-
-      cairo_destroy (cr);
     }
 }
 



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