From 1c0b586e3358a9642acb617583dcf6fb711bbb87 Mon Sep 17 00:00:00 2001 From: Dave Neary Date: Sun, 7 Sep 2003 18:09:58 +0000 Subject: [PATCH] app/vectors/gimpvectors.[ch] app/vectors/gimpstroke.[ch] Cleanup - removed 2003-09-07 Dave Neary * app/vectors/gimpvectors.[ch] * app/vectors/gimpstroke.[ch] * app/vectors/gimpbezierstroke.c: Cleanup - removed libart from the included headers in the .h files, don't pass around libart objects any more. Still stub code. --- ChangeLog | 8 ++++++++ app/vectors/gimpstroke.c | 21 +++++---------------- app/vectors/gimpstroke.h | 8 +------- app/vectors/gimpvectors.c | 32 ++++++++++++-------------------- app/vectors/gimpvectors.h | 8 ++------ 5 files changed, 28 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index e016da3eca..7540d1bb34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-09-07 Dave Neary + + * app/vectors/gimpvectors.[ch] + * app/vectors/gimpstroke.[ch] + * app/vectors/gimpbezierstroke.c: Cleanup - removed libart + from the included headers in the .h files, don't pass around + libart objects any more. Still stub code. + 2003-09-07 Sven Neumann * tools/gimp-remote.c: accept URLs with https protocol. diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c index b0139f7067..5fecec277b 100644 --- a/app/vectors/gimpstroke.c +++ b/app/vectors/gimpstroke.c @@ -148,9 +148,7 @@ static GList * gimp_stroke_real_get_draw_anchors (const GimpStroke *stroke); static GList * gimp_stroke_real_get_draw_controls (const GimpStroke *stroke); static GArray * gimp_stroke_real_get_draw_lines (const GimpStroke *stroke); -static void gimp_stroke_real_to_art_point (const GimpStroke *vectors, - ArtVpath *vec); - +static void gimp_stroke_art_stroke (const GimpStroke *stroke); /* private variables */ @@ -243,7 +241,7 @@ gimp_stroke_class_init (GimpStrokeClass *klass) klass->get_draw_controls = gimp_stroke_real_get_draw_controls; klass->get_draw_lines = gimp_stroke_real_get_draw_lines; - klass->to_art_point = gimp_stroke_real_to_art_point; + klass->art_stroke = gimp_stroke_art_stroke; } static void @@ -1214,21 +1212,12 @@ gimp_stroke_real_get_draw_lines (const GimpStroke *stroke) } - -void -gimp_stroke_to_art_point (const GimpStroke *stroke, - ArtVpath *vec) +static void +gimp_stroke_art_stroke (const GimpStroke *stroke) { g_return_if_fail (GIMP_IS_STROKE (stroke)); - GIMP_STROKE_GET_CLASS (stroke)->to_art_point (stroke, vec); -} - -static void -gimp_stroke_real_to_art_point (const GimpStroke *stroke, - ArtVpath *vec) -{ - g_printerr ("gimp_stroke_to_art_point: default implementation\n"); + GIMP_STROKE_GET_CLASS (stroke)->art_stroke (stroke); return; } diff --git a/app/vectors/gimpstroke.h b/app/vectors/gimpstroke.h index 06066e17ef..7e1bd3f6af 100644 --- a/app/vectors/gimpstroke.h +++ b/app/vectors/gimpstroke.h @@ -22,8 +22,6 @@ #ifndef __GIMP_STROKE_H__ #define __GIMP_STROKE_H__ -#include - #include "core/gimpobject.h" @@ -166,8 +164,7 @@ struct _GimpStrokeClass GList * (* get_draw_controls) (const GimpStroke *stroke); GArray * (* get_draw_lines) (const GimpStroke *stroke); - void (* to_art_point) (const GimpStroke *stroke, - ArtVpath *vec); + void (* art_stroke) (const GimpStroke *stroke); }; @@ -306,9 +303,6 @@ GList * gimp_stroke_get_draw_anchors (const GimpStroke *stroke); GList * gimp_stroke_get_draw_controls (const GimpStroke *stroke); GArray * gimp_stroke_get_draw_lines (const GimpStroke *stroke); -void gimp_stroke_to_art_point (const GimpStroke *stroke, - ArtVpath *vec); - #endif /* __GIMP_STROKE_H__ */ diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c index 03d0e96d8b..fcedf2787d 100644 --- a/app/vectors/gimpvectors.c +++ b/app/vectors/gimpvectors.c @@ -950,37 +950,29 @@ gimp_vectors_real_make_bezier (const GimpVectors *vectors) } /* - * gimp_vectors_to_art_vpath: Create an ArtVpath from a GimpVectors object. + * gimp_vectors_art_stroke: Stroke a GimpVectors object using libart. * @vectors: The source path * - * Traverses the stroke list of a GimpVector object, adding nodes to an - * ArtVpath as it goes. - * The destination path is allocated inside this function, and must be - * freed after use. - * - * Return value: Newly allocated ArtVpath. + * Traverses the stroke list of a GimpVector object, calling art_stroke + * on each stroke as we go. Will eventually take cap type, join type + * and width as arguments. */ -ArtVpath * -gimp_vectors_to_art_vpath (const GimpVectors *vectors) +void +gimp_vectors_art_stroke (const GimpVectors *vectors) { - ArtVpath *vec; /* Libart path we're creating */ - GimpStroke *cur_stroke; - guint num_points; + GimpStroke *cur_stroke; - num_points = g_list_length (vectors->strokes); - - vec = art_new (ArtVpath, num_points); - - /* Get the list of Strokes in the vector, and create the equivalent - * ArtVpath node */ + /* For each Stroke in the vector, stroke it */ for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); cur_stroke; cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke)) { /* Add this stroke to the art_vpath */ - gimp_stroke_to_art_point (cur_stroke, vec); + GIMP_STROKE_GET_CLASS(cur_stroke)->art_stroke (cur_stroke); } - return vec; + /* That's it - nothing else to see here */ + return; + } diff --git a/app/vectors/gimpvectors.h b/app/vectors/gimpvectors.h index 2c8da947d3..457fb3891e 100644 --- a/app/vectors/gimpvectors.h +++ b/app/vectors/gimpvectors.h @@ -22,8 +22,6 @@ #ifndef __GIMP_VECTORS_H__ #define __GIMP_VECTORS_H__ -#include - #include "core/gimpitem.h" @@ -165,9 +163,7 @@ gint gimp_vectors_interpolate (const GimpVectors *vectors, GimpVectors * gimp_vectors_make_bezier (const GimpVectors *vectors); - -/* Convert to libart vector path */ -ArtVpath * gimp_vectors_to_art_vpath (const GimpVectors *vectors); - +/* Stroke a vector with libart (needs a better name) */ +void gimp_vectors_art_stroke(const GimpVectors * vectors); #endif /* __GIMP_VECTORS_H__ */