pdb, libgimpbase: Rename GIMP_VECTORS_STROKE_TYPE...

...to GIMP_PATH_STROKE_TYPE as part of
the GimpVectors -> GimpPath API
update.
This commit is contained in:
Alx Sa 2024-07-19 15:07:43 +00:00
parent 3fbfb21cff
commit d701b70336
15 changed files with 189 additions and 190 deletions

View File

@ -685,7 +685,7 @@ path_stroke_get_points_invoker (GimpProcedure *procedure,
num_points = points_array->len; num_points = points_array->len;
controlpoints = g_new (gdouble, num_points * 2); controlpoints = g_new (gdouble, num_points * 2);
type = GIMP_VECTORS_STROKE_TYPE_BEZIER; type = GIMP_PATH_STROKE_TYPE_BEZIER;
for (i = 0; i < num_points; i++) for (i = 0; i < num_points; i++)
{ {
controlpoints[2*i] = g_array_index (points_array, controlpoints[2*i] = g_array_index (points_array,
@ -749,7 +749,7 @@ path_stroke_new_from_points_invoker (GimpProcedure *procedure,
success = FALSE; success = FALSE;
if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER && if (type == GIMP_PATH_STROKE_TYPE_BEZIER &&
num_points % 6 == 0) num_points % 6 == 0)
{ {
coords = g_new (GimpCoords, num_points/2); coords = g_new (GimpCoords, num_points/2);
@ -1933,9 +1933,9 @@ register_path_procs (GimpPDB *pdb)
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
g_param_spec_enum ("type", g_param_spec_enum ("type",
"type", "type",
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).", "type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).",
GIMP_TYPE_VECTORS_STROKE_TYPE, GIMP_TYPE_PATH_STROKE_TYPE,
GIMP_VECTORS_STROKE_TYPE_BEZIER, GIMP_PATH_STROKE_TYPE_BEZIER,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure, gimp_procedure_add_return_value (procedure,
g_param_spec_int ("num-points", g_param_spec_int ("num-points",
@ -1965,7 +1965,7 @@ register_path_procs (GimpPDB *pdb)
"gimp-path-stroke-new-from-points"); "gimp-path-stroke-new-from-points");
gimp_procedure_set_static_help (procedure, gimp_procedure_set_static_help (procedure,
"Adds a stroke of a given type to the path object.", "Adds a stroke of a given type to the path object.",
"Adds a stroke of a given type to the path object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of float values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC...", "Adds a stroke of a given type to the path object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_PATH_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of float values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC...",
NULL); NULL);
gimp_procedure_set_static_attribution (procedure, gimp_procedure_set_static_attribution (procedure,
"Simon Budig", "Simon Budig",
@ -1980,9 +1980,9 @@ register_path_procs (GimpPDB *pdb)
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_enum ("type", g_param_spec_enum ("type",
"type", "type",
"type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).", "type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).",
GIMP_TYPE_VECTORS_STROKE_TYPE, GIMP_TYPE_PATH_STROKE_TYPE,
GIMP_VECTORS_STROKE_TYPE_BEZIER, GIMP_PATH_STROKE_TYPE_BEZIER,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure, gimp_procedure_add_argument (procedure,
g_param_spec_int ("num-points", g_param_spec_int ("num-points",

View File

@ -29,14 +29,14 @@
GimpStroke * GimpStroke *
gimp_stroke_new_from_coords (GimpVectorsStrokeType type, gimp_stroke_new_from_coords (GimpPathStrokeType type,
const GimpCoords *coords, const GimpCoords *coords,
gint n_coords, gint n_coords,
gboolean closed) gboolean closed)
{ {
switch (type) switch (type)
{ {
case GIMP_VECTORS_STROKE_TYPE_BEZIER: case GIMP_PATH_STROKE_TYPE_BEZIER:
return gimp_bezier_stroke_new_from_coords (coords, n_coords, closed); return gimp_bezier_stroke_new_from_coords (coords, n_coords, closed);
break; break;
default: default:

View File

@ -18,14 +18,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_VECTORS_NEW_H__ #ifndef __GIMP_STROKE_NEW_H__
#define __GIMP_VECTORS_NEW_H__ #define __GIMP_STROKE_NEW_H__
GimpStroke * gimp_stroke_new_from_coords (GimpVectorsStrokeType type, GimpStroke * gimp_stroke_new_from_coords (GimpPathStrokeType type,
const GimpCoords *coords, const GimpCoords *coords,
gint n_coords, gint n_coords,
gboolean closed); gboolean closed);
#endif /* __GIMP_VECTORS_NEW_H__ */ #endif /* __GIMP_STROKE_NEW_H__ */

View File

@ -47,6 +47,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
gimp_pdb_proc_type_get_type, gimp_pdb_proc_type_get_type,
gimp_pdb_status_type_get_type, gimp_pdb_status_type_get_type,
gimp_paint_application_mode_get_type, gimp_paint_application_mode_get_type,
gimp_path_stroke_type_get_type,
gimp_precision_get_type, gimp_precision_get_type,
gimp_progress_command_get_type, gimp_progress_command_get_type,
gimp_repeat_mode_get_type, gimp_repeat_mode_get_type,
@ -61,8 +62,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
gimp_text_justification_get_type, gimp_text_justification_get_type,
gimp_transfer_mode_get_type, gimp_transfer_mode_get_type,
gimp_transform_direction_get_type, gimp_transform_direction_get_type,
gimp_transform_resize_get_type, gimp_transform_resize_get_type
gimp_vectors_stroke_type_get_type
}; };
static const gchar * const type_names[] = static const gchar * const type_names[] =
@ -111,6 +111,7 @@ static const gchar * const type_names[] =
"GimpPDBProcType", "GimpPDBProcType",
"GimpPDBStatusType", "GimpPDBStatusType",
"GimpPaintApplicationMode", "GimpPaintApplicationMode",
"GimpPathStrokeType",
"GimpPrecision", "GimpPrecision",
"GimpProgressCommand", "GimpProgressCommand",
"GimpRepeatMode", "GimpRepeatMode",
@ -125,8 +126,7 @@ static const gchar * const type_names[] =
"GimpTextJustification", "GimpTextJustification",
"GimpTransferMode", "GimpTransferMode",
"GimpTransformDirection", "GimpTransformDirection",
"GimpTransformResize", "GimpTransformResize"
"GimpVectorsStrokeType"
}; };
static gboolean enums_initialized = FALSE; static gboolean enums_initialized = FALSE;

View File

@ -672,11 +672,11 @@ gimp_path_stroke_flip_free (GimpPath *path,
* this is always a bezier stroke, where the coordinates are the * this is always a bezier stroke, where the coordinates are the
* control points. * control points.
* *
* Returns: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now). * Returns: type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).
* *
* Since: 2.4 * Since: 2.4
**/ **/
GimpVectorsStrokeType GimpPathStrokeType
gimp_path_stroke_get_points (GimpPath *path, gimp_path_stroke_get_points (GimpPath *path,
gint stroke_id, gint stroke_id,
gint *num_points, gint *num_points,
@ -685,7 +685,7 @@ gimp_path_stroke_get_points (GimpPath *path,
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
GimpVectorsStrokeType type = 0; GimpPathStrokeType type = 0;
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_PATH, path, GIMP_TYPE_PATH, path,
@ -715,7 +715,7 @@ gimp_path_stroke_get_points (GimpPath *path,
/** /**
* gimp_path_stroke_new_from_points: * gimp_path_stroke_new_from_points:
* @path: The path object. * @path: The path object.
* @type: type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now). * @type: type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).
* @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate). * @num_points: The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate).
* @controlpoints: (array length=num_points) (element-type gdouble): List of the x- and y-coordinates of the control points. * @controlpoints: (array length=num_points) (element-type gdouble): List of the x- and y-coordinates of the control points.
* @closed: Whether the stroke is to be closed or not. * @closed: Whether the stroke is to be closed or not.
@ -724,23 +724,22 @@ gimp_path_stroke_get_points (GimpPath *path,
* *
* Adds a stroke of a given type to the path object. The coordinates of * Adds a stroke of a given type to the path object. The coordinates of
* the control points can be specified. For now only strokes of the * the control points can be specified. For now only strokes of the
* type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control * type GIMP_PATH_STROKE_TYPE_BEZIER are supported. The control points
* points are specified as a pair of float values for the x- and * are specified as a pair of float values for the x- and y-coordinate.
* y-coordinate. The Bezier stroke type needs a multiple of three * The Bezier stroke type needs a multiple of three control points.
* control points. Each Bezier segment endpoint (anchor, A) has two * Each Bezier segment endpoint (anchor, A) has two additional control
* additional control points (C) associated. They are specified in the * points (C) associated. They are specified in the order CACCACCAC...
* order CACCACCAC...
* *
* Returns: The stroke ID of the newly created stroke. * Returns: The stroke ID of the newly created stroke.
* *
* Since: 2.4 * Since: 2.4
**/ **/
gint gint
gimp_path_stroke_new_from_points (GimpPath *path, gimp_path_stroke_new_from_points (GimpPath *path,
GimpVectorsStrokeType type, GimpPathStrokeType type,
gint num_points, gint num_points,
const gdouble *controlpoints, const gdouble *controlpoints,
gboolean closed) gboolean closed)
{ {
GimpValueArray *args; GimpValueArray *args;
GimpValueArray *return_vals; GimpValueArray *return_vals;
@ -748,7 +747,7 @@ gimp_path_stroke_new_from_points (GimpPath *path,
args = gimp_value_array_new_from_types (NULL, args = gimp_value_array_new_from_types (NULL,
GIMP_TYPE_PATH, path, GIMP_TYPE_PATH, path,
GIMP_TYPE_VECTORS_STROKE_TYPE, type, GIMP_TYPE_PATH_STROKE_TYPE, type,
G_TYPE_INT, num_points, G_TYPE_INT, num_points,
GIMP_TYPE_FLOAT_ARRAY, NULL, GIMP_TYPE_FLOAT_ARRAY, NULL,
G_TYPE_BOOLEAN, closed, G_TYPE_BOOLEAN, closed,

View File

@ -32,113 +32,113 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */ /* For information look into the C source or the html documentation */
GimpPath* gimp_path_new (GimpImage *image, GimpPath* gimp_path_new (GimpImage *image,
const gchar *name); const gchar *name);
GimpPath* gimp_path_new_from_text_layer (GimpImage *image, GimpPath* gimp_path_new_from_text_layer (GimpImage *image,
GimpLayer *layer); GimpLayer *layer);
GimpPath* gimp_path_copy (GimpPath *path); GimpPath* gimp_path_copy (GimpPath *path);
gint* gimp_path_get_strokes (GimpPath *path, gint* gimp_path_get_strokes (GimpPath *path,
gint *num_strokes); gint *num_strokes);
gdouble gimp_path_stroke_get_length (GimpPath *path, gdouble gimp_path_stroke_get_length (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble precision); gdouble precision);
gboolean gimp_path_stroke_get_point_at_dist (GimpPath *path, gboolean gimp_path_stroke_get_point_at_dist (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble dist, gdouble dist,
gdouble precision, gdouble precision,
gdouble *x_point, gdouble *x_point,
gdouble *y_point, gdouble *y_point,
gdouble *slope, gdouble *slope,
gboolean *valid); gboolean *valid);
gboolean gimp_path_remove_stroke (GimpPath *path, gboolean gimp_path_remove_stroke (GimpPath *path,
gint stroke_id); gint stroke_id);
gboolean gimp_path_stroke_close (GimpPath *path, gboolean gimp_path_stroke_close (GimpPath *path,
gint stroke_id); gint stroke_id);
gboolean gimp_path_stroke_reverse (GimpPath *path, gboolean gimp_path_stroke_reverse (GimpPath *path,
gint stroke_id); gint stroke_id);
gboolean gimp_path_stroke_translate (GimpPath *path, gboolean gimp_path_stroke_translate (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble off_x, gdouble off_x,
gdouble off_y); gdouble off_y);
gboolean gimp_path_stroke_scale (GimpPath *path, gboolean gimp_path_stroke_scale (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble scale_x, gdouble scale_x,
gdouble scale_y); gdouble scale_y);
gboolean gimp_path_stroke_rotate (GimpPath *path, gboolean gimp_path_stroke_rotate (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble center_x, gdouble center_x,
gdouble center_y, gdouble center_y,
gdouble angle); gdouble angle);
gboolean gimp_path_stroke_flip (GimpPath *path, gboolean gimp_path_stroke_flip (GimpPath *path,
gint stroke_id, gint stroke_id,
GimpOrientationType flip_type, GimpOrientationType flip_type,
gdouble axis); gdouble axis);
gboolean gimp_path_stroke_flip_free (GimpPath *path, gboolean gimp_path_stroke_flip_free (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble x1, gdouble x1,
gdouble y1, gdouble y1,
gdouble x2, gdouble x2,
gdouble y2); gdouble y2);
GimpVectorsStrokeType gimp_path_stroke_get_points (GimpPath *path, GimpPathStrokeType gimp_path_stroke_get_points (GimpPath *path,
gint stroke_id, gint stroke_id,
gint *num_points, gint *num_points,
gdouble **controlpoints, gdouble **controlpoints,
gboolean *closed); gboolean *closed);
gint gimp_path_stroke_new_from_points (GimpPath *path, gint gimp_path_stroke_new_from_points (GimpPath *path,
GimpVectorsStrokeType type, GimpPathStrokeType type,
gint num_points, gint num_points,
const gdouble *controlpoints, const gdouble *controlpoints,
gboolean closed); gboolean closed);
gdouble* gimp_path_stroke_interpolate (GimpPath *path, gdouble* gimp_path_stroke_interpolate (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble precision, gdouble precision,
gint *num_coords, gint *num_coords,
gboolean *closed); gboolean *closed);
gint gimp_path_bezier_stroke_new_moveto (GimpPath *path, gint gimp_path_bezier_stroke_new_moveto (GimpPath *path,
gdouble x0, gdouble x0,
gdouble y0); gdouble y0);
gboolean gimp_path_bezier_stroke_lineto (GimpPath *path, gboolean gimp_path_bezier_stroke_lineto (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble x0, gdouble x0,
gdouble y0); gdouble y0);
gboolean gimp_path_bezier_stroke_conicto (GimpPath *path, gboolean gimp_path_bezier_stroke_conicto (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble x0, gdouble x0,
gdouble y0, gdouble y0,
gdouble x1, gdouble x1,
gdouble y1); gdouble y1);
gboolean gimp_path_bezier_stroke_cubicto (GimpPath *path, gboolean gimp_path_bezier_stroke_cubicto (GimpPath *path,
gint stroke_id, gint stroke_id,
gdouble x0, gdouble x0,
gdouble y0, gdouble y0,
gdouble x1, gdouble x1,
gdouble y1, gdouble y1,
gdouble x2, gdouble x2,
gdouble y2); gdouble y2);
gint gimp_path_bezier_stroke_new_ellipse (GimpPath *path, gint gimp_path_bezier_stroke_new_ellipse (GimpPath *path,
gdouble x0, gdouble x0,
gdouble y0, gdouble y0,
gdouble radius_x, gdouble radius_x,
gdouble radius_y, gdouble radius_y,
gdouble angle); gdouble angle);
gboolean gimp_path_import_from_file (GimpImage *image, gboolean gimp_path_import_from_file (GimpImage *image,
GFile *file, GFile *file,
gboolean merge, gboolean merge,
gboolean scale, gboolean scale,
gint *num_paths, gint *num_paths,
GimpPath ***path); GimpPath ***path);
gboolean gimp_path_import_from_string (GimpImage *image, gboolean gimp_path_import_from_string (GimpImage *image,
const gchar *string, const gchar *string,
gint length, gint length,
gboolean merge, gboolean merge,
gboolean scale, gboolean scale,
gint *num_paths, gint *num_paths,
GimpPath ***path); GimpPath ***path);
gboolean gimp_path_export_to_file (GimpImage *image, gboolean gimp_path_export_to_file (GimpImage *image,
GFile *file, GFile *file,
GimpPath *path); GimpPath *path);
gchar* gimp_path_export_to_string (GimpImage *image, gchar* gimp_path_export_to_string (GimpImage *image,
GimpPath *path); GimpPath *path);
G_END_DECLS G_END_DECLS

View File

@ -154,6 +154,7 @@ EXPORTS
gimp_path_free gimp_path_free
gimp_path_get_user_writable_dir gimp_path_get_user_writable_dir
gimp_path_parse gimp_path_parse
gimp_path_stroke_type_get_type
gimp_path_to_str gimp_path_to_str
gimp_pdb_error_handler_get_type gimp_pdb_error_handler_get_type
gimp_pdb_proc_type_get_type gimp_pdb_proc_type_get_type
@ -246,7 +247,6 @@ EXPORTS
gimp_value_take_float_array gimp_value_take_float_array
gimp_value_take_int32_array gimp_value_take_int32_array
gimp_value_take_object_array gimp_value_take_object_array
gimp_vectors_stroke_type_get_type
gimp_wire_clear_error gimp_wire_clear_error
gimp_wire_destroy gimp_wire_destroy
gimp_wire_error gimp_wire_error

View File

@ -1898,17 +1898,17 @@ gimp_transform_resize_get_type (void)
} }
GType GType
gimp_vectors_stroke_type_get_type (void) gimp_path_stroke_type_get_type (void)
{ {
static const GEnumValue values[] = static const GEnumValue values[] =
{ {
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", "bezier" }, { GIMP_PATH_STROKE_TYPE_BEZIER, "GIMP_PATH_STROKE_TYPE_BEZIER", "bezier" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
static const GimpEnumDesc descs[] = static const GimpEnumDesc descs[] =
{ {
{ GIMP_VECTORS_STROKE_TYPE_BEZIER, "GIMP_VECTORS_STROKE_TYPE_BEZIER", NULL }, { GIMP_PATH_STROKE_TYPE_BEZIER, "GIMP_PATH_STROKE_TYPE_BEZIER", NULL },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
@ -1916,9 +1916,9 @@ gimp_vectors_stroke_type_get_type (void)
if (G_UNLIKELY (! type)) if (G_UNLIKELY (! type))
{ {
type = g_enum_register_static ("GimpVectorsStrokeType", values); type = g_enum_register_static ("GimpPathStrokeType", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_type_set_translation_context (type, "vectors-stroke-type"); gimp_type_set_translation_context (type, "path-stroke-type");
gimp_enum_set_value_descriptions (type, descs); gimp_enum_set_value_descriptions (type, descs);
} }

View File

@ -1306,19 +1306,19 @@ typedef enum /*< skip >*/
/** /**
* GimpVectorsStrokeType: * GimpPathStrokeType:
* @GIMP_VECTORS_STROKE_TYPE_BEZIER: A bezier stroke * @GIMP_PATH_STROKE_TYPE_BEZIER: A bezier stroke
* *
* Possible type of strokes in vectors objects. * Possible type of strokes in path objects.
**/ **/
#define GIMP_TYPE_VECTORS_STROKE_TYPE (gimp_vectors_stroke_type_get_type ()) #define GIMP_TYPE_PATH_STROKE_TYPE (gimp_path_stroke_type_get_type ())
GType gimp_vectors_stroke_type_get_type (void) G_GNUC_CONST; GType gimp_path_stroke_type_get_type (void) G_GNUC_CONST;
typedef enum typedef enum
{ {
GIMP_VECTORS_STROKE_TYPE_BEZIER GIMP_PATH_STROKE_TYPE_BEZIER
} GimpVectorsStrokeType; } GimpPathStrokeType;
G_END_DECLS G_END_DECLS

View File

@ -434,14 +434,14 @@ In some cases you will want a function which returns an array or a
function which receives an array. Array arguments are specified in a function which receives an array. Array arguments are specified in a
special way which is a bit different than the other arguments. To see special way which is a bit different than the other arguments. To see
how array arguments are specified, let's take a look at the +@outargs+ how array arguments are specified, let's take a look at the +@outargs+
of +vectors_stroke_get_points+ from of +path_stroke_get_points+ from
https://gitlab.gnome.org/GNOME/gimp/tree/master/pdb/groups/vectors.pdb[pdb/groups/vectors.pdb]: https://gitlab.gnome.org/GNOME/gimp/tree/master/pdb/groups/path.pdb[pdb/groups/path.pdb]:
[source,perl] [source,perl]
---- ----
@outargs = ( @outargs = (
{ name => 'type', type => 'enum GimpVectorsStrokeType', { name => 'type', type => 'enum GimpPathStrokeType',
desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' },
{ name => 'controlpoints', type => 'floatarray', { name => 'controlpoints', type => 'floatarray',
desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).', desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).',
array => { name => 'num_points', array => { name => 'num_points',

View File

@ -630,11 +630,11 @@ package Gimp::CodeGen::enums;
GIMP_UNIT_PICA => '4', GIMP_UNIT_PICA => '4',
GIMP_UNIT_END => '5' } GIMP_UNIT_END => '5' }
}, },
GimpVectorsStrokeType => GimpPathStrokeType =>
{ contig => 1, { contig => 1,
header => 'libgimpbase/gimpbaseenums.h', header => 'libgimpbase/gimpbaseenums.h',
symbols => [ qw(GIMP_VECTORS_STROKE_TYPE_BEZIER) ], symbols => [ qw(GIMP_PATH_STROKE_TYPE_BEZIER) ],
mapping => { GIMP_VECTORS_STROKE_TYPE_BEZIER => '0' } mapping => { GIMP_PATH_STROKE_TYPE_BEZIER => '0' }
}, },
GimpColorManagementMode => GimpColorManagementMode =>
{ contig => 1, { contig => 1,

View File

@ -633,8 +633,8 @@ HELP
); );
@outargs = ( @outargs = (
{ name => 'type', type => 'enum GimpVectorsStrokeType', { name => 'type', type => 'enum GimpPathStrokeType',
desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' },
{ name => 'controlpoints', type => 'floatarray', { name => 'controlpoints', type => 'floatarray',
desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).', desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).',
array => { name => 'num_points', array => { name => 'num_points',
@ -660,7 +660,7 @@ HELP
num_points = points_array->len; num_points = points_array->len;
controlpoints = g_new (gdouble, num_points * 2); controlpoints = g_new (gdouble, num_points * 2);
type = GIMP_VECTORS_STROKE_TYPE_BEZIER; type = GIMP_PATH_STROKE_TYPE_BEZIER;
for (i = 0; i < num_points; i++) for (i = 0; i < num_points; i++)
{ {
controlpoints[2*i] = g_array_index (points_array, controlpoints[2*i] = g_array_index (points_array,
@ -751,7 +751,7 @@ sub path_stroke_new_from_points {
$help = <<'HELP'; $help = <<'HELP';
Adds a stroke of a given type to the path object. The coordinates of the Adds a stroke of a given type to the path object. The coordinates of the
control points can be specified. control points can be specified.
For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. For now only strokes of the type GIMP_PATH_STROKE_TYPE_BEZIER are supported.
The control points are specified as a pair of float values for the x- and The control points are specified as a pair of float values for the x- and
y-coordinate. y-coordinate.
The Bezier stroke type needs a multiple of three control points. Each Bezier The Bezier stroke type needs a multiple of three control points. Each Bezier
@ -764,8 +764,8 @@ HELP
@inargs = ( @inargs = (
{ name => 'path', type => 'path', { name => 'path', type => 'path',
desc => 'The path object' }, desc => 'The path object' },
{ name => 'type', type => 'enum GimpVectorsStrokeType', { name => 'type', type => 'enum GimpPathStrokeType',
desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' },
{ name => 'controlpoints', type => 'floatarray', { name => 'controlpoints', type => 'floatarray',
desc => 'List of the x- and y-coordinates of the control points.', desc => 'List of the x- and y-coordinates of the control points.',
array => { name => 'num_points', array => { name => 'num_points',
@ -791,7 +791,7 @@ HELP
success = FALSE; success = FALSE;
if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER && if (type == GIMP_PATH_STROKE_TYPE_BEZIER &&
num_points % 6 == 0) num_points % 6 == 0)
{ {
coords = g_new (GimpCoords, num_points/2); coords = g_new (GimpCoords, num_points/2);

View File

@ -1225,17 +1225,17 @@ save_paths (GOutputStream *output,
for (s = 0; s < num_strokes; s++) for (s = 0; s < num_strokes; s++)
{ {
GimpVectorsStrokeType type; GimpPathStrokeType type;
gdouble *points; gdouble *points;
gint num_points; gint num_points;
gboolean closed; gboolean closed;
gint p = 0; gint p = 0;
type = gimp_path_stroke_get_points (iter->data, strokes[s], type = gimp_path_stroke_get_points (iter->data, strokes[s],
&num_points, &points, &closed); &num_points, &points, &closed);
if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || if (type != GIMP_PATH_STROKE_TYPE_BEZIER ||
num_points > 65535 || num_points > 65535 ||
num_points % 6) num_points % 6)
{ {
g_printerr ("psd-export: unsupported stroke type: " g_printerr ("psd-export: unsupported stroke type: "

View File

@ -1704,7 +1704,7 @@ load_resource_2000 (const PSDimageres *res_a,
} }
/* Add sub-path */ /* Add sub-path */
gimp_path_stroke_new_from_points (path, gimp_path_stroke_new_from_points (path,
GIMP_VECTORS_STROKE_TYPE_BEZIER, GIMP_PATH_STROKE_TYPE_BEZIER,
cntr, controlpoints, closed); cntr, controlpoints, closed);
g_free (controlpoints); g_free (controlpoints);
} }

View File

@ -183,17 +183,17 @@ save_paths (TIFF *tif,
for (s = 0; s < num_strokes; s++) for (s = 0; s < num_strokes; s++)
{ {
GimpVectorsStrokeType type; GimpPathStrokeType type;
gdouble *points; gdouble *points;
gint num_points; gint num_points;
gboolean closed; gboolean closed;
gint p = 0; gint p = 0;
type = gimp_path_stroke_get_points (iter->data, strokes[s], type = gimp_path_stroke_get_points (iter->data, strokes[s],
&num_points, &points, &closed); &num_points, &points, &closed);
if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || if (type != GIMP_PATH_STROKE_TYPE_BEZIER ||
num_points > 65535 || num_points > 65535 ||
num_points % 6) num_points % 6)
{ {
g_printerr ("tiff-export: unsupported stroke type: " g_printerr ("tiff-export: unsupported stroke type: "