[cairo-commit] goocanvas/src goocanvasimage.c, 1.16,
1.17 goocanvasitemsimple.c, 1.29, 1.30 goocanvaswidget.c, 1.9, 1.10
Damon Chaplin
commit at pdx.freedesktop.org
Tue Apr 3 02:58:14 PDT 2007
Committed by: damon
Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv9410/src
Modified Files:
goocanvasimage.c goocanvasitemsimple.c goocanvaswidget.c
Log Message:
2007-04-03 Damon Chaplin <damon at gnome.org>
* Released GooCanvas 0.8
2007-04-03 Damon Chaplin <damon at gnome.org>
* demo/mv-demo.c (create_canvas_primitives):
* demo/demo.c (create_canvas_primitives): set the maximum scale to 50,
since if we go above that we hit the cairo 16-bit limit and the large
rectangle isn't painted correctly.
* src/goocanvasitemsimple.c (goo_canvas_item_simple_install_common_properties): improved docs for fill/stroke properties.
* src/goocanvaswidget.c (goo_canvas_widget_new)
(goo_canvas_widget_set_widget): keep our own reference to the widget,
rather than just relying on the canvas widget's reference. Otherwise
once the widget is removed from the canvas we have an invalid pointer.
Index: goocanvasimage.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasimage.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- goocanvasimage.c 6 Mar 2007 13:21:26 -0000 1.16
+++ goocanvasimage.c 3 Apr 2007 09:58:05 -0000 1.17
@@ -372,16 +372,23 @@
if (!image_data->pattern)
return;
- goo_canvas_style_set_fill_options (simple->simple_data->style, cr);
- cairo_set_source (cr, image_data->pattern);
+#if 1
cairo_matrix_init_translate (&matrix, -image_data->x, -image_data->y);
cairo_pattern_set_matrix (image_data->pattern, &matrix);
+ goo_canvas_style_set_fill_options (simple->simple_data->style, cr);
+ cairo_set_source (cr, image_data->pattern);
cairo_rectangle (cr, image_data->x, image_data->y,
image_data->width, image_data->height);
cairo_fill (cr);
-
- /* Using cairo_paint() is much slower, so I guess we shouldn't. */
- /*cairo_paint (cr);*/
+#else
+ /* Using cairo_paint() used to be much slower than cairo_fill(), though
+ they seem similar now. I'm not sure if it matters which we use. */
+ cairo_matrix_init_translate (&matrix, -image_data->x, -image_data->y);
+ cairo_pattern_set_matrix (image_data->pattern, &matrix);
+ goo_canvas_style_set_fill_options (simple->simple_data->style, cr);
+ cairo_set_source (cr, image_data->pattern);
+ cairo_paint (cr);
+#endif
}
Index: goocanvasitemsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemsimple.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- goocanvasitemsimple.c 7 Mar 2007 16:07:11 -0000 1.29
+++ goocanvasitemsimple.c 3 Apr 2007 09:58:05 -0000 1.30
@@ -108,14 +108,14 @@
g_object_class_install_property (gobject_class, PROP_STROKE_PATTERN,
g_param_spec_boxed ("stroke-pattern",
_("Stroke Pattern"),
- _("The pattern to use to paint the perimeter of the item"),
+ _("The pattern to use to paint the perimeter of the item, or NULL disable painting"),
GOO_TYPE_CAIRO_PATTERN,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_FILL_PATTERN,
g_param_spec_boxed ("fill-pattern",
_("Fill Pattern"),
- _("The pattern to use to paint the interior of the item"),
+ _("The pattern to use to paint the interior of the item, or NULL to disable painting"),
GOO_TYPE_CAIRO_PATTERN,
G_PARAM_READWRITE));
@@ -208,42 +208,42 @@
g_object_class_install_property (gobject_class, PROP_STROKE_COLOR,
g_param_spec_string ("stroke-color",
_("Stroke Color"),
- _("The color to use for the item's perimeter"),
+ _("The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"),
NULL,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, PROP_STROKE_COLOR_RGBA,
g_param_spec_uint ("stroke-color-rgba",
_("Stroke Color RGBA"),
- _("The color to use for the item's perimeter, specified as a 32-bit integer value"),
+ _("The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL"),
0, G_MAXUINT, 0,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, PROP_STROKE_PIXBUF,
g_param_spec_object ("stroke-pixbuf",
_("Stroke Pixbuf"),
- _("The pixbuf to use to draw the item's perimeter"),
+ _("The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"),
GDK_TYPE_PIXBUF,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, PROP_FILL_COLOR,
g_param_spec_string ("fill-color",
_("Fill Color"),
- _("The color to use to paint the interior of the item"),
+ _("The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"),
NULL,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, PROP_FILL_COLOR_RGBA,
g_param_spec_uint ("fill-color-rgba",
_("Fill Color RGBA"),
- _("The color to use to paint the interior of the item, specified as a 32-bit integer value"),
+ _("The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL"),
0, G_MAXUINT, 0,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, PROP_FILL_PIXBUF,
g_param_spec_object ("fill-pixbuf",
_("Fill Pixbuf"),
- _("The pixbuf to use to paint the interior of the item"),
+ _("The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"),
GDK_TYPE_PIXBUF,
G_PARAM_WRITABLE));
Index: goocanvaswidget.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvaswidget.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvaswidget.c 8 Mar 2007 14:45:58 -0000 1.9
+++ goocanvaswidget.c 3 Apr 2007 09:58:05 -0000 1.10
@@ -124,6 +124,9 @@
witem = (GooCanvasWidget*) item;
witem->widget = widget;
+ g_object_ref (witem->widget);
+ g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem);
+
witem->x = x;
witem->y = y;
witem->width = width;
@@ -160,12 +163,14 @@
{
g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", NULL);
gtk_widget_unparent (witem->widget);
+ g_object_unref (witem->widget);
witem->widget = NULL;
}
if (widget)
{
witem->widget = widget;
+ g_object_ref (witem->widget);
g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem);
if (simple->simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE)
More information about the cairo-commit
mailing list