Commit 99dba1ca authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/vectors/gimpbezierstroke.c app/vectors/gimpstroke.[ch] removed

2003-09-06  Sven Neumann  <sven@gimp.org>

	* app/vectors/gimpbezierstroke.c
	* app/vectors/gimpstroke.[ch]
	* app/vectors/gimpvectors.[ch]: removed compiler warnings, cleaned
	up coding style issues,
parent 1d4720e5
2003-09-06 Sven Neumann <sven@gimp.org>
* app/vectors/gimpbezierstroke.c
* app/vectors/gimpstroke.[ch]
* app/vectors/gimpvectors.[ch]: removed compiler warnings, cleaned
up coding style issues,
2003-09-06 Dave Neary <bolsh@gimp.org>
Ooops! Sorry for the oversight.
......@@ -117,7 +117,9 @@ static void gimp_bezier_coords_subdivide2 (const GimpCoords *beziercoords,
static gboolean gimp_bezier_coords_is_straight (const GimpCoords *beziercoords,
const gdouble precision);
static void gimp_bezier_stroke_to_art_point (ArtVpath *vec);
static void gimp_bezier_stroke_to_art_point (const GimpStroke *stroke,
ArtVpath *vec);
/* private variables */
......@@ -1612,9 +1614,10 @@ gimp_bezier_coords_subdivide2 (const GimpCoords *beziercoords,
}
static void
gimp_bezier_stroke_to_art_point (ArtVpath *vec)
gimp_bezier_stroke_to_art_point (const GimpStroke *stroke,
ArtVpath *vec)
{
g_printerr ("gimp_bezier_stroke_to_art_point: default implementation\n");
g_printerr ("gimp_bezier_stroke_to_art_point: implement me!\n");
return;
}
......@@ -144,11 +144,13 @@ static void gimp_stroke_real_transform (GimpStroke *stroke,
GimpProgressFunc progress_callback,
gpointer progress_data);
static GList * gimp_stroke_real_get_draw_anchors (const GimpStroke *stroke);
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 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_to_art_point (ArtVpath *vec);
/* private variables */
......@@ -241,7 +243,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_to_art_point;
klass->to_art_point = gimp_stroke_real_to_art_point;
}
static void
......@@ -1211,8 +1213,20 @@ gimp_stroke_real_get_draw_lines (const GimpStroke *stroke)
return ret_lines;
}
void
gimp_stroke_to_art_point (const GimpStroke *stroke,
ArtVpath *vec)
{
g_return_if_fail (GIMP_IS_STROKE (stroke));
GIMP_STROKE_GET_CLASS (stroke)->to_art_point (stroke, vec);
}
static void
gimp_stroke_to_art_point (ArtVpath *vec)
gimp_stroke_real_to_art_point (const GimpStroke *stroke,
ArtVpath *vec)
{
g_printerr ("gimp_stroke_to_art_point: default implementation\n");
......
......@@ -38,9 +38,9 @@
struct _GimpStroke
{
GimpObject parent_instance;
GList *anchors;
gboolean closed;
};
......@@ -78,7 +78,7 @@ struct _GimpStrokeClass
GimpAnchorFeatureType feature);
void (* anchor_delete) (GimpStroke *stroke,
GimpAnchor *anchor);
gboolean (* point_is_movable) (GimpStroke *stroke,
GimpAnchor *predec,
gdouble position);
......@@ -164,8 +164,9 @@ struct _GimpStrokeClass
GList * (* get_draw_anchors) (const GimpStroke *stroke);
GList * (* get_draw_controls) (const GimpStroke *stroke);
GArray * (* get_draw_lines) (const GimpStroke *stroke);
void (* to_art_point) (ArtVpath *vec);
void (* to_art_point) (const GimpStroke *stroke,
ArtVpath *vec);
};
......@@ -183,9 +184,9 @@ gdouble gimp_stroke_nearest_point_get (const GimpStroke *stroke,
GimpCoords *ret_point,
GimpAnchor **ret_segment_start,
gdouble *ret_pos);
/* prev == NULL: "first" anchor */
/* prev == NULL: "first" anchor */
GimpAnchor * gimp_stroke_anchor_get_next (const GimpStroke *stroke,
const GimpAnchor *prev);
......@@ -245,7 +246,7 @@ GimpAnchor * gimp_stroke_extend (GimpStroke *stroke,
const GimpCoords *coords,
GimpAnchor *neighbor,
GimpVectorExtendMode extend_mode);
gboolean gimp_stroke_connect_stroke (GimpStroke *stroke,
GimpAnchor *anchor,
GimpStroke *extension,
......@@ -259,7 +260,7 @@ gdouble gimp_stroke_get_length (const GimpStroke *stroke);
gdouble gimp_stroke_get_distance (const GimpStroke *stroke,
const GimpCoords *coord);
/* returns an array of valid coordinates */
/* returns an array of valid coordinates */
GArray * gimp_stroke_interpolate (const GimpStroke *stroke,
gdouble precision,
gboolean *closed);
......@@ -304,6 +305,9 @@ 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__ */
......@@ -3,7 +3,7 @@
*
* gimpvectors.c
* Copyright (C) 2002 Simon Budig <simon@gimp.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -953,25 +953,27 @@ gimp_vectors_real_make_bezier (const GimpVectors *vectors)
* gimp_vectors_to_art_vpath: Create an ArtVpath from a GimpVectors object.
* @vectors: The source path
*
* Traverses the stroke list of a GimpVector object, adding nodes to an
* 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.
*
* The destination path is allocated inside this function, and must be
* freed after use.
*
* Return value: Newly allocated ArtVpath.
*/
ArtVpath *
gimp_vectors_to_art_vpath(const GimpVectors *vectors)
gimp_vectors_to_art_vpath (GimpVectors *vectors)
{
ArtVpath * vec; /* Libart path we're creating */
GimpStroke *cur_stroke;
guint num_points = g_list_length (vectors->strokes);
ArtVpath *vec; /* Libart path we're creating */
GimpStroke *cur_stroke;
guint num_points;
num_points = g_list_length (vectors->strokes);
vec = art_new (ArtVpath, num_points);
gimp_vectors_freeze (vectors);
/* Get the list of Strokes in the vector, and create the equivalent
/* Get the list of Strokes in the vector, and create the equivalent
* ArtVpath node */
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL);
......@@ -979,9 +981,9 @@ gimp_vectors_to_art_vpath(const GimpVectors *vectors)
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke))
{
/* Add this stroke to the art_vpath */
GIMP_STROKE_GET_CLASS(cur_stroke)->to_art_point (vec);
gimp_stroke_to_art_point (cur_stroke, vec);
}
gimp_vectors_thaw (vectors);
/* That's it - nothing else to see here */
......
......@@ -102,11 +102,11 @@ void gimp_vectors_copy_strokes (const GimpVectors *src_vectors,
GimpAnchor * gimp_vectors_anchor_get (const GimpVectors *vectors,
const GimpCoords *coord,
GimpStroke **ret_stroke);
/* prev == NULL: "first" anchor */
/* prev == NULL: "first" anchor */
GimpAnchor * gimp_vectors_anchor_get_next (const GimpVectors *vectors,
const GimpAnchor *prev);
/* type will be an xorable enum:
* VECTORS_NONE, VECTORS_FIX_ANGLE, VECTORS_FIX_RATIO, VECTORS_RESTRICT_ANGLE
* or so.
......@@ -137,8 +137,8 @@ void gimp_vectors_stroke_remove (GimpVectors *vectors,
GimpStroke *stroke);
GimpStroke * gimp_vectors_stroke_get (const GimpVectors *vectors,
const GimpCoords *coord);
/* prev == NULL: "first" stroke */
/* prev == NULL: "first" stroke */
GimpStroke * gimp_vectors_stroke_get_next (const GimpVectors *vectors,
const GimpStroke *prev);
gdouble gimp_vectors_stroke_get_length (const GimpVectors *vectors,
......@@ -150,8 +150,8 @@ gdouble gimp_vectors_get_length (const GimpVectors *vectors,
const GimpAnchor *start);
gdouble gimp_vectors_get_distance (const GimpVectors *vectors,
const GimpCoords *coord);
/* returns the number of valid coordinates */
/* returns the number of valid coordinates */
gint gimp_vectors_interpolate (const GimpVectors *vectors,
const GimpStroke *stroke,
gdouble precision,
......@@ -164,7 +164,9 @@ 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);
ArtVpath * gimp_vectors_to_art_vpath (GimpVectors *vectors);
#endif /* __GIMP_VECTORS_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment