From b90b6bce000798d103cb97a37b8da37553940b72 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Mon, 8 Jul 2024 23:39:51 +0000 Subject: [PATCH] pdb, libgimp: Rename libgimp GimpVectors vectors API... ...to paths Follow-up to d0bdbdfd. Changes all gimp_vectors_* () PDB to gimp_path_* () and renames relevant PDB files from vectors to path. The next step will be to rename GimpVectors in libgimp to GimpPath, removing the last (public) trace of it. --- app/pdb/gimppdb-utils.c | 20 +- app/pdb/gimppdb-utils.h | 2 +- app/pdb/internal-procs.c | 2 +- app/pdb/internal-procs.h | 2 +- app/pdb/item-cmds.c | 122 +- app/pdb/meson.build | 2 +- app/pdb/{vectors-cmds.c => path-cmds.c} | 1306 ++++++++--------- libgimp/gimp.def | 70 +- libgimp/gimp_pdb_headers.h | 2 +- libgimp/gimpitem.c | 12 +- libgimp/gimpitem.h | 2 +- libgimp/gimpitem_pdb.c | 72 +- libgimp/gimpitem_pdb.h | 2 +- libgimp/{gimpvectors_pdb.c => gimppath_pdb.c} | 520 +++---- libgimp/gimppath_pdb.h | 146 ++ libgimp/gimpplugin.c | 2 +- libgimp/gimpvectors_pdb.h | 146 -- libgimp/meson.build | 4 +- pdb/groups.pl | 2 +- pdb/groups/item.pdb | 34 +- pdb/groups/{vectors.pdb => path.pdb} | 560 +++---- pdb/meson.build | 2 +- plug-ins/common/file-svg.c | 14 +- plug-ins/file-psd/psd-export.c | 16 +- plug-ins/file-psd/psd-image-res-load.c | 14 +- plug-ins/file-tiff/file-tiff-export.c | 16 +- .../selection-to-path/selection-to-path.c | 36 +- 27 files changed, 1564 insertions(+), 1564 deletions(-) rename app/pdb/{vectors-cmds.c => path-cmds.c} (76%) rename libgimp/{gimpvectors_pdb.c => gimppath_pdb.c} (66%) create mode 100644 libgimp/gimppath_pdb.h delete mode 100644 libgimp/gimpvectors_pdb.h rename pdb/groups/{vectors.pdb => path.pdb} (66%) diff --git a/app/pdb/gimppdb-utils.c b/app/pdb/gimppdb-utils.c index b739e09863..873e6b55b3 100644 --- a/app/pdb/gimppdb-utils.c +++ b/app/pdb/gimppdb-utils.c @@ -789,28 +789,28 @@ gimp_pdb_image_get_sample_point (GimpImage *image, } GimpStroke * -gimp_pdb_get_vectors_stroke (GimpVectors *vectors, - gint stroke_id, - GimpPDBItemModify modify, - GError **error) +gimp_pdb_get_path_stroke (GimpVectors *path, + gint stroke_id, + GimpPDBItemModify modify, + GError **error) { GimpStroke *stroke = NULL; - g_return_val_if_fail (GIMP_IS_VECTORS (vectors), NULL); + g_return_val_if_fail (GIMP_IS_VECTORS (path), NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); - if (! gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error)) + if (! gimp_pdb_item_is_not_group (GIMP_ITEM (path), error)) return NULL; - if (! modify || gimp_pdb_item_is_modifiable (GIMP_ITEM (vectors), + if (! modify || gimp_pdb_item_is_modifiable (GIMP_ITEM (path), modify, error)) { - stroke = gimp_vectors_stroke_get_by_id (vectors, stroke_id); + stroke = gimp_vectors_stroke_get_by_id (path, stroke_id); if (! stroke) g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, - _("Vectors object %d does not contain stroke with ID %d"), - gimp_item_get_id (GIMP_ITEM (vectors)), stroke_id); + _("Path object %d does not contain stroke with ID %d"), + gimp_item_get_id (GIMP_ITEM (path)), stroke_id); } return stroke; diff --git a/app/pdb/gimppdb-utils.h b/app/pdb/gimppdb-utils.h index bb672d000d..3958d0229a 100644 --- a/app/pdb/gimppdb-utils.h +++ b/app/pdb/gimppdb-utils.h @@ -102,7 +102,7 @@ GimpSamplePoint * gimp_pdb_image_get_sample_point (GimpImage *image, gint sample_point_id, GError **error); -GimpStroke * gimp_pdb_get_vectors_stroke (GimpVectors *vectors, +GimpStroke * gimp_pdb_get_path_stroke (GimpVectors *path, gint stroke_id, GimpPDBItemModify modify, GError **error); diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c index 725ef3de8a..4ec21cd53f 100644 --- a/app/pdb/internal-procs.c +++ b/app/pdb/internal-procs.c @@ -80,6 +80,7 @@ internal_procs_init (GimpPDB *pdb) register_palette_procs (pdb); register_palette_select_procs (pdb); register_palettes_procs (pdb); + register_path_procs (pdb); register_pattern_procs (pdb); register_pattern_select_procs (pdb); register_patterns_procs (pdb); @@ -92,5 +93,4 @@ internal_procs_init (GimpPDB *pdb) register_text_layer_procs (pdb); register_text_tool_procs (pdb); register_unit_procs (pdb); - register_vectors_procs (pdb); } diff --git a/app/pdb/internal-procs.h b/app/pdb/internal-procs.h index b6826d3aa5..034325ea93 100644 --- a/app/pdb/internal-procs.h +++ b/app/pdb/internal-procs.h @@ -67,6 +67,7 @@ void register_paint_tools_procs (GimpPDB *pdb); void register_palette_procs (GimpPDB *pdb); void register_palette_select_procs (GimpPDB *pdb); void register_palettes_procs (GimpPDB *pdb); +void register_path_procs (GimpPDB *pdb); void register_pattern_procs (GimpPDB *pdb); void register_pattern_select_procs (GimpPDB *pdb); void register_patterns_procs (GimpPDB *pdb); @@ -79,6 +80,5 @@ void register_selection_procs (GimpPDB *pdb); void register_text_layer_procs (GimpPDB *pdb); void register_text_tool_procs (GimpPDB *pdb); void register_unit_procs (GimpPDB *pdb); -void register_vectors_procs (GimpPDB *pdb); #endif /* __INTERNAL_PROCS_H__ */ diff --git a/app/pdb/item-cmds.c b/app/pdb/item-cmds.c index 61021bd7ac..d9fe0b165d 100644 --- a/app/pdb/item-cmds.c +++ b/app/pdb/item-cmds.c @@ -274,6 +274,38 @@ item_id_is_layer_mask_invoker (GimpProcedure *procedure, return return_vals; } +static GimpValueArray * +item_id_is_path_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpValueArray *return_vals; + gint item_id; + gboolean path = FALSE; + + item_id = g_value_get_int (gimp_value_array_index (args, 0)); + + if (success) + { + GimpItem *item = gimp_item_get_by_id (gimp, item_id); + + path = (GIMP_IS_VECTORS (item) && + ! gimp_item_is_removed (item)); + } + + return_vals = gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); + + if (success) + g_value_set_boolean (gimp_value_array_index (return_vals, 1), path); + + return return_vals; +} + static GimpValueArray * item_id_is_selection_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -306,38 +338,6 @@ item_id_is_selection_invoker (GimpProcedure *procedure, return return_vals; } -static GimpValueArray * -item_id_is_vectors_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpValueArray *return_vals; - gint item_id; - gboolean vectors = FALSE; - - item_id = g_value_get_int (gimp_value_array_index (args, 0)); - - if (success) - { - GimpItem *item = gimp_item_get_by_id (gimp, item_id); - - vectors = (GIMP_IS_VECTORS (item) && - ! gimp_item_is_removed (item)); - } - - return_vals = gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); - - if (success) - g_value_set_boolean (gimp_value_array_index (return_vals, 1), vectors); - - return return_vals; -} - static GimpValueArray * item_get_image_invoker (GimpProcedure *procedure, Gimp *gimp, @@ -1264,6 +1264,35 @@ register_item_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); + /* + * gimp-item-id-is-path + */ + procedure = gimp_procedure_new (item_id_is_path_invoker); + gimp_object_set_static_name (GIMP_OBJECT (procedure), + "gimp-item-id-is-path"); + gimp_procedure_set_static_help (procedure, + "Returns whether the item ID is a path.", + "This procedure returns TRUE if the specified item ID is a path.", + NULL); + gimp_procedure_set_static_attribution (procedure, + "Spencer Kimball & Peter Mattis", + "Spencer Kimball & Peter Mattis", + "1995-1996"); + gimp_procedure_add_argument (procedure, + g_param_spec_int ("item-id", + "item id", + "The item ID", + G_MININT32, G_MAXINT32, 0, + GIMP_PARAM_READWRITE)); + gimp_procedure_add_return_value (procedure, + g_param_spec_boolean ("path", + "path", + "TRUE if the item ID is a path, FALSE otherwise", + FALSE, + GIMP_PARAM_READWRITE)); + gimp_pdb_register_procedure (pdb, procedure); + g_object_unref (procedure); + /* * gimp-item-id-is-selection */ @@ -1293,35 +1322,6 @@ register_item_procs (GimpPDB *pdb) gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); - /* - * gimp-item-id-is-vectors - */ - procedure = gimp_procedure_new (item_id_is_vectors_invoker); - gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-item-id-is-vectors"); - gimp_procedure_set_static_help (procedure, - "Returns whether the item ID is a vectors.", - "This procedure returns TRUE if the specified item ID is a vectors.", - NULL); - gimp_procedure_set_static_attribution (procedure, - "Spencer Kimball & Peter Mattis", - "Spencer Kimball & Peter Mattis", - "1995-1996"); - gimp_procedure_add_argument (procedure, - g_param_spec_int ("item-id", - "item id", - "The item ID", - G_MININT32, G_MAXINT32, 0, - GIMP_PARAM_READWRITE)); - gimp_procedure_add_return_value (procedure, - g_param_spec_boolean ("vectors", - "vectors", - "TRUE if the item ID is a vectors, FALSE otherwise", - FALSE, - GIMP_PARAM_READWRITE)); - gimp_pdb_register_procedure (pdb, procedure); - g_object_unref (procedure); - /* * gimp-item-get-image */ diff --git a/app/pdb/meson.build b/app/pdb/meson.build index bc0852bef4..e2aa6dcbb0 100644 --- a/app/pdb/meson.build +++ b/app/pdb/meson.build @@ -52,6 +52,7 @@ libappinternalprocs_sources = [ 'palette-cmds.c', 'palette-select-cmds.c', 'palettes-cmds.c', + 'path-cmds.c', 'pattern-cmds.c', 'pattern-select-cmds.c', 'patterns-cmds.c', @@ -64,7 +65,6 @@ libappinternalprocs_sources = [ 'text-layer-cmds.c', 'text-tool-cmds.c', 'unit-cmds.c', - 'vectors-cmds.c', ] libapppdb = static_library('apppdb', diff --git a/app/pdb/vectors-cmds.c b/app/pdb/path-cmds.c similarity index 76% rename from app/pdb/vectors-cmds.c rename to app/pdb/path-cmds.c index 826cfb7485..151564213a 100644 --- a/app/pdb/vectors-cmds.c +++ b/app/pdb/path-cmds.c @@ -54,49 +54,49 @@ static GimpValueArray * -vectors_new_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_new_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; const gchar *name; - GimpVectors *vectors = NULL; + GimpVectors *path = NULL; image = g_value_get_object (gimp_value_array_index (args, 0)); name = g_value_get_string (gimp_value_array_index (args, 1)); if (success) { - vectors = gimp_vectors_new (image, name); + path = gimp_vectors_new (image, name); } return_vals = gimp_procedure_get_return_values (procedure, success, error ? *error : NULL); if (success) - g_value_set_object (gimp_value_array_index (return_vals, 1), vectors); + g_value_set_object (gimp_value_array_index (return_vals, 1), path); return return_vals; } static GimpValueArray * -vectors_new_from_text_layer_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_new_from_text_layer_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; GimpLayer *layer; - GimpVectors *vectors = NULL; + GimpVectors *path = NULL; image = g_value_get_object (gimp_value_array_index (args, 0)); layer = g_value_get_object (gimp_value_array_index (args, 1)); @@ -107,11 +107,11 @@ vectors_new_from_text_layer_invoker (GimpProcedure *procedure, { gint x, y; - vectors = gimp_text_vectors_new (image, + path = gimp_text_vectors_new (image, gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer))); gimp_item_get_offset (GIMP_ITEM (layer), &x, &y); - gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE); + gimp_item_translate (GIMP_ITEM (path), x, y, FALSE); } else { @@ -123,32 +123,32 @@ vectors_new_from_text_layer_invoker (GimpProcedure *procedure, error ? *error : NULL); if (success) - g_value_set_object (gimp_value_array_index (return_vals, 1), vectors); + g_value_set_object (gimp_value_array_index (return_vals, 1), path); return return_vals; } static GimpValueArray * -vectors_copy_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_copy_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; - GimpVectors *vectors_copy = NULL; + GimpVectors *path; + GimpVectors *path_copy = NULL; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); if (success) { - vectors_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors), - G_TYPE_FROM_INSTANCE (vectors))); + path_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (path), + G_TYPE_FROM_INSTANCE (path))); - if (! vectors_copy) + if (! path_copy) success = FALSE; } @@ -156,30 +156,30 @@ vectors_copy_invoker (GimpProcedure *procedure, error ? *error : NULL); if (success) - g_value_set_object (gimp_value_array_index (return_vals, 1), vectors_copy); + g_value_set_object (gimp_value_array_index (return_vals, 1), path_copy); return return_vals; } static GimpValueArray * -vectors_get_strokes_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_get_strokes_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint num_strokes = 0; gint32 *stroke_ids = NULL; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); if (success) { - num_strokes = gimp_vectors_get_n_strokes (vectors); + num_strokes = gimp_vectors_get_n_strokes (path); if (num_strokes) { @@ -188,9 +188,9 @@ vectors_get_strokes_invoker (GimpProcedure *procedure, stroke_ids = g_new (gint32, num_strokes); - for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); + for (cur_stroke = gimp_vectors_stroke_get_next (path, NULL); cur_stroke; - cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke)) + cur_stroke = gimp_vectors_stroke_get_next (path, cur_stroke)) { stroke_ids[i] = gimp_stroke_get_id (cur_stroke); i++; @@ -211,27 +211,27 @@ vectors_get_strokes_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_get_length_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_get_length_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble precision; gdouble length = 0.0; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); precision = g_value_get_double (gimp_value_array_index (args, 2)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) length = gimp_stroke_get_length (stroke, precision); @@ -249,16 +249,16 @@ vectors_stroke_get_length_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_get_point_at_dist_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble dist; gdouble precision; @@ -267,14 +267,14 @@ vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure, gdouble slope = 0.0; gboolean valid = FALSE; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); dist = g_value_get_double (gimp_value_array_index (args, 2)); precision = g_value_get_double (gimp_value_array_index (args, 3)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) { @@ -304,33 +304,33 @@ vectors_stroke_get_point_at_dist_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_remove_stroke_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_remove_stroke_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Remove path stroke"), - vectors); + path); - gimp_vectors_stroke_remove (vectors, stroke); + gimp_vectors_stroke_remove (path, stroke); } else success = FALSE; @@ -341,35 +341,35 @@ vectors_remove_stroke_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_close_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_close_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Close path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_close (stroke); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -380,183 +380,7 @@ vectors_stroke_close_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_reverse_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpVectors *vectors; - gint stroke_id; - - vectors = g_value_get_object (gimp_value_array_index (args, 0)); - stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); - - if (success) - { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); - - if (stroke) - { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), - _("Reverse path stroke"), - vectors); - - gimp_vectors_freeze (vectors); - gimp_stroke_reverse (stroke); - gimp_vectors_thaw (vectors); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -vectors_stroke_translate_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpVectors *vectors; - gint stroke_id; - gdouble off_x; - gdouble off_y; - - vectors = g_value_get_object (gimp_value_array_index (args, 0)); - stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); - off_x = g_value_get_double (gimp_value_array_index (args, 2)); - off_y = g_value_get_double (gimp_value_array_index (args, 3)); - - if (success) - { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); - - if (stroke) - { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), - _("Translate path stroke"), - vectors); - - gimp_vectors_freeze (vectors); - gimp_stroke_translate (stroke, off_x, off_y); - gimp_vectors_thaw (vectors); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -vectors_stroke_scale_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpVectors *vectors; - gint stroke_id; - gdouble scale_x; - gdouble scale_y; - - vectors = g_value_get_object (gimp_value_array_index (args, 0)); - stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); - scale_x = g_value_get_double (gimp_value_array_index (args, 2)); - scale_y = g_value_get_double (gimp_value_array_index (args, 3)); - - if (success) - { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); - - if (stroke) - { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), - _("Scale path stroke"), - vectors); - - gimp_vectors_freeze (vectors); - gimp_stroke_scale (stroke, scale_x, scale_y); - gimp_vectors_thaw (vectors); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -vectors_stroke_rotate_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) -{ - gboolean success = TRUE; - GimpVectors *vectors; - gint stroke_id; - gdouble center_x; - gdouble center_y; - gdouble angle; - - vectors = g_value_get_object (gimp_value_array_index (args, 0)); - stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); - center_x = g_value_get_double (gimp_value_array_index (args, 2)); - center_y = g_value_get_double (gimp_value_array_index (args, 3)); - angle = g_value_get_double (gimp_value_array_index (args, 4)); - - if (success) - { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); - - if (stroke) - { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), - _("Rotate path stroke"), - vectors); - - gimp_vectors_freeze (vectors); - gimp_stroke_rotate (stroke, center_x, center_y, angle); - gimp_vectors_thaw (vectors); - } - else - success = FALSE; - } - - return gimp_procedure_get_return_values (procedure, success, - error ? *error : NULL); -} - -static GimpValueArray * -vectors_stroke_flip_invoker (GimpProcedure *procedure, +path_stroke_reverse_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, @@ -564,33 +388,27 @@ vectors_stroke_flip_invoker (GimpProcedure *procedure, GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; - gint flip_type; - gdouble axis; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); - flip_type = g_value_get_enum (gimp_value_array_index (args, 2)); - axis = g_value_get_double (gimp_value_array_index (args, 3)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), - _("Flip path stroke"), - vectors); + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), + _("Reverse path stroke"), + path); - gimp_vectors_freeze (vectors); - gimp_stroke_flip (stroke, flip_type, axis); - gimp_vectors_thaw (vectors); + gimp_vectors_freeze (path); + gimp_stroke_reverse (stroke); + gimp_vectors_thaw (path); } else success = FALSE; @@ -601,22 +419,204 @@ vectors_stroke_flip_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_flip_free_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_translate_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; + gint stroke_id; + gdouble off_x; + gdouble off_y; + + path = g_value_get_object (gimp_value_array_index (args, 0)); + stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); + off_x = g_value_get_double (gimp_value_array_index (args, 2)); + off_y = g_value_get_double (gimp_value_array_index (args, 3)); + + if (success) + { + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); + + if (stroke) + { + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), + _("Translate path stroke"), + path); + + gimp_vectors_freeze (path); + gimp_stroke_translate (stroke, off_x, off_y); + gimp_vectors_thaw (path); + } + else + success = FALSE; + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +path_stroke_scale_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpVectors *path; + gint stroke_id; + gdouble scale_x; + gdouble scale_y; + + path = g_value_get_object (gimp_value_array_index (args, 0)); + stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); + scale_x = g_value_get_double (gimp_value_array_index (args, 2)); + scale_y = g_value_get_double (gimp_value_array_index (args, 3)); + + if (success) + { + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); + + if (stroke) + { + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), + _("Scale path stroke"), + path); + + gimp_vectors_freeze (path); + gimp_stroke_scale (stroke, scale_x, scale_y); + gimp_vectors_thaw (path); + } + else + success = FALSE; + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +path_stroke_rotate_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpVectors *path; + gint stroke_id; + gdouble center_x; + gdouble center_y; + gdouble angle; + + path = g_value_get_object (gimp_value_array_index (args, 0)); + stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); + center_x = g_value_get_double (gimp_value_array_index (args, 2)); + center_y = g_value_get_double (gimp_value_array_index (args, 3)); + angle = g_value_get_double (gimp_value_array_index (args, 4)); + + if (success) + { + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); + + if (stroke) + { + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), + _("Rotate path stroke"), + path); + + gimp_vectors_freeze (path); + gimp_stroke_rotate (stroke, center_x, center_y, angle); + gimp_vectors_thaw (path); + } + else + success = FALSE; + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +path_stroke_flip_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpVectors *path; + gint stroke_id; + gint flip_type; + gdouble axis; + + path = g_value_get_object (gimp_value_array_index (args, 0)); + stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); + flip_type = g_value_get_enum (gimp_value_array_index (args, 2)); + axis = g_value_get_double (gimp_value_array_index (args, 3)); + + if (success) + { + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); + + if (stroke) + { + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), + _("Flip path stroke"), + path); + + gimp_vectors_freeze (path); + gimp_stroke_flip (stroke, flip_type, axis); + gimp_vectors_thaw (path); + } + else + success = FALSE; + } + + return gimp_procedure_get_return_values (procedure, success, + error ? *error : NULL); +} + +static GimpValueArray * +path_stroke_flip_free_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) +{ + gboolean success = TRUE; + GimpVectors *path; gint stroke_id; gdouble x1; gdouble y1; gdouble x2; gdouble y2; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); x1 = g_value_get_double (gimp_value_array_index (args, 2)); y1 = g_value_get_double (gimp_value_array_index (args, 3)); @@ -625,21 +625,21 @@ vectors_stroke_flip_free_invoker (GimpProcedure *procedure, if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Flip path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_flip_free (stroke, x1, y1, x2, y2); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -650,28 +650,28 @@ vectors_stroke_flip_free_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_get_points_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_get_points_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gint type = 0; gint num_points = 0; gdouble *controlpoints = NULL; gboolean closed = FALSE; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (GIMP_IS_BEZIER_STROKE (stroke)) { @@ -718,23 +718,23 @@ vectors_stroke_get_points_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_new_from_points_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_new_from_points_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint type; gint num_points; const gdouble *controlpoints; gboolean closed; gint stroke_id = 0; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); type = g_value_get_enum (gimp_value_array_index (args, 1)); num_points = g_value_get_int (gimp_value_array_index (args, 2)); controlpoints = gimp_value_get_float_array (gimp_value_array_index (args, 3)); @@ -763,12 +763,12 @@ vectors_stroke_new_from_points_invoker (GimpProcedure *procedure, stroke = gimp_stroke_new_from_coords (type, coords, num_points/2, closed); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -790,29 +790,29 @@ vectors_stroke_new_from_points_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_stroke_interpolate_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_stroke_interpolate_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble precision; gint num_coords = 0; gdouble *coords = NULL; gboolean closed = FALSE; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); precision = g_value_get_double (gimp_value_array_index (args, 2)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) { @@ -855,29 +855,29 @@ vectors_stroke_interpolate_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gdouble x0; gdouble y0; gint stroke_id = 0; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); x0 = g_value_get_double (gimp_value_array_index (args, 1)); y0 = g_value_get_double (gimp_value_array_index (args, 2)); if (success) { - if (gimp_pdb_item_is_modifiable (GIMP_ITEM (vectors), + if (gimp_pdb_item_is_modifiable (GIMP_ITEM (path), GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error)) + gimp_pdb_item_is_not_group (GIMP_ITEM (path), error)) { GimpStroke *stroke; GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES; @@ -887,12 +887,12 @@ vectors_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure, stroke = gimp_bezier_stroke_new_moveto (&coord0); - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -911,28 +911,28 @@ vectors_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_bezier_stroke_lineto_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_bezier_stroke_lineto_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble x0; gdouble y0; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); x0 = g_value_get_double (gimp_value_array_index (args, 2)); y0 = g_value_get_double (gimp_value_array_index (args, 3)); if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -941,14 +941,14 @@ vectors_bezier_stroke_lineto_invoker (GimpProcedure *procedure, coord0.x = x0; coord0.y = y0; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_lineto (stroke, &coord0); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -959,22 +959,22 @@ vectors_bezier_stroke_lineto_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_bezier_stroke_conicto_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble x0; gdouble y0; gdouble x1; gdouble y1; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); x0 = g_value_get_double (gimp_value_array_index (args, 2)); y0 = g_value_get_double (gimp_value_array_index (args, 3)); @@ -983,8 +983,8 @@ vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure, if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -997,14 +997,14 @@ vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure, coord1.x = x1; coord1.y = y1; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -1015,15 +1015,15 @@ vectors_bezier_stroke_conicto_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; - GimpVectors *vectors; + GimpVectors *path; gint stroke_id; gdouble x0; gdouble y0; @@ -1032,7 +1032,7 @@ vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, gdouble x2; gdouble y2; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); stroke_id = g_value_get_int (gimp_value_array_index (args, 1)); x0 = g_value_get_double (gimp_value_array_index (args, 2)); y0 = g_value_get_double (gimp_value_array_index (args, 3)); @@ -1043,8 +1043,8 @@ vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, if (success) { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -1061,14 +1061,14 @@ vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, coord2.x = x2; coord2.y = y2; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -1079,16 +1079,16 @@ vectors_bezier_stroke_cubicto_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; - GimpVectors *vectors; + GimpVectors *path; gdouble x0; gdouble y0; gdouble radius_x; @@ -1096,7 +1096,7 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, gdouble angle; gint stroke_id = 0; - vectors = g_value_get_object (gimp_value_array_index (args, 0)); + path = g_value_get_object (gimp_value_array_index (args, 0)); x0 = g_value_get_double (gimp_value_array_index (args, 1)); y0 = g_value_get_double (gimp_value_array_index (args, 2)); radius_x = g_value_get_double (gimp_value_array_index (args, 3)); @@ -1105,9 +1105,9 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, if (success) { - if (gimp_pdb_item_is_modifiable (GIMP_ITEM (vectors), + if (gimp_pdb_item_is_modifiable (GIMP_ITEM (path), GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error)) + gimp_pdb_item_is_not_group (GIMP_ITEM (path), error)) { GimpStroke *stroke; GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES; @@ -1117,12 +1117,12 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -1141,12 +1141,12 @@ vectors_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_import_from_file_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_import_from_file_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; @@ -1154,8 +1154,8 @@ vectors_import_from_file_invoker (GimpProcedure *procedure, GFile *file; gboolean merge; gboolean scale; - gint num_vectors = 0; - GimpVectors **vectors = NULL; + gint num_paths = 0; + GimpVectors **path = NULL; image = g_value_get_object (gimp_value_array_index (args, 0)); file = g_value_get_object (gimp_value_array_index (args, 1)); @@ -1164,32 +1164,32 @@ vectors_import_from_file_invoker (GimpProcedure *procedure, if (success) { - GList *vectors_list = NULL; + GList *path_list = NULL; /* FIXME tree */ success = gimp_vectors_import_file (image, file, merge, scale, NULL, -1, - &vectors_list, error); + &path_list, error); if (success) { - num_vectors = g_list_length (vectors_list); + num_paths = g_list_length (path_list); - if (num_vectors) + if (num_paths) { GList *list; gint i; - vectors = g_new (GimpVectors *, num_vectors); + path = g_new (GimpVectors *, num_paths); - for (i = 0, list = vectors_list; - i < num_vectors; + for (i = 0, list = path_list; + i < num_paths; i++, list = g_list_next (list)) { - vectors[i] = g_object_ref (list->data); + path[i] = g_object_ref (list->data); } - g_list_free (vectors_list); + g_list_free (path_list); } } } @@ -1199,20 +1199,20 @@ vectors_import_from_file_invoker (GimpProcedure *procedure, if (success) { - g_value_set_int (gimp_value_array_index (return_vals, 1), num_vectors); - gimp_value_take_object_array (gimp_value_array_index (return_vals, 2), GIMP_TYPE_VECTORS, (GObject **) vectors, num_vectors); + g_value_set_int (gimp_value_array_index (return_vals, 1), num_paths); + gimp_value_take_object_array (gimp_value_array_index (return_vals, 2), GIMP_TYPE_VECTORS, (GObject **) path, num_paths); } return return_vals; } static GimpValueArray * -vectors_import_from_string_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_import_from_string_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; @@ -1221,8 +1221,8 @@ vectors_import_from_string_invoker (GimpProcedure *procedure, gint length; gboolean merge; gboolean scale; - gint num_vectors = 0; - GimpVectors **vectors = NULL; + gint num_paths = 0; + GimpVectors **path = NULL; image = g_value_get_object (gimp_value_array_index (args, 0)); string = g_value_get_string (gimp_value_array_index (args, 1)); @@ -1232,32 +1232,32 @@ vectors_import_from_string_invoker (GimpProcedure *procedure, if (success) { - GList *vectors_list = NULL; + GList *path_list = NULL; /* FIXME tree */ success = gimp_vectors_import_buffer (image, string, length, merge, scale, NULL, -1, - &vectors_list, error); + &path_list, error); if (success) { - num_vectors = g_list_length (vectors_list); + num_paths = g_list_length (path_list); - if (num_vectors) + if (num_paths) { GList *list; gint i; - vectors = g_new (GimpVectors *, num_vectors); + path = g_new (GimpVectors *, num_paths); - for (i = 0, list = vectors_list; - i < num_vectors; + for (i = 0, list = path_list; + i < num_paths; i++, list = g_list_next (list)) { - vectors[i] = g_object_ref (list->data); + path[i] = g_object_ref (list->data); } - g_list_free (vectors_list); + g_list_free (path_list); } } } @@ -1267,40 +1267,40 @@ vectors_import_from_string_invoker (GimpProcedure *procedure, if (success) { - g_value_set_int (gimp_value_array_index (return_vals, 1), num_vectors); - gimp_value_take_object_array (gimp_value_array_index (return_vals, 2), GIMP_TYPE_VECTORS, (GObject **) vectors, num_vectors); + g_value_set_int (gimp_value_array_index (return_vals, 1), num_paths); + gimp_value_take_object_array (gimp_value_array_index (return_vals, 2), GIMP_TYPE_VECTORS, (GObject **) path, num_paths); } return return_vals; } static GimpValueArray * -vectors_export_to_file_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_export_to_file_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpImage *image; GFile *file; - GimpVectors *vectors; + GimpVectors *path; image = g_value_get_object (gimp_value_array_index (args, 0)); file = g_value_get_object (gimp_value_array_index (args, 1)); - vectors = g_value_get_object (gimp_value_array_index (args, 2)); + path = g_value_get_object (gimp_value_array_index (args, 2)); if (success) { - GList *vectors_list = NULL; + GList *path_list = NULL; - if (vectors != NULL) - vectors_list = g_list_prepend (vectors_list, vectors); + if (path != NULL) + path_list = g_list_prepend (path_list, path); - success = gimp_vectors_export_file (image, vectors_list, file, error); + success = gimp_vectors_export_file (image, path_list, file, error); - g_list_free (vectors_list); + g_list_free (path_list); } return gimp_procedure_get_return_values (procedure, success, @@ -1308,31 +1308,31 @@ vectors_export_to_file_invoker (GimpProcedure *procedure, } static GimpValueArray * -vectors_export_to_string_invoker (GimpProcedure *procedure, - Gimp *gimp, - GimpContext *context, - GimpProgress *progress, - const GimpValueArray *args, - GError **error) +path_export_to_string_invoker (GimpProcedure *procedure, + Gimp *gimp, + GimpContext *context, + GimpProgress *progress, + const GimpValueArray *args, + GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; GimpImage *image; - GimpVectors *vectors; + GimpVectors *path; gchar *string = NULL; image = g_value_get_object (gimp_value_array_index (args, 0)); - vectors = g_value_get_object (gimp_value_array_index (args, 1)); + path = g_value_get_object (gimp_value_array_index (args, 1)); if (success) { - GList *vectors_list = NULL; + GList *path_list = NULL; - if (vectors != NULL) - vectors_list = g_list_prepend (vectors_list, vectors); + if (path != NULL) + path_list = g_list_prepend (path_list, path); - string = gimp_vectors_export_string (image, vectors_list); - g_list_free (vectors_list); + string = gimp_vectors_export_string (image, path_list); + g_list_free (path_list); success = (string != NULL); } @@ -1347,19 +1347,19 @@ vectors_export_to_string_invoker (GimpProcedure *procedure, } void -register_vectors_procs (GimpPDB *pdb) +register_path_procs (GimpPDB *pdb) { GimpProcedure *procedure; /* - * gimp-vectors-new + * gimp-path-new */ - procedure = gimp_procedure_new (vectors_new_invoker); + procedure = gimp_procedure_new (path_new_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-new"); + "gimp-path-new"); gimp_procedure_set_static_help (procedure, - "Creates a new empty vectors object.", - "Creates a new empty vectors object. The vectors object needs to be added to the image using 'gimp-image-insert-vectors'.", + "Creates a new empty path object.", + "Creates a new empty path object. The path object needs to be added to the image using 'gimp-image-insert-vectors'.", NULL); gimp_procedure_set_static_attribution (procedure, "Simon Budig", @@ -1374,28 +1374,28 @@ register_vectors_procs (GimpPDB *pdb) gimp_procedure_add_argument (procedure, gimp_param_spec_string ("name", "name", - "the name of the new vector object.", + "the name of the new path object.", FALSE, FALSE, FALSE, NULL, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "the current vector object, 0 if no vector exists in the image.", + gimp_param_spec_vectors ("path", + "path", + "the current path object, 0 if no path exists in the image.", FALSE, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-new-from-text-layer + * gimp-path-new-from-text-layer */ - procedure = gimp_procedure_new (vectors_new_from_text_layer_invoker); + procedure = gimp_procedure_new (path_new_from_text_layer_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-new-from-text-layer"); + "gimp-path-new-from-text-layer"); gimp_procedure_set_static_help (procedure, - "Creates a new vectors object from a text layer.", - "Creates a new vectors object from a text layer. The vectors object needs to be added to the image using 'gimp-image-insert-vectors'.", + "Creates a new path object from a text layer.", + "Creates a new path object from a text layer. The path object needs to be added to the image using 'gimp-image-insert-vectors'.", NULL); gimp_procedure_set_static_attribution (procedure, "Marcus Heese ", @@ -1414,49 +1414,49 @@ register_vectors_procs (GimpPDB *pdb) FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors of the text layer.", + gimp_param_spec_vectors ("path", + "path", + "The path of the text layer.", FALSE, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-copy + * gimp-path-copy */ - procedure = gimp_procedure_new (vectors_copy_invoker); + procedure = gimp_procedure_new (path_copy_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-copy"); + "gimp-path-copy"); gimp_procedure_set_static_help (procedure, - "Copy a vectors object.", - "This procedure copies the specified vectors object and returns the copy.", + "Copy a path object.", + "This procedure copies the specified path object and returns the copy.", NULL); gimp_procedure_set_static_attribution (procedure, "Barak Itkin ", "Barak Itkin", "2008"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object to copy", + gimp_param_spec_vectors ("path", + "path", + "The path object to copy", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - gimp_param_spec_vectors ("vectors-copy", - "vectors copy", - "The newly copied vectors object", + gimp_param_spec_vectors ("path-copy", + "path copy", + "The newly copied path object", FALSE, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-get-strokes + * gimp-path-get-strokes */ - procedure = gimp_procedure_new (vectors_get_strokes_invoker); + procedure = gimp_procedure_new (path_get_strokes_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-get-strokes"); + "gimp-path-get-strokes"); gimp_procedure_set_static_help (procedure, "List the strokes associated with the passed path.", "Returns an Array with the stroke-IDs associated with the passed path.", @@ -1466,9 +1466,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, @@ -1486,11 +1486,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-get-length + * gimp-path-stroke-get-length */ - procedure = gimp_procedure_new (vectors_stroke_get_length_invoker); + procedure = gimp_procedure_new (path_stroke_get_length_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-get-length"); + "gimp-path-stroke-get-length"); gimp_procedure_set_static_help (procedure, "Measure the length of the given stroke.", "Measure the length of the given stroke.", @@ -1500,9 +1500,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1527,11 +1527,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-get-point-at-dist + * gimp-path-stroke-get-point-at-dist */ - procedure = gimp_procedure_new (vectors_stroke_get_point_at_dist_invoker); + procedure = gimp_procedure_new (path_stroke_get_point_at_dist_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-get-point-at-dist"); + "gimp-path-stroke-get-point-at-dist"); gimp_procedure_set_static_help (procedure, "Get point at a specified distance along the stroke.", "This will return the x,y position of a point at a given distance along the stroke. The distance will be obtained by first digitizing the curve internally and then walking along the curve. For a closed stroke the start of the path is the first point on the path that was created. This might not be obvious. If the stroke is not long enough, a \"valid\" flag will be FALSE.", @@ -1541,9 +1541,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1592,23 +1592,23 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-remove-stroke + * gimp-path-remove-stroke */ - procedure = gimp_procedure_new (vectors_remove_stroke_invoker); + procedure = gimp_procedure_new (path_remove_stroke_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-remove-stroke"); + "gimp-path-remove-stroke"); gimp_procedure_set_static_help (procedure, - "remove the stroke from a vectors object.", - "Remove the stroke from a vectors object.", + "remove the stroke from a path object.", + "Remove the stroke from a path object.", NULL); gimp_procedure_set_static_attribution (procedure, "Simon Budig", "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1621,11 +1621,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-close + * gimp-path-stroke-close */ - procedure = gimp_procedure_new (vectors_stroke_close_invoker); + procedure = gimp_procedure_new (path_stroke_close_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-close"); + "gimp-path-stroke-close"); gimp_procedure_set_static_help (procedure, "closes the specified stroke.", "Closes the specified stroke.", @@ -1635,9 +1635,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1650,11 +1650,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-reverse + * gimp-path-stroke-reverse */ - procedure = gimp_procedure_new (vectors_stroke_reverse_invoker); + procedure = gimp_procedure_new (path_stroke_reverse_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-reverse"); + "gimp-path-stroke-reverse"); gimp_procedure_set_static_help (procedure, "reverses the specified stroke.", "Reverses the specified stroke.", @@ -1664,9 +1664,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2020"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1679,11 +1679,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-translate + * gimp-path-stroke-translate */ - procedure = gimp_procedure_new (vectors_stroke_translate_invoker); + procedure = gimp_procedure_new (path_stroke_translate_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-translate"); + "gimp-path-stroke-translate"); gimp_procedure_set_static_help (procedure, "translate the given stroke.", "Translate the given stroke.", @@ -1693,9 +1693,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1720,11 +1720,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-scale + * gimp-path-stroke-scale */ - procedure = gimp_procedure_new (vectors_stroke_scale_invoker); + procedure = gimp_procedure_new (path_stroke_scale_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-scale"); + "gimp-path-stroke-scale"); gimp_procedure_set_static_help (procedure, "scales the given stroke.", "Scale the given stroke.", @@ -1734,9 +1734,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1761,11 +1761,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-rotate + * gimp-path-stroke-rotate */ - procedure = gimp_procedure_new (vectors_stroke_rotate_invoker); + procedure = gimp_procedure_new (path_stroke_rotate_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-rotate"); + "gimp-path-stroke-rotate"); gimp_procedure_set_static_help (procedure, "rotates the given stroke.", "Rotates the given stroke around given center by angle (in degrees).", @@ -1775,9 +1775,9 @@ register_vectors_procs (GimpPDB *pdb) "Jo\xc3\xa3o S. O. Bueno", "2006"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1808,11 +1808,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-flip + * gimp-path-stroke-flip */ - procedure = gimp_procedure_new (vectors_stroke_flip_invoker); + procedure = gimp_procedure_new (path_stroke_flip_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-flip"); + "gimp-path-stroke-flip"); gimp_procedure_set_static_help (procedure, "flips the given stroke.", "Rotates the given stroke around given center by angle (in degrees).", @@ -1822,9 +1822,9 @@ register_vectors_procs (GimpPDB *pdb) "Jo\xc3\xa3o S. O. Bueno", "2006"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1852,11 +1852,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-flip-free + * gimp-path-stroke-flip-free */ - procedure = gimp_procedure_new (vectors_stroke_flip_free_invoker); + procedure = gimp_procedure_new (path_stroke_flip_free_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-flip-free"); + "gimp-path-stroke-flip-free"); gimp_procedure_set_static_help (procedure, "flips the given stroke about an arbitrary axis.", "Flips the given stroke about an arbitrary axis. Axis is defined by two coordinates in the image (in pixels), through which the flipping axis passes.", @@ -1866,9 +1866,9 @@ register_vectors_procs (GimpPDB *pdb) "Jo\xc3\xa3o S. O. Bueno", "2006"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1905,11 +1905,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-get-points + * gimp-path-stroke-get-points */ - procedure = gimp_procedure_new (vectors_stroke_get_points_invoker); + procedure = gimp_procedure_new (path_stroke_get_points_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-get-points"); + "gimp-path-stroke-get-points"); gimp_procedure_set_static_help (procedure, "returns the control points of a stroke.", "returns the control points of a stroke. The interpretation of the coordinates returned depends on the type of the stroke. For Gimp 2.4 this is always a bezier stroke, where the coordinates are the control points.", @@ -1919,9 +1919,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2006"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -1958,23 +1958,23 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-new-from-points + * gimp-path-stroke-new-from-points */ - procedure = gimp_procedure_new (vectors_stroke_new_from_points_invoker); + procedure = gimp_procedure_new (path_stroke_new_from_points_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-new-from-points"); + "gimp-path-stroke-new-from-points"); gimp_procedure_set_static_help (procedure, - "Adds a stroke of a given type to the vectors object.", - "Adds a stroke of a given type to the vectors 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.", + "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...", NULL); gimp_procedure_set_static_attribution (procedure, "Simon Budig", "Simon Budig", "2006"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2011,11 +2011,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-stroke-interpolate + * gimp-path-stroke-interpolate */ - procedure = gimp_procedure_new (vectors_stroke_interpolate_invoker); + procedure = gimp_procedure_new (path_stroke_interpolate_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-stroke-interpolate"); + "gimp-path-stroke-interpolate"); gimp_procedure_set_static_help (procedure, "returns polygonal approximation of the stroke.", "returns polygonal approximation of the stroke.", @@ -2025,9 +2025,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2063,23 +2063,23 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-bezier-stroke-new-moveto + * gimp-path-bezier-stroke-new-moveto */ - procedure = gimp_procedure_new (vectors_bezier_stroke_new_moveto_invoker); + procedure = gimp_procedure_new (path_bezier_stroke_new_moveto_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-bezier-stroke-new-moveto"); + "gimp-path-bezier-stroke-new-moveto"); gimp_procedure_set_static_help (procedure, - "Adds a bezier stroke with a single moveto to the vectors object.", - "Adds a bezier stroke with a single moveto to the vectors object.", + "Adds a bezier stroke with a single moveto to the path object.", + "Adds a bezier stroke with a single moveto to the path object.", NULL); gimp_procedure_set_static_attribution (procedure, "Simon Budig", "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2104,11 +2104,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-bezier-stroke-lineto + * gimp-path-bezier-stroke-lineto */ - procedure = gimp_procedure_new (vectors_bezier_stroke_lineto_invoker); + procedure = gimp_procedure_new (path_bezier_stroke_lineto_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-bezier-stroke-lineto"); + "gimp-path-bezier-stroke-lineto"); gimp_procedure_set_static_help (procedure, "Extends a bezier stroke with a lineto.", "Extends a bezier stroke with a lineto.", @@ -2118,9 +2118,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2145,11 +2145,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-bezier-stroke-conicto + * gimp-path-bezier-stroke-conicto */ - procedure = gimp_procedure_new (vectors_bezier_stroke_conicto_invoker); + procedure = gimp_procedure_new (path_bezier_stroke_conicto_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-bezier-stroke-conicto"); + "gimp-path-bezier-stroke-conicto"); gimp_procedure_set_static_help (procedure, "Extends a bezier stroke with a conic bezier spline.", "Extends a bezier stroke with a conic bezier spline. Actually a cubic bezier spline gets added that realizes the shape of a conic bezier spline.", @@ -2159,9 +2159,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2198,11 +2198,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-bezier-stroke-cubicto + * gimp-path-bezier-stroke-cubicto */ - procedure = gimp_procedure_new (vectors_bezier_stroke_cubicto_invoker); + procedure = gimp_procedure_new (path_bezier_stroke_cubicto_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-bezier-stroke-cubicto"); + "gimp-path-bezier-stroke-cubicto"); gimp_procedure_set_static_help (procedure, "Extends a bezier stroke with a cubic bezier spline.", "Extends a bezier stroke with a cubic bezier spline.", @@ -2212,9 +2212,9 @@ register_vectors_procs (GimpPDB *pdb) "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2263,23 +2263,23 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-bezier-stroke-new-ellipse + * gimp-path-bezier-stroke-new-ellipse */ - procedure = gimp_procedure_new (vectors_bezier_stroke_new_ellipse_invoker); + procedure = gimp_procedure_new (path_bezier_stroke_new_ellipse_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-bezier-stroke-new-ellipse"); + "gimp-path-bezier-stroke-new-ellipse"); gimp_procedure_set_static_help (procedure, - "Adds a bezier stroke describing an ellipse the vectors object.", - "Adds a bezier stroke describing an ellipse the vectors object.", + "Adds a bezier stroke describing an ellipse the path object.", + "Adds a bezier stroke describing an ellipse on the path object.", NULL); gimp_procedure_set_static_attribution (procedure, "Simon Budig", "Simon Budig", "2005"); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object", + gimp_param_spec_vectors ("path", + "path", + "The path object", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2322,11 +2322,11 @@ register_vectors_procs (GimpPDB *pdb) g_object_unref (procedure); /* - * gimp-vectors-import-from-file + * gimp-path-import-from-file */ - procedure = gimp_procedure_new (vectors_import_from_file_invoker); + procedure = gimp_procedure_new (path_import_from_file_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-import-from-file"); + "gimp-path-import-from-file"); gimp_procedure_set_static_help (procedure, "Import paths from an SVG file.", "This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.", @@ -2350,7 +2350,7 @@ register_vectors_procs (GimpPDB *pdb) gimp_procedure_add_argument (procedure, g_param_spec_boolean ("merge", "merge", - "Merge paths into a single vectors object.", + "Merge paths into a single path object.", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2360,26 +2360,26 @@ register_vectors_procs (GimpPDB *pdb) FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - g_param_spec_int ("num-vectors", - "num vectors", - "The number of newly created vectors", + g_param_spec_int ("num-paths", + "num paths", + "The number of newly created path", 0, G_MAXINT32, 0, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - gimp_param_spec_object_array ("vectors", - "vectors", - "The list of newly created vectors", + gimp_param_spec_object_array ("path", + "path", + "The list of newly created path", GIMP_TYPE_VECTORS, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-import-from-string + * gimp-path-import-from-string */ - procedure = gimp_procedure_new (vectors_import_from_string_invoker); + procedure = gimp_procedure_new (path_import_from_string_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-import-from-string"); + "gimp-path-import-from-string"); gimp_procedure_set_static_help (procedure, "Import paths from an SVG string.", "This procedure works like 'gimp-vectors-import-from-file' but takes a string rather than reading the SVG from a file. This allows you to write scripts that generate SVG and feed it to GIMP.", @@ -2410,7 +2410,7 @@ register_vectors_procs (GimpPDB *pdb) gimp_procedure_add_argument (procedure, g_param_spec_boolean ("merge", "merge", - "Merge paths into a single vectors object.", + "Merge paths into a single path object.", FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, @@ -2420,29 +2420,29 @@ register_vectors_procs (GimpPDB *pdb) FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - g_param_spec_int ("num-vectors", - "num vectors", - "The number of newly created vectors", + g_param_spec_int ("num-paths", + "num paths", + "The number of newly created path", 0, G_MAXINT32, 0, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, - gimp_param_spec_object_array ("vectors", - "vectors", - "The list of newly created vectors", + gimp_param_spec_object_array ("path", + "path", + "The list of newly created path", GIMP_TYPE_VECTORS, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-export-to-file + * gimp-path-export-to-file */ - procedure = gimp_procedure_new (vectors_export_to_file_invoker); + procedure = gimp_procedure_new (path_export_to_file_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-export-to-file"); + "gimp-path-export-to-file"); gimp_procedure_set_static_help (procedure, "save a path as an SVG file.", - "This procedure creates an SVG file to save a Vectors object, that is, a path. The resulting file can be edited using a vector graphics application, or later reloaded into GIMP. Pass %NULL as the 'vectors' argument to export all paths in the image.", + "This procedure creates an SVG file to save a Path object, that is, a path. The resulting file can be edited using a vector graphics application, or later reloaded into GIMP. Pass %NULL as the 'path' argument to export all paths in the image.", NULL); gimp_procedure_set_static_attribution (procedure, "Bill Skaggs ", @@ -2461,23 +2461,23 @@ register_vectors_procs (GimpPDB *pdb) G_TYPE_FILE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object to export, or %NULL for all in the image", + gimp_param_spec_vectors ("path", + "path", + "The path object to export, or %NULL for all in the image", TRUE, GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); /* - * gimp-vectors-export-to-string + * gimp-path-export-to-string */ - procedure = gimp_procedure_new (vectors_export_to_string_invoker); + procedure = gimp_procedure_new (path_export_to_string_invoker); gimp_object_set_static_name (GIMP_OBJECT (procedure), - "gimp-vectors-export-to-string"); + "gimp-path-export-to-string"); gimp_procedure_set_static_help (procedure, "Save a path as an SVG string.", - "This procedure works like 'gimp-vectors-export-to-file' but creates a string rather than a file. The string is NULL-terminated and holds a complete XML document. Pass %NULL as the 'vectors' argument to export all paths in the image.", + "This procedure works like 'gimp-path-export-to-file' but creates a string rather than a file. The string is NULL-terminated and holds a complete XML document. Pass %NULL as the 'path' argument to export all paths in the image.", NULL); gimp_procedure_set_static_attribution (procedure, "Bill Skaggs ", @@ -2490,9 +2490,9 @@ register_vectors_procs (GimpPDB *pdb) FALSE, GIMP_PARAM_READWRITE)); gimp_procedure_add_argument (procedure, - gimp_param_spec_vectors ("vectors", - "vectors", - "The vectors object to export, or %NULL for all in the image", + gimp_param_spec_vectors ("path", + "path", + "The path object to export, or %NULL for all in the image", TRUE, GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, diff --git a/libgimp/gimp.def b/libgimp/gimp.def index 0028879c88..abf5ff7c34 100644 --- a/libgimp/gimp.def +++ b/libgimp/gimp.def @@ -565,20 +565,20 @@ EXPORTS gimp_item_id_is_group_layer gimp_item_id_is_layer gimp_item_id_is_layer_mask + gimp_item_id_is_path gimp_item_id_is_selection gimp_item_id_is_text_layer gimp_item_id_is_valid - gimp_item_id_is_vectors gimp_item_is_channel gimp_item_is_drawable gimp_item_is_group gimp_item_is_group_layer gimp_item_is_layer gimp_item_is_layer_mask + gimp_item_is_path gimp_item_is_selection gimp_item_is_text_layer gimp_item_is_valid - gimp_item_is_vectors gimp_item_list_children gimp_item_set_color_tag gimp_item_set_expanded @@ -708,6 +708,32 @@ EXPORTS gimp_param_spec_vectors gimp_param_text_layer_get_type gimp_param_vectors_get_type + gimp_path_bezier_stroke_conicto + gimp_path_bezier_stroke_cubicto + gimp_path_bezier_stroke_lineto + gimp_path_bezier_stroke_new_ellipse + gimp_path_bezier_stroke_new_moveto + gimp_path_copy + gimp_path_export_to_file + gimp_path_export_to_string + gimp_path_get_strokes + gimp_path_import_from_file + gimp_path_import_from_string + gimp_path_new + gimp_path_new_from_text_layer + gimp_path_remove_stroke + gimp_path_stroke_close + gimp_path_stroke_flip + gimp_path_stroke_flip_free + gimp_path_stroke_get_length + gimp_path_stroke_get_point_at_dist + gimp_path_stroke_get_points + gimp_path_stroke_interpolate + gimp_path_stroke_new_from_points + gimp_path_stroke_reverse + gimp_path_stroke_rotate + gimp_path_stroke_scale + gimp_path_stroke_translate gimp_pattern_get_buffer gimp_pattern_get_by_name gimp_pattern_get_info @@ -913,13 +939,13 @@ EXPORTS gimp_resource_get_id gimp_resource_get_name gimp_resource_get_type - gimp_resource_id_is_brush - gimp_resource_id_is_font - gimp_resource_id_is_gradient - gimp_resource_id_is_palette - gimp_resource_id_is_pattern - gimp_resource_id_is_valid - gimp_resource_is_brush + gimp_resource_id_is_brush + gimp_resource_id_is_font + gimp_resource_id_is_gradient + gimp_resource_id_is_palette + gimp_resource_id_is_pattern + gimp_resource_id_is_valid + gimp_resource_is_brush gimp_resource_is_editable gimp_resource_is_font gimp_resource_is_gradient @@ -992,33 +1018,7 @@ EXPORTS gimp_vector_load_procedure_extract_dimensions gimp_vector_load_procedure_get_type gimp_vector_load_procedure_new - gimp_vectors_bezier_stroke_conicto - gimp_vectors_bezier_stroke_cubicto - gimp_vectors_bezier_stroke_lineto - gimp_vectors_bezier_stroke_new_ellipse - gimp_vectors_bezier_stroke_new_moveto - gimp_vectors_copy - gimp_vectors_export_to_file - gimp_vectors_export_to_string gimp_vectors_get_by_id - gimp_vectors_get_strokes gimp_vectors_get_type - gimp_vectors_import_from_file - gimp_vectors_import_from_string - gimp_vectors_new - gimp_vectors_new_from_text_layer - gimp_vectors_remove_stroke - gimp_vectors_stroke_close - gimp_vectors_stroke_flip - gimp_vectors_stroke_flip_free - gimp_vectors_stroke_get_length - gimp_vectors_stroke_get_point_at_dist - gimp_vectors_stroke_get_points - gimp_vectors_stroke_interpolate - gimp_vectors_stroke_new_from_points - gimp_vectors_stroke_reverse - gimp_vectors_stroke_rotate - gimp_vectors_stroke_scale - gimp_vectors_stroke_translate gimp_version gimp_wm_class diff --git a/libgimp/gimp_pdb_headers.h b/libgimp/gimp_pdb_headers.h index 51b546aada..aceaf4f71c 100644 --- a/libgimp/gimp_pdb_headers.h +++ b/libgimp/gimp_pdb_headers.h @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,5 @@ #include #include #include -#include #endif /* __GIMP_PDB_HEADERS_H__ */ diff --git a/libgimp/gimpitem.c b/libgimp/gimpitem.c index 9602d75c0d..ca3a85d118 100644 --- a/libgimp/gimpitem.c +++ b/libgimp/gimpitem.c @@ -331,21 +331,21 @@ gimp_item_is_selection (GimpItem *item) } /** - * gimp_item_is_vectors: + * gimp_item_is_path: * @item: The item. * - * Returns whether the item is a vectors. + * Returns whether the item is a path. * - * This procedure returns TRUE if the specified item is a vectors. + * This procedure returns TRUE if the specified item is a path. * - * Returns: TRUE if the item is a vectors, FALSE otherwise. + * Returns: TRUE if the item is a path, FALSE otherwise. * * Since: 2.8 **/ gboolean -gimp_item_is_vectors (GimpItem *item) +gimp_item_is_path (GimpItem *item) { - return gimp_item_id_is_vectors (gimp_item_get_id (item)); + return gimp_item_id_is_path (gimp_item_get_id (item)); } /** diff --git a/libgimp/gimpitem.h b/libgimp/gimpitem.h index 7ecb75241d..c39e7b5e31 100644 --- a/libgimp/gimpitem.h +++ b/libgimp/gimpitem.h @@ -62,7 +62,7 @@ gboolean gimp_item_is_group_layer (GimpItem *item); gboolean gimp_item_is_channel (GimpItem *item); gboolean gimp_item_is_layer_mask (GimpItem *item); gboolean gimp_item_is_selection (GimpItem *item); -gboolean gimp_item_is_vectors (GimpItem *item); +gboolean gimp_item_is_path (GimpItem *item); GList * gimp_item_list_children (GimpItem *item); diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c index ebab01b572..e4ffe43a04 100644 --- a/libgimp/gimpitem_pdb.c +++ b/libgimp/gimpitem_pdb.c @@ -292,6 +292,42 @@ gimp_item_id_is_layer_mask (gint item_id) return layer_mask; } +/** + * gimp_item_id_is_path: + * @item_id: The item ID. + * + * Returns whether the item ID is a path. + * + * This procedure returns TRUE if the specified item ID is a path. + * + * Returns: TRUE if the item ID is a path, FALSE otherwise. + * + * Since: 3.0 + **/ +gboolean +gimp_item_id_is_path (gint item_id) +{ + GimpValueArray *args; + GimpValueArray *return_vals; + gboolean path = FALSE; + + args = gimp_value_array_new_from_types (NULL, + G_TYPE_INT, item_id, + G_TYPE_NONE); + + return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), + "gimp-item-id-is-path", + args); + gimp_value_array_unref (args); + + if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) + path = GIMP_VALUES_GET_BOOLEAN (return_vals, 1); + + gimp_value_array_unref (return_vals); + + return path; +} + /** * gimp_item_id_is_selection: * @item_id: The item ID. @@ -328,42 +364,6 @@ gimp_item_id_is_selection (gint item_id) return selection; } -/** - * gimp_item_id_is_vectors: - * @item_id: The item ID. - * - * Returns whether the item ID is a vectors. - * - * This procedure returns TRUE if the specified item ID is a vectors. - * - * Returns: TRUE if the item ID is a vectors, FALSE otherwise. - * - * Since: 3.0 - **/ -gboolean -gimp_item_id_is_vectors (gint item_id) -{ - GimpValueArray *args; - GimpValueArray *return_vals; - gboolean vectors = FALSE; - - args = gimp_value_array_new_from_types (NULL, - G_TYPE_INT, item_id, - G_TYPE_NONE); - - return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-item-id-is-vectors", - args); - gimp_value_array_unref (args); - - if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) - vectors = GIMP_VALUES_GET_BOOLEAN (return_vals, 1); - - gimp_value_array_unref (return_vals); - - return vectors; -} - /** * gimp_item_get_image: * @item: The item. diff --git a/libgimp/gimpitem_pdb.h b/libgimp/gimpitem_pdb.h index c6820e0649..97e078c072 100644 --- a/libgimp/gimpitem_pdb.h +++ b/libgimp/gimpitem_pdb.h @@ -39,8 +39,8 @@ gboolean gimp_item_id_is_text_layer (gint item_id); gboolean gimp_item_id_is_group_layer (gint item_id); gboolean gimp_item_id_is_channel (gint item_id); gboolean gimp_item_id_is_layer_mask (gint item_id); +gboolean gimp_item_id_is_path (gint item_id); gboolean gimp_item_id_is_selection (gint item_id); -gboolean gimp_item_id_is_vectors (gint item_id); GimpImage* gimp_item_get_image (GimpItem *item); gboolean gimp_item_delete (GimpItem *item); gboolean gimp_item_is_group (GimpItem *item); diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimppath_pdb.c similarity index 66% rename from libgimp/gimpvectors_pdb.c rename to libgimp/gimppath_pdb.c index df6c3b124f..9827d81525 100644 --- a/libgimp/gimpvectors_pdb.c +++ b/libgimp/gimppath_pdb.c @@ -1,7 +1,7 @@ /* LIBGIMP - The GIMP Library * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball * - * gimpvectors_pdb.c + * gimppath_pdb.c * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,36 +28,36 @@ /** - * SECTION: gimpvectors - * @title: gimpvectors - * @short_description: Functions for querying and manipulating vectors. + * SECTION: gimppath + * @title: gimppath + * @short_description: Functions for querying and manipulating path. * - * Functions for querying and manipulating vectors. + * Functions for querying and manipulating path. **/ /** - * gimp_vectors_new: + * gimp_path_new: * @image: The image. - * @name: the name of the new vector object. + * @name: the name of the new path object. * - * Creates a new empty vectors object. + * Creates a new empty path object. * - * Creates a new empty vectors object. The vectors object needs to be - * added to the image using gimp_image_insert_vectors(). + * Creates a new empty path object. The path object needs to be added + * to the image using gimp_image_insert_vectors(). * * Returns: (transfer none): - * the current vector object, 0 if no vector exists in the image. + * the current path object, 0 if no path exists in the image. * * Since: 2.4 **/ GimpVectors * -gimp_vectors_new (GimpImage *image, - const gchar *name) +gimp_path_new (GimpImage *image, + const gchar *name) { GimpValueArray *args; GimpValueArray *return_vals; - GimpVectors *vectors = NULL; + GimpVectors *path = NULL; args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_IMAGE, image, @@ -65,39 +65,39 @@ gimp_vectors_new (GimpImage *image, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-new", + "gimp-path-new", args); gimp_value_array_unref (args); if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) - vectors = GIMP_VALUES_GET_VECTORS (return_vals, 1); + path = GIMP_VALUES_GET_VECTORS (return_vals, 1); gimp_value_array_unref (return_vals); - return vectors; + return path; } /** - * gimp_vectors_new_from_text_layer: + * gimp_path_new_from_text_layer: * @image: The image. * @layer: The text layer. * - * Creates a new vectors object from a text layer. + * Creates a new path object from a text layer. * - * Creates a new vectors object from a text layer. The vectors object - * needs to be added to the image using gimp_image_insert_vectors(). + * Creates a new path object from a text layer. The path object needs + * to be added to the image using gimp_image_insert_vectors(). * - * Returns: (transfer none): The vectors of the text layer. + * Returns: (transfer none): The path of the text layer. * * Since: 2.6 **/ GimpVectors * -gimp_vectors_new_from_text_layer (GimpImage *image, - GimpLayer *layer) +gimp_path_new_from_text_layer (GimpImage *image, + GimpLayer *layer) { GimpValueArray *args; GimpValueArray *return_vals; - GimpVectors *vectors = NULL; + GimpVectors *path = NULL; args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_IMAGE, image, @@ -105,58 +105,58 @@ gimp_vectors_new_from_text_layer (GimpImage *image, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-new-from-text-layer", + "gimp-path-new-from-text-layer", args); gimp_value_array_unref (args); if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) - vectors = GIMP_VALUES_GET_VECTORS (return_vals, 1); + path = GIMP_VALUES_GET_VECTORS (return_vals, 1); gimp_value_array_unref (return_vals); - return vectors; + return path; } /** - * gimp_vectors_copy: - * @vectors: The vectors object to copy. + * gimp_path_copy: + * @path: The path object to copy. * - * Copy a vectors object. + * Copy a path object. * - * This procedure copies the specified vectors object and returns the + * This procedure copies the specified path object and returns the * copy. * - * Returns: (transfer none): The newly copied vectors object. + * Returns: (transfer none): The newly copied path object. * * Since: 2.6 **/ GimpVectors * -gimp_vectors_copy (GimpVectors *vectors) +gimp_path_copy (GimpVectors *path) { GimpValueArray *args; GimpValueArray *return_vals; - GimpVectors *vectors_copy = NULL; + GimpVectors *path_copy = NULL; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-copy", + "gimp-path-copy", args); gimp_value_array_unref (args); if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS) - vectors_copy = GIMP_VALUES_GET_VECTORS (return_vals, 1); + path_copy = GIMP_VALUES_GET_VECTORS (return_vals, 1); gimp_value_array_unref (return_vals); - return vectors_copy; + return path_copy; } /** - * gimp_vectors_get_strokes: - * @vectors: The vectors object. + * gimp_path_get_strokes: + * @path: The path object. * @num_strokes: (out): The number of strokes returned. * * List the strokes associated with the passed path. @@ -171,19 +171,19 @@ gimp_vectors_copy (GimpVectors *vectors) * Since: 2.4 **/ gint * -gimp_vectors_get_strokes (GimpVectors *vectors, - gint *num_strokes) +gimp_path_get_strokes (GimpVectors *path, + gint *num_strokes) { GimpValueArray *args; GimpValueArray *return_vals; gint *stroke_ids = NULL; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-get-strokes", + "gimp-path-get-strokes", args); gimp_value_array_unref (args); @@ -201,8 +201,8 @@ gimp_vectors_get_strokes (GimpVectors *vectors, } /** - * gimp_vectors_stroke_get_length: - * @vectors: The vectors object. + * gimp_path_stroke_get_length: + * @path: The path object. * @stroke_id: The stroke ID. * @precision: The precision used for approximating straight portions of the stroke. * @@ -215,22 +215,22 @@ gimp_vectors_get_strokes (GimpVectors *vectors, * Since: 2.4 **/ gdouble -gimp_vectors_stroke_get_length (GimpVectors *vectors, - gint stroke_id, - gdouble precision) +gimp_path_stroke_get_length (GimpVectors *path, + gint stroke_id, + gdouble precision) { GimpValueArray *args; GimpValueArray *return_vals; gdouble length = 0.0; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, precision, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-get-length", + "gimp-path-stroke-get-length", args); gimp_value_array_unref (args); @@ -243,8 +243,8 @@ gimp_vectors_stroke_get_length (GimpVectors *vectors, } /** - * gimp_vectors_stroke_get_point_at_dist: - * @vectors: The vectors object. + * gimp_path_stroke_get_point_at_dist: + * @path: The path object. * @stroke_id: The stroke ID. * @dist: The given distance. * @precision: The precision used for the approximation. @@ -267,28 +267,28 @@ gimp_vectors_stroke_get_length (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_get_point_at_dist (GimpVectors *vectors, - gint stroke_id, - gdouble dist, - gdouble precision, - gdouble *x_point, - gdouble *y_point, - gdouble *slope, - gboolean *valid) +gimp_path_stroke_get_point_at_dist (GimpVectors *path, + gint stroke_id, + gdouble dist, + gdouble precision, + gdouble *x_point, + gdouble *y_point, + gdouble *slope, + gboolean *valid) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, dist, G_TYPE_DOUBLE, precision, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-get-point-at-dist", + "gimp-path-stroke-get-point-at-dist", args); gimp_value_array_unref (args); @@ -313,33 +313,33 @@ gimp_vectors_stroke_get_point_at_dist (GimpVectors *vectors, } /** - * gimp_vectors_remove_stroke: - * @vectors: The vectors object. + * gimp_path_remove_stroke: + * @path: The path object. * @stroke_id: The stroke ID. * - * remove the stroke from a vectors object. + * remove the stroke from a path object. * - * Remove the stroke from a vectors object. + * Remove the stroke from a path object. * * Returns: TRUE on success. * * Since: 2.4 **/ gboolean -gimp_vectors_remove_stroke (GimpVectors *vectors, - gint stroke_id) +gimp_path_remove_stroke (GimpVectors *path, + gint stroke_id) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-remove-stroke", + "gimp-path-remove-stroke", args); gimp_value_array_unref (args); @@ -351,8 +351,8 @@ gimp_vectors_remove_stroke (GimpVectors *vectors, } /** - * gimp_vectors_stroke_close: - * @vectors: The vectors object. + * gimp_path_stroke_close: + * @path: The path object. * @stroke_id: The stroke ID. * * closes the specified stroke. @@ -364,20 +364,20 @@ gimp_vectors_remove_stroke (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_close (GimpVectors *vectors, - gint stroke_id) +gimp_path_stroke_close (GimpVectors *path, + gint stroke_id) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-close", + "gimp-path-stroke-close", args); gimp_value_array_unref (args); @@ -389,8 +389,8 @@ gimp_vectors_stroke_close (GimpVectors *vectors, } /** - * gimp_vectors_stroke_reverse: - * @vectors: The vectors object. + * gimp_path_stroke_reverse: + * @path: The path object. * @stroke_id: The stroke ID. * * reverses the specified stroke. @@ -402,20 +402,20 @@ gimp_vectors_stroke_close (GimpVectors *vectors, * Since: 3.0 **/ gboolean -gimp_vectors_stroke_reverse (GimpVectors *vectors, - gint stroke_id) +gimp_path_stroke_reverse (GimpVectors *path, + gint stroke_id) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-reverse", + "gimp-path-stroke-reverse", args); gimp_value_array_unref (args); @@ -427,8 +427,8 @@ gimp_vectors_stroke_reverse (GimpVectors *vectors, } /** - * gimp_vectors_stroke_translate: - * @vectors: The vectors object. + * gimp_path_stroke_translate: + * @path: The path object. * @stroke_id: The stroke ID. * @off_x: Offset in x direction. * @off_y: Offset in y direction. @@ -442,24 +442,24 @@ gimp_vectors_stroke_reverse (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_translate (GimpVectors *vectors, - gint stroke_id, - gdouble off_x, - gdouble off_y) +gimp_path_stroke_translate (GimpVectors *path, + gint stroke_id, + gdouble off_x, + gdouble off_y) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, off_x, G_TYPE_DOUBLE, off_y, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-translate", + "gimp-path-stroke-translate", args); gimp_value_array_unref (args); @@ -471,8 +471,8 @@ gimp_vectors_stroke_translate (GimpVectors *vectors, } /** - * gimp_vectors_stroke_scale: - * @vectors: The vectors object. + * gimp_path_stroke_scale: + * @path: The path object. * @stroke_id: The stroke ID. * @scale_x: Scale factor in x direction. * @scale_y: Scale factor in y direction. @@ -486,24 +486,24 @@ gimp_vectors_stroke_translate (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_scale (GimpVectors *vectors, - gint stroke_id, - gdouble scale_x, - gdouble scale_y) +gimp_path_stroke_scale (GimpVectors *path, + gint stroke_id, + gdouble scale_x, + gdouble scale_y) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, scale_x, G_TYPE_DOUBLE, scale_y, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-scale", + "gimp-path-stroke-scale", args); gimp_value_array_unref (args); @@ -515,8 +515,8 @@ gimp_vectors_stroke_scale (GimpVectors *vectors, } /** - * gimp_vectors_stroke_rotate: - * @vectors: The vectors object. + * gimp_path_stroke_rotate: + * @path: The path object. * @stroke_id: The stroke ID. * @center_x: X coordinate of the rotation center. * @center_y: Y coordinate of the rotation center. @@ -531,18 +531,18 @@ gimp_vectors_stroke_scale (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_rotate (GimpVectors *vectors, - gint stroke_id, - gdouble center_x, - gdouble center_y, - gdouble angle) +gimp_path_stroke_rotate (GimpVectors *path, + gint stroke_id, + gdouble center_x, + gdouble center_y, + gdouble angle) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, center_x, G_TYPE_DOUBLE, center_y, @@ -550,7 +550,7 @@ gimp_vectors_stroke_rotate (GimpVectors *vectors, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-rotate", + "gimp-path-stroke-rotate", args); gimp_value_array_unref (args); @@ -562,8 +562,8 @@ gimp_vectors_stroke_rotate (GimpVectors *vectors, } /** - * gimp_vectors_stroke_flip: - * @vectors: The vectors object. + * gimp_path_stroke_flip: + * @path: The path object. * @stroke_id: The stroke ID. * @flip_type: Flip orientation, either vertical or horizontal. * @axis: axis coordinate about which to flip, in pixels. @@ -577,24 +577,24 @@ gimp_vectors_stroke_rotate (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_flip (GimpVectors *vectors, - gint stroke_id, - GimpOrientationType flip_type, - gdouble axis) +gimp_path_stroke_flip (GimpVectors *path, + gint stroke_id, + GimpOrientationType flip_type, + gdouble axis) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, GIMP_TYPE_ORIENTATION_TYPE, flip_type, G_TYPE_DOUBLE, axis, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-flip", + "gimp-path-stroke-flip", args); gimp_value_array_unref (args); @@ -606,8 +606,8 @@ gimp_vectors_stroke_flip (GimpVectors *vectors, } /** - * gimp_vectors_stroke_flip_free: - * @vectors: The vectors object. + * gimp_path_stroke_flip_free: + * @path: The path object. * @stroke_id: The stroke ID. * @x1: X coordinate of the first point of the flipping axis. * @y1: Y coordinate of the first point of the flipping axis. @@ -625,19 +625,19 @@ gimp_vectors_stroke_flip (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_stroke_flip_free (GimpVectors *vectors, - gint stroke_id, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2) +gimp_path_stroke_flip_free (GimpVectors *path, + gint stroke_id, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, x1, G_TYPE_DOUBLE, y1, @@ -646,7 +646,7 @@ gimp_vectors_stroke_flip_free (GimpVectors *vectors, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-flip-free", + "gimp-path-stroke-flip-free", args); gimp_value_array_unref (args); @@ -658,8 +658,8 @@ gimp_vectors_stroke_flip_free (GimpVectors *vectors, } /** - * gimp_vectors_stroke_get_points: - * @vectors: The vectors object. + * gimp_path_stroke_get_points: + * @path: The path object. * @stroke_id: The stroke ID. * @num_points: (out): The number of floats returned. * @controlpoints: (out) (array length=num_points) (element-type gdouble) (transfer full): List of the control points for the stroke (x0, y0, x1, y1, ...). @@ -677,23 +677,23 @@ gimp_vectors_stroke_flip_free (GimpVectors *vectors, * Since: 2.4 **/ GimpVectorsStrokeType -gimp_vectors_stroke_get_points (GimpVectors *vectors, - gint stroke_id, - gint *num_points, - gdouble **controlpoints, - gboolean *closed) +gimp_path_stroke_get_points (GimpVectors *path, + gint stroke_id, + gint *num_points, + gdouble **controlpoints, + gboolean *closed) { GimpValueArray *args; GimpValueArray *return_vals; GimpVectorsStrokeType type = 0; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-get-points", + "gimp-path-stroke-get-points", args); gimp_value_array_unref (args); @@ -713,17 +713,17 @@ gimp_vectors_stroke_get_points (GimpVectors *vectors, } /** - * gimp_vectors_stroke_new_from_points: - * @vectors: The vectors object. + * gimp_path_stroke_new_from_points: + * @path: The path object. * @type: type of the stroke (always GIMP_VECTORS_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. * - * Adds a stroke of a given type to the vectors object. + * Adds a stroke of a given type to the path object. * - * Adds a stroke of a given type to the vectors object. The coordinates - * of the control points can be specified. For now only strokes of the + * 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 @@ -736,18 +736,18 @@ gimp_vectors_stroke_get_points (GimpVectors *vectors, * Since: 2.4 **/ gint -gimp_vectors_stroke_new_from_points (GimpVectors *vectors, - GimpVectorsStrokeType type, - gint num_points, - const gdouble *controlpoints, - gboolean closed) +gimp_path_stroke_new_from_points (GimpVectors *path, + GimpVectorsStrokeType type, + gint num_points, + const gdouble *controlpoints, + gboolean closed) { GimpValueArray *args; GimpValueArray *return_vals; gint stroke_id = 0; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, GIMP_TYPE_VECTORS_STROKE_TYPE, type, G_TYPE_INT, num_points, GIMP_TYPE_FLOAT_ARRAY, NULL, @@ -756,7 +756,7 @@ gimp_vectors_stroke_new_from_points (GimpVectors *vectors, gimp_value_set_float_array (gimp_value_array_index (args, 3), controlpoints, num_points); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-new-from-points", + "gimp-path-stroke-new-from-points", args); gimp_value_array_unref (args); @@ -769,8 +769,8 @@ gimp_vectors_stroke_new_from_points (GimpVectors *vectors, } /** - * gimp_vectors_stroke_interpolate: - * @vectors: The vectors object. + * gimp_path_stroke_interpolate: + * @path: The path object. * @stroke_id: The stroke ID. * @precision: The precision used for the approximation. * @num_coords: (out): The number of floats returned. @@ -787,24 +787,24 @@ gimp_vectors_stroke_new_from_points (GimpVectors *vectors, * Since: 2.4 **/ gdouble * -gimp_vectors_stroke_interpolate (GimpVectors *vectors, - gint stroke_id, - gdouble precision, - gint *num_coords, - gboolean *closed) +gimp_path_stroke_interpolate (GimpVectors *path, + gint stroke_id, + gdouble precision, + gint *num_coords, + gboolean *closed) { GimpValueArray *args; GimpValueArray *return_vals; gdouble *coords = NULL; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, precision, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-stroke-interpolate", + "gimp-path-stroke-interpolate", args); gimp_value_array_unref (args); @@ -823,36 +823,36 @@ gimp_vectors_stroke_interpolate (GimpVectors *vectors, } /** - * gimp_vectors_bezier_stroke_new_moveto: - * @vectors: The vectors object. + * gimp_path_bezier_stroke_new_moveto: + * @path: The path object. * @x0: The x-coordinate of the moveto. * @y0: The y-coordinate of the moveto. * - * Adds a bezier stroke with a single moveto to the vectors object. + * Adds a bezier stroke with a single moveto to the path object. * - * Adds a bezier stroke with a single moveto to the vectors object. + * Adds a bezier stroke with a single moveto to the path object. * * Returns: The resulting stroke. * * Since: 2.4 **/ gint -gimp_vectors_bezier_stroke_new_moveto (GimpVectors *vectors, - gdouble x0, - gdouble y0) +gimp_path_bezier_stroke_new_moveto (GimpVectors *path, + gdouble x0, + gdouble y0) { GimpValueArray *args; GimpValueArray *return_vals; gint stroke_id = 0; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_DOUBLE, x0, G_TYPE_DOUBLE, y0, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-bezier-stroke-new-moveto", + "gimp-path-bezier-stroke-new-moveto", args); gimp_value_array_unref (args); @@ -865,8 +865,8 @@ gimp_vectors_bezier_stroke_new_moveto (GimpVectors *vectors, } /** - * gimp_vectors_bezier_stroke_lineto: - * @vectors: The vectors object. + * gimp_path_bezier_stroke_lineto: + * @path: The path object. * @stroke_id: The stroke ID. * @x0: The x-coordinate of the lineto. * @y0: The y-coordinate of the lineto. @@ -880,24 +880,24 @@ gimp_vectors_bezier_stroke_new_moveto (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_bezier_stroke_lineto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0) +gimp_path_bezier_stroke_lineto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, x0, G_TYPE_DOUBLE, y0, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-bezier-stroke-lineto", + "gimp-path-bezier-stroke-lineto", args); gimp_value_array_unref (args); @@ -909,8 +909,8 @@ gimp_vectors_bezier_stroke_lineto (GimpVectors *vectors, } /** - * gimp_vectors_bezier_stroke_conicto: - * @vectors: The vectors object. + * gimp_path_bezier_stroke_conicto: + * @path: The path object. * @stroke_id: The stroke ID. * @x0: The x-coordinate of the control point. * @y0: The y-coordinate of the control point. @@ -928,19 +928,19 @@ gimp_vectors_bezier_stroke_lineto (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1) +gimp_path_bezier_stroke_conicto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, x0, G_TYPE_DOUBLE, y0, @@ -949,7 +949,7 @@ gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-bezier-stroke-conicto", + "gimp-path-bezier-stroke-conicto", args); gimp_value_array_unref (args); @@ -961,8 +961,8 @@ gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors, } /** - * gimp_vectors_bezier_stroke_cubicto: - * @vectors: The vectors object. + * gimp_path_bezier_stroke_cubicto: + * @path: The path object. * @stroke_id: The stroke ID. * @x0: The x-coordinate of the first control point. * @y0: The y-coordinate of the first control point. @@ -980,21 +980,21 @@ gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2) +gimp_path_bezier_stroke_cubicto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GimpValueArray *args; GimpValueArray *return_vals; gboolean success = TRUE; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_INT, stroke_id, G_TYPE_DOUBLE, x0, G_TYPE_DOUBLE, y0, @@ -1005,7 +1005,7 @@ gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-bezier-stroke-cubicto", + "gimp-path-bezier-stroke-cubicto", args); gimp_value_array_unref (args); @@ -1017,36 +1017,36 @@ gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors, } /** - * gimp_vectors_bezier_stroke_new_ellipse: - * @vectors: The vectors object. + * gimp_path_bezier_stroke_new_ellipse: + * @path: The path object. * @x0: The x-coordinate of the center. * @y0: The y-coordinate of the center. * @radius_x: The radius in x direction. * @radius_y: The radius in y direction. * @angle: The angle the x-axis of the ellipse (radians, counterclockwise). * - * Adds a bezier stroke describing an ellipse the vectors object. + * Adds a bezier stroke describing an ellipse the path object. * - * Adds a bezier stroke describing an ellipse the vectors object. + * Adds a bezier stroke describing an ellipse on the path object. * * Returns: The resulting stroke. * * Since: 2.4 **/ gint -gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors, - gdouble x0, - gdouble y0, - gdouble radius_x, - gdouble radius_y, - gdouble angle) +gimp_path_bezier_stroke_new_ellipse (GimpVectors *path, + gdouble x0, + gdouble y0, + gdouble radius_x, + gdouble radius_y, + gdouble angle) { GimpValueArray *args; GimpValueArray *return_vals; gint stroke_id = 0; args = gimp_value_array_new_from_types (NULL, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_DOUBLE, x0, G_TYPE_DOUBLE, y0, G_TYPE_DOUBLE, radius_x, @@ -1055,7 +1055,7 @@ gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-bezier-stroke-new-ellipse", + "gimp-path-bezier-stroke-new-ellipse", args); gimp_value_array_unref (args); @@ -1068,13 +1068,13 @@ gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors, } /** - * gimp_vectors_import_from_file: + * gimp_path_import_from_file: * @image: The image. * @file: The SVG file to import. - * @merge: Merge paths into a single vectors object. + * @merge: Merge paths into a single path object. * @scale: Scale the SVG to image dimensions. - * @num_vectors: (out): The number of newly created vectors. - * @vectors: (out) (array length=num_vectors) (element-type GimpVectors) (transfer container): The list of newly created vectors. + * @num_paths: (out): The number of newly created path. + * @path: (out) (array length=num_paths) (element-type GimpVectors) (transfer container): The list of newly created path. * * Import paths from an SVG file. * @@ -1086,12 +1086,12 @@ gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors, * Since: 2.4 **/ gboolean -gimp_vectors_import_from_file (GimpImage *image, - GFile *file, - gboolean merge, - gboolean scale, - gint *num_vectors, - GimpVectors ***vectors) +gimp_path_import_from_file (GimpImage *image, + GFile *file, + gboolean merge, + gboolean scale, + gint *num_paths, + GimpVectors ***path) { GimpValueArray *args; GimpValueArray *return_vals; @@ -1105,19 +1105,19 @@ gimp_vectors_import_from_file (GimpImage *image, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-import-from-file", + "gimp-path-import-from-file", args); gimp_value_array_unref (args); - *num_vectors = 0; - *vectors = NULL; + *num_paths = 0; + *path = NULL; success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; if (success) { - *num_vectors = GIMP_VALUES_GET_INT (return_vals, 1); - { GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) *vectors = g_memdup2 (a->data, a->length * sizeof (gpointer)); }; + *num_paths = GIMP_VALUES_GET_INT (return_vals, 1); + { GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) *path = g_memdup2 (a->data, a->length * sizeof (gpointer)); }; } gimp_value_array_unref (return_vals); @@ -1126,14 +1126,14 @@ gimp_vectors_import_from_file (GimpImage *image, } /** - * gimp_vectors_import_from_string: + * gimp_path_import_from_string: * @image: The image. * @string: A string that must be a complete and valid SVG document. * @length: Number of bytes in string or -1 if the string is NULL terminated. - * @merge: Merge paths into a single vectors object. + * @merge: Merge paths into a single path object. * @scale: Scale the SVG to image dimensions. - * @num_vectors: (out): The number of newly created vectors. - * @vectors: (out) (array length=num_vectors) (element-type GimpVectors) (transfer container): The list of newly created vectors. + * @num_paths: (out): The number of newly created path. + * @path: (out) (array length=num_paths) (element-type GimpVectors) (transfer container): The list of newly created path. * * Import paths from an SVG string. * @@ -1146,13 +1146,13 @@ gimp_vectors_import_from_file (GimpImage *image, * Since: 2.4 **/ gboolean -gimp_vectors_import_from_string (GimpImage *image, - const gchar *string, - gint length, - gboolean merge, - gboolean scale, - gint *num_vectors, - GimpVectors ***vectors) +gimp_path_import_from_string (GimpImage *image, + const gchar *string, + gint length, + gboolean merge, + gboolean scale, + gint *num_paths, + GimpVectors ***path) { GimpValueArray *args; GimpValueArray *return_vals; @@ -1167,19 +1167,19 @@ gimp_vectors_import_from_string (GimpImage *image, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-import-from-string", + "gimp-path-import-from-string", args); gimp_value_array_unref (args); - *num_vectors = 0; - *vectors = NULL; + *num_paths = 0; + *path = NULL; success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS; if (success) { - *num_vectors = GIMP_VALUES_GET_INT (return_vals, 1); - { GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) *vectors = g_memdup2 (a->data, a->length * sizeof (gpointer)); }; + *num_paths = GIMP_VALUES_GET_INT (return_vals, 1); + { GimpObjectArray *a = g_value_get_boxed (gimp_value_array_index (return_vals, 2)); if (a) *path = g_memdup2 (a->data, a->length * sizeof (gpointer)); }; } gimp_value_array_unref (return_vals); @@ -1188,26 +1188,26 @@ gimp_vectors_import_from_string (GimpImage *image, } /** - * gimp_vectors_export_to_file: + * gimp_path_export_to_file: * @image: The image. * @file: The SVG file to create. - * @vectors: (nullable): The vectors object to export, or %NULL for all in the image. + * @path: (nullable): The path object to export, or %NULL for all in the image. * * save a path as an SVG file. * - * This procedure creates an SVG file to save a Vectors object, that - * is, a path. The resulting file can be edited using a vector graphics - * application, or later reloaded into GIMP. Pass %NULL as the - * 'vectors' argument to export all paths in the image. + * This procedure creates an SVG file to save a Path object, that is, a + * path. The resulting file can be edited using a vector graphics + * application, or later reloaded into GIMP. Pass %NULL as the 'path' + * argument to export all paths in the image. * * Returns: TRUE on success. * * Since: 2.6 **/ gboolean -gimp_vectors_export_to_file (GimpImage *image, - GFile *file, - GimpVectors *vectors) +gimp_path_export_to_file (GimpImage *image, + GFile *file, + GimpVectors *path) { GimpValueArray *args; GimpValueArray *return_vals; @@ -1216,11 +1216,11 @@ gimp_vectors_export_to_file (GimpImage *image, args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_IMAGE, image, G_TYPE_FILE, file, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-export-to-file", + "gimp-path-export-to-file", args); gimp_value_array_unref (args); @@ -1232,16 +1232,16 @@ gimp_vectors_export_to_file (GimpImage *image, } /** - * gimp_vectors_export_to_string: + * gimp_path_export_to_string: * @image: The image. - * @vectors: (nullable): The vectors object to export, or %NULL for all in the image. + * @path: (nullable): The path object to export, or %NULL for all in the image. * * Save a path as an SVG string. * - * This procedure works like gimp_vectors_export_to_file() but creates - * a string rather than a file. The string is NULL-terminated and holds - * a complete XML document. Pass %NULL as the 'vectors' argument to - * export all paths in the image. + * This procedure works like gimp_path_export_to_file() but creates a + * string rather than a file. The string is NULL-terminated and holds a + * complete XML document. Pass %NULL as the 'path' argument to export + * all paths in the image. * * Returns: (transfer full): * A string whose contents are a complete SVG document. @@ -1250,8 +1250,8 @@ gimp_vectors_export_to_file (GimpImage *image, * Since: 2.6 **/ gchar * -gimp_vectors_export_to_string (GimpImage *image, - GimpVectors *vectors) +gimp_path_export_to_string (GimpImage *image, + GimpVectors *path) { GimpValueArray *args; GimpValueArray *return_vals; @@ -1259,11 +1259,11 @@ gimp_vectors_export_to_string (GimpImage *image, args = gimp_value_array_new_from_types (NULL, GIMP_TYPE_IMAGE, image, - GIMP_TYPE_VECTORS, vectors, + GIMP_TYPE_VECTORS, path, G_TYPE_NONE); return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (), - "gimp-vectors-export-to-string", + "gimp-path-export-to-string", args); gimp_value_array_unref (args); diff --git a/libgimp/gimppath_pdb.h b/libgimp/gimppath_pdb.h new file mode 100644 index 0000000000..48509f62a5 --- /dev/null +++ b/libgimp/gimppath_pdb.h @@ -0,0 +1,146 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball + * + * gimppath_pdb.h + * + * This library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +/* NOTE: This file is auto-generated by pdbgen.pl */ + +#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GIMP_PATH_PDB_H__ +#define __GIMP_PATH_PDB_H__ + +G_BEGIN_DECLS + +/* For information look into the C source or the html documentation */ + + +GimpVectors* gimp_path_new (GimpImage *image, + const gchar *name); +GimpVectors* gimp_path_new_from_text_layer (GimpImage *image, + GimpLayer *layer); +GimpVectors* gimp_path_copy (GimpVectors *path); +gint* gimp_path_get_strokes (GimpVectors *path, + gint *num_strokes); +gdouble gimp_path_stroke_get_length (GimpVectors *path, + gint stroke_id, + gdouble precision); +gboolean gimp_path_stroke_get_point_at_dist (GimpVectors *path, + gint stroke_id, + gdouble dist, + gdouble precision, + gdouble *x_point, + gdouble *y_point, + gdouble *slope, + gboolean *valid); +gboolean gimp_path_remove_stroke (GimpVectors *path, + gint stroke_id); +gboolean gimp_path_stroke_close (GimpVectors *path, + gint stroke_id); +gboolean gimp_path_stroke_reverse (GimpVectors *path, + gint stroke_id); +gboolean gimp_path_stroke_translate (GimpVectors *path, + gint stroke_id, + gdouble off_x, + gdouble off_y); +gboolean gimp_path_stroke_scale (GimpVectors *path, + gint stroke_id, + gdouble scale_x, + gdouble scale_y); +gboolean gimp_path_stroke_rotate (GimpVectors *path, + gint stroke_id, + gdouble center_x, + gdouble center_y, + gdouble angle); +gboolean gimp_path_stroke_flip (GimpVectors *path, + gint stroke_id, + GimpOrientationType flip_type, + gdouble axis); +gboolean gimp_path_stroke_flip_free (GimpVectors *path, + gint stroke_id, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +GimpVectorsStrokeType gimp_path_stroke_get_points (GimpVectors *path, + gint stroke_id, + gint *num_points, + gdouble **controlpoints, + gboolean *closed); +gint gimp_path_stroke_new_from_points (GimpVectors *path, + GimpVectorsStrokeType type, + gint num_points, + const gdouble *controlpoints, + gboolean closed); +gdouble* gimp_path_stroke_interpolate (GimpVectors *path, + gint stroke_id, + gdouble precision, + gint *num_coords, + gboolean *closed); +gint gimp_path_bezier_stroke_new_moveto (GimpVectors *path, + gdouble x0, + gdouble y0); +gboolean gimp_path_bezier_stroke_lineto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0); +gboolean gimp_path_bezier_stroke_conicto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1); +gboolean gimp_path_bezier_stroke_cubicto (GimpVectors *path, + gint stroke_id, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +gint gimp_path_bezier_stroke_new_ellipse (GimpVectors *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, + GimpVectors ***path); +gboolean gimp_path_import_from_string (GimpImage *image, + const gchar *string, + gint length, + gboolean merge, + gboolean scale, + gint *num_paths, + GimpVectors ***path); +gboolean gimp_path_export_to_file (GimpImage *image, + GFile *file, + GimpVectors *path); +gchar* gimp_path_export_to_string (GimpImage *image, + GimpVectors *path); + + +G_END_DECLS + +#endif /* __GIMP_PATH_PDB_H__ */ diff --git a/libgimp/gimpplugin.c b/libgimp/gimpplugin.c index 502d0a5ae0..a118f8adc9 100644 --- a/libgimp/gimpplugin.c +++ b/libgimp/gimpplugin.c @@ -1600,7 +1600,7 @@ _gimp_plug_in_get_item (GimpPlugIn *plug_in, "id", item_id, NULL); } - else if (gimp_item_id_is_vectors (item_id)) + else if (gimp_item_id_is_path (item_id)) { item = g_object_new (GIMP_TYPE_VECTORS, "id", item_id, diff --git a/libgimp/gimpvectors_pdb.h b/libgimp/gimpvectors_pdb.h deleted file mode 100644 index a48a77a35e..0000000000 --- a/libgimp/gimpvectors_pdb.h +++ /dev/null @@ -1,146 +0,0 @@ -/* LIBGIMP - The GIMP Library - * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball - * - * gimpvectors_pdb.h - * - * This library is free software: you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - */ - -/* NOTE: This file is auto-generated by pdbgen.pl */ - -#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION) -#error "Only can be included directly." -#endif - -#ifndef __GIMP_VECTORS_PDB_H__ -#define __GIMP_VECTORS_PDB_H__ - -G_BEGIN_DECLS - -/* For information look into the C source or the html documentation */ - - -GimpVectors* gimp_vectors_new (GimpImage *image, - const gchar *name); -GimpVectors* gimp_vectors_new_from_text_layer (GimpImage *image, - GimpLayer *layer); -GimpVectors* gimp_vectors_copy (GimpVectors *vectors); -gint* gimp_vectors_get_strokes (GimpVectors *vectors, - gint *num_strokes); -gdouble gimp_vectors_stroke_get_length (GimpVectors *vectors, - gint stroke_id, - gdouble precision); -gboolean gimp_vectors_stroke_get_point_at_dist (GimpVectors *vectors, - gint stroke_id, - gdouble dist, - gdouble precision, - gdouble *x_point, - gdouble *y_point, - gdouble *slope, - gboolean *valid); -gboolean gimp_vectors_remove_stroke (GimpVectors *vectors, - gint stroke_id); -gboolean gimp_vectors_stroke_close (GimpVectors *vectors, - gint stroke_id); -gboolean gimp_vectors_stroke_reverse (GimpVectors *vectors, - gint stroke_id); -gboolean gimp_vectors_stroke_translate (GimpVectors *vectors, - gint stroke_id, - gdouble off_x, - gdouble off_y); -gboolean gimp_vectors_stroke_scale (GimpVectors *vectors, - gint stroke_id, - gdouble scale_x, - gdouble scale_y); -gboolean gimp_vectors_stroke_rotate (GimpVectors *vectors, - gint stroke_id, - gdouble center_x, - gdouble center_y, - gdouble angle); -gboolean gimp_vectors_stroke_flip (GimpVectors *vectors, - gint stroke_id, - GimpOrientationType flip_type, - gdouble axis); -gboolean gimp_vectors_stroke_flip_free (GimpVectors *vectors, - gint stroke_id, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2); -GimpVectorsStrokeType gimp_vectors_stroke_get_points (GimpVectors *vectors, - gint stroke_id, - gint *num_points, - gdouble **controlpoints, - gboolean *closed); -gint gimp_vectors_stroke_new_from_points (GimpVectors *vectors, - GimpVectorsStrokeType type, - gint num_points, - const gdouble *controlpoints, - gboolean closed); -gdouble* gimp_vectors_stroke_interpolate (GimpVectors *vectors, - gint stroke_id, - gdouble precision, - gint *num_coords, - gboolean *closed); -gint gimp_vectors_bezier_stroke_new_moveto (GimpVectors *vectors, - gdouble x0, - gdouble y0); -gboolean gimp_vectors_bezier_stroke_lineto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0); -gboolean gimp_vectors_bezier_stroke_conicto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1); -gboolean gimp_vectors_bezier_stroke_cubicto (GimpVectors *vectors, - gint stroke_id, - gdouble x0, - gdouble y0, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2); -gint gimp_vectors_bezier_stroke_new_ellipse (GimpVectors *vectors, - gdouble x0, - gdouble y0, - gdouble radius_x, - gdouble radius_y, - gdouble angle); -gboolean gimp_vectors_import_from_file (GimpImage *image, - GFile *file, - gboolean merge, - gboolean scale, - gint *num_vectors, - GimpVectors ***vectors); -gboolean gimp_vectors_import_from_string (GimpImage *image, - const gchar *string, - gint length, - gboolean merge, - gboolean scale, - gint *num_vectors, - GimpVectors ***vectors); -gboolean gimp_vectors_export_to_file (GimpImage *image, - GFile *file, - GimpVectors *vectors); -gchar* gimp_vectors_export_to_string (GimpImage *image, - GimpVectors *vectors); - - -G_END_DECLS - -#endif /* __GIMP_VECTORS_PDB_H__ */ diff --git a/libgimp/meson.build b/libgimp/meson.build index 06cff7ef2f..09d311fce2 100644 --- a/libgimp/meson.build +++ b/libgimp/meson.build @@ -103,6 +103,7 @@ pdb_wrappers_sources = [ 'gimppalette_pdb.c', 'gimppalettes_pdb.c', 'gimppaletteselect_pdb.c', + 'gimppath_pdb.c', 'gimppattern_pdb.c', 'gimppatterns_pdb.c', 'gimppatternselect_pdb.c', @@ -111,7 +112,6 @@ pdb_wrappers_sources = [ 'gimpselection_pdb.c', 'gimptextlayer_pdb.c', 'gimptexttool_pdb.c', - 'gimpvectors_pdb.c', ] pdb_wrappers_headers = [ @@ -159,6 +159,7 @@ pdb_wrappers_headers = [ 'gimppalette_pdb.h', 'gimppalettes_pdb.h', 'gimppaletteselect_pdb.h', + 'gimppath_pdb.h', 'gimppattern_pdb.h', 'gimppatterns_pdb.h', 'gimppatternselect_pdb.h', @@ -167,7 +168,6 @@ pdb_wrappers_headers = [ 'gimpselection_pdb.h', 'gimptextlayer_pdb.h', 'gimptexttool_pdb.h', - 'gimpvectors_pdb.h', ] libgimp_sources_introspectable = [ diff --git a/pdb/groups.pl b/pdb/groups.pl index e06c151f6c..ab1e6407db 100644 --- a/pdb/groups.pl +++ b/pdb/groups.pl @@ -43,6 +43,7 @@ palette palette_select palettes + path pattern pattern_select patterns @@ -55,5 +56,4 @@ text_layer text_tool unit - vectors ); diff --git a/pdb/groups/item.pdb b/pdb/groups/item.pdb index 643ad96dfc..96ffa439aa 100644 --- a/pdb/groups/item.pdb +++ b/pdb/groups/item.pdb @@ -270,11 +270,11 @@ CODE ); } -sub item_id_is_vectors { - $blurb = 'Returns whether the item ID is a vectors.'; +sub item_id_is_path { + $blurb = 'Returns whether the item ID is a path.'; $help = < 'vectors', type => 'boolean', - desc => 'TRUE if the item ID is a vectors, FALSE otherwise' } + { name => 'path', type => 'boolean', + desc => 'TRUE if the item ID is a path, FALSE otherwise' } ); %invoke = ( @@ -295,8 +295,8 @@ HELP { GimpItem *item = gimp_item_get_by_id (gimp, item_id); - vectors = (GIMP_IS_VECTORS (item) && - ! gimp_item_is_removed (item)); + path = (GIMP_IS_VECTORS (item) && + ! gimp_item_is_removed (item)); } CODE ); @@ -1009,7 +1009,7 @@ CODE "core/gimplist.h" "core/gimpselection.h" "text/gimptextlayer.h" - "vectors/gimpvectors.h" + "vectors/gimpvectors.h" "gimppdb-utils.h" "gimppdbcontext.h" "gimp-intl.h"); @@ -1019,15 +1019,15 @@ CODE item_id_is_layer item_id_is_text_layer item_id_is_group_layer - item_id_is_channel - item_id_is_layer_mask - item_id_is_selection - item_id_is_vectors + item_id_is_channel + item_id_is_layer_mask + item_id_is_path + item_id_is_selection item_get_image item_delete - item_is_group + item_is_group item_get_parent - item_get_children + item_get_children item_get_expanded item_set_expanded item_get_name item_set_name item_get_visible item_set_visible @@ -1036,9 +1036,9 @@ CODE item_get_lock_visibility item_set_lock_visibility item_get_color_tag item_set_color_tag item_get_tattoo item_set_tattoo - item_attach_parasite item_detach_parasite - item_get_parasite - item_get_parasite_list); + item_attach_parasite item_detach_parasite + item_get_parasite + item_get_parasite_list); %exports = (app => [@procs], lib => [@procs]); diff --git a/pdb/groups/vectors.pdb b/pdb/groups/path.pdb similarity index 66% rename from pdb/groups/vectors.pdb rename to pdb/groups/path.pdb index 07930c30ea..e6033c88a9 100644 --- a/pdb/groups/vectors.pdb +++ b/pdb/groups/path.pdb @@ -14,11 +14,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -sub vectors_new { - $blurb = 'Creates a new empty vectors object.'; +sub path_new { + $blurb = 'Creates a new empty path object.'; $help = <<'HELP'; -Creates a new empty vectors object. The vectors object needs to be added to +Creates a new empty path object. The path object needs to be added to the image using gimp_image_insert_vectors(). HELP @@ -28,29 +28,29 @@ HELP { name => 'image', type => 'image', desc => 'The image' }, { name => 'name', type => 'string', - desc => 'the name of the new vector object.' } + desc => 'the name of the new path object.' } ); @outargs = ( - { name => 'vectors', type => 'vectors', - desc => 'the current vector object, 0 if no vector exists + { name => 'path', type => 'vectors', + desc => 'the current path object, 0 if no path exists in the image.' } ); %invoke = ( code => <<'CODE' { - vectors = gimp_vectors_new (image, name); + path = gimp_vectors_new (image, name); } CODE ); } -sub vectors_new_from_text_layer { - $blurb = 'Creates a new vectors object from a text layer.'; +sub path_new_from_text_layer { + $blurb = 'Creates a new path object from a text layer.'; $help = <<'HELP'; -Creates a new vectors object from a text layer. The vectors object needs to +Creates a new path object from a text layer. The path object needs to be added to the image using gimp_image_insert_vectors(). HELP @@ -64,8 +64,8 @@ HELP ); @outargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors of the text layer.' } + { name => 'path', type => 'vectors', + desc => 'The path of the text layer.' } ); %invoke = ( @@ -75,11 +75,11 @@ HELP { gint x, y; - vectors = gimp_text_vectors_new (image, + path = gimp_text_vectors_new (image, gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer))); gimp_item_get_offset (GIMP_ITEM (layer), &x, &y); - gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE); + gimp_item_translate (GIMP_ITEM (path), x, y, FALSE); } else { @@ -90,39 +90,39 @@ CODE ); } -sub vectors_copy { - $blurb = 'Copy a vectors object.'; +sub path_copy { + $blurb = 'Copy a path object.'; $help = <<'HELP'; -This procedure copies the specified vectors object and returns the copy. +This procedure copies the specified path object and returns the copy. HELP barak_pdb_misc('2008', '2.6'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object to copy' } + { name => 'path', type => 'vectors', + desc => 'The path object to copy' } ); @outargs = ( - { name => 'vectors_copy', type => 'vectors', - desc => 'The newly copied vectors object' } + { name => 'path_copy', type => 'vectors', + desc => 'The newly copied path object' } ); %invoke = ( code => <<'CODE' { - vectors_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors), - G_TYPE_FROM_INSTANCE (vectors))); + path_copy = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (path), + G_TYPE_FROM_INSTANCE (path))); - if (! vectors_copy) + if (! path_copy) success = FALSE; } CODE ); } -sub vectors_get_strokes { +sub path_get_strokes { $blurb = 'List the strokes associated with the passed path.'; $help = <<'HELP'; @@ -132,8 +132,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' } + { name => 'path', type => 'vectors', + desc => 'The path object' } ); @outargs = ( @@ -146,7 +146,7 @@ HELP %invoke = ( code => <<"CODE" { - num_strokes = gimp_vectors_get_n_strokes (vectors); + num_strokes = gimp_vectors_get_n_strokes (path); if (num_strokes) { @@ -155,9 +155,9 @@ HELP stroke_ids = g_new (gint32, num_strokes); - for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); + for (cur_stroke = gimp_vectors_stroke_get_next (path, NULL); cur_stroke; - cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke)) + cur_stroke = gimp_vectors_stroke_get_next (path, cur_stroke)) { stroke_ids[i] = gimp_stroke_get_id (cur_stroke); i++; @@ -168,15 +168,15 @@ CODE ); } -sub vectors_stroke_get_length { +sub path_stroke_get_length { $blurb = 'Measure the length of the given stroke.'; $help = 'Measure the length of the given stroke.'; &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'precision', type => '0.0 <= float', default => 0.1, @@ -191,7 +191,7 @@ sub vectors_stroke_get_length { %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) length = gimp_stroke_get_length (stroke, precision); @@ -202,7 +202,7 @@ CODE ); } -sub vectors_stroke_get_point_at_dist { +sub path_stroke_get_point_at_dist { $blurb = 'Get point at a specified distance along the stroke.'; $help = <<'HELP'; @@ -216,8 +216,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'dist', type => 'float', @@ -240,7 +240,7 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) { @@ -258,18 +258,18 @@ CODE ); } -sub vectors_remove_stroke { - $blurb = 'remove the stroke from a vectors object.'; +sub path_remove_stroke { + $blurb = 'remove the stroke from a path object.'; $help = <<'HELP'; -Remove the stroke from a vectors object. +Remove the stroke from a path object. HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' } ); @@ -277,17 +277,17 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Remove path stroke"), - vectors); + path); - gimp_vectors_stroke_remove (vectors, stroke); + gimp_vectors_stroke_remove (path, stroke); } else success = FALSE; @@ -296,7 +296,7 @@ CODE ); } -sub vectors_stroke_close { +sub path_stroke_close { $blurb = 'closes the specified stroke.'; $help = <<'HELP'; @@ -306,8 +306,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' } ); @@ -315,19 +315,19 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Close path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_close (stroke); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -337,7 +337,7 @@ CODE } -sub vectors_stroke_reverse { +sub path_stroke_reverse { $blurb = 'reverses the specified stroke.'; $help = <<'HELP'; @@ -347,8 +347,8 @@ HELP &simon_pdb_misc('2020', '3.0'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' } ); @@ -356,19 +356,19 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Reverse path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_reverse (stroke); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -378,7 +378,7 @@ CODE } -sub vectors_stroke_translate { +sub path_stroke_translate { $blurb = 'translate the given stroke.'; $help = <<'HELP'; @@ -388,8 +388,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => "off_x", type => 'float', @@ -401,21 +401,21 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Translate path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_translate (stroke, off_x, off_y); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -424,7 +424,7 @@ CODE ); } -sub vectors_stroke_scale { +sub path_stroke_scale { $blurb = 'scales the given stroke.'; $help = <<'HELP'; @@ -434,8 +434,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => "scale_x", type => 'float', @@ -447,21 +447,21 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Scale path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_scale (stroke, scale_x, scale_y); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -470,7 +470,7 @@ CODE ); } -sub vectors_stroke_rotate { +sub path_stroke_rotate { $blurb = 'rotates the given stroke.'; $help = <<'HELP'; @@ -479,8 +479,8 @@ HELP &joao_pdb_misc('2006', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => "center_x", type => 'float', @@ -494,21 +494,21 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Rotate path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_rotate (stroke, center_x, center_y, angle); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -517,7 +517,7 @@ CODE ); } -sub vectors_stroke_flip { +sub path_stroke_flip { $blurb = 'flips the given stroke.'; $help = <<'HELP'; @@ -526,8 +526,8 @@ HELP &joao_pdb_misc('2006', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => "flip_type", @@ -540,21 +540,21 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Flip path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_flip (stroke, flip_type, axis); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -563,7 +563,7 @@ CODE ); } -sub vectors_stroke_flip_free { +sub path_stroke_flip_free { $blurb = 'flips the given stroke about an arbitrary axis.'; $help = <<'HELP'; @@ -573,8 +573,8 @@ HELP &joao_pdb_misc('2006', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => "x1", type => 'float', @@ -591,21 +591,21 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT | - GIMP_PDB_ITEM_POSITION, - error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT | + GIMP_PDB_ITEM_POSITION, + error); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Flip path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_stroke_flip_free (stroke, x1, y1, x2, y2); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -614,7 +614,7 @@ CODE ); } -sub vectors_stroke_get_points { +sub path_stroke_get_points { $blurb = 'returns the control points of a stroke.'; $help = <<'HELP'; @@ -626,8 +626,8 @@ HELP &simon_pdb_misc('2006', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' } ); @@ -646,7 +646,7 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (GIMP_IS_BEZIER_STROKE (stroke)) { @@ -682,7 +682,7 @@ CODE } -sub vectors_stroke_interpolate { +sub path_stroke_interpolate { $blurb = 'returns polygonal approximation of the stroke.'; $help = <<'HELP'; @@ -692,8 +692,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'precision', type => 'float', @@ -712,7 +712,7 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, 0, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, 0, error); if (stroke) { @@ -745,11 +745,11 @@ CODE } -sub vectors_stroke_new_from_points { - $blurb = 'Adds a stroke of a given type to the vectors object.'; +sub path_stroke_new_from_points { + $blurb = 'Adds a stroke of a given type to the path object.'; $help = <<'HELP'; -Adds a stroke of a given type to the vectors 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. 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 @@ -762,8 +762,8 @@ HELP &simon_pdb_misc('2006', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'type', type => 'enum GimpVectorsStrokeType', desc => 'type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now).' }, { name => 'controlpoints', type => 'floatarray', @@ -805,12 +805,12 @@ HELP stroke = gimp_stroke_new_from_coords (type, coords, num_points/2, closed); if (stroke) { - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -825,18 +825,18 @@ CODE ); } -sub vectors_bezier_stroke_new_moveto { - $blurb = 'Adds a bezier stroke with a single moveto to the vectors object.'; +sub path_bezier_stroke_new_moveto { + $blurb = 'Adds a bezier stroke with a single moveto to the path object.'; $help = <<'HELP'; -Adds a bezier stroke with a single moveto to the vectors object. +Adds a bezier stroke with a single moveto to the path object. HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'x0', type => 'float', desc => 'The x-coordinate of the moveto' }, { name => 'y0', type => 'float', @@ -851,9 +851,9 @@ HELP %invoke = ( code => <<"CODE" { - if (gimp_pdb_item_is_modifiable (GIMP_ITEM (vectors), + if (gimp_pdb_item_is_modifiable (GIMP_ITEM (path), GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error)) + gimp_pdb_item_is_not_group (GIMP_ITEM (path), error)) { GimpStroke *stroke; GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES; @@ -863,12 +863,12 @@ HELP stroke = gimp_bezier_stroke_new_moveto (&coord0); - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -880,7 +880,7 @@ CODE ); } -sub vectors_bezier_stroke_lineto { +sub path_bezier_stroke_lineto { $blurb = 'Extends a bezier stroke with a lineto.'; $help = <<'HELP'; @@ -890,8 +890,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'x0', type => 'float', @@ -903,8 +903,8 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -913,14 +913,14 @@ HELP coord0.x = x0; coord0.y = y0; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_lineto (stroke, &coord0); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -929,7 +929,7 @@ CODE ); } -sub vectors_bezier_stroke_conicto { +sub path_bezier_stroke_conicto { $blurb = 'Extends a bezier stroke with a conic bezier spline.'; $help = <<'HELP'; @@ -941,8 +941,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'x0', type => 'float', @@ -958,8 +958,8 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -972,14 +972,14 @@ HELP coord1.x = x1; coord1.y = y1; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -988,7 +988,7 @@ CODE ); } -sub vectors_bezier_stroke_cubicto { +sub path_bezier_stroke_cubicto { $blurb = 'Extends a bezier stroke with a cubic bezier spline.'; $help = <<'HELP'; @@ -998,8 +998,8 @@ HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'stroke_id', type => 'int32', desc => 'The stroke ID' }, { name => 'x0', type => 'float', @@ -1019,8 +1019,8 @@ HELP %invoke = ( code => <<"CODE" { - GimpStroke *stroke = gimp_pdb_get_vectors_stroke (vectors, stroke_id, - GIMP_PDB_ITEM_CONTENT, error); + GimpStroke *stroke = gimp_pdb_get_path_stroke (path, stroke_id, + GIMP_PDB_ITEM_CONTENT, error); if (stroke) { @@ -1037,14 +1037,14 @@ HELP coord2.x = x2; coord2.y = y2; - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Extend path stroke"), - vectors); + path); - gimp_vectors_freeze (vectors); + gimp_vectors_freeze (path); gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); - gimp_vectors_thaw (vectors); + gimp_vectors_thaw (path); } else success = FALSE; @@ -1053,18 +1053,18 @@ CODE ); } -sub vectors_bezier_stroke_new_ellipse { - $blurb = 'Adds a bezier stroke describing an ellipse the vectors object.'; +sub path_bezier_stroke_new_ellipse { + $blurb = 'Adds a bezier stroke describing an ellipse the path object.'; $help = <<'HELP'; -Adds a bezier stroke describing an ellipse the vectors object. +Adds a bezier stroke describing an ellipse on the path object. HELP &simon_pdb_misc('2005', '2.4'); @inargs = ( - { name => 'vectors', type => 'vectors', - desc => 'The vectors object' }, + { name => 'path', type => 'vectors', + desc => 'The path object' }, { name => 'x0', type => 'float', desc => 'The x-coordinate of the center' }, { name => 'y0', type => 'float', @@ -1086,9 +1086,9 @@ HELP %invoke = ( code => <<"CODE" { - if (gimp_pdb_item_is_modifiable (GIMP_ITEM (vectors), + if (gimp_pdb_item_is_modifiable (GIMP_ITEM (path), GIMP_PDB_ITEM_CONTENT, error) && - gimp_pdb_item_is_not_group (GIMP_ITEM (vectors), error)) + gimp_pdb_item_is_not_group (GIMP_ITEM (path), error)) { GimpStroke *stroke; GimpCoords coord0 = GIMP_COORDS_DEFAULT_VALUES; @@ -1098,12 +1098,12 @@ HELP stroke = gimp_bezier_stroke_new_ellipse (&coord0, radius_x, radius_y, angle); - if (gimp_item_is_attached (GIMP_ITEM (vectors))) - gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (vectors)), + if (gimp_item_is_attached (GIMP_ITEM (path))) + gimp_image_undo_push_vectors_mod (gimp_item_get_image (GIMP_ITEM (path)), _("Add path stroke"), - vectors); + path); - gimp_vectors_stroke_add (vectors, stroke); + gimp_vectors_stroke_add (path, stroke); g_object_unref (stroke); stroke_id = gimp_stroke_get_id (stroke); @@ -1115,7 +1115,7 @@ CODE ); } -sub vectors_import_from_file { +sub path_import_from_file { $blurb = 'Import paths from an SVG file.'; $help = <<'HELP'; @@ -1131,48 +1131,48 @@ HELP { name => 'file', type => 'file', desc => 'The SVG file to import.' }, { name => 'merge', type => 'boolean', - desc => 'Merge paths into a single vectors object.' }, + desc => 'Merge paths into a single path object.' }, { name => 'scale', type => 'boolean', desc => 'Scale the SVG to image dimensions.' } ); @outargs = ( - { name => 'vectors', type => 'vectorarray', void_ret => 1, - desc => 'The list of newly created vectors', - array => { name => 'num_vectors', - desc => 'The number of newly created vectors' } } + { name => 'path', type => 'vectorarray', void_ret => 1, + desc => 'The list of newly created path', + array => { name => 'num_paths', + desc => 'The number of newly created path' } } ); %invoke = ( headers => [ qw("vectors/gimpvectors-import.h") ], code => <<'CODE' { - GList *vectors_list = NULL; + GList *path_list = NULL; /* FIXME tree */ success = gimp_vectors_import_file (image, file, merge, scale, NULL, -1, - &vectors_list, error); + &path_list, error); if (success) { - num_vectors = g_list_length (vectors_list); + num_paths = g_list_length (path_list); - if (num_vectors) + if (num_paths) { GList *list; gint i; - vectors = g_new (GimpVectors *, num_vectors); + path = g_new (GimpVectors *, num_paths); - for (i = 0, list = vectors_list; - i < num_vectors; + for (i = 0, list = path_list; + i < num_paths; i++, list = g_list_next (list)) { - vectors[i] = g_object_ref (list->data); + path[i] = g_object_ref (list->data); } - g_list_free (vectors_list); + g_list_free (path_list); } } } @@ -1180,7 +1180,7 @@ CODE ); } -sub vectors_import_from_string { +sub path_import_from_string { $blurb = 'Import paths from an SVG string.'; $help = <<'HELP'; @@ -1200,48 +1200,48 @@ HELP desc => 'Number of bytes in string or -1 if the string is NULL terminated.' }, { name => 'merge', type => 'boolean', - desc => 'Merge paths into a single vectors object.' }, + desc => 'Merge paths into a single path object.' }, { name => 'scale', type => 'boolean', desc => 'Scale the SVG to image dimensions.' } ); @outargs = ( - { name => 'vectors', type => 'vectorarray', void_ret => 1, - desc => 'The list of newly created vectors', - array => { name => 'num_vectors', - desc => 'The number of newly created vectors' } } + { name => 'path', type => 'vectorarray', void_ret => 1, + desc => 'The list of newly created path', + array => { name => 'num_paths', + desc => 'The number of newly created path' } } ); %invoke = ( headers => [ qw("vectors/gimpvectors-import.h") ], code => <<'CODE' { - GList *vectors_list = NULL; + GList *path_list = NULL; /* FIXME tree */ success = gimp_vectors_import_buffer (image, string, length, merge, scale, NULL, -1, - &vectors_list, error); + &path_list, error); if (success) { - num_vectors = g_list_length (vectors_list); + num_paths = g_list_length (path_list); - if (num_vectors) + if (num_paths) { GList *list; gint i; - vectors = g_new (GimpVectors *, num_vectors); + path = g_new (GimpVectors *, num_paths); - for (i = 0, list = vectors_list; - i < num_vectors; + for (i = 0, list = path_list; + i < num_paths; i++, list = g_list_next (list)) { - vectors[i] = g_object_ref (list->data); + path[i] = g_object_ref (list->data); } - g_list_free (vectors_list); + g_list_free (path_list); } } } @@ -1249,13 +1249,13 @@ CODE ); } -sub vectors_export_to_file { +sub path_export_to_file { $blurb = 'save a path as an SVG file.'; $help = <<'HELP'; -This procedure creates an SVG file to save a Vectors object, that is, +This procedure creates an SVG file to save a Path object, that is, a path. The resulting file can be edited using a vector graphics -application, or later reloaded into GIMP. Pass %NULL as the 'vectors' +application, or later reloaded into GIMP. Pass %NULL as the 'path' argument to export all paths in the image. HELP @@ -1266,35 +1266,35 @@ HELP desc => 'The image' }, { name => 'file', type => 'file', desc => 'The SVG file to create.' }, - { name => 'vectors', type => 'vectors', + { name => 'path', type => 'vectors', no_validate => 1, none_ok => 1, - desc => 'The vectors object to export, or %NULL for all in the image' } + desc => 'The path object to export, or %NULL for all in the image' } ); %invoke = ( headers => [ qw("vectors/gimpvectors-export.h") ], code => <<'CODE' { - GList *vectors_list = NULL; + GList *path_list = NULL; - if (vectors != NULL) - vectors_list = g_list_prepend (vectors_list, vectors); + if (path != NULL) + path_list = g_list_prepend (path_list, path); - success = gimp_vectors_export_file (image, vectors_list, file, error); + success = gimp_vectors_export_file (image, path_list, file, error); - g_list_free (vectors_list); + g_list_free (path_list); } CODE ); } -sub vectors_export_to_string { +sub path_export_to_string { $blurb = 'Save a path as an SVG string.'; $help = <<'HELP'; -This procedure works like gimp_vectors_export_to_file() but creates a string +This procedure works like gimp_path_export_to_file() but creates a string rather than a file. The string is NULL-terminated and holds a -complete XML document. Pass %NULL as the 'vectors' argument to export +complete XML document. Pass %NULL as the 'path' argument to export all paths in the image. HELP @@ -1303,9 +1303,9 @@ HELP @inargs = ( { name => 'image', type => 'image', desc => 'The image' }, - { name => 'vectors', type => 'vectors', + { name => 'path', type => 'vectors', no_validate => 1, none_ok => 1, - desc => 'The vectors object to export, or %NULL for all in the image' } + desc => 'The path object to export, or %NULL for all in the image' } ); @outargs = ( @@ -1317,13 +1317,13 @@ HELP headers => [ qw("vectors/gimpvectors-export.h") ], code => <<'CODE' { - GList *vectors_list = NULL; + GList *path_list = NULL; - if (vectors != NULL) - vectors_list = g_list_prepend (vectors_list, vectors); + if (path != NULL) + path_list = g_list_prepend (path_list, path); - string = gimp_vectors_export_string (image, vectors_list); - g_list_free (vectors_list); + string = gimp_vectors_export_string (image, path_list); + g_list_free (path_list); success = (string != NULL); } @@ -1336,8 +1336,8 @@ CODE "core/gimplist.h" "core/gimpimage.h" "core/gimpimage-undo-push.h" - "text/gimptext-vectors.h" - "text/gimptextlayer.h" + "text/gimptext-vectors.h" + "text/gimptextlayer.h" "vectors/gimpanchor.h" "vectors/gimpstroke-new.h" "vectors/gimpbezierstroke.h" @@ -1345,38 +1345,38 @@ CODE "gimppdb-utils.h" "gimp-intl.h"); -@procs = qw(vectors_new - vectors_new_from_text_layer - vectors_copy - vectors_get_strokes - vectors_stroke_get_length - vectors_stroke_get_point_at_dist - vectors_remove_stroke - vectors_stroke_close - vectors_stroke_reverse - vectors_stroke_translate - vectors_stroke_scale - vectors_stroke_rotate - vectors_stroke_flip - vectors_stroke_flip_free - vectors_stroke_get_points - vectors_stroke_new_from_points - vectors_stroke_interpolate - vectors_bezier_stroke_new_moveto - vectors_bezier_stroke_lineto - vectors_bezier_stroke_conicto - vectors_bezier_stroke_cubicto - vectors_bezier_stroke_new_ellipse - vectors_import_from_file - vectors_import_from_string - vectors_export_to_file - vectors_export_to_string); +@procs = qw(path_new + path_new_from_text_layer + path_copy + path_get_strokes + path_stroke_get_length + path_stroke_get_point_at_dist + path_remove_stroke + path_stroke_close + path_stroke_reverse + path_stroke_translate + path_stroke_scale + path_stroke_rotate + path_stroke_flip + path_stroke_flip_free + path_stroke_get_points + path_stroke_new_from_points + path_stroke_interpolate + path_bezier_stroke_new_moveto + path_bezier_stroke_lineto + path_bezier_stroke_conicto + path_bezier_stroke_cubicto + path_bezier_stroke_new_ellipse + path_import_from_file + path_import_from_string + path_export_to_file + path_export_to_string); %exports = (app => [@procs], lib => [@procs]); -$desc = 'Vectors'; -$doc_title = 'gimpvectors'; -$doc_short_desc = 'Functions for querying and manipulating vectors.'; -$doc_long_desc = 'Functions for querying and manipulating vectors.'; +$desc = 'Path'; +$doc_title = 'gimppath'; +$doc_short_desc = 'Functions for querying and manipulating path.'; +$doc_long_desc = 'Functions for querying and manipulating path.'; 1; diff --git a/pdb/meson.build b/pdb/meson.build index e21b00b6c4..f2c6a9b0dd 100644 --- a/pdb/meson.build +++ b/pdb/meson.build @@ -45,6 +45,7 @@ pdb_names = [ 'palette_select', 'palette', 'palettes', + 'path', 'pattern_select', 'pattern', 'patterns', @@ -57,7 +58,6 @@ pdb_names = [ 'text_layer', 'text_tool', 'unit', - 'vectors', ] pdb_sources = [] diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c index 998b5d6322..f14c4bc012 100644 --- a/plug-ins/common/file-svg.c +++ b/plug-ins/common/file-svg.c @@ -497,14 +497,14 @@ svg_load (GimpProcedure *procedure, g_object_get (config, "paths", &import_paths, NULL); if (g_strcmp0 (import_paths, "no-import") != 0) { - GimpVectors **vectors; - gint num_vectors; + GimpVectors **paths; + gint num_paths; - gimp_vectors_import_from_file (image, file, - g_strcmp0 (import_paths, "import-merged") == 0, - TRUE, &num_vectors, &vectors); - if (num_vectors > 0) - g_free (vectors); + gimp_path_import_from_file (image, file, + g_strcmp0 (import_paths, "import-merged") == 0, + TRUE, &num_paths, &paths); + if (num_paths > 0) + g_free (paths); } g_free (import_paths); diff --git a/plug-ins/file-psd/psd-export.c b/plug-ins/file-psd/psd-export.c index 2e1749ca02..3a114eeec8 100644 --- a/plug-ins/file-psd/psd-export.c +++ b/plug-ins/file-psd/psd-export.c @@ -1151,20 +1151,20 @@ save_paths (GOutputStream *output, gshort id = 0x07D0; /* Photoshop paths have IDs >= 2000 */ gdouble width = gimp_image_get_width (image); gdouble height = gimp_image_get_height (image); - GList *vectors; + GList *paths; GList *iter; gint v; gint num_strokes; gint *strokes; gint s; - vectors = gimp_image_list_paths (image); + paths = gimp_image_list_paths (image); - if (! vectors) + if (! paths) return; /* Only up to 997 paths supported */ - for (iter = vectors, v = 0; + for (iter = paths, v = 0; iter && v <= 997; iter = g_list_next (iter), v++) { @@ -1221,7 +1221,7 @@ save_paths (GOutputStream *output, pointrecord[1] = 6; /* fill rule record */ g_string_append_len (data, pointrecord, 26); - strokes = gimp_vectors_get_strokes (iter->data, &num_strokes); + strokes = gimp_path_get_strokes (iter->data, &num_strokes); for (s = 0; s < num_strokes; s++) { @@ -1231,8 +1231,8 @@ save_paths (GOutputStream *output, gboolean closed; gint p = 0; - type = gimp_vectors_stroke_get_points (iter->data, strokes[s], - &num_points, &points, &closed); + type = gimp_path_stroke_get_points (iter->data, strokes[s], + &num_points, &points, &closed); if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || num_points > 65535 || @@ -1279,7 +1279,7 @@ save_paths (GOutputStream *output, id += 0x01; } - g_list_free (vectors); + g_list_free (paths); } static void diff --git a/plug-ins/file-psd/psd-image-res-load.c b/plug-ins/file-psd/psd-image-res-load.c index c0668d93be..5d24282c11 100644 --- a/plug-ins/file-psd/psd-image-res-load.c +++ b/plug-ins/file-psd/psd-image-res-load.c @@ -1533,7 +1533,7 @@ load_resource_2000 (const PSDimageres *res_a, gdouble *controlpoints; gint32 x[3]; gint32 y[3]; - GimpVectors *vectors = NULL; + GimpVectors *path = NULL; gint16 type; gint16 init_fill; gint16 num_rec; @@ -1580,15 +1580,15 @@ load_resource_2000 (const PSDimageres *res_a, if (res_a->id == PSD_WORKING_PATH) { /* use "Working Path" for the path name to match the Photoshop display */ - vectors = gimp_vectors_new (image, "Working Path"); + path = gimp_path_new (image, "Working Path"); } else { /* Use the name stored in the PSD to name the path */ - vectors = gimp_vectors_new (image, res_a->name); + path = gimp_path_new (image, res_a->name); } - gimp_image_insert_path (image, vectors, NULL, -1); + gimp_image_insert_path (image, path, NULL, -1); while (path_rec > 0) { @@ -1703,9 +1703,9 @@ load_resource_2000 (const PSDimageres *res_a, num_rec--; } /* Add sub-path */ - gimp_vectors_stroke_new_from_points (vectors, - GIMP_VECTORS_STROKE_TYPE_BEZIER, - cntr, controlpoints, closed); + gimp_path_stroke_new_from_points (path, + GIMP_VECTORS_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 c52042aef2..7cf9cb1724 100644 --- a/plug-ins/file-tiff/file-tiff-export.c +++ b/plug-ins/file-tiff/file-tiff-export.c @@ -108,21 +108,21 @@ save_paths (TIFF *tif, gint offset_y) { gint id = 2000; /* Photoshop paths have IDs >= 2000 */ - GList *vectors; + GList *path; GList *iter; gint v; gint num_strokes, *strokes, s; GString *ps_tag; - vectors = gimp_image_list_paths (image); + path = gimp_image_list_paths (image); - if (! vectors) + if (! path) return FALSE; ps_tag = g_string_new (""); /* Only up to 1000 paths supported */ - for (iter = vectors, v = 0; + for (iter = path, v = 0; iter && v < 1000; iter = g_list_next (iter), v++) { @@ -179,7 +179,7 @@ save_paths (TIFF *tif, pointrecord[1] = 6; /* fill rule record */ g_string_append_len (data, pointrecord, 26); - strokes = gimp_vectors_get_strokes (iter->data, &num_strokes); + strokes = gimp_path_get_strokes (iter->data, &num_strokes); for (s = 0; s < num_strokes; s++) { @@ -189,8 +189,8 @@ save_paths (TIFF *tif, gboolean closed; gint p = 0; - type = gimp_vectors_stroke_get_points (iter->data, strokes[s], - &num_points, &points, &closed); + type = gimp_path_stroke_get_points (iter->data, strokes[s], + &num_points, &points, &closed); if (type != GIMP_VECTORS_STROKE_TYPE_BEZIER || num_points > 65535 || @@ -240,7 +240,7 @@ save_paths (TIFF *tif, TIFFSetField (tif, TIFFTAG_PHOTOSHOP, ps_tag->len, ps_tag->str); g_string_free (ps_tag, TRUE); - g_list_free (vectors); + g_list_free (path); return TRUE; } diff --git a/plug-ins/selection-to-path/selection-to-path.c b/plug-ins/selection-to-path/selection-to-path.c index e01a8678c5..d17e18630a 100644 --- a/plug-ins/selection-to-path/selection-to-path.c +++ b/plug-ins/selection-to-path/selection-to-path.c @@ -512,7 +512,7 @@ static void do_points (spline_list_array_type in_splines, GimpImage *image) { - GimpVectors *vectors; + GimpVectors *path; gint32 stroke; gint i, j; gboolean have_points = FALSE; @@ -532,7 +532,7 @@ do_points (spline_list_array_type in_splines, if (! have_points) return; - vectors = gimp_vectors_new (image, _("Selection")); + path = gimp_path_new (image, _("Selection")); for (j = 0; j < SPLINE_LIST_ARRAY_LENGTH (in_splines); j++) { @@ -549,41 +549,41 @@ do_points (spline_list_array_type in_splines, * to have the result of least surprise for "Text along Path". */ seg = SPLINE_LIST_ELT (spline_list, SPLINE_LIST_LENGTH (spline_list) - 1); - stroke = gimp_vectors_bezier_stroke_new_moveto (vectors, - END_POINT (seg).x, - END_POINT (seg).y); + stroke = gimp_path_bezier_stroke_new_moveto (path, + END_POINT (seg).x, + END_POINT (seg).y); for (i = SPLINE_LIST_LENGTH (spline_list); i > 0; i--) { seg = SPLINE_LIST_ELT (spline_list, i-1); if (SPLINE_DEGREE (seg) == LINEAR) - gimp_vectors_bezier_stroke_lineto (vectors, stroke, + gimp_path_bezier_stroke_lineto (path, stroke, START_POINT (seg).x, START_POINT (seg).y); else if (SPLINE_DEGREE (seg) == CUBIC) - gimp_vectors_bezier_stroke_cubicto (vectors, stroke, - CONTROL2 (seg).x, - CONTROL2 (seg).y, - CONTROL1 (seg).x, - CONTROL1 (seg).y, - START_POINT (seg).x, - START_POINT (seg).y); + gimp_path_bezier_stroke_cubicto (path, stroke, + CONTROL2 (seg).x, + CONTROL2 (seg).y, + CONTROL1 (seg).x, + CONTROL1 (seg).y, + START_POINT (seg).x, + START_POINT (seg).y); else g_warning ("print_spline: strange degree (%d)", SPLINE_DEGREE (seg)); } - gimp_vectors_stroke_close (vectors, stroke); + gimp_path_stroke_close (path, stroke); /* transform to GIMPs coordinate system, taking the selections * bounding box into account */ - gimp_vectors_stroke_scale (vectors, stroke, 1.0, -1.0); - gimp_vectors_stroke_translate (vectors, stroke, - sel_x1, sel_y1 + sel_height + 1); + gimp_path_stroke_scale (path, stroke, 1.0, -1.0); + gimp_path_stroke_translate (path, stroke, + sel_x1, sel_y1 + sel_height + 1); } - gimp_image_insert_path (image, vectors, NULL, -1); + gimp_image_insert_path (image, path, NULL, -1); }