[cairo-commit] goocanvas/src goocanvasitemsimple.c, 1.13,
1.14 goocanvasprivate.h, 1.2, 1.3 goocanvasutils.c, 1.5,
1.6 goocanvasutils.h, 1.5, 1.6
Damon Chaplin
commit at pdx.freedesktop.org
Tue Aug 15 03:08:27 PDT 2006
Committed by: damon
Update of /cvs/cairo/goocanvas/src
In directory kemper:/tmp/cvs-serv12886/src
Modified Files:
goocanvasitemsimple.c goocanvasprivate.h goocanvasutils.c
goocanvasutils.h
Log Message:
2006-08-15 Damon Chaplin <damon at gnome.org>
* src/goocanvasutils.h: moved GOO_TYPE_CAIRO_PATTERN stuff here, so
bindings can use it.
Also renamed goo_cairo_line_dash stuff to goo_canvas_line_dash for
consistency.
* src/goocanvasutils.c (goo_canvas_line_dash_newv): new non-varargs
variant of function of goo_canvas_line_dash_new() for bindings.
(from Gustavo J. A. M. Carneiro.)
Index: goocanvasitemsimple.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasitemsimple.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- goocanvasitemsimple.c 19 Jul 2006 13:38:13 -0000 1.13
+++ goocanvasitemsimple.c 15 Aug 2006 10:08:25 -0000 1.14
@@ -281,7 +281,7 @@
g_param_spec_boxed ("line-dash",
_("Line Dash"),
_("The dash pattern to use"),
- GOO_TYPE_CAIRO_LINE_DASH,
+ GOO_TYPE_CANVAS_LINE_DASH,
G_PARAM_READWRITE));
/* Convenience properties - writable only. */
Index: goocanvasprivate.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasprivate.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- goocanvasprivate.h 19 Jul 2006 13:38:13 -0000 1.2
+++ goocanvasprivate.h 15 Aug 2006 10:08:25 -0000 1.3
@@ -27,21 +27,17 @@
gpointer data);
-#define GOO_TYPE_CAIRO_PATTERN (goo_cairo_pattern_get_type ())
#define GOO_TYPE_CAIRO_FILL_RULE (goo_cairo_fill_rule_get_type ())
#define GOO_TYPE_CAIRO_OPERATOR (goo_cairo_operator_get_type())
#define GOO_TYPE_CAIRO_ANTIALIAS (goo_cairo_antialias_get_type())
#define GOO_TYPE_CAIRO_LINE_CAP (goo_cairo_line_cap_get_type ())
#define GOO_TYPE_CAIRO_LINE_JOIN (goo_cairo_line_join_get_type ())
-#define GOO_TYPE_CAIRO_LINE_DASH (goo_cairo_line_dash_get_type ())
-GType goo_cairo_pattern_get_type (void) G_GNUC_CONST;
GType goo_cairo_fill_rule_get_type (void) G_GNUC_CONST;
GType goo_cairo_operator_get_type (void) G_GNUC_CONST;
GType goo_cairo_antialias_get_type (void) G_GNUC_CONST;
GType goo_cairo_line_cap_get_type (void) G_GNUC_CONST;
GType goo_cairo_line_join_get_type (void) G_GNUC_CONST;
-GType goo_cairo_line_dash_get_type (void) G_GNUC_CONST;
cairo_pattern_t* goo_canvas_cairo_pattern_from_pixbuf (GdkPixbuf *pixbuf);
cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf);
Index: goocanvasutils.c
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasutils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- goocanvasutils.c 19 Jul 2006 13:38:13 -0000 1.5
+++ goocanvasutils.c 15 Aug 2006 10:08:25 -0000 1.6
@@ -390,7 +390,7 @@
GType
-goo_cairo_line_dash_get_type (void)
+goo_canvas_line_dash_get_type (void)
{
static GType cairo_line_dash_type = 0;
@@ -439,6 +439,30 @@
return dash;
}
+/**
+ * goo_canvas_line_dash_newv:
+ * @num_dashes: the number of dashes and gaps in the pattern.
+ * @dashes: a g_new-allocated vector of doubles, the length of each
+ * dash and gap.
+ *
+ * Creates a new dash pattern. Takes ownership of the @dashes vector.
+ *
+ * Returns: a new dash pattern.
+ **/
+GooCanvasLineDash*
+goo_canvas_line_dash_newv (gint num_dashes,
+ double *dashes)
+{
+ GooCanvasLineDash *dash;
+
+ dash = g_new (GooCanvasLineDash, 1);
+ dash->ref_count = 1;
+ dash->num_dashes = num_dashes;
+ dash->dashes = dashes;
+ dash->dash_offset = 0.0;
+
+ return dash;
+}
cairo_matrix_t*
goo_cairo_matrix_copy (cairo_matrix_t *matrix)
Index: goocanvasutils.h
===================================================================
RCS file: /cvs/cairo/goocanvas/src/goocanvasutils.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- goocanvasutils.h 19 Jul 2006 13:38:13 -0000 1.5
+++ goocanvasutils.h 15 Aug 2006 10:08:25 -0000 1.6
@@ -131,8 +131,13 @@
double dash_offset;
};
-GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes,
+#define GOO_TYPE_CANVAS_LINE_DASH (goo_canvas_line_dash_get_type ())
+
+GType goo_canvas_line_dash_get_type (void) G_GNUC_CONST;
+GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes,
...);
+GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes,
+ double *dashes);
GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash);
void goo_canvas_line_dash_unref (GooCanvasLineDash *dash);
@@ -140,7 +145,11 @@
#define GOO_TYPE_CAIRO_MATRIX (goo_cairo_matrix_get_type())
GType goo_cairo_matrix_get_type (void) G_GNUC_CONST;
-cairo_matrix_t* goo_cairo_matrix_copy (cairo_matrix_t *matrix);
+cairo_matrix_t* goo_cairo_matrix_copy (cairo_matrix_t *matrix);
+
+
+#define GOO_TYPE_CAIRO_PATTERN (goo_cairo_pattern_get_type ())
+GType goo_cairo_pattern_get_type (void) G_GNUC_CONST;
G_END_DECLS
More information about the cairo-commit
mailing list