From d701b70336261621bd1ef88942ca716888c3166f Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 19 Jul 2024 15:07:43 +0000 Subject: [PATCH] pdb, libgimpbase: Rename GIMP_VECTORS_STROKE_TYPE... ...to GIMP_PATH_STROKE_TYPE as part of the GimpVectors -> GimpPath API update. --- app/pdb/path-cmds.c | 18 +-- app/vectors/gimpstroke-new.c | 10 +- app/vectors/gimpstroke-new.h | 14 +- libgimp/gimpenums.c.tail | 8 +- libgimp/gimppath_pdb.c | 31 ++-- libgimp/gimppath_pdb.h | 214 ++++++++++++------------- libgimpbase/gimpbase.def | 2 +- libgimpbase/gimpbaseenums.c | 10 +- libgimpbase/gimpbaseenums.h | 14 +- pdb/README_NEW_PDB_PROC | 8 +- pdb/enums.pl | 6 +- pdb/groups/path.pdb | 14 +- plug-ins/file-psd/psd-export.c | 14 +- plug-ins/file-psd/psd-image-res-load.c | 2 +- plug-ins/file-tiff/file-tiff-export.c | 14 +- 15 files changed, 189 insertions(+), 190 deletions(-) diff --git a/app/pdb/path-cmds.c b/app/pdb/path-cmds.c index 587b7d5a66..f28eb221f7 100644 --- a/app/pdb/path-cmds.c +++ b/app/pdb/path-cmds.c @@ -685,7 +685,7 @@ path_stroke_get_points_invoker (GimpProcedure *procedure, num_points = points_array->len; 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++) { controlpoints[2*i] = g_array_index (points_array, @@ -749,7 +749,7 @@ path_stroke_new_from_points_invoker (GimpProcedure *procedure, success = FALSE; - if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER && + if (type == GIMP_PATH_STROKE_TYPE_BEZIER && num_points % 6 == 0) { coords = g_new (GimpCoords, num_points/2); @@ -1933,9 +1933,9 @@ register_path_procs (GimpPDB *pdb) gimp_procedure_add_return_value (procedure, g_param_spec_enum ("type", "type", - "type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).", - GIMP_TYPE_VECTORS_STROKE_TYPE, - GIMP_VECTORS_STROKE_TYPE_BEZIER, + "type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).", + GIMP_TYPE_PATH_STROKE_TYPE, + GIMP_PATH_STROKE_TYPE_BEZIER, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, g_param_spec_int ("num-points", @@ -1965,7 +1965,7 @@ register_path_procs (GimpPDB *pdb) "gimp-path-stroke-new-from-points"); 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. 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); gimp_procedure_set_static_attribution (procedure, "Simon Budig", @@ -1980,9 +1980,9 @@ register_path_procs (GimpPDB *pdb) gimp_procedure_add_argument (procedure, g_param_spec_enum ("type", "type", - "type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).", - GIMP_TYPE_VECTORS_STROKE_TYPE, - GIMP_VECTORS_STROKE_TYPE_BEZIER, + "type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).", + GIMP_TYPE_PATH_STROKE_TYPE, + GIMP_PATH_STROKE_TYPE_BEZIER, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, g_param_spec_int ("num-points", diff --git a/app/vectors/gimpstroke-new.c b/app/vectors/gimpstroke-new.c index daba683151..ed8f77f112 100644 --- a/app/vectors/gimpstroke-new.c +++ b/app/vectors/gimpstroke-new.c @@ -29,14 +29,14 @@ GimpStroke * -gimp_stroke_new_from_coords (GimpVectorsStrokeType type, - const GimpCoords *coords, - gint n_coords, - gboolean closed) +gimp_stroke_new_from_coords (GimpPathStrokeType type, + const GimpCoords *coords, + gint n_coords, + gboolean closed) { 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); break; default: diff --git a/app/vectors/gimpstroke-new.h b/app/vectors/gimpstroke-new.h index 5365cc5b84..8b35d6a541 100644 --- a/app/vectors/gimpstroke-new.h +++ b/app/vectors/gimpstroke-new.h @@ -18,14 +18,14 @@ * along with this program. If not, see . */ -#ifndef __GIMP_VECTORS_NEW_H__ -#define __GIMP_VECTORS_NEW_H__ +#ifndef __GIMP_STROKE_NEW_H__ +#define __GIMP_STROKE_NEW_H__ -GimpStroke * gimp_stroke_new_from_coords (GimpVectorsStrokeType type, - const GimpCoords *coords, - gint n_coords, - gboolean closed); +GimpStroke * gimp_stroke_new_from_coords (GimpPathStrokeType type, + const GimpCoords *coords, + gint n_coords, + gboolean closed); -#endif /* __GIMP_VECTORS_NEW_H__ */ +#endif /* __GIMP_STROKE_NEW_H__ */ diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail index fd937076a9..d14b26477b 100644 --- a/libgimp/gimpenums.c.tail +++ b/libgimp/gimpenums.c.tail @@ -47,6 +47,7 @@ static const GimpGetTypeFunc get_type_funcs[] = gimp_pdb_proc_type_get_type, gimp_pdb_status_type_get_type, gimp_paint_application_mode_get_type, + gimp_path_stroke_type_get_type, gimp_precision_get_type, gimp_progress_command_get_type, gimp_repeat_mode_get_type, @@ -61,8 +62,7 @@ static const GimpGetTypeFunc get_type_funcs[] = gimp_text_justification_get_type, gimp_transfer_mode_get_type, gimp_transform_direction_get_type, - gimp_transform_resize_get_type, - gimp_vectors_stroke_type_get_type + gimp_transform_resize_get_type }; static const gchar * const type_names[] = @@ -111,6 +111,7 @@ static const gchar * const type_names[] = "GimpPDBProcType", "GimpPDBStatusType", "GimpPaintApplicationMode", + "GimpPathStrokeType", "GimpPrecision", "GimpProgressCommand", "GimpRepeatMode", @@ -125,8 +126,7 @@ static const gchar * const type_names[] = "GimpTextJustification", "GimpTransferMode", "GimpTransformDirection", - "GimpTransformResize", - "GimpVectorsStrokeType" + "GimpTransformResize" }; static gboolean enums_initialized = FALSE; diff --git a/libgimp/gimppath_pdb.c b/libgimp/gimppath_pdb.c index 1b8ce85502..9c76363203 100644 --- a/libgimp/gimppath_pdb.c +++ b/libgimp/gimppath_pdb.c @@ -672,11 +672,11 @@ gimp_path_stroke_flip_free (GimpPath *path, * this is always a bezier stroke, where the coordinates are the * 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 **/ -GimpVectorsStrokeType +GimpPathStrokeType gimp_path_stroke_get_points (GimpPath *path, gint stroke_id, gint *num_points, @@ -685,7 +685,7 @@ gimp_path_stroke_get_points (GimpPath *path, { GimpValueArray *args; GimpValueArray *return_vals; - GimpVectorsStrokeType type = 0; + GimpPathStrokeType type = 0; args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_PATH, path, @@ -715,7 +715,7 @@ gimp_path_stroke_get_points (GimpPath *path, /** * gimp_path_stroke_new_from_points: * @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). * @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. @@ -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 * 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... + * 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... * * Returns: The stroke ID of the newly created stroke. * * Since: 2.4 **/ gint -gimp_path_stroke_new_from_points (GimpPath *path, - GimpVectorsStrokeType type, - gint num_points, - const gdouble *controlpoints, - gboolean closed) +gimp_path_stroke_new_from_points (GimpPath *path, + GimpPathStrokeType type, + gint num_points, + const gdouble *controlpoints, + gboolean closed) { GimpValueArray *args; GimpValueArray *return_vals; @@ -748,7 +747,7 @@ gimp_path_stroke_new_from_points (GimpPath *path, args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_PATH, path, - GIMP_TYPE_VECTORS_STROKE_TYPE, type, + GIMP_TYPE_PATH_STROKE_TYPE, type, G_TYPE_INT, num_points, GIMP_TYPE_FLOAT_ARRAY, NULL, G_TYPE_BOOLEAN, closed, diff --git a/libgimp/gimppath_pdb.h b/libgimp/gimppath_pdb.h index 6c6d9e2298..c77f6f5d5b 100644 --- a/libgimp/gimppath_pdb.h +++ b/libgimp/gimppath_pdb.h @@ -32,113 +32,113 @@ G_BEGIN_DECLS /* For information look into the C source or the html documentation */ -GimpPath* gimp_path_new (GimpImage *image, - const gchar *name); -GimpPath* gimp_path_new_from_text_layer (GimpImage *image, - GimpLayer *layer); -GimpPath* gimp_path_copy (GimpPath *path); -gint* gimp_path_get_strokes (GimpPath *path, - gint *num_strokes); -gdouble gimp_path_stroke_get_length (GimpPath *path, - gint stroke_id, - gdouble precision); -gboolean gimp_path_stroke_get_point_at_dist (GimpPath *path, - gint stroke_id, - gdouble dist, - gdouble precision, - gdouble *x_point, - gdouble *y_point, - gdouble *slope, - gboolean *valid); -gboolean gimp_path_remove_stroke (GimpPath *path, - gint stroke_id); -gboolean gimp_path_stroke_close (GimpPath *path, - gint stroke_id); -gboolean gimp_path_stroke_reverse (GimpPath *path, - gint stroke_id); -gboolean gimp_path_stroke_translate (GimpPath *path, - gint stroke_id, - gdouble off_x, - gdouble off_y); -gboolean gimp_path_stroke_scale (GimpPath *path, - gint stroke_id, - gdouble scale_x, - gdouble scale_y); -gboolean gimp_path_stroke_rotate (GimpPath *path, - gint stroke_id, - gdouble center_x, - gdouble center_y, - gdouble angle); -gboolean gimp_path_stroke_flip (GimpPath *path, - gint stroke_id, - GimpOrientationType flip_type, - gdouble axis); -gboolean gimp_path_stroke_flip_free (GimpPath *path, - gint stroke_id, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2); -GimpVectorsStrokeType gimp_path_stroke_get_points (GimpPath *path, - gint stroke_id, - gint *num_points, - gdouble **controlpoints, - gboolean *closed); -gint gimp_path_stroke_new_from_points (GimpPath *path, - GimpVectorsStrokeType type, - gint num_points, - const gdouble *controlpoints, - gboolean closed); -gdouble* gimp_path_stroke_interpolate (GimpPath *path, - gint stroke_id, - gdouble precision, - gint *num_coords, - gboolean *closed); -gint gimp_path_bezier_stroke_new_moveto (GimpPath *path, - gdouble x0, - gdouble y0); -gboolean gimp_path_bezier_stroke_lineto (GimpPath *path, - gint stroke_id, - gdouble x0, - gdouble y0); -gboolean gimp_path_bezier_stroke_conicto (GimpPath *path, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1); -gboolean gimp_path_bezier_stroke_cubicto (GimpPath *path, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2); -gint gimp_path_bezier_stroke_new_ellipse (GimpPath *path, - gdouble x0, - gdouble y0, - gdouble radius_x, - gdouble radius_y, - gdouble angle); -gboolean gimp_path_import_from_file (GimpImage *image, - GFile *file, - gboolean merge, - gboolean scale, - gint *num_paths, - GimpPath ***path); -gboolean gimp_path_import_from_string (GimpImage *image, - const gchar *string, - gint length, - gboolean merge, - gboolean scale, - gint *num_paths, - GimpPath ***path); -gboolean gimp_path_export_to_file (GimpImage *image, - GFile *file, - GimpPath *path); -gchar* gimp_path_export_to_string (GimpImage *image, - GimpPath *path); +GimpPath* gimp_path_new (GimpImage *image, + const gchar *name); +GimpPath* gimp_path_new_from_text_layer (GimpImage *image, + GimpLayer *layer); +GimpPath* gimp_path_copy (GimpPath *path); +gint* gimp_path_get_strokes (GimpPath *path, + gint *num_strokes); +gdouble gimp_path_stroke_get_length (GimpPath *path, + gint stroke_id, + gdouble precision); +gboolean gimp_path_stroke_get_point_at_dist (GimpPath *path, + gint stroke_id, + gdouble dist, + gdouble precision, + gdouble *x_point, + gdouble *y_point, + gdouble *slope, + gboolean *valid); +gboolean gimp_path_remove_stroke (GimpPath *path, + gint stroke_id); +gboolean gimp_path_stroke_close (GimpPath *path, + gint stroke_id); +gboolean gimp_path_stroke_reverse (GimpPath *path, + gint stroke_id); +gboolean gimp_path_stroke_translate (GimpPath *path, + gint stroke_id, + gdouble off_x, + gdouble off_y); +gboolean gimp_path_stroke_scale (GimpPath *path, + gint stroke_id, + gdouble scale_x, + gdouble scale_y); +gboolean gimp_path_stroke_rotate (GimpPath *path, + gint stroke_id, + gdouble center_x, + gdouble center_y, + gdouble angle); +gboolean gimp_path_stroke_flip (GimpPath *path, + gint stroke_id, + GimpOrientationType flip_type, + gdouble axis); +gboolean gimp_path_stroke_flip_free (GimpPath *path, + gint stroke_id, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +GimpPathStrokeType gimp_path_stroke_get_points (GimpPath *path, + gint stroke_id, + gint *num_points, + gdouble **controlpoints, + gboolean *closed); +gint gimp_path_stroke_new_from_points (GimpPath *path, + GimpPathStrokeType type, + gint num_points, + const gdouble *controlpoints, + gboolean closed); +gdouble* gimp_path_stroke_interpolate (GimpPath *path, + gint stroke_id, + gdouble precision, + gint *num_coords, + gboolean *closed); +gint gimp_path_bezier_stroke_new_moveto (GimpPath *path, + gdouble x0, + gdouble y0); +gboolean gimp_path_bezier_stroke_lineto (GimpPath *path, + gint stroke_id, + gdouble x0, + gdouble y0); +gboolean gimp_path_bezier_stroke_conicto (GimpPath *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1); +gboolean gimp_path_bezier_stroke_cubicto (GimpPath *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +gint gimp_path_bezier_stroke_new_ellipse (GimpPath *path, + gdouble x0, + gdouble y0, + gdouble radius_x, + gdouble radius_y, + gdouble angle); +gboolean gimp_path_import_from_file (GimpImage *image, + GFile *file, + gboolean merge, + gboolean scale, + gint *num_paths, + GimpPath ***path); +gboolean gimp_path_import_from_string (GimpImage *image, + const gchar *string, + gint length, + gboolean merge, + gboolean scale, + gint *num_paths, + GimpPath ***path); +gboolean gimp_path_export_to_file (GimpImage *image, + GFile *file, + GimpPath *path); +gchar* gimp_path_export_to_string (GimpImage *image, + GimpPath *path); G_END_DECLS diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def index 0ca356fc7a..4397fc14b7 100644 --- a/libgimpbase/gimpbase.def +++ b/libgimpbase/gimpbase.def @@ -154,6 +154,7 @@ EXPORTS gimp_path_free gimp_path_get_user_writable_dir gimp_path_parse + gimp_path_stroke_type_get_type gimp_path_to_str gimp_pdb_error_handler_get_type gimp_pdb_proc_type_get_type @@ -246,7 +247,6 @@ EXPORTS gimp_value_take_float_array gimp_value_take_int32_array gimp_value_take_object_array - gimp_vectors_stroke_type_get_type gimp_wire_clear_error gimp_wire_destroy gimp_wire_error diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c index e23593c151..518a2c3f12 100644 --- a/libgimpbase/gimpbaseenums.c +++ b/libgimpbase/gimpbaseenums.c @@ -1898,17 +1898,17 @@ gimp_transform_resize_get_type (void) } GType -gimp_vectors_stroke_type_get_type (void) +gimp_path_stroke_type_get_type (void) { 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 } }; 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 } }; @@ -1916,9 +1916,9 @@ gimp_vectors_stroke_type_get_type (void) 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_context (type, "vectors-stroke-type"); + gimp_type_set_translation_context (type, "path-stroke-type"); gimp_enum_set_value_descriptions (type, descs); } diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h index 6d9ccf0d13..72f4ab63ac 100644 --- a/libgimpbase/gimpbaseenums.h +++ b/libgimpbase/gimpbaseenums.h @@ -1306,19 +1306,19 @@ typedef enum /*< skip >*/ /** - * GimpVectorsStrokeType: - * @GIMP_VECTORS_STROKE_TYPE_BEZIER: A bezier stroke + * GimpPathStrokeType: + * @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 { - GIMP_VECTORS_STROKE_TYPE_BEZIER -} GimpVectorsStrokeType; + GIMP_PATH_STROKE_TYPE_BEZIER +} GimpPathStrokeType; G_END_DECLS diff --git a/pdb/README_NEW_PDB_PROC b/pdb/README_NEW_PDB_PROC index 04f2d46e5f..d04c8ae0f9 100644 --- a/pdb/README_NEW_PDB_PROC +++ b/pdb/README_NEW_PDB_PROC @@ -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 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+ -of +vectors_stroke_get_points+ from -https://gitlab.gnome.org/GNOME/gimp/tree/master/pdb/groups/vectors.pdb[pdb/groups/vectors.pdb]: +of +path_stroke_get_points+ from +https://gitlab.gnome.org/GNOME/gimp/tree/master/pdb/groups/path.pdb[pdb/groups/path.pdb]: [source,perl] ---- @outargs = ( - { name => 'type', type => 'enum GimpVectorsStrokeType', - desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, + { name => 'type', type => 'enum GimpPathStrokeType', + desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' }, { name => 'controlpoints', type => 'floatarray', desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).', array => { name => 'num_points', diff --git a/pdb/enums.pl b/pdb/enums.pl index abeb2eeef7..ace0d65539 100644 --- a/pdb/enums.pl +++ b/pdb/enums.pl @@ -630,11 +630,11 @@ package Gimp::CodeGen::enums; GIMP_UNIT_PICA => '4', GIMP_UNIT_END => '5' } }, - GimpVectorsStrokeType => + GimpPathStrokeType => { contig => 1, header => 'libgimpbase/gimpbaseenums.h', - symbols => [ qw(GIMP_VECTORS_STROKE_TYPE_BEZIER) ], - mapping => { GIMP_VECTORS_STROKE_TYPE_BEZIER => '0' } + symbols => [ qw(GIMP_PATH_STROKE_TYPE_BEZIER) ], + mapping => { GIMP_PATH_STROKE_TYPE_BEZIER => '0' } }, GimpColorManagementMode => { contig => 1, diff --git a/pdb/groups/path.pdb b/pdb/groups/path.pdb index c680a75f5a..fceacc61e6 100644 --- a/pdb/groups/path.pdb +++ b/pdb/groups/path.pdb @@ -633,8 +633,8 @@ HELP ); @outargs = ( - { name => 'type', type => 'enum GimpVectorsStrokeType', - desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, + { name => 'type', type => 'enum GimpPathStrokeType', + desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' }, { name => 'controlpoints', type => 'floatarray', desc => 'List of the control points for the stroke (x0, y0, x1, y1, ...).', array => { name => 'num_points', @@ -660,7 +660,7 @@ HELP num_points = points_array->len; 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++) { controlpoints[2*i] = g_array_index (points_array, @@ -751,7 +751,7 @@ sub path_stroke_new_from_points { $help = <<'HELP'; 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. +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 @@ -764,8 +764,8 @@ HELP @inargs = ( { name => 'path', type => 'path', desc => 'The path object' }, - { name => 'type', type => 'enum GimpVectorsStrokeType', - desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, + { name => 'type', type => 'enum GimpPathStrokeType', + desc => 'type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now).' }, { name => 'controlpoints', type => 'floatarray', desc => 'List of the x- and y-coordinates of the control points.', array => { name => 'num_points', @@ -791,7 +791,7 @@ HELP success = FALSE; - if (type == GIMP_VECTORS_STROKE_TYPE_BEZIER && + if (type == GIMP_PATH_STROKE_TYPE_BEZIER && num_points % 6 == 0) { coords = g_new (GimpCoords, num_points/2); diff --git a/plug-ins/file-psd/psd-export.c b/plug-ins/file-psd/psd-export.c index f66163b1e0..4da65c53b4 100644 --- a/plug-ins/file-psd/psd-export.c +++ b/plug-ins/file-psd/psd-export.c @@ -1225,17 +1225,17 @@ save_paths (GOutputStream *output, for (s = 0; s < num_strokes; s++) { - GimpVectorsStrokeType type; - gdouble *points; - gint num_points; - gboolean closed; - gint p = 0; + GimpPathStrokeType type; + gdouble *points; + gint num_points; + gboolean closed; + gint p = 0; type = gimp_path_stroke_get_points (iter->data, strokes[s], &num_points, &points, &closed); - if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || - num_points > 65535 || + if (type != GIMP_PATH_STROKE_TYPE_BEZIER || + num_points > 65535 || num_points % 6) { g_printerr ("psd-export: unsupported stroke type: " diff --git a/plug-ins/file-psd/psd-image-res-load.c b/plug-ins/file-psd/psd-image-res-load.c index c6a9c7b0e3..982411a4e5 100644 --- a/plug-ins/file-psd/psd-image-res-load.c +++ b/plug-ins/file-psd/psd-image-res-load.c @@ -1704,7 +1704,7 @@ load_resource_2000 (const PSDimageres *res_a, } /* Add sub-path */ gimp_path_stroke_new_from_points (path, - GIMP_VECTORS_STROKE_TYPE_BEZIER, + GIMP_PATH_STROKE_TYPE_BEZIER, cntr, controlpoints, closed); g_free (controlpoints); } diff --git a/plug-ins/file-tiff/file-tiff-export.c b/plug-ins/file-tiff/file-tiff-export.c index 7cf9cb1724..2d81f68b68 100644 --- a/plug-ins/file-tiff/file-tiff-export.c +++ b/plug-ins/file-tiff/file-tiff-export.c @@ -183,17 +183,17 @@ save_paths (TIFF *tif, for (s = 0; s < num_strokes; s++) { - GimpVectorsStrokeType type; - gdouble *points; - gint num_points; - gboolean closed; - gint p = 0; + GimpPathStrokeType type; + gdouble *points; + gint num_points; + gboolean closed; + gint p = 0; type = gimp_path_stroke_get_points (iter->data, strokes[s], &num_points, &points, &closed); - if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || - num_points > 65535 || + if (type != GIMP_PATH_STROKE_TYPE_BEZIER || + num_points > 65535 || num_points % 6) { g_printerr ("tiff-export: unsupported stroke type: "