[cairo-commit] goocanvas/src goocanvasitemsimple.c, 1.11,
1.12 goocanvasitemsimple.h, 1.9, 1.10
Damon Chaplin
commit at pdx.freedesktop.org
Thu Jun 8 01:45:28 PDT 2006
Committed by: damon
Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv6442/src
Modified Files:
goocanvasitemsimple.c goocanvasitemsimple.h
Log Message:
2006-06-08 Damon Chaplin <damon at gnome.org>
* src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property):
only create the item's style when needed.
(goo_canvas_style_get_type): register boxed type (from Gustavo J. A. M.
Carneiro).
Index: goocanvasitemsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemsimple.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- goocanvasitemsimple.c 27 May 2006 19:31:44 -0000 1.11
+++ goocanvasitemsimple.c 8 Jun 2006 08:45:27 -0000 1.12
@@ -51,7 +51,8 @@
PROP_FILL_COLOR_RGBA,
PROP_FILL_PIXBUF,
- /* Other properties. */
+ /* Other properties. Note that the order here is important PROP_TRANSFORM
+ must be the first non-style property. see set_property(). */
PROP_TRANSFORM,
PROP_VISIBILITY,
PROP_VISIBILITY_THRESHOLD,
@@ -181,6 +182,17 @@
}
+GType
+goo_canvas_style_get_type (void)
+{
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ our_type = g_boxed_type_register_static ("GooCanvasStyle",
+ (GBoxedCopyFunc) goo_canvas_style_copy,
+ (GBoxedFreeFunc) goo_canvas_style_unref);
+ return our_type;
+}
/*
* GooCanvasItemSimple.
@@ -457,7 +469,7 @@
cairo_matrix_t *transform;
/* See if we need to create our own style or copy a shared style. */
- if (prop_id != PROP_TRANSFORM)
+ if (prop_id < PROP_TRANSFORM)
{
if (!item->style)
{
Index: goocanvasitemsimple.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemsimple.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- goocanvasitemsimple.h 27 May 2006 19:31:44 -0000 1.9
+++ goocanvasitemsimple.h 8 Jun 2006 08:45:27 -0000 1.10
@@ -93,9 +93,11 @@
};
-GooCanvasStyle* goo_canvas_style_new (void);
-GooCanvasStyle* goo_canvas_style_ref (GooCanvasStyle *style);
-void goo_canvas_style_unref (GooCanvasStyle *style);
+#define GOO_TYPE_CANVAS_STYLE (goo_canvas_style_get_type ())
+GType goo_canvas_style_get_type (void);
+GooCanvasStyle* goo_canvas_style_new (void);
+GooCanvasStyle* goo_canvas_style_ref (GooCanvasStyle *style);
+void goo_canvas_style_unref (GooCanvasStyle *style);
#define GOO_TYPE_CANVAS_ITEM_SIMPLE (goo_canvas_item_simple_get_type ())
More information about the cairo-commit
mailing list