From 3b3b6cb0abf2bab0a145df00184fc96677870ec8 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 2 Nov 2010 11:16:48 +0100 Subject: Add forgotten cairo_destroy() calls --- libgnomecanvas/gnome-canvas-pixbuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 32e83bbe1d..910b61b8e7 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -280,8 +280,10 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable, cr = gdk_cairo_create (drawable); gnome_canvas_item_i2c_matrix (item, &matrix); - if (cairo_matrix_invert (&matrix)) + if (cairo_matrix_invert (&matrix)) { + cairo_destroy (cr); return; + } cairo_transform (cr, &matrix); gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); -- cgit v1.2.3 From 7e9fc6d2b61287deaac0fa17e4dc19164c9ad51f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 7 Nov 2010 21:13:03 -0500 Subject: Coding style and whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 910b61b8e7..ea331c6ee8 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -285,7 +285,7 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable, return; } cairo_transform (cr, &matrix); - + gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); cairo_paint (cr); @@ -305,7 +305,7 @@ gnome_canvas_pixbuf_point (GnomeCanvasItem *item, GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; GdkPixbuf *pixbuf; - int px, py; + gint px, py; guchar *src; gcp = GNOME_CANVAS_PIXBUF (item); -- cgit v1.2.3 From a7788ff36828762193cf64b72909bb23ef0fe4d0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Nov 2010 08:41:52 -0500 Subject: Adapt GnomeCanvas to latest gtk+-3.0 API. --- libgnomecanvas/gnome-canvas-pixbuf.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index ea331c6ee8..6fc3e44fd9 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -50,7 +50,7 @@ static void gnome_canvas_pixbuf_get_property (GObject *object, GParamSpec *pspec); static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags); -static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable, +static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height); static GnomeCanvasItem *gnome_canvas_pixbuf_point (GnomeCanvasItem *item, gdouble x, @@ -264,13 +264,12 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, /* Draw handler for the pixbuf canvas item */ static void -gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable, +gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; cairo_matrix_t matrix; - cairo_t *cr; gcp = GNOME_CANVAS_PIXBUF (item); priv = gcp->priv; @@ -278,18 +277,14 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (!priv->pixbuf) return; - cr = gdk_cairo_create (drawable); gnome_canvas_item_i2c_matrix (item, &matrix); - if (cairo_matrix_invert (&matrix)) { - cairo_destroy (cr); - return; - } + + cairo_save (cr); cairo_transform (cr, &matrix); gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); cairo_paint (cr); - - cairo_destroy (cr); + cairo_restore (cr); } -- cgit v1.2.3 From 6af0c53b697c6981c1470c177b2c37e081635258 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 29 Jan 2011 10:50:53 -0500 Subject: Coding style and whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 6fc3e44fd9..82152bd629 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -49,7 +49,9 @@ static void gnome_canvas_pixbuf_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags); +static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags); static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height); static GnomeCanvasItem *gnome_canvas_pixbuf_point (GnomeCanvasItem *item, @@ -250,7 +252,8 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, priv = gcp->priv; if (GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->update) - GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->update (item, i2c, flags); + GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)-> + update (item, i2c, flags); /* ordinary update logic */ gnome_canvas_request_redraw ( -- cgit v1.2.3 From dbc22f9de50142b8339fa843575a5e15bd3fe8ff Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Jan 2011 11:32:55 -0500 Subject: More whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 48 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 82152bd629..3565610b47 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -70,21 +70,21 @@ G_DEFINE_TYPE (GnomeCanvasPixbuf, gnome_canvas_pixbuf, GNOME_TYPE_CANVAS_ITEM) static void gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) { - GObjectClass *gobject_class; + GObjectClass *gobject_class; GnomeCanvasItemClass *item_class; - gobject_class = (GObjectClass *) class; + gobject_class = (GObjectClass *) class; item_class = (GnomeCanvasItemClass *) class; gobject_class->set_property = gnome_canvas_pixbuf_set_property; gobject_class->get_property = gnome_canvas_pixbuf_get_property; - g_object_class_install_property - (gobject_class, - PROP_PIXBUF, + g_object_class_install_property + (gobject_class, + PROP_PIXBUF, g_param_spec_object ("pixbuf", NULL, NULL, - GDK_TYPE_PIXBUF, - (G_PARAM_READABLE | G_PARAM_WRITABLE))); + GDK_TYPE_PIXBUF, + (G_PARAM_READABLE | G_PARAM_WRITABLE))); item_class->dispose = gnome_canvas_pixbuf_dispose; item_class->update = gnome_canvas_pixbuf_update; @@ -92,7 +92,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) item_class->point = gnome_canvas_pixbuf_point; item_class->bounds = gnome_canvas_pixbuf_bounds; - g_type_class_add_private (class, sizeof (GnomeCanvasPixbufPrivate)); + g_type_class_add_private (class, sizeof (GnomeCanvasPixbufPrivate)); } /* Object initialization function for the pixbuf canvas item */ @@ -102,8 +102,8 @@ gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp) GnomeCanvasPixbufPrivate *priv; priv = gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (gcp, - GNOME_TYPE_CANVAS_PIXBUF, - GnomeCanvasPixbufPrivate); + GNOME_TYPE_CANVAS_PIXBUF, + GnomeCanvasPixbufPrivate); } /* Dispose handler for the pixbuf canvas item */ @@ -211,7 +211,7 @@ recompute_bounding_box (GnomeCanvasPixbuf *gcp) GnomeCanvasItem *item; GnomeCanvasPixbufPrivate *priv; cairo_matrix_t i2c; - double x1, x2, y1, y2; + double x1, x2, y1, y2; item = GNOME_CANVAS_ITEM (gcp); priv = gcp->priv; @@ -256,10 +256,10 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, update (item, i2c, flags); /* ordinary update logic */ - gnome_canvas_request_redraw ( + gnome_canvas_request_redraw ( item->canvas, item->x1, item->y1, item->x2, item->y2); - recompute_bounding_box (gcp); - gnome_canvas_request_redraw ( + recompute_bounding_box (gcp); + gnome_canvas_request_redraw ( item->canvas, item->x1, item->y1, item->x2, item->y2); } @@ -272,7 +272,7 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; - cairo_matrix_t matrix; + cairo_matrix_t matrix; gcp = GNOME_CANVAS_PIXBUF (item); priv = gcp->priv; @@ -280,13 +280,13 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, if (!priv->pixbuf) return; - gnome_canvas_item_i2c_matrix (item, &matrix); + gnome_canvas_item_i2c_matrix (item, &matrix); cairo_save (cr); - cairo_transform (cr, &matrix); + cairo_transform (cr, &matrix); - gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); - cairo_paint (cr); + gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0); + cairo_paint (cr); cairo_restore (cr); } @@ -302,9 +302,9 @@ gnome_canvas_pixbuf_point (GnomeCanvasItem *item, { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; - GdkPixbuf *pixbuf; - gint px, py; - guchar *src; + GdkPixbuf *pixbuf; + gint px, py; + guchar *src; gcp = GNOME_CANVAS_PIXBUF (item); priv = gcp->priv; @@ -313,8 +313,8 @@ gnome_canvas_pixbuf_point (GnomeCanvasItem *item, if (!priv->pixbuf) return NULL; - px = x; - py = y; + px = x; + py = y; if (px < 0 || px >= gdk_pixbuf_get_width (pixbuf) || py < 0 || py >= gdk_pixbuf_get_height (pixbuf)) -- cgit v1.2.3 From 8efc1bc6f91e06ca61b00eb8119c9c36697e43a6 Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Tue, 8 Feb 2011 11:57:50 -0500 Subject: Bug 641756 - Fix warnings from GCC 4.6 GCC learned how to find dead assignments. --- libgnomecanvas/gnome-canvas-pixbuf.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 3565610b47..3d4657a560 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -99,25 +99,20 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) static void gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp) { - GnomeCanvasPixbufPrivate *priv; - - priv = gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (gcp, - GNOME_TYPE_CANVAS_PIXBUF, - GnomeCanvasPixbufPrivate); + gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate); } /* Dispose handler for the pixbuf canvas item */ static void gnome_canvas_pixbuf_dispose (GnomeCanvasItem *object) { - GnomeCanvasItem *item; GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; g_return_if_fail (object != NULL); g_return_if_fail (GNOME_IS_CANVAS_PIXBUF (object)); - item = GNOME_CANVAS_ITEM (object); gcp = GNOME_CANVAS_PIXBUF (object); priv = gcp->priv; @@ -246,10 +241,8 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, gint flags) { GnomeCanvasPixbuf *gcp; - GnomeCanvasPixbufPrivate *priv; gcp = GNOME_CANVAS_PIXBUF (item); - priv = gcp->priv; if (GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->update) GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)-> -- cgit v1.2.3 From 3b6c8972a51d635309b789b1aef9034ca23dc737 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Feb 2011 19:35:59 -0500 Subject: Coding style and whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 3d4657a560..fbe673d4c0 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -206,7 +206,7 @@ recompute_bounding_box (GnomeCanvasPixbuf *gcp) GnomeCanvasItem *item; GnomeCanvasPixbufPrivate *priv; cairo_matrix_t i2c; - double x1, x2, y1, y2; + gdouble x1, x2, y1, y2; item = GNOME_CANVAS_ITEM (gcp); priv = gcp->priv; -- cgit v1.2.3 From c003c99a75587ba39a45d164272760c33f9666b5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 25 Feb 2011 16:20:41 +0100 Subject: Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly --- libgnomecanvas/gnome-canvas-pixbuf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index fbe673d4c0..fa6d403959 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -99,8 +99,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) static void gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp) { - gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate); + gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate); } /* Dispose handler for the pixbuf canvas item */ -- cgit v1.2.3 From 7aacf983b32ecac26bc9707697da622b3ef164a3 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 5 Mar 2011 12:33:49 -0500 Subject: Coding style and whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index fa6d403959..fbe673d4c0 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -99,7 +99,8 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) static void gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp) { - gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE (gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate); + gcp->priv = G_TYPE_INSTANCE_GET_PRIVATE ( + gcp, GNOME_TYPE_CANVAS_PIXBUF, GnomeCanvasPixbufPrivate); } /* Dispose handler for the pixbuf canvas item */ -- cgit v1.2.3 From c24038c4f62f37b89d1bda9542ca5ccc843d4ea0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 27 May 2011 15:23:07 +0200 Subject: Bug #646109 - Fix use of include to make sure translations work --- libgnomecanvas/gnome-canvas-pixbuf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index fbe673d4c0..31f348c517 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -20,7 +20,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include -- cgit v1.2.3 From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- libgnomecanvas/gnome-canvas-pixbuf.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 31f348c517..091db2a72a 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -132,10 +132,10 @@ gnome_canvas_pixbuf_dispose (GnomeCanvasItem *object) /* Set_property handler for the pixbuf canvas item */ static void -gnome_canvas_pixbuf_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) +gnome_canvas_pixbuf_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; GnomeCanvasPixbuf *gcp; @@ -170,10 +170,10 @@ gnome_canvas_pixbuf_set_property (GObject *object, /* Get_property handler for the pixbuf canvasi item */ static void -gnome_canvas_pixbuf_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_pixbuf_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; @@ -263,8 +263,12 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, /* Draw handler for the pixbuf canvas item */ static void -gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { GnomeCanvasPixbuf *gcp; GnomeCanvasPixbufPrivate *priv; -- cgit v1.2.3 From e64d6fe05c30c2cc1d7625a202afba3ba2da07cd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 22 Nov 2011 18:22:14 -0500 Subject: Miscellaneous cleanups. --- libgnomecanvas/gnome-canvas-pixbuf.c | 1 - 1 file changed, 1 deletion(-) (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c') diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 71c7d95906..b9ece1f504 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -67,7 +67,6 @@ static void gnome_canvas_pixbuf_bounds (GnomeCanvasItem *item, G_DEFINE_TYPE (GnomeCanvasPixbuf, gnome_canvas_pixbuf, GNOME_TYPE_CANVAS_ITEM) - /* Class initialization function for the pixbuf canvas item */ static void gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class) -- cgit v1.2.3