[gimp/gtk3-port: 5/262] libgimpwidgets: port virtual functions to GTK+ 3.0
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 5/262] libgimpwidgets: port virtual functions to GTK+ 3.0
- Date: Sun, 29 Apr 2018 16:44:22 +0000 (UTC)
commit 7512f4a7c4aa9bb656a1b955d97719b5d5670e6f
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]