app: Rename app/core GimpVectors vectors API...

...to path.
Changes the names of
gimp_vectors_* () API to
gimp_path[s]_* (). Renames related files
to [path] instead of [vectors], along with
relevant enums and functions.
This commit is contained in:
Alx Sa 2024-07-13 05:07:57 +00:00
parent 2d8d5e1e81
commit 2e6938b3da
95 changed files with 2252 additions and 2253 deletions

View File

@ -43,7 +43,7 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimage-undo.h" #include "core/gimpimage-undo.h"
#include "vectors/gimpvectors-import.h" #include "vectors/gimppath-import.h"
#include "widgets/gimpclipboard.h" #include "widgets/gimpclipboard.h"
#include "widgets/gimphelp-ids.h" #include "widgets/gimphelp-ids.h"
@ -658,7 +658,7 @@ edit_paste (GimpDisplay *display,
if (svg) if (svg)
{ {
if (gimp_vectors_import_buffer (image, svg, svg_size, if (gimp_path_import_buffer (image, svg, svg_size,
TRUE, FALSE, TRUE, FALSE,
GIMP_IMAGE_ACTIVE_PARENT, -1, GIMP_IMAGE_ACTIVE_PARENT, -1,
NULL, NULL)) NULL, NULL))

View File

@ -58,12 +58,12 @@
#include "core/gimpprogress.h" #include "core/gimpprogress.h"
#include "text/gimptext.h" #include "text/gimptext.h"
#include "text/gimptext-vectors.h" #include "text/gimptext-path.h"
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimppath-warp.h"
#include "vectors/gimpstroke.h" #include "vectors/gimpstroke.h"
#include "vectors/gimpvectors-warp.h"
#include "widgets/gimpaction.h" #include "widgets/gimpaction.h"
#include "widgets/gimpdock.h" #include "widgets/gimpdock.h"
@ -1044,7 +1044,7 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
return_if_no_layers (image, layers, data); return_if_no_layers (image, layers, data);
/* TODO: have the proper undo group. */ /* TODO: have the proper undo group. */
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_VECTORS_IMPORT, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PATHS_IMPORT,
_("Add Paths")); _("Add Paths"));
for (iter = layers; iter; iter = iter->next) for (iter = layers; iter; iter = iter->next)
{ {
@ -1055,7 +1055,7 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
GimpPath *path; GimpPath *path;
gint x, y; gint x, y;
path = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text); path = gimp_text_path_new (image, GIMP_TEXT_LAYER (layer)->text);
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y); gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (path), x, y, FALSE); gimp_item_translate (GIMP_ITEM (path), x, y, FALSE);
@ -1077,7 +1077,7 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
GList *layers; GList *layers;
GList *paths; GList *paths;
GimpLayer *layer; GimpLayer *layer;
GimpPath *vectors; GimpPath *path;
return_if_no_layers (image, layers, data); return_if_no_layers (image, layers, data);
return_if_no_vectors_list (image, paths, data); return_if_no_vectors_list (image, paths, data);
@ -1085,18 +1085,18 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
return; return;
layer = layers->data; layer = layers->data;
vectors = paths->data; path = paths->data;
if (GIMP_IS_TEXT_LAYER (layer)) if (GIMP_IS_TEXT_LAYER (layer))
{ {
gdouble box_width; gdouble box_width;
gdouble box_height; gdouble box_height;
GimpPath *new_vectors; GimpPath *new_path;
gdouble offset; gdouble offset;
box_width = gimp_item_get_width (GIMP_ITEM (layer)); box_width = gimp_item_get_width (GIMP_ITEM (layer));
box_height = gimp_item_get_height (GIMP_ITEM (layer)); box_height = gimp_item_get_height (GIMP_ITEM (layer));
new_vectors = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text); new_path = gimp_text_path_new (image, GIMP_TEXT_LAYER (layer)->text);
offset = 0; offset = 0;
switch (GIMP_TEXT_LAYER (layer)->text->base_dir) switch (GIMP_TEXT_LAYER (layer)->text->base_dir)
@ -1112,7 +1112,7 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
{ {
GimpStroke *stroke = NULL; GimpStroke *stroke = NULL;
while ((stroke = gimp_vectors_stroke_get_next (new_vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (new_path, stroke)))
{ {
gimp_stroke_rotate (stroke, 0, 0, 270); gimp_stroke_rotate (stroke, 0, 0, 270);
gimp_stroke_translate (stroke, 0, box_width); gimp_stroke_translate (stroke, 0, box_width);
@ -1122,12 +1122,11 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
break; break;
} }
gimp_path_warp_path (path, new_path, offset);
gimp_vectors_warp_vectors (vectors, new_vectors, offset); gimp_item_set_visible (GIMP_ITEM (new_path), TRUE, FALSE);
gimp_item_set_visible (GIMP_ITEM (new_vectors), TRUE, FALSE); gimp_image_add_path (image, new_path,
gimp_image_add_path (image, new_vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image); gimp_image_flush (image);
} }

View File

@ -45,8 +45,8 @@
#include "pdb/gimpprocedure.h" #include "pdb/gimpprocedure.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectors-export.h" #include "vectors/gimppath-export.h"
#include "vectors/gimpvectors-import.h" #include "vectors/gimppath-import.h"
#include "widgets/gimpaction.h" #include "widgets/gimpaction.h"
#include "widgets/gimpclipboard.h" #include "widgets/gimpclipboard.h"
@ -58,9 +58,9 @@
#include "tools/tool_manager.h" #include "tools/tool_manager.h"
#include "dialogs/dialogs.h" #include "dialogs/dialogs.h"
#include "dialogs/vectors-export-dialog.h" #include "dialogs/path-export-dialog.h"
#include "dialogs/vectors-import-dialog.h" #include "dialogs/path-import-dialog.h"
#include "dialogs/vectors-options-dialog.h" #include "dialogs/path-options-dialog.h"
#include "actions.h" #include "actions.h"
#include "items-commands.h" #include "items-commands.h"
@ -73,32 +73,32 @@
static void vectors_new_callback (GtkWidget *dialog, static void vectors_new_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpPath *vectors, GimpPath *path,
GimpContext *context, GimpContext *context,
const gchar *vectors_name, const gchar *path_name,
gboolean vectors_visible, gboolean path_visible,
GimpColorTag vectors_color_tag, GimpColorTag path_color_tag,
gboolean vectors_lock_content, gboolean path_lock_content,
gboolean vectors_lock_position, gboolean path_lock_position,
gboolean vectors_lock_visibility, gboolean path_lock_visibility,
gpointer user_data); gpointer user_data);
static void vectors_edit_attributes_callback (GtkWidget *dialog, static void vectors_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpPath *vectors, GimpPath *path,
GimpContext *context, GimpContext *context,
const gchar *vectors_name, const gchar *path_name,
gboolean vectors_visible, gboolean path_visible,
GimpColorTag vectors_color_tag, GimpColorTag path_color_tag,
gboolean vectors_lock_content, gboolean path_lock_content,
gboolean vectors_lock_position, gboolean path_lock_position,
gboolean vectors_lock_visibility, gboolean path_lock_visibility,
gpointer user_data); gpointer user_data);
static void vectors_import_callback (GtkWidget *dialog, static void vectors_import_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GFile *file, GFile *file,
GFile *import_folder, GFile *import_folder,
gboolean merge_vectors, gboolean merge_paths,
gboolean scale_vectors, gboolean scale_paths,
gpointer user_data); gpointer user_data);
static void vectors_export_callback (GtkWidget *dialog, static void vectors_export_callback (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
@ -116,11 +116,11 @@ vectors_edit_cmd_callback (GimpAction *action,
gpointer data) gpointer data)
{ {
GimpImage *image; GimpImage *image;
GList *vectors; GList *paths;
GimpTool *active_tool; GimpTool *active_tool;
return_if_no_vectors_list (image, vectors, data); return_if_no_vectors_list (image, paths, data);
if (g_list_length (vectors) != 1) if (g_list_length (paths) != 1)
return; return;
active_tool = tool_manager_get_active (image->gimp); active_tool = tool_manager_get_active (image->gimp);
@ -138,7 +138,7 @@ vectors_edit_cmd_callback (GimpAction *action,
} }
if (GIMP_IS_VECTOR_TOOL (active_tool)) if (GIMP_IS_VECTOR_TOOL (active_tool))
gimp_vector_tool_set_vectors (GIMP_VECTOR_TOOL (active_tool), vectors->data); gimp_vector_tool_set_vectors (GIMP_VECTOR_TOOL (active_tool), paths->data);
} }
void void
@ -167,7 +167,7 @@ vectors_edit_attributes_cmd_callback (GimpAction *action,
{ {
GimpItem *item = GIMP_ITEM (vectors); GimpItem *item = GIMP_ITEM (vectors);
dialog = vectors_options_dialog_new (image, vectors, dialog = path_options_dialog_new (image, vectors,
action_data_get_context (data), action_data_get_context (data),
widget, widget,
_("Path Attributes"), _("Path Attributes"),
@ -209,7 +209,7 @@ vectors_new_cmd_callback (GimpAction *action,
{ {
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config); GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
dialog = vectors_options_dialog_new (image, NULL, dialog = path_options_dialog_new (image, NULL,
action_data_get_context (data), action_data_get_context (data),
widget, widget,
_("New Path"), _("New Path"),
@ -244,7 +244,7 @@ vectors_new_last_vals_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config); config = GIMP_DIALOG_CONFIG (image->gimp->config);
vectors = gimp_vectors_new (image, config->vectors_new_name); vectors = gimp_path_new (image, config->vectors_new_name);
gimp_image_add_path (image, vectors, gimp_image_add_path (image, vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image); gimp_image_flush (image);
@ -419,7 +419,7 @@ vectors_duplicate_cmd_callback (GimpAction *action,
/* TODO: proper undo group. */ /* TODO: proper undo group. */
gimp_image_undo_group_start (image, gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_VECTORS_IMPORT, GIMP_UNDO_GROUP_PATHS_IMPORT,
_("Duplicate Paths")); _("Duplicate Paths"));
for (iter = paths; iter; iter = iter->next) for (iter = paths; iter; iter = iter->next)
{ {
@ -432,7 +432,7 @@ vectors_duplicate_cmd_callback (GimpAction *action,
* above it * above it
*/ */
gimp_image_add_path (image, new_path, gimp_image_add_path (image, new_path,
gimp_vectors_get_parent (iter->data), -1, gimp_path_get_parent (iter->data), -1,
TRUE); TRUE);
new_paths = g_list_prepend (new_paths, new_path); new_paths = g_list_prepend (new_paths, new_path);
} }
@ -457,7 +457,7 @@ vectors_delete_cmd_callback (GimpAction *action,
paths = g_list_copy (paths); paths = g_list_copy (paths);
/* TODO: proper undo group. */ /* TODO: proper undo group. */
gimp_image_undo_group_start (image, gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_VECTORS_IMPORT, GIMP_UNDO_GROUP_PATHS_IMPORT,
_("Remove Paths")); _("Remove Paths"));
for (GList *iter = paths; iter; iter = iter->next) for (GList *iter = paths; iter; iter = iter->next)
@ -641,7 +641,7 @@ vectors_copy_cmd_callback (GimpAction *action,
gchar *svg; gchar *svg;
return_if_no_vectors_list (image, vectors, data); return_if_no_vectors_list (image, vectors, data);
svg = gimp_vectors_export_string (image, vectors); svg = gimp_path_export_string (image, vectors);
if (svg) if (svg)
{ {
@ -668,7 +668,7 @@ vectors_paste_cmd_callback (GimpAction *action,
{ {
GError *error = NULL; GError *error = NULL;
if (! gimp_vectors_import_buffer (image, svg, svg_size, if (! gimp_path_import_buffer (image, svg, svg_size,
TRUE, FALSE, TRUE, FALSE,
GIMP_IMAGE_ACTIVE_PARENT, -1, GIMP_IMAGE_ACTIVE_PARENT, -1,
NULL, &error)) NULL, &error))
@ -711,7 +711,7 @@ vectors_export_cmd_callback (GimpAction *action,
folder = gimp_file_new_for_config_path (config->vectors_export_path, folder = gimp_file_new_for_config_path (config->vectors_export_path,
NULL); NULL);
dialog = vectors_export_dialog_new (image, widget, dialog = path_export_dialog_new (image, widget,
folder, folder,
config->vectors_export_active_only, config->vectors_export_active_only,
vectors_export_callback, vectors_export_callback,
@ -750,7 +750,7 @@ vectors_import_cmd_callback (GimpAction *action,
folder = gimp_file_new_for_config_path (config->vectors_import_path, folder = gimp_file_new_for_config_path (config->vectors_import_path,
NULL); NULL);
dialog = vectors_import_dialog_new (image, widget, dialog = path_import_dialog_new (image, widget,
folder, folder,
config->vectors_import_merge, config->vectors_import_merge,
config->vectors_import_scale, config->vectors_import_scale,
@ -836,7 +836,7 @@ vectors_new_callback (GtkWidget *dialog,
"path-new-name", vectors_name, "path-new-name", vectors_name,
NULL); NULL);
vectors = gimp_vectors_new (image, config->vectors_new_name); vectors = gimp_path_new (image, config->vectors_new_name);
gimp_item_set_visible (GIMP_ITEM (vectors), vectors_visible, FALSE); gimp_item_set_visible (GIMP_ITEM (vectors), vectors_visible, FALSE);
gimp_item_set_color_tag (GIMP_ITEM (vectors), vectors_color_tag, FALSE); gimp_item_set_color_tag (GIMP_ITEM (vectors), vectors_color_tag, FALSE);
gimp_item_set_lock_content (GIMP_ITEM (vectors), vectors_lock_content, FALSE); gimp_item_set_lock_content (GIMP_ITEM (vectors), vectors_lock_content, FALSE);
@ -927,7 +927,7 @@ vectors_import_callback (GtkWidget *dialog,
if (path) if (path)
g_free (path); g_free (path);
if (gimp_vectors_import_file (image, file, if (gimp_path_import_file (image, file,
config->vectors_import_merge, config->vectors_import_merge,
config->vectors_import_scale, config->vectors_import_scale,
GIMP_IMAGE_ACTIVE_PARENT, -1, GIMP_IMAGE_ACTIVE_PARENT, -1,
@ -974,7 +974,7 @@ vectors_export_callback (GtkWidget *dialog,
if (config->vectors_export_active_only) if (config->vectors_export_active_only)
vectors = gimp_image_get_selected_paths (image); vectors = gimp_image_get_selected_paths (image);
if (! gimp_vectors_export_file (image, vectors, file, &error)) if (! gimp_path_export_file (image, vectors, file, &error))
{ {
gimp_message (image->gimp, G_OBJECT (dialog), gimp_message (image->gimp, G_OBJECT (dialog),
GIMP_MESSAGE_ERROR, GIMP_MESSAGE_ERROR,

View File

@ -504,7 +504,7 @@ gimp_dirty_mask_get_type (void)
{ GIMP_DIRTY_ITEM, "GIMP_DIRTY_ITEM", "item" }, { GIMP_DIRTY_ITEM, "GIMP_DIRTY_ITEM", "item" },
{ GIMP_DIRTY_ITEM_META, "GIMP_DIRTY_ITEM_META", "item-meta" }, { GIMP_DIRTY_ITEM_META, "GIMP_DIRTY_ITEM_META", "item-meta" },
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", "drawable" }, { GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", "drawable" },
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", "vectors" }, { GIMP_DIRTY_PATH, "GIMP_DIRTY_PATH", "path" },
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", "selection" }, { GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", "selection" },
{ GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", "active-drawable" }, { GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", "active-drawable" },
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", "all" }, { GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", "all" },
@ -521,7 +521,7 @@ gimp_dirty_mask_get_type (void)
{ GIMP_DIRTY_ITEM, "GIMP_DIRTY_ITEM", NULL }, { GIMP_DIRTY_ITEM, "GIMP_DIRTY_ITEM", NULL },
{ GIMP_DIRTY_ITEM_META, "GIMP_DIRTY_ITEM_META", NULL }, { GIMP_DIRTY_ITEM_META, "GIMP_DIRTY_ITEM_META", NULL },
{ GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", NULL }, { GIMP_DIRTY_DRAWABLE, "GIMP_DIRTY_DRAWABLE", NULL },
{ GIMP_DIRTY_VECTORS, "GIMP_DIRTY_VECTORS", NULL }, { GIMP_DIRTY_PATH, "GIMP_DIRTY_PATH", NULL },
{ GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", NULL }, { GIMP_DIRTY_SELECTION, "GIMP_DIRTY_SELECTION", NULL },
{ GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", NULL }, { GIMP_DIRTY_ACTIVE_DRAWABLE, "GIMP_DIRTY_ACTIVE_DRAWABLE", NULL },
{ GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", NULL }, { GIMP_DIRTY_ALL, "GIMP_DIRTY_ALL", NULL },
@ -1192,7 +1192,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, "GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE", "group-image-item-remove" }, { GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, "GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE", "group-image-item-remove" },
{ GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, "GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER", "group-image-item-reorder" }, { GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, "GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER", "group-image-item-reorder" },
{ GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, "GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE", "group-image-layers-merge" }, { GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, "GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE", "group-image-layers-merge" },
{ GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, "GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE", "group-image-vectors-merge" }, { GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE, "GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE", "group-image-paths-merge" },
{ GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, "GIMP_UNDO_GROUP_IMAGE_QUICK_MASK", "group-image-quick-mask" }, { GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, "GIMP_UNDO_GROUP_IMAGE_QUICK_MASK", "group-image-quick-mask" },
{ GIMP_UNDO_GROUP_IMAGE_GRID, "GIMP_UNDO_GROUP_IMAGE_GRID", "group-image-grid" }, { GIMP_UNDO_GROUP_IMAGE_GRID, "GIMP_UNDO_GROUP_IMAGE_GRID", "group-image-grid" },
{ GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, "GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP", "group-image-colormap-remap" }, { GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, "GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP", "group-image-colormap-remap" },
@ -1228,7 +1228,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_PAINT, "GIMP_UNDO_GROUP_PAINT", "group-paint" }, { GIMP_UNDO_GROUP_PAINT, "GIMP_UNDO_GROUP_PAINT", "group-paint" },
{ GIMP_UNDO_GROUP_PARASITE_ATTACH, "GIMP_UNDO_GROUP_PARASITE_ATTACH", "group-parasite-attach" }, { GIMP_UNDO_GROUP_PARASITE_ATTACH, "GIMP_UNDO_GROUP_PARASITE_ATTACH", "group-parasite-attach" },
{ GIMP_UNDO_GROUP_PARASITE_REMOVE, "GIMP_UNDO_GROUP_PARASITE_REMOVE", "group-parasite-remove" }, { GIMP_UNDO_GROUP_PARASITE_REMOVE, "GIMP_UNDO_GROUP_PARASITE_REMOVE", "group-parasite-remove" },
{ GIMP_UNDO_GROUP_VECTORS_IMPORT, "GIMP_UNDO_GROUP_VECTORS_IMPORT", "group-vectors-import" }, { GIMP_UNDO_GROUP_PATHS_IMPORT, "GIMP_UNDO_GROUP_PATHS_IMPORT", "group-paths-import" },
{ GIMP_UNDO_GROUP_MISC, "GIMP_UNDO_GROUP_MISC", "group-misc" }, { GIMP_UNDO_GROUP_MISC, "GIMP_UNDO_GROUP_MISC", "group-misc" },
{ GIMP_UNDO_IMAGE_TYPE, "GIMP_UNDO_IMAGE_TYPE", "image-type" }, { GIMP_UNDO_IMAGE_TYPE, "GIMP_UNDO_IMAGE_TYPE", "image-type" },
{ GIMP_UNDO_IMAGE_PRECISION, "GIMP_UNDO_IMAGE_PRECISION", "image-precision" }, { GIMP_UNDO_IMAGE_PRECISION, "GIMP_UNDO_IMAGE_PRECISION", "image-precision" },
@ -1274,9 +1274,9 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_CHANNEL_ADD, "GIMP_UNDO_CHANNEL_ADD", "channel-add" }, { GIMP_UNDO_CHANNEL_ADD, "GIMP_UNDO_CHANNEL_ADD", "channel-add" },
{ GIMP_UNDO_CHANNEL_REMOVE, "GIMP_UNDO_CHANNEL_REMOVE", "channel-remove" }, { GIMP_UNDO_CHANNEL_REMOVE, "GIMP_UNDO_CHANNEL_REMOVE", "channel-remove" },
{ GIMP_UNDO_CHANNEL_COLOR, "GIMP_UNDO_CHANNEL_COLOR", "channel-color" }, { GIMP_UNDO_CHANNEL_COLOR, "GIMP_UNDO_CHANNEL_COLOR", "channel-color" },
{ GIMP_UNDO_VECTORS_ADD, "GIMP_UNDO_VECTORS_ADD", "vectors-add" }, { GIMP_UNDO_PATH_ADD, "GIMP_UNDO_PATH_ADD", "path-add" },
{ GIMP_UNDO_VECTORS_REMOVE, "GIMP_UNDO_VECTORS_REMOVE", "vectors-remove" }, { GIMP_UNDO_PATH_REMOVE, "GIMP_UNDO_PATH_REMOVE", "path-remove" },
{ GIMP_UNDO_VECTORS_MOD, "GIMP_UNDO_VECTORS_MOD", "vectors-mod" }, { GIMP_UNDO_PATH_MOD, "GIMP_UNDO_PATH_MOD", "path-mod" },
{ GIMP_UNDO_FS_TO_LAYER, "GIMP_UNDO_FS_TO_LAYER", "fs-to-layer" }, { GIMP_UNDO_FS_TO_LAYER, "GIMP_UNDO_FS_TO_LAYER", "fs-to-layer" },
{ GIMP_UNDO_TRANSFORM_GRID, "GIMP_UNDO_TRANSFORM_GRID", "transform-grid" }, { GIMP_UNDO_TRANSFORM_GRID, "GIMP_UNDO_TRANSFORM_GRID", "transform-grid" },
{ GIMP_UNDO_PAINT, "GIMP_UNDO_PAINT", "paint" }, { GIMP_UNDO_PAINT, "GIMP_UNDO_PAINT", "paint" },
@ -1304,7 +1304,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, NC_("undo-type", "Remove item"), NULL }, { GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, NC_("undo-type", "Remove item"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, NC_("undo-type", "Reorder item"), NULL }, { GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, NC_("undo-type", "Reorder item"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, NC_("undo-type", "Merge layers"), NULL }, { GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, NC_("undo-type", "Merge layers"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, NC_("undo-type", "Merge paths"), NULL }, { GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE, NC_("undo-type", "Merge paths"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, NC_("undo-type", "Quick Mask"), NULL }, { GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, NC_("undo-type", "Quick Mask"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_GRID, NC_("undo-type", "Grid"), NULL }, { GIMP_UNDO_GROUP_IMAGE_GRID, NC_("undo-type", "Grid"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, NC_("undo-type", "Colormap remapping"), NULL }, { GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, NC_("undo-type", "Colormap remapping"), NULL },
@ -1340,7 +1340,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_PAINT, NC_("undo-type", "Paint"), NULL }, { GIMP_UNDO_GROUP_PAINT, NC_("undo-type", "Paint"), NULL },
{ GIMP_UNDO_GROUP_PARASITE_ATTACH, NC_("undo-type", "Attach parasite"), NULL }, { GIMP_UNDO_GROUP_PARASITE_ATTACH, NC_("undo-type", "Attach parasite"), NULL },
{ GIMP_UNDO_GROUP_PARASITE_REMOVE, NC_("undo-type", "Remove parasite"), NULL }, { GIMP_UNDO_GROUP_PARASITE_REMOVE, NC_("undo-type", "Remove parasite"), NULL },
{ GIMP_UNDO_GROUP_VECTORS_IMPORT, NC_("undo-type", "Import paths"), NULL }, { GIMP_UNDO_GROUP_PATHS_IMPORT, NC_("undo-type", "Import paths"), NULL },
{ GIMP_UNDO_GROUP_MISC, NC_("undo-type", "Plug-In"), NULL }, { GIMP_UNDO_GROUP_MISC, NC_("undo-type", "Plug-In"), NULL },
{ GIMP_UNDO_IMAGE_TYPE, NC_("undo-type", "Image type"), NULL }, { GIMP_UNDO_IMAGE_TYPE, NC_("undo-type", "Image type"), NULL },
{ GIMP_UNDO_IMAGE_PRECISION, NC_("undo-type", "Image precision"), NULL }, { GIMP_UNDO_IMAGE_PRECISION, NC_("undo-type", "Image precision"), NULL },
@ -1386,9 +1386,9 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_CHANNEL_ADD, NC_("undo-type", "New channel"), NULL }, { GIMP_UNDO_CHANNEL_ADD, NC_("undo-type", "New channel"), NULL },
{ GIMP_UNDO_CHANNEL_REMOVE, NC_("undo-type", "Delete channel"), NULL }, { GIMP_UNDO_CHANNEL_REMOVE, NC_("undo-type", "Delete channel"), NULL },
{ GIMP_UNDO_CHANNEL_COLOR, NC_("undo-type", "Channel color"), NULL }, { GIMP_UNDO_CHANNEL_COLOR, NC_("undo-type", "Channel color"), NULL },
{ GIMP_UNDO_VECTORS_ADD, NC_("undo-type", "New path"), NULL }, { GIMP_UNDO_PATH_ADD, NC_("undo-type", "New path"), NULL },
{ GIMP_UNDO_VECTORS_REMOVE, NC_("undo-type", "Delete path"), NULL }, { GIMP_UNDO_PATH_REMOVE, NC_("undo-type", "Delete path"), NULL },
{ GIMP_UNDO_VECTORS_MOD, NC_("undo-type", "Path modification"), NULL }, { GIMP_UNDO_PATH_MOD, NC_("undo-type", "Path modification"), NULL },
{ GIMP_UNDO_FS_TO_LAYER, NC_("undo-type", "Floating selection to layer"), NULL }, { GIMP_UNDO_FS_TO_LAYER, NC_("undo-type", "Floating selection to layer"), NULL },
{ GIMP_UNDO_TRANSFORM_GRID, NC_("undo-type", "Transform grid"), NULL }, { GIMP_UNDO_TRANSFORM_GRID, NC_("undo-type", "Transform grid"), NULL },
{ GIMP_UNDO_PAINT, NC_("undo-type", "Paint"), NULL }, { GIMP_UNDO_PAINT, NC_("undo-type", "Paint"), NULL },

View File

@ -262,7 +262,7 @@ typedef enum /*< pdb-skip >*/
GIMP_DIRTY_ITEM = 1 << 4, GIMP_DIRTY_ITEM = 1 << 4,
GIMP_DIRTY_ITEM_META = 1 << 5, GIMP_DIRTY_ITEM_META = 1 << 5,
GIMP_DIRTY_DRAWABLE = 1 << 6, GIMP_DIRTY_DRAWABLE = 1 << 6,
GIMP_DIRTY_VECTORS = 1 << 7, GIMP_DIRTY_PATH = 1 << 7,
GIMP_DIRTY_SELECTION = 1 << 8, GIMP_DIRTY_SELECTION = 1 << 8,
GIMP_DIRTY_ACTIVE_DRAWABLE = 1 << 9, GIMP_DIRTY_ACTIVE_DRAWABLE = 1 << 9,
@ -541,7 +541,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, /*< desc="Remove item" >*/ GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, /*< desc="Remove item" >*/
GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, /*< desc="Reorder item" >*/ GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER, /*< desc="Reorder item" >*/
GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, /*< desc="Merge layers" >*/ GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, /*< desc="Merge layers" >*/
GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, /*< desc="Merge paths" >*/ GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE, /*< desc="Merge paths" >*/
GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, /*< desc="Quick Mask" >*/ GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, /*< desc="Quick Mask" >*/
GIMP_UNDO_GROUP_IMAGE_GRID, /*< desc="Grid" >*/ GIMP_UNDO_GROUP_IMAGE_GRID, /*< desc="Grid" >*/
GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, /*< desc="Colormap remapping" >*/ GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, /*< desc="Colormap remapping" >*/
@ -577,7 +577,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_PAINT, /*< desc="Paint" >*/ GIMP_UNDO_GROUP_PAINT, /*< desc="Paint" >*/
GIMP_UNDO_GROUP_PARASITE_ATTACH, /*< desc="Attach parasite" >*/ GIMP_UNDO_GROUP_PARASITE_ATTACH, /*< desc="Attach parasite" >*/
GIMP_UNDO_GROUP_PARASITE_REMOVE, /*< desc="Remove parasite" >*/ GIMP_UNDO_GROUP_PARASITE_REMOVE, /*< desc="Remove parasite" >*/
GIMP_UNDO_GROUP_VECTORS_IMPORT, /*< desc="Import paths" >*/ GIMP_UNDO_GROUP_PATHS_IMPORT, /*< desc="Import paths" >*/
GIMP_UNDO_GROUP_MISC, /*< desc="Plug-In" >*/ GIMP_UNDO_GROUP_MISC, /*< desc="Plug-In" >*/
GIMP_UNDO_GROUP_LAST = GIMP_UNDO_GROUP_MISC, /*< skip >*/ GIMP_UNDO_GROUP_LAST = GIMP_UNDO_GROUP_MISC, /*< skip >*/
@ -628,9 +628,9 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_CHANNEL_ADD, /*< desc="New channel" >*/ GIMP_UNDO_CHANNEL_ADD, /*< desc="New channel" >*/
GIMP_UNDO_CHANNEL_REMOVE, /*< desc="Delete channel" >*/ GIMP_UNDO_CHANNEL_REMOVE, /*< desc="Delete channel" >*/
GIMP_UNDO_CHANNEL_COLOR, /*< desc="Channel color" >*/ GIMP_UNDO_CHANNEL_COLOR, /*< desc="Channel color" >*/
GIMP_UNDO_VECTORS_ADD, /*< desc="New path" >*/ GIMP_UNDO_PATH_ADD, /*< desc="New path" >*/
GIMP_UNDO_VECTORS_REMOVE, /*< desc="Delete path" >*/ GIMP_UNDO_PATH_REMOVE, /*< desc="Delete path" >*/
GIMP_UNDO_VECTORS_MOD, /*< desc="Path modification" >*/ GIMP_UNDO_PATH_MOD, /*< desc="Path modification" >*/
GIMP_UNDO_FS_TO_LAYER, /*< desc="Floating selection to layer" >*/ GIMP_UNDO_FS_TO_LAYER, /*< desc="Floating selection to layer" >*/
GIMP_UNDO_TRANSFORM_GRID, /*< desc="Transform grid" >*/ GIMP_UNDO_TRANSFORM_GRID, /*< desc="Transform grid" >*/
GIMP_UNDO_PAINT, /*< desc="Paint" >*/ GIMP_UNDO_PAINT, /*< desc="Paint" >*/

View File

@ -279,7 +279,7 @@ gimp_channel_select_polygon (GimpChannel *channel,
} }
void void
gimp_channel_select_vectors (GimpChannel *channel, gimp_channel_select_path (GimpChannel *channel,
const gchar *undo_desc, const gchar *undo_desc,
GimpPath *vectors, GimpPath *vectors,
GimpChannelOps op, GimpChannelOps op,
@ -296,7 +296,7 @@ gimp_channel_select_vectors (GimpChannel *channel,
g_return_if_fail (undo_desc != NULL); g_return_if_fail (undo_desc != NULL);
g_return_if_fail (GIMP_IS_PATH (vectors)); g_return_if_fail (GIMP_IS_PATH (vectors));
bezier = gimp_vectors_get_bezier (vectors); bezier = gimp_path_get_bezier (vectors);
if (bezier && bezier->num_data > 4) if (bezier && bezier->num_data > 4)
{ {

View File

@ -79,7 +79,7 @@ void gimp_channel_select_polygon (GimpChannel *channel,
gdouble feather_radius_x, gdouble feather_radius_x,
gdouble feather_radius_y, gdouble feather_radius_y,
gboolean push_undo); gboolean push_undo);
void gimp_channel_select_vectors (GimpChannel *channel, void gimp_channel_select_path (GimpChannel *channel,
const gchar *undo_desc, const gchar *undo_desc,
GimpPath *vectors, GimpPath *vectors,
GimpChannelOps op, GimpChannelOps op,

View File

@ -177,7 +177,7 @@ gimp_drawable_fill_boundary (GimpDrawable *drawable,
} }
gboolean gboolean
gimp_drawable_fill_vectors (GimpDrawable *drawable, gimp_drawable_fill_path (GimpDrawable *drawable,
GimpFillOptions *options, GimpFillOptions *options,
GimpPath *vectors, GimpPath *vectors,
gboolean push_undo, gboolean push_undo,
@ -195,7 +195,7 @@ gimp_drawable_fill_vectors (GimpDrawable *drawable,
FALSE); FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
bezier = gimp_vectors_get_bezier (vectors); bezier = gimp_path_get_bezier (vectors);
if (bezier && bezier->num_data > 4) if (bezier && bezier->num_data > 4)
{ {

View File

@ -45,7 +45,7 @@ void gimp_drawable_fill_boundary (GimpDrawable *drawable,
gint offset_y, gint offset_y,
gboolean push_undo); gboolean push_undo);
gboolean gimp_drawable_fill_vectors (GimpDrawable *drawable, gboolean gimp_drawable_fill_path (GimpDrawable *drawable,
GimpFillOptions *options, GimpFillOptions *options,
GimpPath *vectors, GimpPath *vectors,
gboolean push_undo, gboolean push_undo,

View File

@ -74,7 +74,7 @@ gimp_drawable_stroke_boundary (GimpDrawable *drawable,
} }
gboolean gboolean
gimp_drawable_stroke_vectors (GimpDrawable *drawable, gimp_drawable_stroke_path (GimpDrawable *drawable,
GimpStrokeOptions *options, GimpStrokeOptions *options,
GimpPath *vectors, GimpPath *vectors,
gboolean push_undo, gboolean push_undo,
@ -92,7 +92,7 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
FALSE); FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
bezier = gimp_vectors_get_bezier (vectors); bezier = gimp_path_get_bezier (vectors);
if (bezier && bezier->num_data >= 2) if (bezier && bezier->num_data >= 2)
{ {

View File

@ -30,7 +30,7 @@ void gimp_drawable_stroke_boundary (GimpDrawable *drawable,
gint offset_y, gint offset_y,
gboolean push_undo); gboolean push_undo);
gboolean gimp_drawable_stroke_vectors (GimpDrawable *drawable, gboolean gimp_drawable_stroke_path (GimpDrawable *drawable,
GimpStrokeOptions *options, GimpStrokeOptions *options,
GimpPath *vectors, GimpPath *vectors,
gboolean push_undo, gboolean push_undo,

View File

@ -499,7 +499,7 @@ gimp_image_merge_visible_paths (GimpImage *image,
gimp_set_busy (image->gimp); gimp_set_busy (image->gimp);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE,
C_("undo-type", "Merge Visible Paths")); C_("undo-type", "Merge Visible Paths"));
path = GIMP_PATH (merge_list->data); path = GIMP_PATH (merge_list->data);
@ -517,7 +517,7 @@ gimp_image_merge_visible_paths (GimpImage *image,
{ {
path = list->data; path = list->data;
gimp_vectors_add_strokes (path, target_path); gimp_path_add_strokes (path, target_path);
gimp_image_remove_path (image, path, TRUE, NULL); gimp_image_remove_path (image, path, TRUE, NULL);
} }

View File

@ -210,7 +210,7 @@ gimp_image_pick_path (GimpImage *image,
GimpStroke *stroke = NULL; GimpStroke *stroke = NULL;
GimpCoords coords = GIMP_COORDS_DEFAULT_VALUES; GimpCoords coords = GIMP_COORDS_DEFAULT_VALUES;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
gdouble dist; gdouble dist;

View File

@ -730,7 +730,7 @@ gimp_image_snap_point (GimpImage *image,
{ {
GimpPath *vectors = iter->data; GimpPath *vectors = iter->data;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
GimpCoords nearest; GimpCoords nearest;
@ -979,7 +979,7 @@ gimp_image_snap_rectangle (GimpImage *image,
{ {
GimpPath *vectors = iter->data; GimpPath *vectors = iter->data;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
GimpCoords nearest; GimpCoords nearest;
gdouble dist; gdouble dist;

View File

@ -57,9 +57,9 @@
#include "text/gimptextundo.h" #include "text/gimptextundo.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectorsmodundo.h" #include "vectors/gimppathmodundo.h"
#include "vectors/gimpvectorspropundo.h" #include "vectors/gimppathpropundo.h"
#include "vectors/gimpvectorsundo.h" #include "vectors/gimppathundo.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -451,7 +451,7 @@ gimp_image_undo_push_item_displace (GimpImage *image,
GIMP_UNDO_ITEM_DISPLACE, undo_desc, GIMP_UNDO_ITEM_DISPLACE, undo_desc,
GIMP_IS_DRAWABLE (item) ? GIMP_IS_DRAWABLE (item) ?
GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE : GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE :
GIMP_DIRTY_ITEM | GIMP_DIRTY_VECTORS, GIMP_DIRTY_ITEM | GIMP_DIRTY_PATH,
"item", item, "item", item,
NULL); NULL);
} }
@ -1023,11 +1023,11 @@ gimp_image_undo_push_path_add (GimpImage *image,
for (iter = prev_paths; iter; iter = iter->next) for (iter = prev_paths; iter; iter = iter->next)
g_return_val_if_fail (GIMP_IS_PATH (iter->data), NULL); g_return_val_if_fail (GIMP_IS_PATH (iter->data), NULL);
return gimp_image_undo_push (image, GIMP_TYPE_VECTORS_UNDO, return gimp_image_undo_push (image, GIMP_TYPE_PATH_UNDO,
GIMP_UNDO_VECTORS_ADD, undo_desc, GIMP_UNDO_PATH_ADD, undo_desc,
GIMP_DIRTY_IMAGE_STRUCTURE, GIMP_DIRTY_IMAGE_STRUCTURE,
"item", path, "item", path,
"prev-vectors", prev_paths, "prev-paths", prev_paths,
NULL); NULL);
} }
@ -1050,13 +1050,13 @@ gimp_image_undo_push_path_remove (GimpImage *image,
for (iter = prev_paths; iter; iter = iter->next) for (iter = prev_paths; iter; iter = iter->next)
g_return_val_if_fail (GIMP_IS_PATH (iter->data), NULL); g_return_val_if_fail (GIMP_IS_PATH (iter->data), NULL);
return gimp_image_undo_push (image, GIMP_TYPE_VECTORS_UNDO, return gimp_image_undo_push (image, GIMP_TYPE_PATH_UNDO,
GIMP_UNDO_VECTORS_REMOVE, undo_desc, GIMP_UNDO_PATH_REMOVE, undo_desc,
GIMP_DIRTY_IMAGE_STRUCTURE, GIMP_DIRTY_IMAGE_STRUCTURE,
"item", path, "item", path,
"prev-parent", prev_parent, "prev-parent", prev_parent,
"prev-position", prev_position, "prev-position", prev_position,
"prev-vectors", prev_paths, "prev-paths", prev_paths,
NULL); NULL);
} }
@ -1069,9 +1069,9 @@ gimp_image_undo_push_path_mod (GimpImage *image,
g_return_val_if_fail (GIMP_IS_PATH (path), NULL); g_return_val_if_fail (GIMP_IS_PATH (path), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (path)), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (path)), NULL);
return gimp_image_undo_push (image, GIMP_TYPE_VECTORS_MOD_UNDO, return gimp_image_undo_push (image, GIMP_TYPE_PATH_MOD_UNDO,
GIMP_UNDO_VECTORS_MOD, undo_desc, GIMP_UNDO_PATH_MOD, undo_desc,
GIMP_DIRTY_ITEM | GIMP_DIRTY_VECTORS, GIMP_DIRTY_ITEM | GIMP_DIRTY_PATH,
"item", path, "item", path,
NULL); NULL);
} }

View File

@ -627,8 +627,8 @@ gimp_image_undo_dirty_from_type (GimpUndoType undo_type)
case GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE: case GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE:
return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_DRAWABLE; return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_DRAWABLE;
case GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE: case GIMP_UNDO_GROUP_IMAGE_PATHS_MERGE:
return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_VECTORS; return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_PATH;
case GIMP_UNDO_GROUP_IMAGE_QUICK_MASK: /* FIXME */ case GIMP_UNDO_GROUP_IMAGE_QUICK_MASK: /* FIXME */
return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_SELECTION; return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_SELECTION;
@ -649,11 +649,11 @@ gimp_image_undo_dirty_from_type (GimpUndoType undo_type)
return GIMP_DIRTY_ITEM_META; return GIMP_DIRTY_ITEM_META;
case GIMP_UNDO_GROUP_ITEM_DISPLACE: /* FIXME */ case GIMP_UNDO_GROUP_ITEM_DISPLACE: /* FIXME */
return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_VECTORS; return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_PATH;
case GIMP_UNDO_GROUP_ITEM_SCALE: /* FIXME */ case GIMP_UNDO_GROUP_ITEM_SCALE: /* FIXME */
case GIMP_UNDO_GROUP_ITEM_RESIZE: /* FIXME */ case GIMP_UNDO_GROUP_ITEM_RESIZE: /* FIXME */
return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_VECTORS; return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_PATH;
case GIMP_UNDO_GROUP_LAYER_ADD_MASK: case GIMP_UNDO_GROUP_LAYER_ADD_MASK:
case GIMP_UNDO_GROUP_LAYER_APPLY_MASK: case GIMP_UNDO_GROUP_LAYER_APPLY_MASK:
@ -674,7 +674,7 @@ gimp_image_undo_dirty_from_type (GimpUndoType undo_type)
return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE; return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE;
case GIMP_UNDO_GROUP_TRANSFORM: /* FIXME */ case GIMP_UNDO_GROUP_TRANSFORM: /* FIXME */
return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_VECTORS; return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE | GIMP_DIRTY_PATH;
case GIMP_UNDO_GROUP_PAINT: case GIMP_UNDO_GROUP_PAINT:
return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE; return GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE;
@ -683,8 +683,8 @@ gimp_image_undo_dirty_from_type (GimpUndoType undo_type)
case GIMP_UNDO_GROUP_PARASITE_REMOVE: case GIMP_UNDO_GROUP_PARASITE_REMOVE:
return GIMP_DIRTY_IMAGE_META | GIMP_DIRTY_ITEM_META; return GIMP_DIRTY_IMAGE_META | GIMP_DIRTY_ITEM_META;
case GIMP_UNDO_GROUP_VECTORS_IMPORT: case GIMP_UNDO_GROUP_PATHS_IMPORT:
return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_VECTORS; return GIMP_DIRTY_IMAGE_STRUCTURE | GIMP_DIRTY_PATH;
case GIMP_UNDO_GROUP_MISC: case GIMP_UNDO_GROUP_MISC:
return GIMP_DIRTY_ALL; return GIMP_DIRTY_ALL;

View File

@ -5956,7 +5956,7 @@ gimp_image_remove_path (GimpImage *image,
if (push_undo) if (push_undo)
gimp_image_undo_push_path_remove (image, C_("undo-type", "Remove Path"), path, gimp_image_undo_push_path_remove (image, C_("undo-type", "Remove Path"), path,
gimp_vectors_get_parent (path), gimp_path_get_parent (path),
gimp_item_get_index (GIMP_ITEM (path)), gimp_item_get_index (GIMP_ITEM (path)),
selected_path); selected_path);

View File

@ -64,7 +64,7 @@
#include "widgets/gimptoolpresetfactoryview.h" #include "widgets/gimptoolpresetfactoryview.h"
#include "widgets/gimptoolpreseteditor.h" #include "widgets/gimptoolpreseteditor.h"
#include "widgets/gimpundoeditor.h" #include "widgets/gimpundoeditor.h"
#include "widgets/gimpvectorstreeview.h" #include "widgets/gimppathtreeview.h"
#include "display/gimpcursorview.h" #include "display/gimpcursorview.h"
#include "display/gimpnavigationeditor.h" #include "display/gimpnavigationeditor.h"
@ -774,7 +774,7 @@ dialogs_vectors_list_view_new (GimpDialogFactory *factory,
if (view_size < 1) if (view_size < 1)
view_size = context->gimp->config->layer_preview_size; view_size = context->gimp->config->layer_preview_size;
return gimp_item_tree_view_new (GIMP_TYPE_VECTORS_TREE_VIEW, return gimp_item_tree_view_new (GIMP_TYPE_PATH_TREE_VIEW,
view_size, 1, TRUE, view_size, 1, TRUE,
gimp_context_get_image (context), gimp_context_get_image (context),
menus_get_global_menu_factory (context->gimp), menus_get_global_menu_factory (context->gimp),

View File

@ -41,6 +41,9 @@ libappdialogs_sources = [
'metadata-rotation-import-dialog.c', 'metadata-rotation-import-dialog.c',
'module-dialog.c', 'module-dialog.c',
'palette-import-dialog.c', 'palette-import-dialog.c',
'path-export-dialog.c',
'path-import-dialog.c',
'path-options-dialog.c',
'preferences-dialog-utils.c', 'preferences-dialog-utils.c',
'preferences-dialog.c', 'preferences-dialog.c',
'print-size-dialog.c', 'print-size-dialog.c',
@ -53,9 +56,6 @@ libappdialogs_sources = [
'tips-dialog.c', 'tips-dialog.c',
'tips-parser.c', 'tips-parser.c',
'user-install-dialog.c', 'user-install-dialog.c',
'vectors-export-dialog.c',
'vectors-import-dialog.c',
'vectors-options-dialog.c',
'welcome-dialog.c', 'welcome-dialog.c',
gitversion_h, gitversion_h,
welcome_dialog_data_c, welcome_dialog_data_c,

View File

@ -28,44 +28,44 @@
#include "widgets/gimpwidgets-utils.h" #include "widgets/gimpwidgets-utils.h"
#include "vectors-export-dialog.h" #include "path-export-dialog.h"
#include "gimp-intl.h" #include "gimp-intl.h"
typedef struct _VectorsExportDialog VectorsExportDialog; typedef struct _PathExportDialog PathExportDialog;
struct _VectorsExportDialog struct _PathExportDialog
{ {
GimpImage *image; GimpImage *image;
gboolean active_only; gboolean active_only;
GimpVectorsExportCallback callback; GimpPathExportCallback callback;
gpointer user_data; gpointer user_data;
}; };
/* local function prototypes */ /* local function prototypes */
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static void vectors_export_dialog_realize (GtkWidget *dialog, static void path_export_dialog_realize (GtkWidget *dialog,
VectorsExportDialog *data); PathExportDialog *data);
#endif #endif
static void vectors_export_dialog_free (VectorsExportDialog *private); static void path_export_dialog_free (PathExportDialog *private);
static void vectors_export_dialog_response (GtkWidget *widget, static void path_export_dialog_response (GtkWidget *widget,
gint response_id, gint response_id,
VectorsExportDialog *private); PathExportDialog *private);
/* public function */ /* public function */
GtkWidget * GtkWidget *
vectors_export_dialog_new (GimpImage *image, path_export_dialog_new (GimpImage *image,
GtkWidget *parent, GtkWidget *parent,
GFile *export_folder, GFile *export_folder,
gboolean active_only, gboolean active_only,
GimpVectorsExportCallback callback, GimpPathExportCallback callback,
gpointer user_data) gpointer user_data)
{ {
VectorsExportDialog *private; PathExportDialog *private;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *combo; GtkWidget *combo;
@ -75,7 +75,7 @@ vectors_export_dialog_new (GimpImage *image,
NULL); NULL);
g_return_val_if_fail (callback != NULL, NULL); g_return_val_if_fail (callback != NULL, NULL);
private = g_slice_new0 (VectorsExportDialog); private = g_slice_new0 (PathExportDialog);
private->image = image; private->image = image;
private->active_only = active_only; private->active_only = active_only;
@ -109,7 +109,7 @@ vectors_export_dialog_new (GimpImage *image,
export_folder, NULL); export_folder, NULL);
g_object_weak_ref (G_OBJECT (dialog), g_object_weak_ref (G_OBJECT (dialog),
(GWeakNotify) vectors_export_dialog_free, private); (GWeakNotify) path_export_dialog_free, private);
g_signal_connect_object (image, "disconnect", g_signal_connect_object (image, "disconnect",
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
@ -117,7 +117,7 @@ vectors_export_dialog_new (GimpImage *image,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
g_signal_connect (dialog, "realize", g_signal_connect (dialog, "realize",
G_CALLBACK (vectors_export_dialog_realize), G_CALLBACK (path_export_dialog_realize),
private); private);
#endif #endif
g_signal_connect (dialog, "delete-event", g_signal_connect (dialog, "delete-event",
@ -125,7 +125,7 @@ vectors_export_dialog_new (GimpImage *image,
NULL); NULL);
g_signal_connect (dialog, "response", g_signal_connect (dialog, "response",
G_CALLBACK (vectors_export_dialog_response), G_CALLBACK (path_export_dialog_response),
private); private);
combo = gimp_int_combo_box_new (_("Export the selected paths"), TRUE, combo = gimp_int_combo_box_new (_("Export the selected paths"), TRUE,
@ -147,23 +147,23 @@ vectors_export_dialog_new (GimpImage *image,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static void static void
vectors_export_dialog_realize (GtkWidget *dialog, path_export_dialog_realize (GtkWidget *dialog,
VectorsExportDialog *data) PathExportDialog *data)
{ {
gimp_window_set_title_bar_theme (data->image->gimp, dialog); gimp_window_set_title_bar_theme (data->image->gimp, dialog);
} }
#endif #endif
static void static void
vectors_export_dialog_free (VectorsExportDialog *private) path_export_dialog_free (PathExportDialog *private)
{ {
g_slice_free (VectorsExportDialog, private); g_slice_free (PathExportDialog, private);
} }
static void static void
vectors_export_dialog_response (GtkWidget *dialog, path_export_dialog_response (GtkWidget *dialog,
gint response_id, gint response_id,
VectorsExportDialog *private) PathExportDialog *private)
{ {
if (response_id == GTK_RESPONSE_OK) if (response_id == GTK_RESPONSE_OK)
{ {

View File

@ -0,0 +1,38 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __PATH_EXPORT_DIALOG_H__
#define __PATH_EXPORT_DIALOG_H__
typedef void (* GimpPathExportCallback) (GtkWidget *dialog,
GimpImage *image,
GFile *file,
GFile *export_folder,
gboolean active_only,
gpointer user_data);
GtkWidget * path_export_dialog_new (GimpImage *image,
GtkWidget *parent,
GFile *export_folder,
gboolean active_only,
GimpPathExportCallback callback,
gpointer user_data);
#endif /* __PATH_EXPORT_DIALOG_H__ */

View File

@ -28,46 +28,46 @@
#include "widgets/gimpwidgets-utils.h" #include "widgets/gimpwidgets-utils.h"
#include "vectors-import-dialog.h" #include "path-import-dialog.h"
#include "gimp-intl.h" #include "gimp-intl.h"
typedef struct _VectorsImportDialog VectorsImportDialog; typedef struct _PathImportDialog PathImportDialog;
struct _VectorsImportDialog struct _PathImportDialog
{ {
GimpImage *image; GimpImage *image;
gboolean merge_vectors; gboolean merge_path;
gboolean scale_vectors; gboolean scale_path;
GimpVectorsImportCallback callback; GimpPathImportCallback callback;
gpointer user_data; gpointer user_data;
}; };
/* local function prototypes */ /* local function prototypes */
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static void vectors_import_dialog_realize (GtkWidget *dialog, static void path_import_dialog_realize (GtkWidget *dialog,
VectorsImportDialog *data); PathImportDialog *data);
#endif #endif
static void vectors_import_dialog_free (VectorsImportDialog *private); static void path_import_dialog_free (PathImportDialog *private);
static void vectors_import_dialog_response (GtkWidget *dialog, static void path_import_dialog_response (GtkWidget *dialog,
gint response_id, gint response_id,
VectorsImportDialog *private); PathImportDialog *private);
/* public function */ /* public function */
GtkWidget * GtkWidget *
vectors_import_dialog_new (GimpImage *image, path_import_dialog_new (GimpImage *image,
GtkWidget *parent, GtkWidget *parent,
GFile *import_folder, GFile *import_folder,
gboolean merge_vectors, gboolean merge_path,
gboolean scale_vectors, gboolean scale_path,
GimpVectorsImportCallback callback, GimpPathImportCallback callback,
gpointer user_data) gpointer user_data)
{ {
VectorsImportDialog *private; PathImportDialog *private;
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *button; GtkWidget *button;
@ -79,11 +79,11 @@ vectors_import_dialog_new (GimpImage *image,
NULL); NULL);
g_return_val_if_fail (callback != NULL, NULL); g_return_val_if_fail (callback != NULL, NULL);
private = g_slice_new0 (VectorsImportDialog); private = g_slice_new0 (PathImportDialog);
private->image = image; private->image = image;
private->merge_vectors = merge_vectors; private->merge_path = merge_path;
private->scale_vectors = scale_vectors; private->scale_path = scale_path;
private->callback = callback; private->callback = callback;
private->user_data = user_data; private->user_data = user_data;
@ -111,7 +111,7 @@ vectors_import_dialog_new (GimpImage *image,
import_folder, NULL); import_folder, NULL);
g_object_weak_ref (G_OBJECT (dialog), g_object_weak_ref (G_OBJECT (dialog),
(GWeakNotify) vectors_import_dialog_free, private); (GWeakNotify) path_import_dialog_free, private);
g_signal_connect_object (image, "disconnect", g_signal_connect_object (image, "disconnect",
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
@ -119,7 +119,7 @@ vectors_import_dialog_new (GimpImage *image,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
g_signal_connect (dialog, "realize", g_signal_connect (dialog, "realize",
G_CALLBACK (vectors_import_dialog_realize), G_CALLBACK (path_import_dialog_realize),
private); private);
#endif #endif
g_signal_connect (dialog, "delete-event", g_signal_connect (dialog, "delete-event",
@ -127,7 +127,7 @@ vectors_import_dialog_new (GimpImage *image,
NULL); NULL);
g_signal_connect (dialog, "response", g_signal_connect (dialog, "response",
G_CALLBACK (vectors_import_dialog_response), G_CALLBACK (path_import_dialog_response),
private); private);
filter = gtk_file_filter_new (); filter = gtk_file_filter_new ();
@ -149,24 +149,24 @@ vectors_import_dialog_new (GimpImage *image,
button = gtk_check_button_new_with_mnemonic (_("_Merge imported paths")); button = gtk_check_button_new_with_mnemonic (_("_Merge imported paths"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
private->merge_vectors); private->merge_path);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
g_signal_connect (button, "toggled", g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&private->merge_vectors); &private->merge_path);
button = gtk_check_button_new_with_mnemonic (_("_Scale imported paths " button = gtk_check_button_new_with_mnemonic (_("_Scale imported paths "
"to fit image")); "to fit image"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
private->scale_vectors); private->scale_path);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
g_signal_connect (button, "toggled", g_signal_connect (button, "toggled",
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&private->scale_vectors); &private->scale_path);
return dialog; return dialog;
} }
@ -176,23 +176,23 @@ vectors_import_dialog_new (GimpImage *image,
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
static void static void
vectors_import_dialog_realize (GtkWidget *dialog, path_import_dialog_realize (GtkWidget *dialog,
VectorsImportDialog *data) PathImportDialog *data)
{ {
gimp_window_set_title_bar_theme (data->image->gimp, dialog); gimp_window_set_title_bar_theme (data->image->gimp, dialog);
} }
#endif #endif
static void static void
vectors_import_dialog_free (VectorsImportDialog *private) path_import_dialog_free (PathImportDialog *private)
{ {
g_slice_free (VectorsImportDialog, private); g_slice_free (PathImportDialog, private);
} }
static void static void
vectors_import_dialog_response (GtkWidget *dialog, path_import_dialog_response (GtkWidget *dialog,
gint response_id, gint response_id,
VectorsImportDialog *private) PathImportDialog *private)
{ {
if (response_id == GTK_RESPONSE_OK) if (response_id == GTK_RESPONSE_OK)
{ {
@ -211,8 +211,8 @@ vectors_import_dialog_response (GtkWidget *dialog,
private->image, private->image,
file, file,
folder, folder,
private->merge_vectors, private->merge_path,
private->scale_vectors, private->scale_path,
private->user_data); private->user_data);
if (folder) if (folder)

View File

@ -0,0 +1,40 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __PATH_IMPORT_DIALOG_H__
#define __PATH_IMPORT_DIALOG_H__
typedef void (* GimpPathImportCallback) (GtkWidget *dialog,
GimpImage *image,
GFile *file,
GFile *import_folder,
gboolean merge_vectors,
gboolean scale_vectors,
gpointer user_data);
GtkWidget * path_import_dialog_new (GimpImage *image,
GtkWidget *parent,
GFile *import_folder,
gboolean merge_path,
gboolean scale_path,
GimpPathImportCallback callback,
gpointer user_data);
#endif /* __PATH_IMPORT_DIALOG_H__ */

View File

@ -0,0 +1,161 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "dialogs-types.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "vectors/gimppath.h"
#include "item-options-dialog.h"
#include "path-options-dialog.h"
#include "gimp-intl.h"
typedef struct _PathOptionsDialog PathOptionsDialog;
struct _PathOptionsDialog
{
GimpPathOptionsCallback callback;
gpointer user_data;
};
/* local function prototypes */
static void path_options_dialog_free (PathOptionsDialog *private);
static void path_options_dialog_callback (GtkWidget *dialog,
GimpImage *image,
GimpItem *item,
GimpContext *context,
const gchar *item_name,
gboolean item_visible,
GimpColorTag item_color_tag,
gboolean item_lock_content,
gboolean item_lock_position,
gboolean item_lock_visibility,
gpointer user_data);
/* public functions */
GtkWidget *
path_options_dialog_new (GimpImage *image,
GimpPath *path,
GimpContext *context,
GtkWidget *parent,
const gchar *title,
const gchar *role,
const gchar *icon_name,
const gchar *desc,
const gchar *help_id,
const gchar *path_name,
gboolean path_visible,
GimpColorTag path_color_tag,
gboolean path_lock_content,
gboolean path_lock_position,
gboolean path_lock_visibility,
GimpPathOptionsCallback callback,
gpointer user_data)
{
PathOptionsDialog *private;
GtkWidget *dialog;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (path == NULL || GIMP_IS_PATH (path), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (role != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (callback != NULL, NULL);
private = g_slice_new0 (PathOptionsDialog);
private->callback = callback;
private->user_data = user_data;
dialog = item_options_dialog_new (image, GIMP_ITEM (path), context,
parent, title, role,
icon_name, desc, help_id,
_("Path _name:"),
GIMP_ICON_LOCK_CONTENT,
_("Lock path _strokes"),
_("Lock path _position"),
_("Lock path _visibility"),
path_name,
path_visible,
path_color_tag,
path_lock_content,
path_lock_position,
path_lock_visibility,
path_options_dialog_callback,
private);
g_object_weak_ref (G_OBJECT (dialog),
(GWeakNotify) path_options_dialog_free, private);
return dialog;
}
/* private functions */
static void
path_options_dialog_free (PathOptionsDialog *private)
{
g_slice_free (PathOptionsDialog, private);
}
static void
path_options_dialog_callback (GtkWidget *dialog,
GimpImage *image,
GimpItem *item,
GimpContext *context,
const gchar *item_name,
gboolean item_visible,
GimpColorTag item_color_tag,
gboolean item_lock_content,
gboolean item_lock_position,
gboolean item_lock_visibility,
gpointer user_data)
{
PathOptionsDialog *private = user_data;
private->callback (dialog,
image,
GIMP_PATH (item),
context,
item_name,
item_visible,
item_color_tag,
item_lock_content,
item_lock_position,
item_lock_visibility,
private->user_data);
}

View File

@ -15,25 +15,25 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __VECTORS_OPTIONS_DIALOG_H__ #ifndef __PATH_OPTIONS_DIALOG_H__
#define __VECTORS_OPTIONS_DIALOG_H__ #define __PATH_OPTIONS_DIALOG_H__
typedef void (* GimpVectorsOptionsCallback) (GtkWidget *dialog, typedef void (* GimpPathOptionsCallback) (GtkWidget *dialog,
GimpImage *image, GimpImage *image,
GimpPath *vectors, GimpPath *path,
GimpContext *context, GimpContext *context,
const gchar *vectors_name, const gchar *path_name,
gboolean vectors_visible, gboolean path_visible,
GimpColorTag vectors_color_tag, GimpColorTag path_color_tag,
gboolean vectors_lock_content, gboolean path_lock_content,
gboolean vectors_lock_position, gboolean path_lock_position,
gboolean vectors_lock_visibility, gboolean path_lock_visibility,
gpointer user_data); gpointer user_data);
GtkWidget * vectors_options_dialog_new (GimpImage *image, GtkWidget * path_options_dialog_new (GimpImage *image,
GimpPath *vectors, GimpPath *path,
GimpContext *context, GimpContext *context,
GtkWidget *parent, GtkWidget *parent,
const gchar *title, const gchar *title,
@ -41,14 +41,14 @@ GtkWidget * vectors_options_dialog_new (GimpImage *image,
const gchar *icon_name, const gchar *icon_name,
const gchar *desc, const gchar *desc,
const gchar *help_id, const gchar *help_id,
const gchar *vectors_name, const gchar *path_name,
gboolean vectors_visible, gboolean path_visible,
GimpColorTag vectors_color_tag, GimpColorTag path_color_tag,
gboolean vectors_lock_content, gboolean path_lock_content,
gboolean vectors_lock_position, gboolean path_lock_position,
gboolean vectors_lock_visibility, gboolean path_lock_visibility,
GimpVectorsOptionsCallback callback, GimpPathOptionsCallback callback,
gpointer user_data); gpointer user_data);
#endif /* __VECTORS_OPTIONS_DIALOG_H__ */ #endif /* __PATH_OPTIONS_DIALOG_H__ */

View File

@ -1,38 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __VECTORS_EXPORT_DIALOG_H__
#define __VECTORS_EXPORT_DIALOG_H__
typedef void (* GimpVectorsExportCallback) (GtkWidget *dialog,
GimpImage *image,
GFile *file,
GFile *export_folder,
gboolean active_only,
gpointer user_data);
GtkWidget * vectors_export_dialog_new (GimpImage *image,
GtkWidget *parent,
GFile *export_folder,
gboolean active_only,
GimpVectorsExportCallback callback,
gpointer user_data);
#endif /* __VECTORS_EXPORT_DIALOG_H__ */

View File

@ -1,40 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __VECTORS_IMPORT_DIALOG_H__
#define __VECTORS_IMPORT_DIALOG_H__
typedef void (* GimpVectorsImportCallback) (GtkWidget *dialog,
GimpImage *image,
GFile *file,
GFile *import_folder,
gboolean merge_vectors,
gboolean scale_vectors,
gpointer user_data);
GtkWidget * vectors_import_dialog_new (GimpImage *image,
GtkWidget *parent,
GFile *import_folder,
gboolean merge_vectors,
gboolean scale_vectors,
GimpVectorsImportCallback callback,
gpointer user_data);
#endif /* __VECTORS_IMPORT_DIALOG_H__ */

View File

@ -1,161 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "dialogs-types.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "vectors/gimppath.h"
#include "item-options-dialog.h"
#include "vectors-options-dialog.h"
#include "gimp-intl.h"
typedef struct _VectorsOptionsDialog VectorsOptionsDialog;
struct _VectorsOptionsDialog
{
GimpVectorsOptionsCallback callback;
gpointer user_data;
};
/* local function prototypes */
static void vectors_options_dialog_free (VectorsOptionsDialog *private);
static void vectors_options_dialog_callback (GtkWidget *dialog,
GimpImage *image,
GimpItem *item,
GimpContext *context,
const gchar *item_name,
gboolean item_visible,
GimpColorTag item_color_tag,
gboolean item_lock_content,
gboolean item_lock_position,
gboolean item_lock_visibility,
gpointer user_data);
/* public functions */
GtkWidget *
vectors_options_dialog_new (GimpImage *image,
GimpPath *vectors,
GimpContext *context,
GtkWidget *parent,
const gchar *title,
const gchar *role,
const gchar *icon_name,
const gchar *desc,
const gchar *help_id,
const gchar *vectors_name,
gboolean vectors_visible,
GimpColorTag vectors_color_tag,
gboolean vectors_lock_content,
gboolean vectors_lock_position,
gboolean vectors_lock_visibility,
GimpVectorsOptionsCallback callback,
gpointer user_data)
{
VectorsOptionsDialog *private;
GtkWidget *dialog;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (vectors == NULL || GIMP_IS_PATH (vectors), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (role != NULL, NULL);
g_return_val_if_fail (icon_name != NULL, NULL);
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (callback != NULL, NULL);
private = g_slice_new0 (VectorsOptionsDialog);
private->callback = callback;
private->user_data = user_data;
dialog = item_options_dialog_new (image, GIMP_ITEM (vectors), context,
parent, title, role,
icon_name, desc, help_id,
_("Path _name:"),
GIMP_ICON_LOCK_CONTENT,
_("Lock path _strokes"),
_("Lock path _position"),
_("Lock path _visibility"),
vectors_name,
vectors_visible,
vectors_color_tag,
vectors_lock_content,
vectors_lock_position,
vectors_lock_visibility,
vectors_options_dialog_callback,
private);
g_object_weak_ref (G_OBJECT (dialog),
(GWeakNotify) vectors_options_dialog_free, private);
return dialog;
}
/* private functions */
static void
vectors_options_dialog_free (VectorsOptionsDialog *private)
{
g_slice_free (VectorsOptionsDialog, private);
}
static void
vectors_options_dialog_callback (GtkWidget *dialog,
GimpImage *image,
GimpItem *item,
GimpContext *context,
const gchar *item_name,
gboolean item_visible,
GimpColorTag item_color_tag,
gboolean item_lock_content,
gboolean item_lock_position,
gboolean item_lock_visibility,
gpointer user_data)
{
VectorsOptionsDialog *private = user_data;
private->callback (dialog,
image,
GIMP_PATH (item),
context,
item_name,
item_visible,
item_color_tag,
item_lock_content,
item_lock_position,
item_lock_visibility,
private->user_data);
}

View File

@ -129,7 +129,7 @@ gimp_canvas_item_on_vectors_handle (GimpCanvasItem *item,
if (ret_anchor) *ret_anchor = NULL; if (ret_anchor) *ret_anchor = NULL;
if (ret_stroke) *ret_stroke = NULL; if (ret_stroke) *ret_stroke = NULL;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
GList *anchor_list; GList *anchor_list;
GList *list; GList *list;
@ -250,7 +250,7 @@ gimp_canvas_item_on_vectors_curve (GimpCanvasItem *item,
min_dist = -1.0; min_dist = -1.0;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
cur_dist = gimp_stroke_nearest_point_get (stroke, coord, 1.0, cur_dist = gimp_stroke_nearest_point_get (stroke, coord, 1.0,
&cur_coords, &cur_coords,

View File

@ -47,7 +47,7 @@
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectors-import.h" #include "vectors/gimppath-import.h"
#include "widgets/gimpdnd.h" #include "widgets/gimpdnd.h"
@ -319,7 +319,7 @@ gimp_display_shell_drop_svg (GtkWidget *widget,
if (! image) if (! image)
return; return;
if (! gimp_vectors_import_buffer (image, if (! gimp_path_import_buffer (image,
(const gchar *) svg_data, svg_data_len, (const gchar *) svg_data, svg_data_len,
TRUE, FALSE, TRUE, FALSE,
GIMP_IMAGE_ACTIVE_PARENT, -1, GIMP_IMAGE_ACTIVE_PARENT, -1,

View File

@ -1000,7 +1000,7 @@ gimp_display_shell_path_thaw_handler (GimpPath *path,
item = gimp_canvas_proxy_group_get_item (group, path); item = gimp_canvas_proxy_group_get_item (group, path);
gimp_canvas_path_set (item, gimp_vectors_get_bezier (path)); gimp_canvas_path_set (item, gimp_path_get_bezier (path));
} }
static void static void
@ -1025,7 +1025,7 @@ gimp_display_shell_path_add_handler (GimpContainer *container,
GimpCanvasItem *item; GimpCanvasItem *item;
item = gimp_canvas_path_new (shell, item = gimp_canvas_path_new (shell,
gimp_vectors_get_bezier (path), gimp_path_get_bezier (path),
0, 0, 0, 0,
FALSE, FALSE,
GIMP_PATH_STYLE_VECTORS); GIMP_PATH_STYLE_VECTORS);

View File

@ -64,7 +64,7 @@
#define INSDEL_MASK gimp_get_toggle_behavior_mask () #define INSDEL_MASK gimp_get_toggle_behavior_mask ()
/* possible vector functions */ /* possible path functions */
typedef enum typedef enum
{ {
VECTORS_SELECT_VECTOR, VECTORS_SELECT_VECTOR,
@ -83,7 +83,7 @@ typedef enum
VECTORS_DELETE_SEGMENT, VECTORS_DELETE_SEGMENT,
VECTORS_CONVERT_EDGE, VECTORS_CONVERT_EDGE,
VECTORS_FINISHED VECTORS_FINISHED
} GimpVectorFunction; } GimpPathFunction;
enum enum
{ {
@ -107,7 +107,7 @@ struct _GimpToolPathPrivate
GimpVectorMode edit_mode; GimpVectorMode edit_mode;
gboolean polygonal; gboolean polygonal;
GimpVectorFunction function; /* function we're performing */ GimpPathFunction function; /* function we're performing */
GimpAnchorFeatureType restriction; /* movement restriction */ GimpAnchorFeatureType restriction; /* movement restriction */
gboolean modifier_lock; /* can we toggle the Shift key? */ gboolean modifier_lock; /* can we toggle the Shift key? */
GdkModifierType saved_state; /* modifier state at button_press */ GdkModifierType saved_state; /* modifier state at button_press */
@ -183,7 +183,7 @@ static GimpUIManager * gimp_tool_path_get_popup (GimpToolWidget *widget,
GdkModifierType state, GdkModifierType state,
const gchar **ui_path); const gchar **ui_path);
static GimpVectorFunction static GimpPathFunction
gimp_tool_path_get_function (GimpToolPath *path, gimp_tool_path_get_function (GimpToolPath *path,
const GimpCoords *coords, const GimpCoords *coords,
GdkModifierType state); GdkModifierType state);
@ -398,18 +398,18 @@ gimp_tool_path_changed (GimpToolWidget *widget)
private->items = NULL; private->items = NULL;
} }
if (vectors && gimp_vectors_get_bezier (vectors)) if (vectors && gimp_path_get_bezier (vectors))
{ {
GimpStroke *cur_stroke; GimpStroke *cur_stroke;
gimp_canvas_path_set (private->path, gimp_canvas_path_set (private->path,
gimp_vectors_get_bezier (vectors)); gimp_path_get_bezier (vectors));
gimp_canvas_item_set_visible (private->path, gimp_canvas_item_set_visible (private->path,
! gimp_item_get_visible (GIMP_ITEM (vectors))); ! gimp_item_get_visible (GIMP_ITEM (vectors)));
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); for (cur_stroke = gimp_path_stroke_get_next (vectors, NULL);
cur_stroke; cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke)) cur_stroke = gimp_path_stroke_get_next (vectors, cur_stroke))
{ {
GimpCanvasItem *item; GimpCanvasItem *item;
GArray *coords; GArray *coords;
@ -614,7 +614,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
GimpImage *image = gimp_display_get_image (shell->display); GimpImage *image = gimp_display_get_image (shell->display);
GimpPath *vectors; GimpPath *vectors;
vectors = gimp_vectors_new (image, _("Unnamed")); vectors = gimp_path_new (image, _("Unnamed"));
g_object_ref_sink (vectors); g_object_ref_sink (vectors);
/* Undo step gets added implicitly */ /* Undo step gets added implicitly */
@ -629,7 +629,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
} }
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
/* create a new stroke */ /* create a new stroke */
@ -640,7 +640,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
private->undo_motion = TRUE; private->undo_motion = TRUE;
private->cur_stroke = gimp_bezier_stroke_new (); private->cur_stroke = gimp_bezier_stroke_new ();
gimp_vectors_stroke_add (private->vectors, private->cur_stroke); gimp_path_stroke_add (private->vectors, private->cur_stroke);
g_object_unref (private->cur_stroke); g_object_unref (private->cur_stroke);
private->sel_stroke = private->cur_stroke; private->sel_stroke = private->cur_stroke;
@ -719,7 +719,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
{ {
if (! private->cur_anchor->selected) if (! private->cur_anchor->selected)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor, private->cur_anchor,
TRUE, TRUE); TRUE, TRUE);
@ -748,7 +748,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
if (! private->cur_anchor->selected) if (! private->cur_anchor->selected)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor, private->cur_anchor,
TRUE, TRUE); TRUE, TRUE);
@ -766,7 +766,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
if (state & TOGGLE_MASK) if (state & TOGGLE_MASK)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor, private->cur_anchor,
!private->cur_anchor->selected, !private->cur_anchor->selected,
@ -790,7 +790,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
* from gimp_bezier_stroke_point_move_relative in gimpbezierstroke.c. */ * from gimp_bezier_stroke_point_move_relative in gimpbezierstroke.c. */
if (private->cur_position < 5.0 / 6.0) if (private->cur_position < 5.0 / 6.0)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor, TRUE, TRUE); private->cur_anchor, TRUE, TRUE);
private->undo_motion = TRUE; private->undo_motion = TRUE;
@ -798,7 +798,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
if (private->cur_position > 1.0 / 6.0) if (private->cur_position > 1.0 / 6.0)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor2, TRUE, private->cur_anchor2, TRUE,
(private->cur_position >= 5.0 / 6.0)); (private->cur_position >= 5.0 / 6.0));
@ -824,14 +824,14 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
if (private->cur_stroke != private->sel_stroke && if (private->cur_stroke != private->sel_stroke &&
gimp_stroke_is_empty (private->cur_stroke)) gimp_stroke_is_empty (private->cur_stroke))
{ {
gimp_vectors_stroke_remove (private->vectors, gimp_path_stroke_remove (private->vectors,
private->cur_stroke); private->cur_stroke);
} }
private->sel_anchor = private->cur_anchor; private->sel_anchor = private->cur_anchor;
private->cur_stroke = private->sel_stroke; private->cur_stroke = private->sel_stroke;
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->sel_stroke, private->sel_stroke,
private->sel_anchor, TRUE, TRUE); private->sel_anchor, TRUE, TRUE);
@ -865,7 +865,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
if (private->cur_anchor->type == GIMP_ANCHOR_ANCHOR) if (private->cur_anchor->type == GIMP_ANCHOR_ANCHOR)
{ {
gimp_vectors_anchor_select (private->vectors, gimp_path_anchor_select (private->vectors,
private->cur_stroke, private->cur_stroke,
private->cur_anchor, TRUE, TRUE); private->cur_anchor, TRUE, TRUE);
@ -894,7 +894,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
private->cur_anchor); private->cur_anchor);
if (gimp_stroke_is_empty (private->cur_stroke)) if (gimp_stroke_is_empty (private->cur_stroke))
gimp_vectors_stroke_remove (private->vectors, gimp_path_stroke_remove (private->vectors,
private->cur_stroke); private->cur_stroke);
private->cur_stroke = NULL; private->cur_stroke = NULL;
@ -917,7 +917,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
private->cur_anchor); private->cur_anchor);
if (new_stroke) if (new_stroke)
{ {
gimp_vectors_stroke_add (private->vectors, new_stroke); gimp_path_stroke_add (private->vectors, new_stroke);
g_object_unref (new_stroke); g_object_unref (new_stroke);
} }
@ -929,7 +929,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget,
private->last_x = coords->x; private->last_x = coords->x;
private->last_y = coords->y; private->last_y = coords->y;
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
return 1; return 1;
} }
@ -977,7 +977,7 @@ gimp_tool_path_motion (GimpToolWidget *widget,
position.x = coords->x; position.x = coords->x;
position.y = coords->y; position.y = coords->y;
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
if ((private->saved_state & TOGGLE_MASK) != (state & TOGGLE_MASK)) if ((private->saved_state & TOGGLE_MASK) != (state & TOGGLE_MASK))
private->modifier_lock = FALSE; private->modifier_lock = FALSE;
@ -1064,7 +1064,7 @@ gimp_tool_path_motion (GimpToolWidget *widget,
break; break;
} }
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
private->last_x = coords->x; private->last_x = coords->x;
private->last_y = coords->y; private->last_y = coords->y;
@ -1163,7 +1163,7 @@ gimp_tool_path_key_press (GimpToolWidget *widget,
ydist = FUNSCALEY (shell, pixels); ydist = FUNSCALEY (shell, pixels);
gimp_tool_path_begin_change (path, _("Move Anchors")); gimp_tool_path_begin_change (path, _("Move Anchors"));
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
switch (kevent->keyval) switch (kevent->keyval)
{ {
@ -1187,7 +1187,7 @@ gimp_tool_path_key_press (GimpToolWidget *widget,
break; break;
} }
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
break; break;
@ -1325,7 +1325,7 @@ gimp_tool_path_get_popup (GimpToolWidget *widget,
} }
static GimpVectorFunction static GimpPathFunction
gimp_tool_path_get_function (GimpToolPath *path, gimp_tool_path_get_function (GimpToolPath *path,
const GimpCoords *coords, const GimpCoords *coords,
GdkModifierType state) GdkModifierType state)
@ -1338,7 +1338,7 @@ gimp_tool_path_get_function (GimpToolPath *path,
gboolean on_handle = FALSE; gboolean on_handle = FALSE;
gboolean on_curve = FALSE; gboolean on_curve = FALSE;
gboolean on_vectors = FALSE; gboolean on_vectors = FALSE;
GimpVectorFunction function = VECTORS_FINISHED; GimpPathFunction function = VECTORS_FINISHED;
private->modifier_lock = FALSE; private->modifier_lock = FALSE;
@ -1779,7 +1779,7 @@ gimp_tool_path_verify_state (GimpToolPath *path)
return; return;
} }
while ((cur_stroke = gimp_vectors_stroke_get_next (private->vectors, while ((cur_stroke = gimp_path_stroke_get_next (private->vectors,
cur_stroke))) cur_stroke)))
{ {
GList *anchors; GList *anchors;
@ -1852,7 +1852,7 @@ gimp_tool_path_move_selected_anchors (GimpToolPath *path,
offset.x = x; offset.x = x;
offset.y = y; offset.y = y;
while ((cur_stroke = gimp_vectors_stroke_get_next (private->vectors, while ((cur_stroke = gimp_path_stroke_get_next (private->vectors,
cur_stroke))) cur_stroke)))
{ {
/* anchors */ /* anchors */
@ -1883,9 +1883,9 @@ gimp_tool_path_delete_selected_anchors (GimpToolPath *path)
GList *list; GList *list;
gboolean have_undo = FALSE; gboolean have_undo = FALSE;
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
while ((cur_stroke = gimp_vectors_stroke_get_next (private->vectors, while ((cur_stroke = gimp_path_stroke_get_next (private->vectors,
cur_stroke))) cur_stroke)))
{ {
/* anchors */ /* anchors */
@ -1907,7 +1907,7 @@ gimp_tool_path_delete_selected_anchors (GimpToolPath *path)
if (gimp_stroke_is_empty (cur_stroke)) if (gimp_stroke_is_empty (cur_stroke))
{ {
gimp_vectors_stroke_remove (private->vectors, cur_stroke); gimp_path_stroke_remove (private->vectors, cur_stroke);
cur_stroke = NULL; cur_stroke = NULL;
} }
} }
@ -1919,7 +1919,7 @@ gimp_tool_path_delete_selected_anchors (GimpToolPath *path)
if (have_undo) if (have_undo)
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }
@ -2008,13 +2008,13 @@ gimp_tool_path_delete_anchor (GimpToolPath *path)
g_return_if_fail (private->cur_stroke != NULL); g_return_if_fail (private->cur_stroke != NULL);
g_return_if_fail (private->cur_anchor != NULL); g_return_if_fail (private->cur_anchor != NULL);
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
gimp_tool_path_begin_change (path, _("Delete Anchors")); gimp_tool_path_begin_change (path, _("Delete Anchors"));
if (private->cur_anchor->type == GIMP_ANCHOR_ANCHOR) if (private->cur_anchor->type == GIMP_ANCHOR_ANCHOR)
{ {
gimp_stroke_anchor_delete (private->cur_stroke, private->cur_anchor); gimp_stroke_anchor_delete (private->cur_stroke, private->cur_anchor);
if (gimp_stroke_is_empty (private->cur_stroke)) if (gimp_stroke_is_empty (private->cur_stroke))
gimp_vectors_stroke_remove (private->vectors, gimp_path_stroke_remove (private->vectors,
private->cur_stroke); private->cur_stroke);
} }
else else
@ -2025,7 +2025,7 @@ gimp_tool_path_delete_anchor (GimpToolPath *path)
} }
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }
void void
@ -2035,11 +2035,11 @@ gimp_tool_path_shift_start (GimpToolPath *path)
g_return_if_fail (private->cur_stroke != NULL); g_return_if_fail (private->cur_stroke != NULL);
g_return_if_fail (private->cur_anchor != NULL); g_return_if_fail (private->cur_anchor != NULL);
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
gimp_tool_path_begin_change (path, _("Shift start")); gimp_tool_path_begin_change (path, _("Shift start"));
gimp_stroke_shift_start (private->cur_stroke, private->cur_anchor); gimp_stroke_shift_start (private->cur_stroke, private->cur_anchor);
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }
void void
@ -2050,13 +2050,13 @@ gimp_tool_path_insert_anchor (GimpToolPath *path)
g_return_if_fail (private->cur_anchor != NULL); g_return_if_fail (private->cur_anchor != NULL);
g_return_if_fail (private->cur_position >= 0.0); g_return_if_fail (private->cur_position >= 0.0);
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
gimp_tool_path_begin_change (path, _("Insert Anchor")); gimp_tool_path_begin_change (path, _("Insert Anchor"));
private->cur_anchor = gimp_stroke_anchor_insert (private->cur_stroke, private->cur_anchor = gimp_stroke_anchor_insert (private->cur_stroke,
private->cur_anchor, private->cur_anchor,
private->cur_position); private->cur_position);
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }
void void
@ -2067,18 +2067,18 @@ gimp_tool_path_delete_segment (GimpToolPath *path)
g_return_if_fail (private->cur_stroke != NULL); g_return_if_fail (private->cur_stroke != NULL);
g_return_if_fail (private->cur_anchor != NULL); g_return_if_fail (private->cur_anchor != NULL);
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
gimp_tool_path_begin_change (path, _("Delete Segment")); gimp_tool_path_begin_change (path, _("Delete Segment"));
new_stroke = gimp_stroke_open (private->cur_stroke, new_stroke = gimp_stroke_open (private->cur_stroke,
private->cur_anchor); private->cur_anchor);
if (new_stroke) if (new_stroke)
{ {
gimp_vectors_stroke_add (private->vectors, new_stroke); gimp_path_stroke_add (private->vectors, new_stroke);
g_object_unref (new_stroke); g_object_unref (new_stroke);
} }
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }
void void
@ -2087,9 +2087,9 @@ gimp_tool_path_reverse_stroke (GimpToolPath *path)
GimpToolPathPrivate *private = path->private; GimpToolPathPrivate *private = path->private;
g_return_if_fail (private->cur_stroke != NULL); g_return_if_fail (private->cur_stroke != NULL);
gimp_vectors_freeze (private->vectors); gimp_path_freeze (private->vectors);
gimp_tool_path_begin_change (path, _("Insert Anchor")); gimp_tool_path_begin_change (path, _("Insert Anchor"));
gimp_stroke_reverse (private->cur_stroke); gimp_stroke_reverse (private->cur_stroke);
gimp_tool_path_end_change (path, TRUE); gimp_tool_path_end_change (path, TRUE);
gimp_vectors_thaw (private->vectors); gimp_path_thaw (private->vectors);
} }

View File

@ -95,9 +95,9 @@ EXPORTS
gimp_channel_select_channel gimp_channel_select_channel
gimp_channel_select_component gimp_channel_select_component
gimp_channel_select_ellipse gimp_channel_select_ellipse
gimp_channel_select_path
gimp_channel_select_polygon gimp_channel_select_polygon
gimp_channel_select_rectangle gimp_channel_select_rectangle
gimp_channel_select_vectors
gimp_channel_set_color gimp_channel_set_color
gimp_channel_sharpen gimp_channel_sharpen
gimp_channel_shrink gimp_channel_shrink
@ -487,6 +487,18 @@ EXPORTS
gimp_parameters_append_valist gimp_parameters_append_valist
gimp_parameters_free gimp_parameters_free
gimp_path_get_type gimp_path_get_type
gimp_path_anchor_select
gimp_path_bounds
gimp_path_export_file
gimp_path_export_string
gimp_path_freeze
gimp_path_import_buffer
gimp_path_import_file
gimp_path_new
gimp_path_stroke_add
gimp_path_stroke_get_next
gimp_path_stroke_remove
gimp_path_thaw
gimp_pattern_get_standard gimp_pattern_get_standard
gimp_pattern_get_type gimp_pattern_get_type
gimp_pencil_options_get_type gimp_pencil_options_get_type
@ -546,7 +558,7 @@ EXPORTS
gimp_text_layer_new gimp_text_layer_new
gimp_text_layer_set gimp_text_layer_set
gimp_text_undo_get_type gimp_text_undo_get_type
gimp_text_vectors_new gimp_text_path_new
gimp_tool_info_get_standard gimp_tool_info_get_standard
gimp_tool_info_get_type gimp_tool_info_get_type
gimp_tool_info_new gimp_tool_info_new
@ -570,18 +582,6 @@ EXPORTS
gimp_undo_stack_peek gimp_undo_stack_peek
gimp_undo_stack_pop_undo gimp_undo_stack_pop_undo
gimp_unset_busy gimp_unset_busy
gimp_vectors_anchor_select
gimp_vectors_bounds
gimp_vectors_export_file
gimp_vectors_export_string
gimp_vectors_freeze
gimp_vectors_import_buffer
gimp_vectors_import_file
gimp_vectors_new
gimp_vectors_stroke_add
gimp_vectors_stroke_get_next
gimp_vectors_stroke_remove
gimp_vectors_thaw
gimp_viewable_calc_preview_size gimp_viewable_calc_preview_size
gimp_viewable_get_description gimp_viewable_get_description
gimp_viewable_get_new_preview gimp_viewable_get_new_preview
@ -680,7 +680,7 @@ gimp_gradient_segment_split_midpoint
gimp_image_resize_with_layers gimp_image_resize_with_layers
gimp_image_update_sample_point gimp_image_update_sample_point
gimp_palette_set_columns gimp_palette_set_columns
gimp_vectors_warp_vectors gimp_path_warp_path
gimp_buffer_new_from_pixbuf gimp_buffer_new_from_pixbuf
gimp_container_is_empty gimp_container_is_empty
gimp_data_factory_data_refresh gimp_data_factory_data_refresh
@ -949,6 +949,7 @@ gimp_marshal_VOID__DOUBLE
gimp_marshal_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE gimp_marshal_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE
gimp_operation_hue_saturation_map gimp_operation_hue_saturation_map
gimp_operation_levels_map_input gimp_operation_levels_map_input
gimp_path_make_bezier
gimp_perspective_clone_set_transform gimp_perspective_clone_set_transform
gimp_posterize_config_get_type gimp_posterize_config_get_type
gimp_recent_list_load gimp_recent_list_load
@ -958,4 +959,3 @@ gimp_threshold_config_get_type
gimp_threshold_config_to_cruft gimp_threshold_config_to_cruft
gimp_tool_info_build_options_filename gimp_tool_info_build_options_filename
gimp_use_gegl gimp_use_gegl
gimp_vectors_make_bezier

View File

@ -230,7 +230,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
} }
gboolean gboolean
gimp_paint_core_stroke_vectors (GimpPaintCore *core, gimp_paint_core_stroke_path (GimpPaintCore *core,
GimpDrawable *drawable, GimpDrawable *drawable,
GimpPaintOptions *paint_options, GimpPaintOptions *paint_options,
gboolean emulate_dynamics, gboolean emulate_dynamics,

View File

@ -36,7 +36,7 @@ gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core,
gint offset_y, gint offset_y,
gboolean push_undo, gboolean push_undo,
GError **error); GError **error);
gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core, gboolean gimp_paint_core_stroke_path (GimpPaintCore *core,
GimpDrawable *drawable, GimpDrawable *drawable,
GimpPaintOptions *paint_options, GimpPaintOptions *paint_options,
gboolean emulate_dynamics, gboolean emulate_dynamics,

View File

@ -805,7 +805,7 @@ gimp_pdb_get_path_stroke (GimpPath *path,
if (! modify || gimp_pdb_item_is_modifiable (GIMP_ITEM (path), if (! modify || gimp_pdb_item_is_modifiable (GIMP_ITEM (path),
modify, error)) modify, error))
{ {
stroke = gimp_vectors_stroke_get_by_id (path, stroke_id); stroke = gimp_path_stroke_get_by_id (path, stroke_id);
if (! stroke) if (! stroke)
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,

View File

@ -36,14 +36,14 @@
#include "core/gimplayer.h" #include "core/gimplayer.h"
#include "core/gimplist.h" #include "core/gimplist.h"
#include "core/gimpparamspecs.h" #include "core/gimpparamspecs.h"
#include "text/gimptext-vectors.h" #include "text/gimptext-path.h"
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
#include "vectors/gimpanchor.h" #include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h" #include "vectors/gimpbezierstroke.h"
#include "vectors/gimppath-export.h"
#include "vectors/gimppath-import.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpstroke-new.h" #include "vectors/gimpstroke-new.h"
#include "vectors/gimpvectors-export.h"
#include "vectors/gimpvectors-import.h"
#include "gimppdb.h" #include "gimppdb.h"
#include "gimppdb-utils.h" #include "gimppdb-utils.h"
@ -72,7 +72,7 @@ path_new_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
path = gimp_vectors_new (image, name); path = gimp_path_new (image, name);
} }
return_vals = gimp_procedure_get_return_values (procedure, success, return_vals = gimp_procedure_get_return_values (procedure, success,
@ -107,7 +107,7 @@ path_new_from_text_layer_invoker (GimpProcedure *procedure,
{ {
gint x, y; gint x, y;
path = gimp_text_vectors_new (image, path = gimp_text_path_new (image,
gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer))); gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)));
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y); gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
@ -179,7 +179,7 @@ path_get_strokes_invoker (GimpProcedure *procedure,
if (success) if (success)
{ {
num_strokes = gimp_vectors_get_n_strokes (path); num_strokes = gimp_path_get_n_strokes (path);
if (num_strokes) if (num_strokes)
{ {
@ -188,9 +188,9 @@ path_get_strokes_invoker (GimpProcedure *procedure,
stroke_ids = g_new (gint32, num_strokes); stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (path, NULL); for (cur_stroke = gimp_path_stroke_get_next (path, NULL);
cur_stroke; cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (path, cur_stroke)) cur_stroke = gimp_path_stroke_get_next (path, cur_stroke))
{ {
stroke_ids[i] = gimp_stroke_get_id (cur_stroke); stroke_ids[i] = gimp_stroke_get_id (cur_stroke);
i++; i++;
@ -330,7 +330,7 @@ path_remove_stroke_invoker (GimpProcedure *procedure,
_("Remove path stroke"), _("Remove path stroke"),
path); path);
gimp_vectors_stroke_remove (path, stroke); gimp_path_stroke_remove (path, stroke);
} }
else else
success = FALSE; success = FALSE;
@ -367,9 +367,9 @@ path_stroke_close_invoker (GimpProcedure *procedure,
_("Close path stroke"), _("Close path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_close (stroke); gimp_stroke_close (stroke);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -406,9 +406,9 @@ path_stroke_reverse_invoker (GimpProcedure *procedure,
_("Reverse path stroke"), _("Reverse path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_reverse (stroke); gimp_stroke_reverse (stroke);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -451,9 +451,9 @@ path_stroke_translate_invoker (GimpProcedure *procedure,
_("Translate path stroke"), _("Translate path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_translate (stroke, off_x, off_y); gimp_stroke_translate (stroke, off_x, off_y);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -496,9 +496,9 @@ path_stroke_scale_invoker (GimpProcedure *procedure,
_("Scale path stroke"), _("Scale path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_scale (stroke, scale_x, scale_y); gimp_stroke_scale (stroke, scale_x, scale_y);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -543,9 +543,9 @@ path_stroke_rotate_invoker (GimpProcedure *procedure,
_("Rotate path stroke"), _("Rotate path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_rotate (stroke, center_x, center_y, angle); gimp_stroke_rotate (stroke, center_x, center_y, angle);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -588,9 +588,9 @@ path_stroke_flip_invoker (GimpProcedure *procedure,
_("Flip path stroke"), _("Flip path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_flip (stroke, flip_type, axis); gimp_stroke_flip (stroke, flip_type, axis);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -637,9 +637,9 @@ path_stroke_flip_free_invoker (GimpProcedure *procedure,
_("Flip path stroke"), _("Flip path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_flip_free (stroke, x1, y1, x2, y2); gimp_stroke_flip_free (stroke, x1, y1, x2, y2);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -768,7 +768,7 @@ path_stroke_new_from_points_invoker (GimpProcedure *procedure,
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -892,7 +892,7 @@ path_bezier_stroke_new_moveto_invoker (GimpProcedure *procedure,
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -946,9 +946,9 @@ path_bezier_stroke_lineto_invoker (GimpProcedure *procedure,
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_lineto (stroke, &coord0); gimp_bezier_stroke_lineto (stroke, &coord0);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -1002,9 +1002,9 @@ path_bezier_stroke_conicto_invoker (GimpProcedure *procedure,
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -1066,9 +1066,9 @@ path_bezier_stroke_cubicto_invoker (GimpProcedure *procedure,
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -1122,7 +1122,7 @@ path_bezier_stroke_new_ellipse_invoker (GimpProcedure *procedure,
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -1167,7 +1167,7 @@ path_import_from_file_invoker (GimpProcedure *procedure,
GList *path_list = NULL; GList *path_list = NULL;
/* FIXME tree */ /* FIXME tree */
success = gimp_vectors_import_file (image, file, success = gimp_path_import_file (image, file,
merge, scale, NULL, -1, merge, scale, NULL, -1,
&path_list, error); &path_list, error);
@ -1235,7 +1235,7 @@ path_import_from_string_invoker (GimpProcedure *procedure,
GList *path_list = NULL; GList *path_list = NULL;
/* FIXME tree */ /* FIXME tree */
success = gimp_vectors_import_buffer (image, string, length, success = gimp_path_import_buffer (image, string, length,
merge, scale, NULL, -1, merge, scale, NULL, -1,
&path_list, error); &path_list, error);
@ -1298,7 +1298,7 @@ path_export_to_file_invoker (GimpProcedure *procedure,
if (path != NULL) if (path != NULL)
path_list = g_list_prepend (path_list, path); path_list = g_list_prepend (path_list, path);
success = gimp_vectors_export_file (image, path_list, file, error); success = gimp_path_export_file (image, path_list, file, error);
g_list_free (path_list); g_list_free (path_list);
} }
@ -1331,7 +1331,7 @@ path_export_to_string_invoker (GimpProcedure *procedure,
if (path != NULL) if (path != NULL)
path_list = g_list_prepend (path_list, path); path_list = g_list_prepend (path_list, path);
string = gimp_vectors_export_string (image, path_list); string = gimp_path_export_string (image, path_list);
g_list_free (path_list); g_list_free (path_list);
success = (string != NULL); success = (string != NULL);
@ -2382,7 +2382,7 @@ register_path_procs (GimpPDB *pdb)
"gimp-path-import-from-string"); "gimp-path-import-from-string");
gimp_procedure_set_static_help (procedure, gimp_procedure_set_static_help (procedure,
"Import paths from an SVG string.", "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.", "This procedure works like 'gimp-path-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.",
NULL); NULL);
gimp_procedure_set_static_attribution (procedure, gimp_procedure_set_static_attribution (procedure,
"Simon Budig", "Simon Budig",

View File

@ -529,11 +529,11 @@ gimp_create_mainimage (Gimp *gimp,
FALSE /*push_undo*/); FALSE /*push_undo*/);
/* Vectors 1 */ /* Vectors 1 */
vectors = gimp_vectors_new (image, vectors = gimp_path_new (image,
GIMP_MAINIMAGE_VECTORS1_NAME); GIMP_MAINIMAGE_VECTORS1_NAME);
/* The XCF file can save vectors in two kind of ways, one old way /* The XCF file can save vectors in two kind of ways, one old way
* and a new way. Parameterize the way so we can test both variants, * and a new way. Parameterize the way so we can test both variants,
* i.e. gimp_vectors_compat_is_compatible() must return both TRUE * i.e. gimp_path_compat_is_compatible() must return both TRUE
* and FALSE. * and FALSE.
*/ */
if (! compat_paths) if (! compat_paths)
@ -548,7 +548,7 @@ gimp_create_mainimage (Gimp *gimp,
stroke = gimp_bezier_stroke_new_from_coords (vectors1_coords, stroke = gimp_bezier_stroke_new_from_coords (vectors1_coords,
G_N_ELEMENTS (vectors1_coords), G_N_ELEMENTS (vectors1_coords),
TRUE /*closed*/); TRUE /*closed*/);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (vectors, stroke);
gimp_image_add_path (image, gimp_image_add_path (image,
vectors, vectors,
NULL /*parent*/, NULL /*parent*/,
@ -556,13 +556,13 @@ gimp_create_mainimage (Gimp *gimp,
FALSE /*push_undo*/); FALSE /*push_undo*/);
/* Vectors 2 */ /* Vectors 2 */
vectors = gimp_vectors_new (image, vectors = gimp_path_new (image,
GIMP_MAINIMAGE_VECTORS2_NAME); GIMP_MAINIMAGE_VECTORS2_NAME);
stroke = gimp_bezier_stroke_new_from_coords (vectors2_coords, stroke = gimp_bezier_stroke_new_from_coords (vectors2_coords,
G_N_ELEMENTS (vectors2_coords), G_N_ELEMENTS (vectors2_coords),
TRUE /*closed*/); TRUE /*closed*/);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (vectors, stroke);
gimp_image_add_path (image, gimp_image_add_path (image,
vectors, vectors,
NULL /*parent*/, NULL /*parent*/,
@ -694,7 +694,7 @@ gimp_assert_vectors (GimpImage *image,
gint i = 0; gint i = 0;
vectors = gimp_image_get_path_by_name (image, name); vectors = gimp_image_get_path_by_name (image, name);
stroke = gimp_vectors_stroke_get_next (vectors, NULL); stroke = gimp_path_stroke_get_next (vectors, NULL);
g_assert_true (stroke != NULL); g_assert_true (stroke != NULL);
control_points = gimp_stroke_control_points_get (stroke, control_points = gimp_stroke_control_points_get (stroke,
&closed); &closed);

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* GimpText-vectors * GimpText-path
* Copyright (C) 2003 Sven Neumann <sven@gimp.org> * Copyright (C) 2003 Sven Neumann <sven@gimp.org>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -34,34 +34,34 @@
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "gimptext.h" #include "gimptext.h"
#include "gimptext-vectors.h" #include "gimptext-path.h"
#include "gimptextlayout.h" #include "gimptextlayout.h"
#include "gimptextlayout-render.h" #include "gimptextlayout-render.h"
typedef struct typedef struct
{ {
GimpPath *vectors; GimpPath *path;
GimpStroke *stroke; GimpStroke *stroke;
GimpAnchor *anchor; GimpAnchor *anchor;
} RenderContext; } RenderContext;
static void gimp_text_render_vectors (cairo_t *cr, static void gimp_text_render_path (cairo_t *cr,
RenderContext *context); RenderContext *context);
GimpPath * GimpPath *
gimp_text_vectors_new (GimpImage *image, gimp_text_path_new (GimpImage *image,
GimpText *text) GimpText *text)
{ {
GimpPath *vectors; GimpPath *path;
RenderContext context = { NULL, }; RenderContext context = { NULL, };
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GIMP_IS_TEXT (text), NULL); g_return_val_if_fail (GIMP_IS_TEXT (text), NULL);
vectors = gimp_vectors_new (image, NULL); path = gimp_path_new (image, NULL);
if (text->text || text->markup) if (text->text || text->markup)
{ {
@ -73,9 +73,9 @@ gimp_text_vectors_new (GimpImage *image,
GError *error = NULL; GError *error = NULL;
if (text->text) if (text->text)
gimp_object_set_name_safe (GIMP_OBJECT (vectors), text->text); gimp_object_set_name_safe (GIMP_OBJECT (path), text->text);
context.vectors = vectors; context.path = path;
surface = cairo_recording_surface_create (CAIRO_CONTENT_ALPHA, NULL); surface = cairo_recording_surface_create (CAIRO_CONTENT_ALPHA, NULL);
cr = cairo_create (surface); cr = cairo_create (surface);
@ -91,7 +91,7 @@ gimp_text_vectors_new (GimpImage *image,
gimp_text_layout_render (layout, cr, text->base_dir, TRUE); gimp_text_layout_render (layout, cr, text->base_dir, TRUE);
g_object_unref (layout); g_object_unref (layout);
gimp_text_render_vectors (cr, &context); gimp_text_render_path (cr, &context);
cairo_destroy (cr); cairo_destroy (cr);
cairo_surface_destroy (surface); cairo_surface_destroy (surface);
@ -100,7 +100,7 @@ gimp_text_vectors_new (GimpImage *image,
gimp_stroke_close (context.stroke); gimp_stroke_close (context.stroke);
} }
return vectors; return path;
} }
@ -135,7 +135,7 @@ moveto (RenderContext *context,
context->stroke = gimp_bezier_stroke_new_moveto (&start); context->stroke = gimp_bezier_stroke_new_moveto (&start);
gimp_vectors_stroke_add (context->vectors, context->stroke); gimp_path_stroke_add (context->path, context->stroke);
g_object_unref (context->stroke); g_object_unref (context->stroke);
return 0; return 0;
@ -209,7 +209,7 @@ closepath (RenderContext *context)
} }
static void static void
gimp_text_render_vectors (cairo_t *cr, gimp_text_render_path (cairo_t *cr,
RenderContext *context) RenderContext *context)
{ {
cairo_path_t *path; cairo_path_t *path;

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* GimpText-vectors * GimpText-path
* Copyright (C) 2003 Sven Neumann <sven@gimp.org> * Copyright (C) 2003 Sven Neumann <sven@gimp.org>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -18,12 +18,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_TEXT_VECTORS_H__ #ifndef __GIMP_TEXT_PATH_H__
#define __GIMP_TEXT_VECTORS_H__ #define __GIMP_TEXT_PATH_H__
GimpPath * gimp_text_vectors_new (GimpImage *image, GimpPath * gimp_text_path_new (GimpImage *image,
GimpText *text); GimpText *text);
#endif /* __GIMP_TEXT_VECTORS_H__ */ #endif /* __GIMP_TEXT_PATH_H__ */

View File

@ -22,7 +22,7 @@ libapptext_sources = [
'gimpfontfactory.c', 'gimpfontfactory.c',
'gimptext-compat.c', 'gimptext-compat.c',
'gimptext-parasite.c', 'gimptext-parasite.c',
'gimptext-vectors.c', 'gimptext-path.c',
'gimptext-xlfd.c', 'gimptext-xlfd.c',
'gimptext.c', 'gimptext.c',
'gimptextlayer-transform.c', 'gimptextlayer-transform.c',

View File

@ -51,14 +51,14 @@
#include "menus/menus.h" #include "menus/menus.h"
#include "text/gimptext.h" #include "text/gimptext.h"
#include "text/gimptext-vectors.h" #include "text/gimptext-path.h"
#include "text/gimptextlayer.h" #include "text/gimptextlayer.h"
#include "text/gimptextlayout.h" #include "text/gimptextlayout.h"
#include "text/gimptextundo.h" #include "text/gimptextundo.h"
#include "vectors/gimpstroke.h" #include "vectors/gimpstroke.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectors-warp.h" #include "vectors/gimppath-warp.h"
#include "widgets/gimpdialogfactory.h" #include "widgets/gimpdialogfactory.h"
#include "widgets/gimpdockcontainer.h" #include "widgets/gimpdockcontainer.h"
@ -2320,7 +2320,7 @@ gimp_text_tool_create_vectors (GimpTextTool *text_tool)
if (! text_tool->text || ! text_tool->image) if (! text_tool->text || ! text_tool->image)
return; return;
path = gimp_text_vectors_new (text_tool->image, text_tool->text); path = gimp_text_path_new (text_tool->image, text_tool->text);
if (text_tool->layer) if (text_tool->layer)
{ {
@ -2374,7 +2374,7 @@ gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool,
return FALSE; return FALSE;
} }
vectors = gimp_text_vectors_new (text_tool->image, text_tool->text); vectors = gimp_text_path_new (text_tool->image, text_tool->text);
offset = 0; offset = 0;
dir = gimp_text_tool_get_direction (text_tool); dir = gimp_text_tool_get_direction (text_tool);
@ -2391,7 +2391,7 @@ gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool,
{ {
GimpStroke *stroke = NULL; GimpStroke *stroke = NULL;
while ((stroke = gimp_vectors_stroke_get_next (vectors, stroke))) while ((stroke = gimp_path_stroke_get_next (vectors, stroke)))
{ {
gimp_stroke_rotate (stroke, 0, 0, 270); gimp_stroke_rotate (stroke, 0, 0, 270);
gimp_stroke_translate (stroke, 0, box_width); gimp_stroke_translate (stroke, 0, box_width);
@ -2401,7 +2401,7 @@ gimp_text_tool_create_vectors_warped (GimpTextTool *text_tool,
break; break;
} }
gimp_vectors_warp_vectors (vectors0->data, vectors, offset); gimp_path_warp_path (vectors0->data, vectors, offset);
gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE); gimp_item_set_visible (GIMP_ITEM (vectors), TRUE, FALSE);

View File

@ -50,8 +50,8 @@
#include "core/gimptoolinfo.h" #include "core/gimptoolinfo.h"
#include "core/gimpviewable.h" #include "core/gimpviewable.h"
#include "vectors/gimpstroke.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpstroke.h"
#include "widgets/gimpwidgets-utils.h" #include "widgets/gimpwidgets-utils.h"
@ -835,7 +835,7 @@ gimp_transform_grid_tool_draw (GimpDrawTool *draw_tool)
GimpPath *path = iter->data; GimpPath *path = iter->data;
GimpStroke *stroke = NULL; GimpStroke *stroke = NULL;
while ((stroke = gimp_vectors_stroke_get_next (path, stroke))) while ((stroke = gimp_path_stroke_get_next (path, stroke)))
{ {
GArray *coords; GArray *coords;
gboolean closed; gboolean closed;

View File

@ -749,7 +749,7 @@ gimp_transform_tool_check_selected_objects (GimpTransformTool *tr_tool,
locked_message = _("The selected path's strokes are locked."); locked_message = _("The selected path's strokes are locked.");
else if (gimp_item_is_position_locked (item, &locked_item)) else if (gimp_item_is_position_locked (item, &locked_item))
locked_message = _("The selected path's position is locked."); locked_message = _("The selected path's position is locked.");
else if (! gimp_vectors_get_n_strokes (GIMP_PATH (item))) else if (! gimp_path_get_n_strokes (GIMP_PATH (item)))
locked_message = _("The selected path has no strokes."); locked_message = _("The selected path has no strokes.");
} }
break; break;

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpvectors-compat.c * gimppath-compat.c
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org> * Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -30,14 +30,14 @@
#include "gimpanchor.h" #include "gimpanchor.h"
#include "gimpbezierstroke.h" #include "gimpbezierstroke.h"
#include "gimppath.h" #include "gimppath.h"
#include "gimpvectors-compat.h" #include "gimppath-compat.h"
enum enum
{ {
GIMP_VECTORS_COMPAT_ANCHOR = 1, GIMP_PATH_COMPAT_ANCHOR = 1,
GIMP_VECTORS_COMPAT_CONTROL = 2, GIMP_PATH_COMPAT_CONTROL = 2,
GIMP_VECTORS_COMPAT_NEW_STROKE = 3 GIMP_PATH_COMPAT_NEW_STROKE = 3
}; };
@ -45,13 +45,13 @@ static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES;
GimpPath * GimpPath *
gimp_vectors_compat_new (GimpImage *image, gimp_path_compat_new (GimpImage *image,
const gchar *name, const gchar *name,
GimpVectorsCompatPoint *points, GimpPathCompatPoint *points,
gint n_points, gint n_points,
gboolean closed) gboolean closed)
{ {
GimpPath *vectors; GimpPath *path;
GimpStroke *stroke; GimpStroke *stroke;
GimpCoords *coords; GimpCoords *coords;
GimpCoords *curr_stroke; GimpCoords *curr_stroke;
@ -63,7 +63,7 @@ gimp_vectors_compat_new (GimpImage *image,
g_return_val_if_fail (points != NULL || n_points == 0, NULL); g_return_val_if_fail (points != NULL || n_points == 0, NULL);
g_return_val_if_fail (n_points >= 0, NULL); g_return_val_if_fail (n_points >= 0, NULL);
vectors = gimp_vectors_new (image, name); path = gimp_path_new (image, name);
coords = g_new0 (GimpCoords, n_points + 1); coords = g_new0 (GimpCoords, n_points + 1);
@ -84,7 +84,7 @@ gimp_vectors_compat_new (GimpImage *image,
*curr_stroke = *curr_coord; *curr_stroke = *curr_coord;
/* found new stroke start */ /* found new stroke start */
if (points[i].type == GIMP_VECTORS_COMPAT_NEW_STROKE) if (points[i].type == GIMP_PATH_COMPAT_NEW_STROKE)
{ {
/* copy the last control point to the beginning of the stroke */ /* copy the last control point to the beginning of the stroke */
*curr_stroke = *(curr_coord - 1); *curr_stroke = *(curr_coord - 1);
@ -93,7 +93,7 @@ gimp_vectors_compat_new (GimpImage *image,
gimp_bezier_stroke_new_from_coords (curr_stroke, gimp_bezier_stroke_new_from_coords (curr_stroke,
curr_coord - curr_stroke - 1, curr_coord - curr_stroke - 1,
TRUE); TRUE);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
/* start a new stroke */ /* start a new stroke */
@ -116,16 +116,16 @@ gimp_vectors_compat_new (GimpImage *image,
stroke = gimp_bezier_stroke_new_from_coords (curr_stroke, stroke = gimp_bezier_stroke_new_from_coords (curr_stroke,
curr_coord - curr_stroke, curr_coord - curr_stroke,
closed); closed);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
g_free (coords); g_free (coords);
return vectors; return path;
} }
gboolean gboolean
gimp_vectors_compat_is_compatible (GimpImage *image) gimp_path_compat_is_compatible (GimpImage *image)
{ {
GList *list; GList *list;
@ -135,14 +135,14 @@ gimp_vectors_compat_is_compatible (GimpImage *image)
list; list;
list = g_list_next (list)) list = g_list_next (list))
{ {
GimpPath *vectors = GIMP_PATH (list->data); GimpPath *path = GIMP_PATH (list->data);
GList *strokes; GList *strokes;
gint open_count = 0; gint open_count = 0;
if (gimp_item_get_visible (GIMP_ITEM (vectors))) if (gimp_item_get_visible (GIMP_ITEM (path)))
return FALSE; return FALSE;
for (strokes = vectors->strokes->head; for (strokes = path->strokes->head;
strokes; strokes;
strokes = g_list_next (strokes)) strokes = g_list_next (strokes))
{ {
@ -162,19 +162,19 @@ gimp_vectors_compat_is_compatible (GimpImage *image)
return TRUE; return TRUE;
} }
GimpVectorsCompatPoint * GimpPathCompatPoint *
gimp_vectors_compat_get_points (GimpPath *vectors, gimp_path_compat_get_points (GimpPath *path,
gint32 *n_points, gint32 *n_points,
gint32 *closed) gint32 *closed)
{ {
GimpVectorsCompatPoint *points; GimpPathCompatPoint *points;
GList *strokes; GList *strokes;
gint i; gint i;
GList *postponed = NULL; /* for the one open stroke... */ GList *postponed = NULL; /* for the one open stroke... */
gint open_count; gint open_count;
gboolean first_stroke = TRUE; gboolean first_stroke = TRUE;
g_return_val_if_fail (GIMP_IS_PATH (vectors), NULL); g_return_val_if_fail (GIMP_IS_PATH (path), NULL);
g_return_val_if_fail (n_points != NULL, NULL); g_return_val_if_fail (n_points != NULL, NULL);
g_return_val_if_fail (closed != NULL, NULL); g_return_val_if_fail (closed != NULL, NULL);
@ -183,7 +183,7 @@ gimp_vectors_compat_get_points (GimpPath *vectors,
open_count = 0; open_count = 0;
for (strokes = vectors->strokes->head; for (strokes = path->strokes->head;
strokes; strokes;
strokes = g_list_next (strokes)) strokes = g_list_next (strokes))
{ {
@ -198,7 +198,7 @@ gimp_vectors_compat_get_points (GimpPath *vectors,
if (open_count >= 2) if (open_count >= 2)
{ {
g_warning ("gimp_vectors_compat_get_points(): convert failed"); g_warning ("gimp_path_compat_get_points(): convert failed");
*n_points = 0; *n_points = 0;
return NULL; return NULL;
} }
@ -212,11 +212,11 @@ gimp_vectors_compat_get_points (GimpPath *vectors,
*n_points += n_anchors; *n_points += n_anchors;
} }
points = g_new0 (GimpVectorsCompatPoint, *n_points); points = g_new0 (GimpPathCompatPoint, *n_points);
i = 0; i = 0;
for (strokes = vectors->strokes->head; for (strokes = path->strokes->head;
strokes || postponed; strokes || postponed;
strokes = g_list_next (strokes)) strokes = g_list_next (strokes))
{ {
@ -251,13 +251,13 @@ gimp_vectors_compat_get_points (GimpPath *vectors,
{ {
case GIMP_ANCHOR_ANCHOR: case GIMP_ANCHOR_ANCHOR:
if (anchors->prev == stroke->anchors->head && ! first_stroke) if (anchors->prev == stroke->anchors->head && ! first_stroke)
points[i].type = GIMP_VECTORS_COMPAT_NEW_STROKE; points[i].type = GIMP_PATH_COMPAT_NEW_STROKE;
else else
points[i].type = GIMP_VECTORS_COMPAT_ANCHOR; points[i].type = GIMP_PATH_COMPAT_ANCHOR;
break; break;
case GIMP_ANCHOR_CONTROL: case GIMP_ANCHOR_CONTROL:
points[i].type = GIMP_VECTORS_COMPAT_CONTROL; points[i].type = GIMP_PATH_COMPAT_CONTROL;
break; break;
} }
@ -271,7 +271,7 @@ gimp_vectors_compat_get_points (GimpPath *vectors,
{ {
anchor = g_queue_peek_head (stroke->anchors); anchor = g_queue_peek_head (stroke->anchors);
points[i].type = GIMP_VECTORS_COMPAT_CONTROL; points[i].type = GIMP_PATH_COMPAT_CONTROL;
points[i].x = anchor->position.x; points[i].x = anchor->position.x;
points[i].y = anchor->position.y; points[i].y = anchor->position.y;

View File

@ -0,0 +1,48 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimppath-compat.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PATH_COMPAT_H__
#define __GIMP_PATH_COMPAT_H__
typedef struct _GimpPathCompatPoint GimpPathCompatPoint;
struct _GimpPathCompatPoint
{
guint32 type;
gdouble x;
gdouble y;
};
GimpPath * gimp_path_compat_new (GimpImage *image,
const gchar *name,
GimpPathCompatPoint *points,
gint n_points,
gboolean closed);
gboolean gimp_path_compat_is_compatible (GimpImage *image);
GimpPathCompatPoint * gimp_path_compat_get_points (GimpPath *path,
gint32 *n_points,
gint32 *closed);
#endif /* __GIMP_PATH_COMPAT_H__ */

View File

@ -30,29 +30,29 @@
#include "gimpanchor.h" #include "gimpanchor.h"
#include "gimpbezierstroke.h" #include "gimpbezierstroke.h"
#include "gimppath.h" #include "gimppath.h"
#include "gimppath-export.h"
#include "gimpstroke.h" #include "gimpstroke.h"
#include "gimpvectors-export.h"
#include "gimp-intl.h" #include "gimp-intl.h"
static GString * gimp_vectors_export (GimpImage *image, static GString * gimp_path_export (GimpImage *image,
GList *vectors); GList *paths);
static void gimp_vectors_export_image_size (GimpImage *image, static void gimp_path_export_image_size (GimpImage *image,
GString *str); GString *str);
static void gimp_vectors_export_path (GimpPath *vectors, static void gimp_path_export_path (GimpPath *paths,
GString *str); GString *str);
static gchar * gimp_vectors_export_path_data (GimpPath *vectors); static gchar * gimp_path_export_path_data (GimpPath *paths);
/** /**
* gimp_vectors_export_file: * gimp_path_export_file:
* @image: the #GimpImage from which to export * @image: the #GimpImage from which to export
* @path_list: a #GList of #GimpPath objects or %NULL to export all paths in @image * @path_list: a #GList of #GimpPath objects or %NULL to export all paths in @image
* @file: the file to write * @file: the file to write
* @error: return location for errors * @error: return location for errors
* *
* Exports one or more vectors aka path to an SVG file aka XML doc. * Exports one or more paths to an SVG file aka XML doc.
* *
* When @path_list is %NULL aka empty list, exports all paths in image. * When @path_list is %NULL aka empty list, exports all paths in image.
* *
@ -65,7 +65,7 @@ static gchar * gimp_vectors_export_path_data (GimpPath *vectors);
* %FALSE when there was an error writing the file * %FALSE when there was an error writing the file
**/ **/
gboolean gboolean
gimp_vectors_export_file (GimpImage *image, gimp_path_export_file (GimpImage *image,
GList *path_list, GList *path_list,
GFile *file, GFile *file,
GError **error) GError **error)
@ -84,7 +84,7 @@ gimp_vectors_export_file (GimpImage *image,
if (! output) if (! output)
return FALSE; return FALSE;
string = gimp_vectors_export (image, path_list); string = gimp_path_export (image, path_list);
if (! g_output_stream_write_all (output, string->str, string->len, if (! g_output_stream_write_all (output, string->str, string->len,
NULL, NULL, &my_error)) NULL, NULL, &my_error))
@ -113,11 +113,11 @@ gimp_vectors_export_file (GimpImage *image,
} }
/** /**
* gimp_vectors_export_string: * gimp_path_export_string:
* @image: the #GimpImage from which to export * @image: the #GimpImage from which to export
* @path_list: a #GList of #GimpPath objects, or %NULL to export all paths in @image * @path_list: a #GList of #GimpPath objects, or %NULL to export all paths in @image
* *
* Exports one or more vectors aka path to a SVG string. * Exports one or more paths to a SVG string.
* *
* When @path_list is %NULL aka empty list, exports all paths in image. * When @path_list is %NULL aka empty list, exports all paths in image.
* *
@ -127,17 +127,17 @@ gimp_vectors_export_file (GimpImage *image,
* Returns: a NULL-terminated string that holds a complete XML document * Returns: a NULL-terminated string that holds a complete XML document
**/ **/
gchar * gchar *
gimp_vectors_export_string (GimpImage *image, gimp_path_export_string (GimpImage *image,
GList *path_list) GList *path_list)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
return g_string_free (gimp_vectors_export (image, path_list), FALSE); return g_string_free (gimp_path_export (image, path_list), FALSE);
} }
static GString * static GString *
gimp_vectors_export (GimpImage *image, gimp_path_export (GimpImage *image,
GList *vectors) GList *path)
{ {
GString *str = g_string_new (NULL); GString *str = g_string_new (NULL);
GList *list; GList *list;
@ -150,7 +150,7 @@ gimp_vectors_export (GimpImage *image,
"<svg xmlns=\"http://www.w3.org/2000/svg\"\n"); "<svg xmlns=\"http://www.w3.org/2000/svg\"\n");
g_string_append (str, " "); g_string_append (str, " ");
gimp_vectors_export_image_size (image, str); gimp_path_export_image_size (image, str);
g_string_append_c (str, '\n'); g_string_append_c (str, '\n');
g_string_append_printf (str, g_string_append_printf (str,
@ -158,11 +158,11 @@ gimp_vectors_export (GimpImage *image,
gimp_image_get_width (image), gimp_image_get_width (image),
gimp_image_get_height (image)); gimp_image_get_height (image));
if (! vectors) if (! path)
vectors = gimp_image_get_path_iter (image); path = gimp_image_get_path_iter (image);
for (list = vectors; list; list = list->next) for (list = path; list; list = list->next)
gimp_vectors_export_path (GIMP_PATH (list->data), str); gimp_path_export_path (GIMP_PATH (list->data), str);
g_string_append (str, "</svg>\n"); g_string_append (str, "</svg>\n");
@ -170,7 +170,7 @@ gimp_vectors_export (GimpImage *image,
} }
static void static void
gimp_vectors_export_image_size (GimpImage *image, gimp_path_export_image_size (GimpImage *image,
GString *str) GString *str)
{ {
GimpUnit unit; GimpUnit unit;
@ -210,11 +210,11 @@ gimp_vectors_export_image_size (GimpImage *image,
} }
static void static void
gimp_vectors_export_path (GimpPath *vectors, gimp_path_export_path (GimpPath *path,
GString *str) GString *str)
{ {
const gchar *name = gimp_object_get_name (vectors); const gchar *name = gimp_object_get_name (path);
gchar *data = gimp_vectors_export_path_data (vectors); gchar *data = gimp_path_export_path_data (path);
gchar *esc_name; gchar *esc_name;
esc_name = g_markup_escape_text (name, strlen (name)); esc_name = g_markup_escape_text (name, strlen (name));
@ -233,7 +233,7 @@ gimp_vectors_export_path (GimpPath *vectors,
#define NEWLINE "\n " #define NEWLINE "\n "
static gchar * static gchar *
gimp_vectors_export_path_data (GimpPath *vectors) gimp_path_export_path_data (GimpPath *path)
{ {
GString *str; GString *str;
GList *strokes; GList *strokes;
@ -243,7 +243,7 @@ gimp_vectors_export_path_data (GimpPath *vectors)
str = g_string_new (NULL); str = g_string_new (NULL);
for (strokes = vectors->strokes->head; for (strokes = path->strokes->head;
strokes; strokes;
strokes = strokes->next) strokes = strokes->next)
{ {

View File

@ -15,16 +15,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_VECTORS_EXPORT_H__ #ifndef __GIMP_PATH_EXPORT_H__
#define __GIMP_VECTORS_EXPORT_H__ #define __GIMP_PATH_EXPORT_H__
gboolean gimp_vectors_export_file (GimpImage *image, gboolean gimp_path_export_file (GimpImage *image,
GList *vectors, GList *path_list,
GFile *file, GFile *file,
GError **error); GError **error);
gchar * gimp_vectors_export_string (GimpImage *image, gchar * gimp_path_export_string (GimpImage *image,
GList *vectors); GList *path_list);
#endif /* __GIMP_VECTORS_IMPORT_H__ */ #endif /* __GIMP_PATH_IMPORT_H__ */

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* GimpVectors Import * GimpPath Import
* Copyright (C) 2003-2004 Sven Neumann <sven@gimp.org> * Copyright (C) 2003-2004 Sven Neumann <sven@gimp.org>
* *
* Some code here is based on code from librsvg that was originally * Some code here is based on code from librsvg that was originally
@ -50,7 +50,7 @@
#include "gimpbezierstroke.h" #include "gimpbezierstroke.h"
#include "gimpstroke.h" #include "gimpstroke.h"
#include "gimppath.h" #include "gimppath.h"
#include "gimpvectors-import.h" #include "gimppath-import.h"
#include "gimp-intl.h" #include "gimp-intl.h"
@ -105,7 +105,7 @@ typedef struct
} SvgPath; } SvgPath;
static gboolean gimp_vectors_import (GimpImage *image, static gboolean gimp_path_import (GimpImage *image,
GFile *file, GFile *file,
const gchar *str, const gchar *str,
gsize len, gsize len,
@ -113,7 +113,7 @@ static gboolean gimp_vectors_import (GimpImage *image,
gboolean scale, gboolean scale,
GimpPath *parent, GimpPath *parent,
gint position, gint position,
GList **ret_vectors, GList **ret_paths,
GError **error); GError **error);
static void svg_parser_start_element (GMarkupParseContext *context, static void svg_parser_start_element (GMarkupParseContext *context,
@ -196,12 +196,12 @@ static GList * parse_path_data (const gchar *data);
/** /**
* gimp_vectors_import_file: * gimp_path_import_file:
* @image: the #GimpImage to add the paths to * @image: the #GimpImage to add the paths to
* @file: a SVG file * @file: a SVG file
* @merge: should multiple paths be merged into a single #GimpPath object * @merge: should multiple paths be merged into a single #GimpPath object
* @scale: should the SVG be scaled to fit the image dimensions * @scale: should the SVG be scaled to fit the image dimensions
* @position: position in the image's vectors stack where to add the vectors * @position: position in the image's path stack where to add the paths
* @error: location to store possible errors * @error: location to store possible errors
* *
* Imports one or more paths and basic shapes from a SVG file. * Imports one or more paths and basic shapes from a SVG file.
@ -209,13 +209,13 @@ static GList * parse_path_data (const gchar *data);
* Returns: %TRUE on success, %FALSE if an error occurred * Returns: %TRUE on success, %FALSE if an error occurred
**/ **/
gboolean gboolean
gimp_vectors_import_file (GimpImage *image, gimp_path_import_file (GimpImage *image,
GFile *file, GFile *file,
gboolean merge, gboolean merge,
gboolean scale, gboolean scale,
GimpPath *parent, GimpPath *parent,
gint position, gint position,
GList **ret_vectors, GList **ret_paths,
GError **error) GError **error)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
@ -234,16 +234,16 @@ gimp_vectors_import_file (GimpImage *image,
parent == GIMP_IMAGE_ACTIVE_PARENT || parent == GIMP_IMAGE_ACTIVE_PARENT ||
gimp_viewable_get_children (GIMP_VIEWABLE (parent)), gimp_viewable_get_children (GIMP_VIEWABLE (parent)),
FALSE); FALSE);
g_return_val_if_fail (ret_vectors == NULL || *ret_vectors == NULL, FALSE); g_return_val_if_fail (ret_paths == NULL || *ret_paths == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return gimp_vectors_import (image, file, NULL, 0, merge, scale, return gimp_path_import (image, file, NULL, 0, merge, scale,
parent, position, parent, position,
ret_vectors, error); ret_paths, error);
} }
/** /**
* gimp_vectors_import_string: * gimp_path_import_string:
* @image: the #GimpImage to add the paths to * @image: the #GimpImage to add the paths to
* @buffer: a character buffer to parse * @buffer: a character buffer to parse
* @len: number of bytes in @str or -1 if @str is %NUL-terminated * @len: number of bytes in @str or -1 if @str is %NUL-terminated
@ -256,14 +256,14 @@ gimp_vectors_import_file (GimpImage *image,
* Returns: %TRUE on success, %FALSE if an error occurred * Returns: %TRUE on success, %FALSE if an error occurred
**/ **/
gboolean gboolean
gimp_vectors_import_buffer (GimpImage *image, gimp_path_import_buffer (GimpImage *image,
const gchar *buffer, const gchar *buffer,
gsize len, gsize len,
gboolean merge, gboolean merge,
gboolean scale, gboolean scale,
GimpPath *parent, GimpPath *parent,
gint position, gint position,
GList **ret_vectors, GList **ret_paths,
GError **error) GError **error)
{ {
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
@ -282,16 +282,16 @@ gimp_vectors_import_buffer (GimpImage *image,
parent == GIMP_IMAGE_ACTIVE_PARENT || parent == GIMP_IMAGE_ACTIVE_PARENT ||
gimp_viewable_get_children (GIMP_VIEWABLE (parent)), gimp_viewable_get_children (GIMP_VIEWABLE (parent)),
FALSE); FALSE);
g_return_val_if_fail (ret_vectors == NULL || *ret_vectors == NULL, FALSE); g_return_val_if_fail (ret_paths == NULL || *ret_paths == NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
return gimp_vectors_import (image, NULL, buffer, len, merge, scale, return gimp_path_import (image, NULL, buffer, len, merge, scale,
parent, position, parent, position,
ret_vectors, error); ret_paths, error);
} }
static gboolean static gboolean
gimp_vectors_import (GimpImage *image, gimp_path_import (GimpImage *image,
GFile *file, GFile *file,
const gchar *str, const gchar *str,
gsize len, gsize len,
@ -299,7 +299,7 @@ gimp_vectors_import (GimpImage *image,
gboolean scale, gboolean scale,
GimpPath *parent, GimpPath *parent,
gint position, gint position,
GList **ret_vectors, GList **ret_paths,
GError **error) GError **error)
{ {
GimpXmlParser *xml_parser; GimpXmlParser *xml_parser;
@ -334,48 +334,48 @@ gimp_vectors_import (GimpImage *image,
{ {
if (base->paths) if (base->paths)
{ {
GimpPath *vectors = NULL; GimpPath *path = NULL;
base->paths = g_list_reverse (base->paths); base->paths = g_list_reverse (base->paths);
merge = merge && base->paths->next; merge = merge && base->paths->next;
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_VECTORS_IMPORT, gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PATHS_IMPORT,
_("Import Paths")); _("Import Paths"));
for (paths = base->paths; paths; paths = paths->next) for (paths = base->paths; paths; paths = paths->next)
{ {
SvgPath *path = paths->data; SvgPath *svg_path = paths->data;
GList *list; GList *list;
if (! merge || ! vectors) if (! merge || ! path)
{ {
vectors = gimp_vectors_new (image, path = gimp_path_new (image,
((merge || ! path->id) ? ((merge || ! svg_path->id) ?
_("Imported Path") : path->id)); _("Imported Path") : svg_path->id));
gimp_image_add_path (image, vectors, gimp_image_add_path (image, path,
parent, position, TRUE); parent, position, TRUE);
gimp_vectors_freeze (vectors); gimp_path_freeze (path);
if (ret_vectors) if (ret_paths)
*ret_vectors = g_list_prepend (*ret_vectors, vectors); *ret_paths = g_list_prepend (*ret_paths, path);
if (position != -1) if (position != -1)
position++; position++;
} }
for (list = path->strokes; list; list = list->next) for (list = svg_path->strokes; list; list = list->next)
gimp_vectors_stroke_add (vectors, GIMP_STROKE (list->data)); gimp_path_stroke_add (path, GIMP_STROKE (list->data));
if (! merge) if (! merge)
gimp_vectors_thaw (vectors); gimp_path_thaw (path);
g_list_free_full (path->strokes, g_object_unref); g_list_free_full (svg_path->strokes, g_object_unref);
path->strokes = NULL; svg_path->strokes = NULL;
} }
if (merge) if (merge)
gimp_vectors_thaw (vectors); gimp_path_thaw (path);
gimp_image_undo_group_end (image); gimp_image_undo_group_end (image);
} }
@ -407,17 +407,17 @@ gimp_vectors_import (GimpImage *image,
{ {
for (paths = base->paths; paths; paths = paths->next) for (paths = base->paths; paths; paths = paths->next)
{ {
SvgPath *path = paths->data; SvgPath *svg_path = paths->data;
GList *list; GList *list;
g_free (path->id); g_free (svg_path->id);
for (list = path->strokes; list; list = list->next) for (list = svg_path->strokes; list; list = list->next)
g_object_unref (list->data); g_object_unref (list->data);
g_list_free (path->strokes); g_list_free (svg_path->strokes);
g_slice_free (SvgPath, path); g_slice_free (SvgPath, svg_path);
} }
g_list_free (base->paths); g_list_free (base->paths);
@ -494,10 +494,10 @@ svg_parser_end_element (GMarkupParseContext *context,
{ {
for (paths = handler->paths; paths; paths = paths->next) for (paths = handler->paths; paths; paths = paths->next)
{ {
SvgPath *path = paths->data; SvgPath *svg_path = paths->data;
GList *list; GList *list;
for (list = path->strokes; list; list = list->next) for (list = svg_path->strokes; list; list = list->next)
gimp_stroke_transform (GIMP_STROKE (list->data), gimp_stroke_transform (GIMP_STROKE (list->data),
handler->transform, NULL); handler->transform, NULL);
} }

View File

@ -0,0 +1,44 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* GimpPath Import
* Copyright (C) 2003 Sven Neumann <sven@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PATH_IMPORT_H__
#define __GIMP_PATH_IMPORT_H__
gboolean gimp_path_import_file (GimpImage *image,
GFile *file,
gboolean merge,
gboolean scale,
GimpPath *parent,
gint position,
GList **ret_paths,
GError **error);
gboolean gimp_path_import_buffer (GimpImage *image,
const gchar *buffer,
gsize len,
gboolean merge,
gboolean scale,
GimpPath *parent,
gint position,
GList **ret_paths,
GError **error);
#endif /* __GIMP_PATH_IMPORT_H__ */

View File

@ -29,27 +29,27 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimptempbuf.h" #include "core/gimptempbuf.h"
#include "gimppath.h"
#include "gimpstroke.h" #include "gimpstroke.h"
#include "gimpvectors-preview.h" #include "gimppath.h"
#include "gimppath-preview.h"
/* public functions */ /* public functions */
GimpTempBuf * GimpTempBuf *
gimp_vectors_get_new_preview (GimpViewable *viewable, gimp_path_get_new_preview (GimpViewable *viewable,
GimpContext *context, GimpContext *context,
gint width, gint width,
gint height) gint height)
{ {
GimpPath *vectors; GimpPath *path;
GimpItem *item; GimpItem *item;
GimpStroke *cur_stroke; GimpStroke *cur_stroke;
gdouble xscale, yscale; gdouble xscale, yscale;
guchar *data; guchar *data;
GimpTempBuf *temp_buf; GimpTempBuf *temp_buf;
vectors = GIMP_PATH (viewable); path = GIMP_PATH (viewable);
item = GIMP_ITEM (viewable); item = GIMP_ITEM (viewable);
xscale = ((gdouble) width) / gimp_image_get_width (gimp_item_get_image (item)); xscale = ((gdouble) width) / gimp_image_get_width (gimp_item_get_image (item));
@ -59,9 +59,9 @@ gimp_vectors_get_new_preview (GimpViewable *viewable,
data = gimp_temp_buf_get_data (temp_buf); data = gimp_temp_buf_get_data (temp_buf);
memset (data, 255, width * height); memset (data, 255, width * height);
for (cur_stroke = gimp_vectors_stroke_get_next (vectors, NULL); for (cur_stroke = gimp_path_stroke_get_next (path, NULL);
cur_stroke; cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (vectors, cur_stroke)) cur_stroke = gimp_path_stroke_get_next (path, cur_stroke))
{ {
GArray *coords; GArray *coords;
gboolean closed; gboolean closed;

View File

@ -15,18 +15,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_VECTORS_PREVIEW_H__ #ifndef __GIMP_PATH_PREVIEW_H__
#define __GIMP_VECTORS_PREVIEW_H__ #define __GIMP_PATH_PREVIEW_H__
/* /*
* virtual function of GimpVectors -- don't call directly * virtual function of GimpPath -- don't call directly
*/ */
GimpTempBuf * gimp_vectors_get_new_preview (GimpViewable *viewable, GimpTempBuf * gimp_path_get_new_preview (GimpViewable *viewable,
GimpContext *context, GimpContext *context,
gint width, gint width,
gint height); gint height);
#endif /* __GIMP_VECTORS_PREVIEW_H__ */ #endif /* __GIMP_PATH_PREVIEW_H__ */

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpvectors-warp.c * gimppath-warp.c
* Copyright (C) 2005 Bill Skaggs <weskaggs@primate.ucdavis.edu> * Copyright (C) 2005 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -31,9 +31,9 @@
#include "core/gimpcoords.h" #include "core/gimpcoords.h"
#include "gimpanchor.h" #include "gimpanchor.h"
#include "gimppath.h"
#include "gimpstroke.h" #include "gimpstroke.h"
#include "gimpvectors-warp.h" #include "gimppath.h"
#include "gimppath-warp.h"
#define EPSILON 0.2 #define EPSILON 0.2
@ -47,13 +47,13 @@ static void gimp_stroke_warp_point (GimpStroke *stroke,
gdouble y_offset, gdouble y_offset,
gdouble x_len); gdouble x_len);
static void gimp_vectors_warp_stroke (GimpPath *vectors, static void gimp_path_warp_stroke (GimpPath *path,
GimpStroke *stroke, GimpStroke *stroke,
gdouble y_offset); gdouble y_offset);
void void
gimp_vectors_warp_point (GimpPath *vectors, gimp_path_warp_point (GimpPath *path,
GimpCoords *point, GimpCoords *point,
GimpCoords *point_warped, GimpCoords *point_warped,
gdouble y_offset) gdouble y_offset)
@ -64,13 +64,13 @@ gimp_vectors_warp_point (GimpPath *vectors,
GList *list; GList *list;
GimpStroke *stroke; GimpStroke *stroke;
for (list = vectors->strokes->head; for (list = path->strokes->head;
list; list;
list = g_list_next (list)) list = g_list_next (list))
{ {
stroke = list->data; stroke = list->data;
len = gimp_vectors_stroke_get_length (vectors, stroke); len = gimp_path_stroke_get_length (path, stroke);
if (x < len || ! list->next) if (x < len || ! list->next)
break; break;
@ -176,7 +176,7 @@ gimp_stroke_warp_point (GimpStroke *stroke,
} }
static void static void
gimp_vectors_warp_stroke (GimpPath *vectors, gimp_path_warp_stroke (GimpPath *path,
GimpStroke *stroke, GimpStroke *stroke,
gdouble y_offset) gdouble y_offset)
{ {
@ -186,25 +186,25 @@ gimp_vectors_warp_stroke (GimpPath *vectors,
{ {
GimpAnchor *anchor = list->data; GimpAnchor *anchor = list->data;
gimp_vectors_warp_point (vectors, gimp_path_warp_point (path,
&anchor->position, &anchor->position, &anchor->position, &anchor->position,
y_offset); y_offset);
} }
} }
void void
gimp_vectors_warp_vectors (GimpPath *vectors, gimp_path_warp_path (GimpPath *path,
GimpPath *vectors_in, GimpPath *path_in,
gdouble y_offset) gdouble y_offset)
{ {
GList *list; GList *list;
for (list = vectors_in->strokes->head; for (list = path_in->strokes->head;
list; list;
list = g_list_next (list)) list = g_list_next (list))
{ {
GimpStroke *stroke = list->data; GimpStroke *stroke = list->data;
gimp_vectors_warp_stroke (vectors, stroke, y_offset); gimp_path_warp_stroke (path, stroke, y_offset);
} }
} }

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpvectors-warp.h * gimppath-warp.h
* Copyright (C) 2005 Bill Skaggs <weskaggs@primate.ucdavis.edu> * Copyright (C) 2005 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -18,19 +18,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_VECTORS_WARP_H__ #ifndef __GIMP_PATH_WARP_H__
#define __GIMP_VECTORS_WARP_H__ #define __GIMP_PATH_WARP_H__
void gimp_vectors_warp_point (GimpPath *vectors, void gimp_path_warp_point (GimpPath *path,
GimpCoords *point, GimpCoords *point,
GimpCoords *point_warped, GimpCoords *point_warped,
gdouble y_offset); gdouble y_offset);
void gimp_vectors_warp_vectors (GimpPath *vectors, void gimp_path_warp_path (GimpPath *path,
GimpPath *vectors_in, GimpPath *path_in,
gdouble yoffset); gdouble yoffset);
#endif /* __GIMP_VECTORS_WARP_H__ */ #endif /* __GIMP_PATH_WARP_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -95,47 +95,47 @@ struct _GimpPathClass
GType gimp_path_get_type (void) G_GNUC_CONST; GType gimp_path_get_type (void) G_GNUC_CONST;
GimpPath * gimp_vectors_new (GimpImage *image, GimpPath * gimp_path_new (GimpImage *image,
const gchar *name); const gchar *name);
GimpPath * gimp_vectors_get_parent (GimpPath *path); GimpPath * gimp_path_get_parent (GimpPath *path);
void gimp_vectors_freeze (GimpPath *path); void gimp_path_freeze (GimpPath *path);
void gimp_vectors_thaw (GimpPath *path); void gimp_path_thaw (GimpPath *path);
void gimp_vectors_copy_strokes (GimpPath *src_vectors, void gimp_path_copy_strokes (GimpPath *src_path,
GimpPath *dest_vectors); GimpPath *dest_path);
void gimp_vectors_add_strokes (GimpPath *src_vectors, void gimp_path_add_strokes (GimpPath *src_path,
GimpPath *dest_vectors); GimpPath *dest_path);
/* accessing / modifying the anchors */ /* accessing / modifying the anchors */
GimpAnchor * gimp_vectors_anchor_get (GimpPath *path, GimpAnchor * gimp_path_anchor_get (GimpPath *path,
const GimpCoords *coord, const GimpCoords *coord,
GimpStroke **ret_stroke); GimpStroke **ret_stroke);
/* prev == NULL: "first" anchor */ /* prev == NULL: "first" anchor */
GimpAnchor * gimp_vectors_anchor_get_next (GimpPath *path, GimpAnchor * gimp_path_anchor_get_next (GimpPath *path,
const GimpAnchor *prev); const GimpAnchor *prev);
/* type will be an xorable enum: /* type will be an xorable enum:
* VECTORS_NONE, VECTORS_FIX_ANGLE, VECTORS_FIX_RATIO, VECTORS_RESTRICT_ANGLE * VECTORS_NONE, VECTORS_FIX_ANGLE, VECTORS_FIX_RATIO, VECTORS_RESTRICT_ANGLE
* or so. * or so.
*/ */
void gimp_vectors_anchor_move_relative (GimpPath *path, void gimp_path_anchor_move_relative (GimpPath *path,
GimpAnchor *anchor, GimpAnchor *anchor,
const GimpCoords *deltacoord, const GimpCoords *deltacoord,
gint type); gint type);
void gimp_vectors_anchor_move_absolute (GimpPath *path, void gimp_path_anchor_move_absolute (GimpPath *path,
GimpAnchor *anchor, GimpAnchor *anchor,
const GimpCoords *coord, const GimpCoords *coord,
gint type); gint type);
void gimp_vectors_anchor_delete (GimpPath *path, void gimp_path_anchor_delete (GimpPath *path,
GimpAnchor *anchor); GimpAnchor *anchor);
void gimp_vectors_anchor_select (GimpPath *path, void gimp_path_anchor_select (GimpPath *path,
GimpStroke *target_stroke, GimpStroke *target_stroke,
GimpAnchor *anchor, GimpAnchor *anchor,
gboolean selected, gboolean selected,
@ -144,32 +144,32 @@ void gimp_vectors_anchor_select (GimpPath *path,
/* GimpStroke is a connected component of a GimpPath object */ /* GimpStroke is a connected component of a GimpPath object */
void gimp_vectors_stroke_add (GimpPath *path, void gimp_path_stroke_add (GimpPath *path,
GimpStroke *stroke); GimpStroke *stroke);
void gimp_vectors_stroke_remove (GimpPath *path, void gimp_path_stroke_remove (GimpPath *path,
GimpStroke *stroke); GimpStroke *stroke);
gint gimp_vectors_get_n_strokes (GimpPath *path); gint gimp_path_get_n_strokes (GimpPath *path);
GimpStroke * gimp_vectors_stroke_get (GimpPath *path, GimpStroke * gimp_path_stroke_get (GimpPath *path,
const GimpCoords *coord); const GimpCoords *coord);
GimpStroke * gimp_vectors_stroke_get_by_id (GimpPath *path, GimpStroke * gimp_path_stroke_get_by_id (GimpPath *path,
gint id); gint id);
/* prev == NULL: "first" stroke */ /* prev == NULL: "first" stroke */
GimpStroke * gimp_vectors_stroke_get_next (GimpPath *path, GimpStroke * gimp_path_stroke_get_next (GimpPath *path,
GimpStroke *prev); GimpStroke *prev);
gdouble gimp_vectors_stroke_get_length (GimpPath *path, gdouble gimp_path_stroke_get_length (GimpPath *path,
GimpStroke *stroke); GimpStroke *stroke);
/* accessing the shape of the curve */ /* accessing the shape of the curve */
gdouble gimp_vectors_get_length (GimpPath *path, gdouble gimp_path_get_length (GimpPath *path,
const GimpAnchor *start); const GimpAnchor *start);
gdouble gimp_vectors_get_distance (GimpPath *path, gdouble gimp_path_get_distance (GimpPath *path,
const GimpCoords *coord); const GimpCoords *coord);
/* returns the number of valid coordinates */ /* returns the number of valid coordinates */
gint gimp_vectors_interpolate (GimpPath *path, gint gimp_path_interpolate (GimpPath *path,
GimpStroke *stroke, GimpStroke *stroke,
gdouble precision, gdouble precision,
gint max_points, gint max_points,
@ -178,7 +178,7 @@ gint gimp_vectors_interpolate (GimpPath *path,
/* usually overloaded */ /* usually overloaded */
/* returns a bezier representation */ /* returns a bezier representation */
const GimpBezierDesc * gimp_vectors_get_bezier (GimpPath *path); const GimpBezierDesc * gimp_path_get_bezier (GimpPath *path);
#endif /* __GIMP_VECTORS_H__ */ #endif /* __GIMP_PATH_H__ */

View File

@ -0,0 +1,141 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "vectors-types.h"
#include "gimppath.h"
#include "gimppathmodundo.h"
static void gimp_path_mod_undo_constructed (GObject *object);
static gint64 gimp_path_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_path_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_path_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpPathModUndo, gimp_path_mod_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_path_mod_undo_parent_class
static void
gimp_path_mod_undo_class_init (GimpPathModUndoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_path_mod_undo_constructed;
gimp_object_class->get_memsize = gimp_path_mod_undo_get_memsize;
undo_class->pop = gimp_path_mod_undo_pop;
undo_class->free = gimp_path_mod_undo_free;
}
static void
gimp_path_mod_undo_init (GimpPathModUndo *undo)
{
}
static void
gimp_path_mod_undo_constructed (GObject *object)
{
GimpPathModUndo *path_mod_undo = GIMP_PATH_MOD_UNDO (object);
GimpPath *path;
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item));
path = GIMP_PATH (GIMP_ITEM_UNDO (object)->item);
path_mod_undo->path =
GIMP_PATH (gimp_item_duplicate (GIMP_ITEM (path),
G_TYPE_FROM_INSTANCE (path)));
}
static gint64
gimp_path_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpPathModUndo *path_mod_undo = GIMP_PATH_MOD_UNDO (object);
gint64 memsize = 0;
memsize += gimp_object_get_memsize (GIMP_OBJECT (path_mod_undo->path),
gui_size);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
static void
gimp_path_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpPathModUndo *path_mod_undo = GIMP_PATH_MOD_UNDO (undo);
GimpPath *path = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item);
GimpPath *temp;
gint offset_x;
gint offset_y;
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
temp = path_mod_undo->path;
path_mod_undo->path =
GIMP_PATH (gimp_item_duplicate (GIMP_ITEM (path),
G_TYPE_FROM_INSTANCE (path)));
gimp_path_freeze (path);
gimp_path_copy_strokes (temp, path);
gimp_item_get_offset (GIMP_ITEM (temp), &offset_x, &offset_y);
gimp_item_set_offset (GIMP_ITEM (path), offset_x, offset_y);
gimp_item_set_size (GIMP_ITEM (path),
gimp_item_get_width (GIMP_ITEM (temp)),
gimp_item_get_height (GIMP_ITEM (temp)));
g_object_unref (temp);
gimp_path_thaw (path);
}
static void
gimp_path_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode)
{
GimpPathModUndo *path_mod_undo = GIMP_PATH_MOD_UNDO (undo);
g_clear_object (&path_mod_undo->path);
GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
}

View File

@ -0,0 +1,52 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PATH_MOD_UNDO_H__
#define __GIMP_PATH_MOD_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_PATH_MOD_UNDO (gimp_path_mod_undo_get_type ())
#define GIMP_PATH_MOD_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PATH_MOD_UNDO, GimpPathModUndo))
#define GIMP_PATH_MOD_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PATH_MOD_UNDO, GimpPathModUndoClass))
#define GIMP_IS_PATH_MOD_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PATH_MOD_UNDO))
#define GIMP_IS_PATH_MOD_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_MOD_UNDO))
#define GIMP_PATH_MOD_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PATH_MOD_UNDO, GimpPathModUndoClass))
typedef struct _GimpPathModUndo GimpPathModUndo;
typedef struct _GimpPathModUndoClass GimpPathModUndoClass;
struct _GimpPathModUndo
{
GimpItemUndo parent_instance;
GimpPath *path;
};
struct _GimpPathModUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_path_mod_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_PATH_MOD_UNDO_H__ */

View File

@ -25,47 +25,47 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "gimppath.h" #include "gimppath.h"
#include "gimpvectorspropundo.h" #include "gimppathpropundo.h"
static void gimp_vectors_prop_undo_constructed (GObject *object); static void gimp_path_prop_undo_constructed (GObject *object);
static void gimp_vectors_prop_undo_pop (GimpUndo *undo, static void gimp_path_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode, GimpUndoMode undo_mode,
GimpUndoAccumulator *accum); GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpVectorsPropUndo, gimp_vectors_prop_undo, GIMP_TYPE_ITEM_UNDO) G_DEFINE_TYPE (GimpPathPropUndo, gimp_path_prop_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_vectors_prop_undo_parent_class #define parent_class gimp_path_prop_undo_parent_class
static void static void
gimp_vectors_prop_undo_class_init (GimpVectorsPropUndoClass *klass) gimp_path_prop_undo_class_init (GimpPathPropUndoClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass); GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_vectors_prop_undo_constructed; object_class->constructed = gimp_path_prop_undo_constructed;
undo_class->pop = gimp_vectors_prop_undo_pop; undo_class->pop = gimp_path_prop_undo_pop;
} }
static void static void
gimp_vectors_prop_undo_init (GimpVectorsPropUndo *undo) gimp_path_prop_undo_init (GimpPathPropUndo *undo)
{ {
} }
static void static void
gimp_vectors_prop_undo_constructed (GObject *object) gimp_path_prop_undo_constructed (GObject *object)
{ {
/* GimpVectors *vectors; */ /* GimpPath *path; */
G_OBJECT_CLASS (parent_class)->constructed (object); G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item)); gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item));
/* vectors = GIMP_PATH (GIMP_ITEM_UNDO (object)->item); */ /* path = GIMP_PATH (GIMP_ITEM_UNDO (object)->item); */
switch (GIMP_UNDO (object)->undo_type) switch (GIMP_UNDO (object)->undo_type)
{ {
@ -75,13 +75,13 @@ gimp_vectors_prop_undo_constructed (GObject *object)
} }
static void static void
gimp_vectors_prop_undo_pop (GimpUndo *undo, gimp_path_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode, GimpUndoMode undo_mode,
GimpUndoAccumulator *accum) GimpUndoAccumulator *accum)
{ {
#if 0 #if 0
GimpVectorsPropUndo *vectors_prop_undo = GIMP_VECTORS_PROP_UNDO (undo); GimpPathPropUndo *path_prop_undo = GIMP_PATH_PROP_UNDO (undo);
GimpPath *vectors = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item); GimpPath *path = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item);
#endif #endif
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum); GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);

View File

@ -0,0 +1,50 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PATH_PROP_UNDO_H__
#define __GIMP_PATH_PROP_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_PATH_PROP_UNDO (gimp_path_prop_undo_get_type ())
#define GIMP_PATH_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PATH_PROP_UNDO, GimpPathPropUndo))
#define GIMP_PATH_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PATH_PROP_UNDO, GimpPathPropUndoClass))
#define GIMP_IS_PATH_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PATH_PROP_UNDO))
#define GIMP_IS_PATH_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_PROP_UNDO))
#define GIMP_PATH_PROP_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PATH_PROP_UNDO, GimpPathPropUndoClass))
typedef struct _GimpPathPropUndo GimpPathPropUndo;
typedef struct _GimpPathPropUndoClass GimpPathPropUndoClass;
struct _GimpPathPropUndo
{
GimpItemUndo parent_instance;
};
struct _GimpPathPropUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_path_prop_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_PATH_PROP_UNDO_H__ */

228
app/vectors/gimppathundo.c Normal file
View File

@ -0,0 +1,228 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "vectors-types.h"
#include "libgimpbase/gimpbase.h"
#include "core/gimpimage.h"
#include "gimppath.h"
#include "gimppathundo.h"
enum
{
PROP_0,
PROP_PREV_PARENT,
PROP_PREV_POSITION,
PROP_PREV_PATHS
};
static void gimp_path_undo_constructed (GObject *object);
static void gimp_path_undo_finalize (GObject *object);
static void gimp_path_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_path_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_path_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_path_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpPathUndo, gimp_path_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_path_undo_parent_class
static void
gimp_path_undo_class_init (GimpPathUndoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_path_undo_constructed;
object_class->finalize = gimp_path_undo_finalize;
object_class->set_property = gimp_path_undo_set_property;
object_class->get_property = gimp_path_undo_get_property;
gimp_object_class->get_memsize = gimp_path_undo_get_memsize;
undo_class->pop = gimp_path_undo_pop;
g_object_class_install_property (object_class, PROP_PREV_PARENT,
g_param_spec_object ("prev-parent",
NULL, NULL,
GIMP_TYPE_PATH,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_PREV_POSITION,
g_param_spec_int ("prev-position", NULL, NULL,
0, G_MAXINT, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_PREV_PATHS,
g_param_spec_pointer ("prev-paths", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
gimp_path_undo_init (GimpPathUndo *undo)
{
undo->prev_paths = NULL;
}
static void
gimp_path_undo_constructed (GObject *object)
{
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item));
}
static void
gimp_path_undo_finalize (GObject *object)
{
GimpPathUndo *undo = GIMP_PATH_UNDO (object);
g_clear_pointer (&undo->prev_paths, g_list_free);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_path_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpPathUndo *path_undo = GIMP_PATH_UNDO (object);
switch (property_id)
{
case PROP_PREV_PARENT:
path_undo->prev_parent = g_value_get_object (value);
break;
case PROP_PREV_POSITION:
path_undo->prev_position = g_value_get_int (value);
break;
case PROP_PREV_PATHS:
path_undo->prev_paths = g_list_copy (g_value_get_pointer (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_path_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpPathUndo *path_undo = GIMP_PATH_UNDO (object);
switch (property_id)
{
case PROP_PREV_PARENT:
g_value_set_object (value, path_undo->prev_parent);
break;
case PROP_PREV_POSITION:
g_value_set_int (value, path_undo->prev_position);
break;
case PROP_PREV_PATHS:
g_value_set_pointer (value, path_undo->prev_paths);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static gint64
gimp_path_undo_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpItemUndo *item_undo = GIMP_ITEM_UNDO (object);
gint64 memsize = 0;
if (! gimp_item_is_attached (item_undo->item))
memsize += gimp_object_get_memsize (GIMP_OBJECT (item_undo->item),
gui_size);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
static void
gimp_path_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpPathUndo *path_undo = GIMP_PATH_UNDO (undo);
GimpPath *path = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item);
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
if ((undo_mode == GIMP_UNDO_MODE_UNDO &&
undo->undo_type == GIMP_UNDO_PATH_ADD) ||
(undo_mode == GIMP_UNDO_MODE_REDO &&
undo->undo_type == GIMP_UNDO_PATH_REMOVE))
{
/* remove path */
/* record the current parent and position */
path_undo->prev_parent = gimp_path_get_parent (path);
path_undo->prev_position = gimp_item_get_index (GIMP_ITEM (path));
gimp_image_remove_path (undo->image, path, FALSE,
path_undo->prev_paths);
}
else
{
/* restore path */
/* record the active path */
g_clear_pointer (&path_undo->prev_paths, g_list_free);
path_undo->prev_paths = g_list_copy (gimp_image_get_selected_paths (undo->image));
gimp_image_add_path (undo->image, path,
path_undo->prev_parent,
path_undo->prev_position, FALSE);
}
}

View File

@ -0,0 +1,54 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_PATH_UNDO_H__
#define __GIMP_PATH_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_PATH_UNDO (gimp_path_undo_get_type ())
#define GIMP_PATH_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PATH_UNDO, GimpPathUndo))
#define GIMP_PATH_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PATH_UNDO, GimpPathUndoClass))
#define GIMP_IS_PATH_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PATH_UNDO))
#define GIMP_IS_PATH_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_UNDO))
#define GIMP_PATH_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PATH_UNDO, GimpPathUndoClass))
typedef struct _GimpPathUndo GimpPathUndo;
typedef struct _GimpPathUndoClass GimpPathUndoClass;
struct _GimpPathUndo
{
GimpItemUndo parent_instance;
GimpPath *prev_parent;
gint prev_position; /* former position in list */
GList *prev_paths; /* previous selected path */
};
struct _GimpPathUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_path_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_PATH_UNDO_H__ */

View File

@ -1,48 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpvectors-compat.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_COMPAT_H__
#define __GIMP_VECTORS_COMPAT_H__
typedef struct _GimpVectorsCompatPoint GimpVectorsCompatPoint;
struct _GimpVectorsCompatPoint
{
guint32 type;
gdouble x;
gdouble y;
};
GimpPath * gimp_vectors_compat_new (GimpImage *image,
const gchar *name,
GimpVectorsCompatPoint *points,
gint n_points,
gboolean closed);
gboolean gimp_vectors_compat_is_compatible (GimpImage *image);
GimpVectorsCompatPoint * gimp_vectors_compat_get_points (GimpPath *vectors,
gint32 *n_points,
gint32 *closed);
#endif /* __GIMP_VECTORS_COMPAT_H__ */

View File

@ -1,44 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* GimpVectors Import
* Copyright (C) 2003 Sven Neumann <sven@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_IMPORT_H__
#define __GIMP_VECTORS_IMPORT_H__
gboolean gimp_vectors_import_file (GimpImage *image,
GFile *file,
gboolean merge,
gboolean scale,
GimpPath *parent,
gint position,
GList **ret_vectors,
GError **error);
gboolean gimp_vectors_import_buffer (GimpImage *image,
const gchar *buffer,
gsize len,
gboolean merge,
gboolean scale,
GimpPath *parent,
gint position,
GList **ret_vectors,
GError **error);
#endif /* __GIMP_VECTORS_IMPORT_H__ */

View File

@ -1,141 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "vectors-types.h"
#include "gimppath.h"
#include "gimpvectorsmodundo.h"
static void gimp_vectors_mod_undo_constructed (GObject *object);
static gint64 gimp_vectors_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_vectors_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void gimp_vectors_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode);
G_DEFINE_TYPE (GimpVectorsModUndo, gimp_vectors_mod_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_vectors_mod_undo_parent_class
static void
gimp_vectors_mod_undo_class_init (GimpVectorsModUndoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_vectors_mod_undo_constructed;
gimp_object_class->get_memsize = gimp_vectors_mod_undo_get_memsize;
undo_class->pop = gimp_vectors_mod_undo_pop;
undo_class->free = gimp_vectors_mod_undo_free;
}
static void
gimp_vectors_mod_undo_init (GimpVectorsModUndo *undo)
{
}
static void
gimp_vectors_mod_undo_constructed (GObject *object)
{
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (object);
GimpPath *vectors;
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item));
vectors = GIMP_PATH (GIMP_ITEM_UNDO (object)->item);
vectors_mod_undo->vectors =
GIMP_PATH (gimp_item_duplicate (GIMP_ITEM (vectors),
G_TYPE_FROM_INSTANCE (vectors)));
}
static gint64
gimp_vectors_mod_undo_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (object);
gint64 memsize = 0;
memsize += gimp_object_get_memsize (GIMP_OBJECT (vectors_mod_undo->vectors),
gui_size);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
static void
gimp_vectors_mod_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (undo);
GimpPath *vectors = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item);
GimpPath *temp;
gint offset_x;
gint offset_y;
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
temp = vectors_mod_undo->vectors;
vectors_mod_undo->vectors =
GIMP_PATH (gimp_item_duplicate (GIMP_ITEM (vectors),
G_TYPE_FROM_INSTANCE (vectors)));
gimp_vectors_freeze (vectors);
gimp_vectors_copy_strokes (temp, vectors);
gimp_item_get_offset (GIMP_ITEM (temp), &offset_x, &offset_y);
gimp_item_set_offset (GIMP_ITEM (vectors), offset_x, offset_y);
gimp_item_set_size (GIMP_ITEM (vectors),
gimp_item_get_width (GIMP_ITEM (temp)),
gimp_item_get_height (GIMP_ITEM (temp)));
g_object_unref (temp);
gimp_vectors_thaw (vectors);
}
static void
gimp_vectors_mod_undo_free (GimpUndo *undo,
GimpUndoMode undo_mode)
{
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (undo);
g_clear_object (&vectors_mod_undo->vectors);
GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
}

View File

@ -1,52 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_MOD_UNDO_H__
#define __GIMP_VECTORS_MOD_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_VECTORS_MOD_UNDO (gimp_vectors_mod_undo_get_type ())
#define GIMP_VECTORS_MOD_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS_MOD_UNDO, GimpVectorsModUndo))
#define GIMP_VECTORS_MOD_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS_MOD_UNDO, GimpVectorsModUndoClass))
#define GIMP_IS_VECTORS_MOD_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS_MOD_UNDO))
#define GIMP_IS_VECTORS_MOD_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTORS_MOD_UNDO))
#define GIMP_VECTORS_MOD_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTORS_MOD_UNDO, GimpVectorsModUndoClass))
typedef struct _GimpVectorsModUndo GimpVectorsModUndo;
typedef struct _GimpVectorsModUndoClass GimpVectorsModUndoClass;
struct _GimpVectorsModUndo
{
GimpItemUndo parent_instance;
GimpPath *vectors;
};
struct _GimpVectorsModUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_vectors_mod_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VECTORS_MOD_UNDO_H__ */

View File

@ -1,50 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_PROP_UNDO_H__
#define __GIMP_VECTORS_PROP_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_VECTORS_PROP_UNDO (gimp_vectors_prop_undo_get_type ())
#define GIMP_VECTORS_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS_PROP_UNDO, GimpVectorsPropUndo))
#define GIMP_VECTORS_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS_PROP_UNDO, GimpVectorsPropUndoClass))
#define GIMP_IS_VECTORS_PROP_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS_PROP_UNDO))
#define GIMP_IS_VECTORS_PROP_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTORS_PROP_UNDO))
#define GIMP_VECTORS_PROP_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTORS_PROP_UNDO, GimpVectorsPropUndoClass))
typedef struct _GimpVectorsPropUndo GimpVectorsPropUndo;
typedef struct _GimpVectorsPropUndoClass GimpVectorsPropUndoClass;
struct _GimpVectorsPropUndo
{
GimpItemUndo parent_instance;
};
struct _GimpVectorsPropUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_vectors_prop_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VECTORS_PROP_UNDO_H__ */

View File

@ -1,228 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "vectors-types.h"
#include "libgimpbase/gimpbase.h"
#include "core/gimpimage.h"
#include "gimppath.h"
#include "gimpvectorsundo.h"
enum
{
PROP_0,
PROP_PREV_PARENT,
PROP_PREV_POSITION,
PROP_PREV_VECTORS
};
static void gimp_vectors_undo_constructed (GObject *object);
static void gimp_vectors_undo_finalize (GObject *object);
static void gimp_vectors_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_vectors_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gint64 gimp_vectors_undo_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_vectors_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
G_DEFINE_TYPE (GimpVectorsUndo, gimp_vectors_undo, GIMP_TYPE_ITEM_UNDO)
#define parent_class gimp_vectors_undo_parent_class
static void
gimp_vectors_undo_class_init (GimpVectorsUndoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_vectors_undo_constructed;
object_class->finalize = gimp_vectors_undo_finalize;
object_class->set_property = gimp_vectors_undo_set_property;
object_class->get_property = gimp_vectors_undo_get_property;
gimp_object_class->get_memsize = gimp_vectors_undo_get_memsize;
undo_class->pop = gimp_vectors_undo_pop;
g_object_class_install_property (object_class, PROP_PREV_PARENT,
g_param_spec_object ("prev-parent",
NULL, NULL,
GIMP_TYPE_PATH,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_PREV_POSITION,
g_param_spec_int ("prev-position", NULL, NULL,
0, G_MAXINT, 0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_PREV_VECTORS,
g_param_spec_pointer ("prev-vectors", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
}
static void
gimp_vectors_undo_init (GimpVectorsUndo *undo)
{
undo->prev_vectors = NULL;
}
static void
gimp_vectors_undo_constructed (GObject *object)
{
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_PATH (GIMP_ITEM_UNDO (object)->item));
}
static void
gimp_vectors_undo_finalize (GObject *object)
{
GimpVectorsUndo *undo = GIMP_VECTORS_UNDO (object);
g_clear_pointer (&undo->prev_vectors, g_list_free);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_vectors_undo_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpVectorsUndo *vectors_undo = GIMP_VECTORS_UNDO (object);
switch (property_id)
{
case PROP_PREV_PARENT:
vectors_undo->prev_parent = g_value_get_object (value);
break;
case PROP_PREV_POSITION:
vectors_undo->prev_position = g_value_get_int (value);
break;
case PROP_PREV_VECTORS:
vectors_undo->prev_vectors = g_list_copy (g_value_get_pointer (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_vectors_undo_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpVectorsUndo *vectors_undo = GIMP_VECTORS_UNDO (object);
switch (property_id)
{
case PROP_PREV_PARENT:
g_value_set_object (value, vectors_undo->prev_parent);
break;
case PROP_PREV_POSITION:
g_value_set_int (value, vectors_undo->prev_position);
break;
case PROP_PREV_VECTORS:
g_value_set_pointer (value, vectors_undo->prev_vectors);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static gint64
gimp_vectors_undo_get_memsize (GimpObject *object,
gint64 *gui_size)
{
GimpItemUndo *item_undo = GIMP_ITEM_UNDO (object);
gint64 memsize = 0;
if (! gimp_item_is_attached (item_undo->item))
memsize += gimp_object_get_memsize (GIMP_OBJECT (item_undo->item),
gui_size);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
static void
gimp_vectors_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpVectorsUndo *vectors_undo = GIMP_VECTORS_UNDO (undo);
GimpPath *path = GIMP_PATH (GIMP_ITEM_UNDO (undo)->item);
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
if ((undo_mode == GIMP_UNDO_MODE_UNDO &&
undo->undo_type == GIMP_UNDO_VECTORS_ADD) ||
(undo_mode == GIMP_UNDO_MODE_REDO &&
undo->undo_type == GIMP_UNDO_VECTORS_REMOVE))
{
/* remove path */
/* record the current parent and position */
vectors_undo->prev_parent = gimp_vectors_get_parent (path);
vectors_undo->prev_position = gimp_item_get_index (GIMP_ITEM (path));
gimp_image_remove_path (undo->image, path, FALSE,
vectors_undo->prev_vectors);
}
else
{
/* restore path */
/* record the active path */
g_clear_pointer (&vectors_undo->prev_vectors, g_list_free);
vectors_undo->prev_vectors = g_list_copy (gimp_image_get_selected_paths (undo->image));
gimp_image_add_path (undo->image, path,
vectors_undo->prev_parent,
vectors_undo->prev_position, FALSE);
}
}

View File

@ -1,54 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VECTORS_UNDO_H__
#define __GIMP_VECTORS_UNDO_H__
#include "core/gimpitemundo.h"
#define GIMP_TYPE_VECTORS_UNDO (gimp_vectors_undo_get_type ())
#define GIMP_VECTORS_UNDO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS_UNDO, GimpVectorsUndo))
#define GIMP_VECTORS_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS_UNDO, GimpVectorsUndoClass))
#define GIMP_IS_VECTORS_UNDO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS_UNDO))
#define GIMP_IS_VECTORS_UNDO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTORS_UNDO))
#define GIMP_VECTORS_UNDO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTORS_UNDO, GimpVectorsUndoClass))
typedef struct _GimpVectorsUndo GimpVectorsUndo;
typedef struct _GimpVectorsUndoClass GimpVectorsUndoClass;
struct _GimpVectorsUndo
{
GimpItemUndo parent_instance;
GimpPath *prev_parent;
gint prev_position; /* former position in list */
GList *prev_vectors; /* previous selected vectors */
};
struct _GimpVectorsUndoClass
{
GimpItemUndoClass parent_class;
};
GType gimp_vectors_undo_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VECTORS_UNDO_H__ */

View File

@ -2,16 +2,16 @@ libappvectors_sources = [
'gimpanchor.c', 'gimpanchor.c',
'gimpbezierstroke.c', 'gimpbezierstroke.c',
'gimppath.c', 'gimppath.c',
'gimppath-compat.c',
'gimppath-export.c',
'gimppath-import.c',
'gimppath-preview.c',
'gimppath-warp.c',
'gimppathmodundo.c',
'gimppathpropundo.c',
'gimppathundo.c',
'gimpstroke-new.c', 'gimpstroke-new.c',
'gimpstroke.c', 'gimpstroke.c',
'gimpvectors-compat.c',
'gimpvectors-export.c',
'gimpvectors-import.c',
'gimpvectors-preview.c',
'gimpvectors-warp.c',
'gimpvectorsmodundo.c',
'gimpvectorspropundo.c',
'gimpvectorsundo.c',
] ]
libappvectors = static_library('appvectors', libappvectors = static_library('appvectors',

View File

@ -62,7 +62,7 @@
{ "application/x-gimp-layer-mask-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK } { "application/x-gimp-layer-mask-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_LAYER_MASK }
#define GIMP_TARGET_PATH \ #define GIMP_TARGET_PATH \
{ "application/x-gimp-vectors-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_VECTORS } { "application/x-gimp-path-id", GTK_TARGET_SAME_APP, GIMP_DND_TYPE_VECTORS }
#define GIMP_TARGET_BRUSH \ #define GIMP_TARGET_BRUSH \
{ "application/x-gimp-brush-name", 0, GIMP_DND_TYPE_BRUSH } { "application/x-gimp-brush-name", 0, GIMP_DND_TYPE_BRUSH }

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpvectorstreeview.c * gimppathstreeview.c
* Copyright (C) 2001-2009 Michael Natterer <mitch@gimp.org> * Copyright (C) 2001-2009 Michael Natterer <mitch@gimp.org>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -35,57 +35,57 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectors-export.h" #include "vectors/gimppath-export.h"
#include "vectors/gimpvectors-import.h" #include "vectors/gimppath-import.h"
#include "gimpactiongroup.h" #include "gimpactiongroup.h"
#include "gimpcontainerview.h" #include "gimpcontainerview.h"
#include "gimpdnd.h" #include "gimpdnd.h"
#include "gimphelp-ids.h" #include "gimphelp-ids.h"
#include "gimpuimanager.h" #include "gimpuimanager.h"
#include "gimpvectorstreeview.h" #include "gimppathtreeview.h"
#include "gimpwidgets-utils.h" #include "gimpwidgets-utils.h"
#include "gimp-intl.h" #include "gimp-intl.h"
static void gimp_vectors_tree_view_view_iface_init (GimpContainerViewInterface *iface); static void gimp_path_tree_view_view_iface_init (GimpContainerViewInterface *iface);
static void gimp_vectors_tree_view_constructed (GObject *object); static void gimp_path_tree_view_constructed (GObject *object);
static void gimp_vectors_tree_view_set_container (GimpContainerView *view, static void gimp_path_tree_view_set_container (GimpContainerView *view,
GimpContainer *container); GimpContainer *container);
static void gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view, static void gimp_path_tree_view_drop_svg (GimpContainerTreeView *tree_view,
const gchar *svg_data, const gchar *svg_data,
gsize svg_data_len, gsize svg_data_len,
GimpViewable *dest_viewable, GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos); GtkTreeViewDropPosition drop_pos);
static GimpItem * gimp_vectors_tree_view_item_new (GimpImage *image); static GimpItem * gimp_path_tree_view_item_new (GimpImage *image);
static guchar * gimp_vectors_tree_view_drag_svg (GtkWidget *widget, static guchar * gimp_path_tree_view_drag_svg (GtkWidget *widget,
gsize *svg_data_len, gsize *svg_data_len,
gpointer data); gpointer data);
G_DEFINE_TYPE_WITH_CODE (GimpVectorsTreeView, gimp_vectors_tree_view, G_DEFINE_TYPE_WITH_CODE (GimpPathTreeView, gimp_path_tree_view,
GIMP_TYPE_ITEM_TREE_VIEW, GIMP_TYPE_ITEM_TREE_VIEW,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW, G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_vectors_tree_view_view_iface_init)) gimp_path_tree_view_view_iface_init))
#define parent_class gimp_vectors_tree_view_parent_class #define parent_class gimp_path_tree_view_parent_class
static GimpContainerViewInterface *parent_view_iface = NULL; static GimpContainerViewInterface *parent_view_iface = NULL;
static void static void
gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass) gimp_path_tree_view_class_init (GimpPathTreeViewClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpContainerTreeViewClass *view_class = GIMP_CONTAINER_TREE_VIEW_CLASS (klass); GimpContainerTreeViewClass *view_class = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
GimpItemTreeViewClass *iv_class = GIMP_ITEM_TREE_VIEW_CLASS (klass); GimpItemTreeViewClass *iv_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);
object_class->constructed = gimp_vectors_tree_view_constructed; object_class->constructed = gimp_path_tree_view_constructed;
view_class->drop_svg = gimp_vectors_tree_view_drop_svg; view_class->drop_svg = gimp_path_tree_view_drop_svg;
iv_class->item_type = GIMP_TYPE_PATH; iv_class->item_type = GIMP_TYPE_PATH;
iv_class->signal_name = "selected-paths-changed"; iv_class->signal_name = "selected-paths-changed";
@ -95,7 +95,7 @@ gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
iv_class->set_selected_items = (GimpSetItemsFunc) gimp_image_set_selected_paths; iv_class->set_selected_items = (GimpSetItemsFunc) gimp_image_set_selected_paths;
iv_class->add_item = (GimpAddItemFunc) gimp_image_add_path; iv_class->add_item = (GimpAddItemFunc) gimp_image_add_path;
iv_class->remove_item = (GimpRemoveItemFunc) gimp_image_remove_path; iv_class->remove_item = (GimpRemoveItemFunc) gimp_image_remove_path;
iv_class->new_item = gimp_vectors_tree_view_item_new; iv_class->new_item = gimp_path_tree_view_item_new;
iv_class->action_group = "vectors"; iv_class->action_group = "vectors";
iv_class->activate_action = "vectors-edit"; iv_class->activate_action = "vectors-edit";
@ -116,24 +116,24 @@ gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
} }
static void static void
gimp_vectors_tree_view_view_iface_init (GimpContainerViewInterface *iface) gimp_path_tree_view_view_iface_init (GimpContainerViewInterface *iface)
{ {
parent_view_iface = g_type_interface_peek_parent (iface); parent_view_iface = g_type_interface_peek_parent (iface);
iface->set_container = gimp_vectors_tree_view_set_container; iface->set_container = gimp_path_tree_view_set_container;
} }
static void static void
gimp_vectors_tree_view_init (GimpVectorsTreeView *view) gimp_path_tree_view_init (GimpPathTreeView *view)
{ {
} }
static void static void
gimp_vectors_tree_view_constructed (GObject *object) gimp_path_tree_view_constructed (GObject *object)
{ {
GimpEditor *editor = GIMP_EDITOR (object); GimpEditor *editor = GIMP_EDITOR (object);
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (object); GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (object);
GimpVectorsTreeView *view = GIMP_VECTORS_TREE_VIEW (object); GimpPathTreeView *view = GIMP_PATH_TREE_VIEW (object);
GdkModifierType extend_mask; GdkModifierType extend_mask;
GdkModifierType modify_mask; GdkModifierType modify_mask;
@ -185,7 +185,7 @@ gimp_vectors_tree_view_constructed (GObject *object)
} }
static void static void
gimp_vectors_tree_view_set_container (GimpContainerView *view, gimp_path_tree_view_set_container (GimpContainerView *view,
GimpContainer *container) GimpContainer *container)
{ {
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view); GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
@ -203,13 +203,13 @@ gimp_vectors_tree_view_set_container (GimpContainerView *view,
if (! old_container && container) if (! old_container && container)
{ {
gimp_dnd_svg_source_add (GTK_WIDGET (tree_view->view), gimp_dnd_svg_source_add (GTK_WIDGET (tree_view->view),
gimp_vectors_tree_view_drag_svg, gimp_path_tree_view_drag_svg,
tree_view); tree_view);
} }
} }
static void static void
gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view, gimp_path_tree_view_drop_svg (GimpContainerTreeView *tree_view,
const gchar *svg_data, const gchar *svg_data,
gsize svg_data_len, gsize svg_data_len,
GimpViewable *dest_viewable, GimpViewable *dest_viewable,
@ -228,7 +228,7 @@ gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
drop_pos, drop_pos,
(GimpViewable **) &parent); (GimpViewable **) &parent);
if (! gimp_vectors_import_buffer (image, svg_data, svg_data_len, if (! gimp_path_import_buffer (image, svg_data, svg_data_len,
TRUE, FALSE, parent, index, NULL, &error)) TRUE, FALSE, parent, index, NULL, &error))
{ {
gimp_message_literal (image->gimp, gimp_message_literal (image->gimp,
@ -243,11 +243,11 @@ gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
} }
static GimpItem * static GimpItem *
gimp_vectors_tree_view_item_new (GimpImage *image) gimp_path_tree_view_item_new (GimpImage *image)
{ {
GimpPath *new_path; GimpPath *new_path;
new_path = gimp_vectors_new (image, _("Path")); new_path = gimp_path_new (image, _("Path"));
gimp_image_add_path (image, new_path, gimp_image_add_path (image, new_path,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE); GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
@ -256,7 +256,7 @@ gimp_vectors_tree_view_item_new (GimpImage *image)
} }
static guchar * static guchar *
gimp_vectors_tree_view_drag_svg (GtkWidget *widget, gimp_path_tree_view_drag_svg (GtkWidget *widget,
gsize *svg_data_len, gsize *svg_data_len,
gpointer data) gpointer data)
{ {
@ -271,7 +271,7 @@ gimp_vectors_tree_view_drag_svg (GtkWidget *widget,
if (items) if (items)
{ {
svg_data = gimp_vectors_export_string (image, items); svg_data = gimp_path_export_string (image, items);
if (svg_data) if (svg_data)
*svg_data_len = strlen (svg_data); *svg_data_len = strlen (svg_data);

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpvectorstreeview.h * gimppathtreeview.h
* Copyright (C) 2001-2003 Michael Natterer <mitch@gimp.org> * Copyright (C) 2001-2003 Michael Natterer <mitch@gimp.org>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -18,24 +18,24 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __GIMP_VECTORS_TREE_VIEW_H__ #ifndef __GIMP_PATH_TREE_VIEW_H__
#define __GIMP_VECTORS_TREE_VIEW_H__ #define __GIMP_PATH_TREE_VIEW_H__
#include "gimpitemtreeview.h" #include "gimpitemtreeview.h"
#define GIMP_TYPE_VECTORS_TREE_VIEW (gimp_vectors_tree_view_get_type ()) #define GIMP_TYPE_PATH_TREE_VIEW (gimp_path_tree_view_get_type ())
#define GIMP_VECTORS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS_TREE_VIEW, GimpVectorsTreeView)) #define GIMP_PATH_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PATH_TREE_VIEW, GimpPathTreeView))
#define GIMP_VECTORS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VECTORS_TREE_VIEW, GimpVectorsTreeViewClass)) #define GIMP_PATH_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PATH_TREE_VIEW, GimpPathTreeViewClass))
#define GIMP_IS_VECTORS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS_TREE_VIEW)) #define GIMP_IS_PATH_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PATH_TREE_VIEW))
#define GIMP_IS_VECTORS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VECTORS_TREE_VIEW)) #define GIMP_IS_PATH_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PATH_TREE_VIEW))
#define GIMP_VECTORS_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VECTORS_TREE_VIEW, GimpVectorsTreeViewClass)) #define GIMP_PATH_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PATH_TREE_VIEW, GimpPathTreeViewClass))
typedef struct _GimpVectorsTreeViewClass GimpVectorsTreeViewClass; typedef struct _GimpPathTreeViewClass GimpPathTreeViewClass;
struct _GimpVectorsTreeView struct _GimpPathTreeView
{ {
GimpItemTreeView parent_instance; GimpItemTreeView parent_instance;
@ -44,13 +44,13 @@ struct _GimpVectorsTreeView
GtkWidget *stroke_button; GtkWidget *stroke_button;
}; };
struct _GimpVectorsTreeViewClass struct _GimpPathTreeViewClass
{ {
GimpItemTreeViewClass parent_class; GimpItemTreeViewClass parent_class;
}; };
GType gimp_vectors_tree_view_get_type (void) G_GNUC_CONST; GType gimp_path_tree_view_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VECTORS_TREE_VIEW_H__ */ #endif /* __GIMP_PATH_TREE_VIEW_H__ */

View File

@ -45,7 +45,7 @@
#include "gimpviewrendererimage.h" #include "gimpviewrendererimage.h"
#include "gimpviewrendererimagefile.h" #include "gimpviewrendererimagefile.h"
#include "gimpviewrendererpalette.h" #include "gimpviewrendererpalette.h"
#include "gimpviewrenderervectors.h" #include "gimpviewrendererpath.h"
GType GType
@ -83,7 +83,7 @@ gimp_view_renderer_type_from_viewable_type (GType viewable_type)
} }
else if (g_type_is_a (viewable_type, GIMP_TYPE_PATH)) else if (g_type_is_a (viewable_type, GIMP_TYPE_PATH))
{ {
type = GIMP_TYPE_VIEW_RENDERER_VECTORS; type = GIMP_TYPE_VIEW_RENDERER_PATH;
} }
else if (g_type_is_a (viewable_type, GIMP_TYPE_IMAGEFILE)) else if (g_type_is_a (viewable_type, GIMP_TYPE_IMAGEFILE))
{ {

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program /* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis * Copyright (C) 1995 Spencer Kimball and Peter Mattis
* *
* gimpviewrenderervectors.c * gimpviewrendererpath.c
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org> * Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* Simon Budig <simon@gimp.org> * Simon Budig <simon@gimp.org>
* *
@ -35,43 +35,43 @@
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpstroke.h" #include "vectors/gimpstroke.h"
#include "gimpviewrenderervectors.h" #include "gimpviewrendererpath.h"
static void gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer, static void gimp_view_renderer_path_draw (GimpViewRenderer *renderer,
GtkWidget *widget, GtkWidget *widget,
cairo_t *cr, cairo_t *cr,
gint available_width, gint available_width,
gint available_height); gint available_height);
G_DEFINE_TYPE (GimpViewRendererVectors, gimp_view_renderer_vectors, G_DEFINE_TYPE (GimpViewRendererPath, gimp_view_renderer_path,
GIMP_TYPE_VIEW_RENDERER) GIMP_TYPE_VIEW_RENDERER)
#define parent_class gimp_view_renderer_vectors_parent_class #define parent_class gimp_view_renderer_path_parent_class
static void static void
gimp_view_renderer_vectors_class_init (GimpViewRendererVectorsClass *klass) gimp_view_renderer_path_class_init (GimpViewRendererPathClass *klass)
{ {
GimpViewRendererClass *renderer_class = GIMP_VIEW_RENDERER_CLASS (klass); GimpViewRendererClass *renderer_class = GIMP_VIEW_RENDERER_CLASS (klass);
renderer_class->draw = gimp_view_renderer_vectors_draw; renderer_class->draw = gimp_view_renderer_path_draw;
} }
static void static void
gimp_view_renderer_vectors_init (GimpViewRendererVectors *renderer) gimp_view_renderer_path_init (GimpViewRendererPath *renderer)
{ {
} }
static void static void
gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer, gimp_view_renderer_path_draw (GimpViewRenderer *renderer,
GtkWidget *widget, GtkWidget *widget,
cairo_t *cr, cairo_t *cr,
gint available_width, gint available_width,
gint available_height) gint available_height)
{ {
GimpPath *vectors = GIMP_PATH (renderer->viewable); GimpPath *path = GIMP_PATH (renderer->viewable);
const GimpBezierDesc *desc; const GimpBezierDesc *desc;
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
@ -83,7 +83,7 @@ gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer,
cairo_clip_preserve (cr); cairo_clip_preserve (cr);
cairo_fill (cr); cairo_fill (cr);
desc = gimp_vectors_get_bezier (vectors); desc = gimp_path_get_bezier (path);
if (desc) if (desc)
{ {
@ -91,9 +91,9 @@ gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer,
gdouble yscale; gdouble yscale;
xscale = ((gdouble) renderer->width / xscale = ((gdouble) renderer->width /
(gdouble) gimp_item_get_width (GIMP_ITEM (vectors))); (gdouble) gimp_item_get_width (GIMP_ITEM (path)));
yscale = ((gdouble) renderer->height / yscale = ((gdouble) renderer->height /
(gdouble) gimp_item_get_height (GIMP_ITEM (vectors))); (gdouble) gimp_item_get_height (GIMP_ITEM (path)));
cairo_scale (cr, xscale, yscale); cairo_scale (cr, xscale, yscale);

View File

@ -0,0 +1,51 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpviewrendererpath.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* Simon Budig <simon@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VIEW_RENDERER_PATH_H__
#define __GIMP_VIEW_RENDERER_PATH_H__
#include "gimpviewrenderer.h"
#define GIMP_TYPE_VIEW_RENDERER_PATH (gimp_view_renderer_path_get_type ())
#define GIMP_VIEW_RENDERER_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEW_RENDERER_PATH, GimpViewRendererPath))
#define GIMP_VIEW_RENDERER_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEW_RENDERER_PATH, GimpViewRendererPathClass))
#define GIMP_IS_VIEW_RENDERER_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_VIEW_RENDERER_PATH))
#define GIMP_IS_VIEW_RENDERER_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEW_RENDERER_PATH))
#define GIMP_VIEW_RENDERER_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEW_RENDERER_PATH, GimpViewRendererPathClass))
typedef struct _GimpViewRendererPathClass GimpViewRendererPathClass;
struct _GimpViewRendererPath
{
GimpViewRenderer parent_instance;
};
struct _GimpViewRendererPathClass
{
GimpViewRendererClass parent_class;
};
GType gimp_view_renderer_path_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VIEW_RENDERER_PATH_H__ */

View File

@ -1,51 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpviewrenderervectors.h
* Copyright (C) 2003 Michael Natterer <mitch@gimp.org>
* Simon Budig <simon@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_VIEW_RENDERER_VECTORS_H__
#define __GIMP_VIEW_RENDERER_VECTORS_H__
#include "gimpviewrenderer.h"
#define GIMP_TYPE_VIEW_RENDERER_VECTORS (gimp_view_renderer_vectors_get_type ())
#define GIMP_VIEW_RENDERER_VECTORS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VIEW_RENDERER_VECTORS, GimpViewRendererVectors))
#define GIMP_VIEW_RENDERER_VECTORS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_VIEW_RENDERER_VECTORS, GimpViewRendererVectorsClass))
#define GIMP_IS_VIEW_RENDERER_VECTORS(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_VIEW_RENDERER_VECTORS))
#define GIMP_IS_VIEW_RENDERER_VECTORS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_VIEW_RENDERER_VECTORS))
#define GIMP_VIEW_RENDERER_VECTORS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_VIEW_RENDERER_VECTORS, GimpViewRendererVectorsClass))
typedef struct _GimpViewRendererVectorsClass GimpViewRendererVectorsClass;
struct _GimpViewRendererVectors
{
GimpViewRenderer parent_instance;
};
struct _GimpViewRendererVectorsClass
{
GimpViewRendererClass parent_class;
};
GType gimp_view_renderer_vectors_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_VIEW_RENDERER_VECTORS_H__ */

View File

@ -221,7 +221,7 @@ libappwidgets_sources = [
'gimptranslationstore.c', 'gimptranslationstore.c',
'gimpuimanager.c', 'gimpuimanager.c',
'gimpundoeditor.c', 'gimpundoeditor.c',
'gimpvectorstreeview.c', 'gimppathtreeview.c',
'gimpview-popup.c', 'gimpview-popup.c',
'gimpview.c', 'gimpview.c',
'gimpviewablebox.c', 'gimpviewablebox.c',
@ -238,7 +238,7 @@ libappwidgets_sources = [
'gimpviewrendererimagefile.c', 'gimpviewrendererimagefile.c',
'gimpviewrendererlayer.c', 'gimpviewrendererlayer.c',
'gimpviewrendererpalette.c', 'gimpviewrendererpalette.c',
'gimpviewrenderervectors.c', 'gimpviewrendererpath.c',
'gimpwidgets-constructors.c', 'gimpwidgets-constructors.c',
'gimpwidgets-utils.c', 'gimpwidgets-utils.c',
'gimpwindow.c', 'gimpwindow.c',

View File

@ -95,7 +95,7 @@ typedef struct _GimpContainerView GimpContainerView; /* dummy typedef
typedef struct _GimpDrawableTreeView GimpDrawableTreeView; typedef struct _GimpDrawableTreeView GimpDrawableTreeView;
typedef struct _GimpItemTreeView GimpItemTreeView; typedef struct _GimpItemTreeView GimpItemTreeView;
typedef struct _GimpLayerTreeView GimpLayerTreeView; typedef struct _GimpLayerTreeView GimpLayerTreeView;
typedef struct _GimpVectorsTreeView GimpVectorsTreeView; typedef struct _GimpPathTreeView GimpPathTreeView;
typedef struct _GimpContainerPopup GimpContainerPopup; typedef struct _GimpContainerPopup GimpContainerPopup;
typedef struct _GimpViewableButton GimpViewableButton; typedef struct _GimpViewableButton GimpViewableButton;
@ -266,7 +266,7 @@ typedef struct _GimpViewRendererImage GimpViewRendererImage;
typedef struct _GimpViewRendererImagefile GimpViewRendererImagefile; typedef struct _GimpViewRendererImagefile GimpViewRendererImagefile;
typedef struct _GimpViewRendererLayer GimpViewRendererLayer; typedef struct _GimpViewRendererLayer GimpViewRendererLayer;
typedef struct _GimpViewRendererPalette GimpViewRendererPalette; typedef struct _GimpViewRendererPalette GimpViewRendererPalette;
typedef struct _GimpViewRendererVectors GimpViewRendererVectors; typedef struct _GimpViewRendererPath GimpViewRendererPath;
/* cell renderers */ /* cell renderers */

View File

@ -73,7 +73,7 @@
#include "vectors/gimpstroke.h" #include "vectors/gimpstroke.h"
#include "vectors/gimpbezierstroke.h" #include "vectors/gimpbezierstroke.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpvectors-compat.h" #include "vectors/gimppath-compat.h"
#include "xcf-private.h" #include "xcf-private.h"
#include "xcf-load.h" #include "xcf-load.h"
@ -3428,7 +3428,7 @@ xcf_load_path (XcfInfo *info,
GIMP_LOG (XCF, "Path name='%s'", name); GIMP_LOG (XCF, "Path name='%s'", name);
/* create a new path */ /* create a new path */
vectors = gimp_vectors_new (image, name); vectors = gimp_path_new (image, name);
g_free (name); g_free (name);
if (! vectors) if (! vectors)
return NULL; return NULL;
@ -3540,7 +3540,7 @@ xcf_load_path (XcfInfo *info,
"control-points", control_points, "control-points", control_points,
NULL); NULL);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (vectors, stroke);
g_object_unref (stroke); g_object_unref (stroke);
gimp_value_array_unref (control_points); gimp_value_array_unref (control_points);
@ -4232,7 +4232,7 @@ xcf_load_old_path (XcfInfo *info,
guint32 version; /* changed from num_paths */ guint32 version; /* changed from num_paths */
GimpTattoo tattoo = 0; GimpTattoo tattoo = 0;
GimpPath *vectors; GimpPath *vectors;
GimpVectorsCompatPoint *points; GimpPathCompatPoint *points;
gint i; gint i;
xcf_read_string (info, &name, 1); xcf_read_string (info, &name, 1);
@ -4272,7 +4272,7 @@ xcf_load_old_path (XcfInfo *info,
return FALSE; return FALSE;
} }
points = g_new0 (GimpVectorsCompatPoint, num_points); points = g_new0 (GimpPathCompatPoint, num_points);
for (i = 0; i < num_points; i++) for (i = 0; i < num_points; i++)
{ {
@ -4302,7 +4302,7 @@ xcf_load_old_path (XcfInfo *info,
} }
} }
vectors = gimp_vectors_compat_new (image, name, points, num_points, closed); vectors = gimp_path_compat_new (image, name, points, num_points, closed);
g_free (name); g_free (name);
g_free (points); g_free (points);
@ -4404,7 +4404,7 @@ xcf_load_old_vector (XcfInfo *info,
name, tattoo, visible, linked, num_parasites, num_strokes); name, tattoo, visible, linked, num_parasites, num_strokes);
#endif #endif
vectors = gimp_vectors_new (image, name); vectors = gimp_path_new (image, name);
g_free (name); g_free (name);
gimp_item_set_visible (GIMP_ITEM (vectors), visible, FALSE); gimp_item_set_visible (GIMP_ITEM (vectors), visible, FALSE);
@ -4520,7 +4520,7 @@ xcf_load_old_vector (XcfInfo *info,
"control-points", control_points, "control-points", control_points,
NULL); NULL);
gimp_vectors_stroke_add (vectors, stroke); gimp_path_stroke_add (vectors, stroke);
g_object_unref (stroke); g_object_unref (stroke);
gimp_value_array_unref (control_points); gimp_value_array_unref (control_points);

View File

@ -69,7 +69,7 @@
#include "vectors/gimpbezierstroke.h" #include "vectors/gimpbezierstroke.h"
#include "vectors/gimppath.h" #include "vectors/gimppath.h"
#include "vectors/gimpstroke.h" #include "vectors/gimpstroke.h"
#include "vectors/gimpvectors-compat.h" #include "vectors/gimppath-compat.h"
#include "xcf-private.h" #include "xcf-private.h"
#include "xcf-read.h" #include "xcf-read.h"
@ -525,7 +525,7 @@ xcf_save_image_props (XcfInfo *info,
if (gimp_container_get_n_children (gimp_image_get_paths (image)) > 0 && if (gimp_container_get_n_children (gimp_image_get_paths (image)) > 0 &&
info->file_version < 18) info->file_version < 18)
{ {
if (gimp_vectors_compat_is_compatible (image)) if (gimp_path_compat_is_compatible (image))
xcf_check_error (xcf_save_prop (info, image, PROP_PATHS, error), ;); xcf_check_error (xcf_save_prop (info, image, PROP_PATHS, error), ;);
else else
xcf_check_error (xcf_save_prop (info, image, PROP_VECTORS, error), ;); xcf_check_error (xcf_save_prop (info, image, PROP_VECTORS, error), ;);
@ -2942,7 +2942,7 @@ xcf_save_old_paths (XcfInfo *info,
guint32 version; guint32 version;
guint32 pathtype; guint32 pathtype;
guint32 tattoo; guint32 tattoo;
GimpVectorsCompatPoint *points; GimpPathCompatPoint *points;
guint32 num_points; guint32 num_points;
guint32 closed; guint32 closed;
gint i; gint i;
@ -2959,7 +2959,7 @@ xcf_save_old_paths (XcfInfo *info,
* then each point. * then each point.
*/ */
points = gimp_vectors_compat_get_points (vectors, points = gimp_path_compat_get_points (vectors,
(gint32 *) &num_points, (gint32 *) &num_points,
(gint32 *) &closed); (gint32 *) &closed);

View File

@ -166,14 +166,14 @@ possible in the previous API is obviously still possible.
| `gimp_path_delete()` | `gimp_image_remove_path()` | | `gimp_path_delete()` | `gimp_image_remove_path()` |
| `gimp_path_get_current()` | `gimp_image_get_selected_paths()` | | `gimp_path_get_current()` | `gimp_image_get_selected_paths()` |
| `gimp_path_get_locked()` | *N/A* | | `gimp_path_get_locked()` | *N/A* |
| `gimp_path_get_points()` | `gimp_vectors_stroke_get_points()` | | `gimp_path_get_points()` | `gimp_path_stroke_get_points()` |
| `gimp_path_get_point_at_dist()` | `gimp_vectors_stroke_get_point_at_dist()` | | `gimp_path_get_point_at_dist()` | `gimp_path_stroke_get_point_at_dist()` |
| `gimp_path_get_tattoo()` | `gimp_item_get_tattoo()` | | `gimp_path_get_tattoo()` | `gimp_item_get_tattoo()` |
| `gimp_path_import()` | `gimp_vectors_import_from_file()` | | `gimp_path_import()` | `gimp_path_import_from_file()` |
| `gimp_path_list()` | `gimp_image_get_paths()` | | `gimp_path_list()` | `gimp_image_get_paths()` |
| `gimp_path_set_current()` | `gimp_image_set_selected_paths()` | | `gimp_path_set_current()` | `gimp_image_set_selected_paths()` |
| `gimp_path_set_locked()` | *N/A* | | `gimp_path_set_locked()` | *N/A* |
| `gimp_path_set_points()` | `gimp_vectors_stroke_new_from_points()` | | `gimp_path_set_points()` | `gimp_path_stroke_new_from_points()` |
| `gimp_path_set_tattoo()` | `gimp_item_set_tattoo()` | | `gimp_path_set_tattoo()` | `gimp_item_set_tattoo()` |
| `gimp_path_stroke_current()` | `gimp_edit_stroke_vectors()` | | `gimp_path_stroke_current()` | `gimp_edit_stroke_vectors()` |
| `gimp_path_to_selection()` | `gimp_image_select_item()` | | `gimp_path_to_selection()` | `gimp_image_select_item()` |

View File

@ -847,6 +847,9 @@ EXPORTS
gimp_procedure_add_parasite_argument gimp_procedure_add_parasite_argument
gimp_procedure_add_parasite_aux_argument gimp_procedure_add_parasite_aux_argument
gimp_procedure_add_parasite_return_value gimp_procedure_add_parasite_return_value
gimp_procedure_add_path_argument
gimp_procedure_add_path_aux_argument
gimp_procedure_add_path_return_value
gimp_procedure_add_pattern_argument gimp_procedure_add_pattern_argument
gimp_procedure_add_pattern_aux_argument gimp_procedure_add_pattern_aux_argument
gimp_procedure_add_pattern_return_value gimp_procedure_add_pattern_return_value
@ -871,9 +874,6 @@ EXPORTS
gimp_procedure_add_unit_argument gimp_procedure_add_unit_argument
gimp_procedure_add_unit_aux_argument gimp_procedure_add_unit_aux_argument
gimp_procedure_add_unit_return_value gimp_procedure_add_unit_return_value
gimp_procedure_add_vectors_argument
gimp_procedure_add_vectors_aux_argument
gimp_procedure_add_vectors_return_value
gimp_procedure_config_get_choice_id gimp_procedure_config_get_choice_id
gimp_procedure_config_get_procedure gimp_procedure_config_get_procedure
gimp_procedure_config_get_type gimp_procedure_config_get_type

View File

@ -65,7 +65,7 @@ struct _GimpItemComboBoxPrivate
typedef struct _GimpDrawableComboBoxClass GimpDrawableComboBoxClass; typedef struct _GimpDrawableComboBoxClass GimpDrawableComboBoxClass;
typedef struct _GimpChannelComboBoxClass GimpChannelComboBoxClass; typedef struct _GimpChannelComboBoxClass GimpChannelComboBoxClass;
typedef struct _GimpLayerComboBoxClass GimpLayerComboBoxClass; typedef struct _GimpLayerComboBoxClass GimpLayerComboBoxClass;
typedef struct _GimpVectorsComboBoxClass GimpVectorsComboBoxClass; typedef struct _GimpPathComboBoxClass GimpPathComboBoxClass;
struct _GimpDrawableComboBox struct _GimpDrawableComboBox
{ {
@ -97,12 +97,12 @@ struct _GimpLayerComboBoxClass
GimpIntComboBoxClass parent_class; GimpIntComboBoxClass parent_class;
}; };
struct _GimpVectorsComboBox struct _GimpPathComboBox
{ {
GimpIntComboBox parent_instance; GimpIntComboBox parent_instance;
}; };
struct _GimpVectorsComboBoxClass struct _GimpPathComboBoxClass
{ {
GimpIntComboBoxClass parent_class; GimpIntComboBoxClass parent_class;
}; };
@ -135,7 +135,7 @@ static const GtkTargetEntry targets[] =
{ {
{ "application/x-gimp-channel-id", 0 }, { "application/x-gimp-channel-id", 0 },
{ "application/x-gimp-layer-id", 0 }, { "application/x-gimp-layer-id", 0 },
{ "application/x-gimp-vectors-id", 0 } { "application/x-gimp-path-id", 0 }
}; };
@ -293,11 +293,11 @@ gimp_layer_combo_box_new (GimpItemConstraintFunc constraint,
} }
G_DEFINE_TYPE (GimpVectorsComboBox, gimp_vectors_combo_box, G_DEFINE_TYPE (GimpPathComboBox, gimp_path_combo_box,
GIMP_TYPE_INT_COMBO_BOX) GIMP_TYPE_INT_COMBO_BOX)
static void static void
gimp_vectors_combo_box_class_init (GimpVectorsComboBoxClass *klass) gimp_path_combo_box_class_init (GimpPathComboBoxClass *klass)
{ {
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@ -305,7 +305,7 @@ gimp_vectors_combo_box_class_init (GimpVectorsComboBoxClass *klass)
} }
static void static void
gimp_vectors_combo_box_init (GimpVectorsComboBox *combo_box) gimp_path_combo_box_init (GimpPathComboBox *combo_box)
{ {
gtk_drag_dest_set (GTK_WIDGET (combo_box), gtk_drag_dest_set (GTK_WIDGET (combo_box),
GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_HIGHLIGHT |
@ -321,31 +321,31 @@ gimp_vectors_combo_box_init (GimpVectorsComboBox *combo_box)
/** /**
* gimp_vectors_combo_box_new: * gimp_path_combo_box_new:
* @constraint: (nullable): A #GimpItemConstraintFunc or %NULL * @constraint: (nullable): A #GimpItemConstraintFunc or %NULL
* @data: (closure constraint): A pointer that is passed to @constraint * @data: (closure constraint): A pointer that is passed to @constraint
* @data_destroy: (destroy data): Destroy function for @data * @data_destroy: (destroy data): Destroy function for @data
* *
* Creates a new #GimpIntComboBox filled with all currently opened * Creates a new #GimpIntComboBox filled with all currently opened
* vectors objects. If a @constraint function is specified, it is called for * path objects. If a @constraint function is specified, it is called for
* each vectors object and only if the function returns %TRUE, the vectors * each path object and only if the function returns %TRUE, the path
* object is added to the combobox. * object is added to the combobox.
* *
* You should use gimp_int_combo_box_connect() to initialize and connect * You should use gimp_int_combo_box_connect() to initialize and connect
* the combo. Use gimp_int_combo_box_set_active() to set the active * the combo. Use gimp_int_combo_box_set_active() to set the active
* vectors ID and gimp_int_combo_box_get_active() to retrieve the ID * path ID and gimp_int_combo_box_get_active() to retrieve the ID
* of the selected vectors object. * of the selected path object.
* *
* Returns: a new #GimpIntComboBox. * Returns: a new #GimpIntComboBox.
* *
* Since: 2.4 * Since: 2.4
**/ **/
GtkWidget * GtkWidget *
gimp_vectors_combo_box_new (GimpItemConstraintFunc constraint, gimp_path_combo_box_new (GimpItemConstraintFunc constraint,
gpointer data, gpointer data,
GDestroyNotify data_destroy) GDestroyNotify data_destroy)
{ {
return gimp_item_combo_box_new (GIMP_TYPE_VECTORS_COMBO_BOX, return gimp_item_combo_box_new (GIMP_TYPE_PATH_COMBO_BOX,
constraint, data, data_destroy); constraint, data, data_destroy);
} }
@ -416,7 +416,7 @@ gimp_item_combo_box_populate (GimpIntComboBox *combo_box)
g_list_free (items); g_list_free (items);
} }
if (GIMP_IS_VECTORS_COMBO_BOX (combo_box)) if (GIMP_IS_PATH_COMBO_BOX (combo_box))
{ {
items = gimp_image_list_paths (image); items = gimp_image_list_paths (image);
gimp_item_combo_box_model_add (combo_box, GTK_LIST_STORE (model), gimp_item_combo_box_model_add (combo_box, GTK_LIST_STORE (model),
@ -476,7 +476,7 @@ gimp_item_combo_box_model_add (GimpIntComboBox *combo_box,
g_free (item_name); g_free (item_name);
g_free (image_name); g_free (image_name);
if (GIMP_IS_VECTORS_COMBO_BOX (combo_box)) if (GIMP_IS_PATH_COMBO_BOX (combo_box))
thumb = NULL; thumb = NULL;
else else
thumb = gimp_drawable_get_thumbnail (GIMP_DRAWABLE (item), thumb = gimp_drawable_get_thumbnail (GIMP_DRAWABLE (item),

View File

@ -44,15 +44,15 @@ G_BEGIN_DECLS
#define GIMP_LAYER_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_COMBO_BOX, GimpLayerComboBox)) #define GIMP_LAYER_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_LAYER_COMBO_BOX, GimpLayerComboBox))
#define GIMP_IS_LAYER_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LAYER_COMBO_BOX)) #define GIMP_IS_LAYER_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_LAYER_COMBO_BOX))
#define GIMP_TYPE_VECTORS_COMBO_BOX (gimp_vectors_combo_box_get_type ()) #define GIMP_TYPE_PATH_COMBO_BOX (gimp_path_combo_box_get_type ())
#define GIMP_VECTORS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_VECTORS_COMBO_BOX, GimpVectorsComboBox)) #define GIMP_PATH_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PATH_COMBO_BOX, GimpPathComboBox))
#define GIMP_IS_VECTORS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_VECTORS_COMBO_BOX)) #define GIMP_IS_PATH_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PATH_COMBO_BOX))
GType gimp_drawable_combo_box_get_type (void) G_GNUC_CONST; GType gimp_drawable_combo_box_get_type (void) G_GNUC_CONST;
GType gimp_channel_combo_box_get_type (void) G_GNUC_CONST; GType gimp_channel_combo_box_get_type (void) G_GNUC_CONST;
GType gimp_layer_combo_box_get_type (void) G_GNUC_CONST; GType gimp_layer_combo_box_get_type (void) G_GNUC_CONST;
GType gimp_vectors_combo_box_get_type (void) G_GNUC_CONST; GType gimp_path_combo_box_get_type (void) G_GNUC_CONST;
/** /**
* GimpItemConstraintFunc: * GimpItemConstraintFunc:
@ -73,7 +73,7 @@ GtkWidget * gimp_channel_combo_box_new (GimpItemConstraintFunc constraint,
GtkWidget * gimp_layer_combo_box_new (GimpItemConstraintFunc constraint, GtkWidget * gimp_layer_combo_box_new (GimpItemConstraintFunc constraint,
gpointer data, gpointer data,
GDestroyNotify data_destroy); GDestroyNotify data_destroy);
GtkWidget * gimp_vectors_combo_box_new (GimpItemConstraintFunc constraint, GtkWidget * gimp_path_combo_box_new (GimpItemConstraintFunc constraint,
gpointer data, gpointer data,
GDestroyNotify data_destroy); GDestroyNotify data_destroy);

View File

@ -1137,8 +1137,8 @@ gimp_path_import_from_file (GimpImage *image,
* *
* Import paths from an SVG string. * Import paths from an SVG string.
* *
* This procedure works like gimp_vectors_import_from_file() but takes * This procedure works like gimp_path_import_from_file() but takes a
* a string rather than reading the SVG from a file. This allows you to * string rather than reading the SVG from a file. This allows you to
* write scripts that generate SVG and feed it to GIMP. * write scripts that generate SVG and feed it to GIMP.
* *
* Returns: TRUE on success. * Returns: TRUE on success.

View File

@ -2197,7 +2197,7 @@ gimp_procedure_add_selection_return_value (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_add_vectors_argument: * gimp_procedure_add_path_argument:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
@ -2205,12 +2205,12 @@ gimp_procedure_add_selection_return_value (GimpProcedure *procedure,
* @none_ok: Whether no is a valid value. * @none_ok: Whether no is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpVectors argument to @procedure. * Add a new #GimpPath argument to @procedure.
* *
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_procedure_add_vectors_argument (GimpProcedure *procedure, gimp_procedure_add_path_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
@ -2223,7 +2223,7 @@ gimp_procedure_add_vectors_argument (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_add_vectors_aux_argument: * gimp_procedure_add_path_aux_argument:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
@ -2231,12 +2231,12 @@ gimp_procedure_add_vectors_argument (GimpProcedure *procedure,
* @none_ok: Whether no is a valid value. * @none_ok: Whether no is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpVectors auxiliary argument to @procedure. * Add a new #GimpPath auxiliary argument to @procedure.
* *
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_procedure_add_vectors_aux_argument (GimpProcedure *procedure, gimp_procedure_add_path_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
@ -2249,7 +2249,7 @@ gimp_procedure_add_vectors_aux_argument (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_add_vectors_return_value: * gimp_procedure_add_path_return_value:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @name: the name of the argument to be created. * @name: the name of the argument to be created.
* @nick: the label used in #GimpProcedureDialog. * @nick: the label used in #GimpProcedureDialog.
@ -2257,12 +2257,12 @@ gimp_procedure_add_vectors_aux_argument (GimpProcedure *procedure,
* @none_ok: Whether no is a valid value. * @none_ok: Whether no is a valid value.
* @flags: argument flags. * @flags: argument flags.
* *
* Add a new #GimpVectors return value to @procedure. * Add a new #GimpPath return value to @procedure.
* *
* Since: 3.0 * Since: 3.0
**/ **/
void void
gimp_procedure_add_vectors_return_value (GimpProcedure *procedure, gimp_procedure_add_path_return_value (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,

View File

@ -363,7 +363,7 @@ G_BEGIN_DECLS
g_value_set_object (gimp_value_array_index (args, n), value) g_value_set_object (gimp_value_array_index (args, n), value)
/* vectors */ /* path */
#define GIMP_VALUES_GET_PATH(args, n) \ #define GIMP_VALUES_GET_PATH(args, n) \
g_value_get_object (gimp_value_array_index (args, n)) g_value_get_object (gimp_value_array_index (args, n))
@ -956,19 +956,19 @@ void gimp_procedure_add_selection_return_value (GimpProcedure *procedure
gboolean none_ok, gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_vectors_argument (GimpProcedure *procedure, void gimp_procedure_add_path_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok, gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_vectors_aux_argument (GimpProcedure *procedure, void gimp_procedure_add_path_aux_argument (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,
gboolean none_ok, gboolean none_ok,
GParamFlags flags); GParamFlags flags);
void gimp_procedure_add_vectors_return_value (GimpProcedure *procedure, void gimp_procedure_add_path_return_value (GimpProcedure *procedure,
const gchar *name, const gchar *name,
const gchar *nick, const gchar *nick,
const gchar *blurb, const gchar *blurb,

View File

@ -31,6 +31,8 @@ EXPORTS
gimp_layer_combo_box_new gimp_layer_combo_box_new
gimp_palette_chooser_get_type gimp_palette_chooser_get_type
gimp_palette_chooser_new gimp_palette_chooser_new
gimp_path_combo_box_get_type
gimp_path_combo_box_new
gimp_pattern_chooser_get_type gimp_pattern_chooser_get_type
gimp_pattern_chooser_new gimp_pattern_chooser_new
gimp_proc_browser_dialog_get_selected gimp_proc_browser_dialog_get_selected
@ -95,8 +97,6 @@ EXPORTS
gimp_ui_init gimp_ui_init
gimp_vector_load_procedure_dialog_get_type gimp_vector_load_procedure_dialog_get_type
gimp_vector_load_procedure_dialog_new gimp_vector_load_procedure_dialog_new
gimp_vectors_combo_box_get_type
gimp_vectors_combo_box_new
gimp_window_set_transient gimp_window_set_transient
gimp_window_set_transient_for_display gimp_window_set_transient_for_display
gimp_zoom_preview_get_drawable gimp_zoom_preview_get_drawable

View File

@ -41,7 +41,7 @@ typedef struct _GimpZoomPreview GimpZoomPreview;
typedef struct _GimpDrawableComboBox GimpDrawableComboBox; typedef struct _GimpDrawableComboBox GimpDrawableComboBox;
typedef struct _GimpChannelComboBox GimpChannelComboBox; typedef struct _GimpChannelComboBox GimpChannelComboBox;
typedef struct _GimpLayerComboBox GimpLayerComboBox; typedef struct _GimpLayerComboBox GimpLayerComboBox;
typedef struct _GimpVectorsComboBox GimpVectorsComboBox; typedef struct _GimpPathComboBox GimpPathComboBox;
typedef struct _GimpImageComboBox GimpImageComboBox; typedef struct _GimpImageComboBox GimpImageComboBox;
typedef struct _GimpDrawableChooser GimpDrawableChooser; typedef struct _GimpDrawableChooser GimpDrawableChooser;

View File

@ -40,7 +40,7 @@ HELP
%invoke = ( %invoke = (
code => <<'CODE' code => <<'CODE'
{ {
path = gimp_vectors_new (image, name); path = gimp_path_new (image, name);
} }
CODE CODE
); );
@ -75,7 +75,7 @@ HELP
{ {
gint x, y; gint x, y;
path = gimp_text_vectors_new (image, path = gimp_text_path_new (image,
gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer))); gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)));
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y); gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
@ -146,7 +146,7 @@ HELP
%invoke = ( %invoke = (
code => <<"CODE" code => <<"CODE"
{ {
num_strokes = gimp_vectors_get_n_strokes (path); num_strokes = gimp_path_get_n_strokes (path);
if (num_strokes) if (num_strokes)
{ {
@ -155,9 +155,9 @@ HELP
stroke_ids = g_new (gint32, num_strokes); stroke_ids = g_new (gint32, num_strokes);
for (cur_stroke = gimp_vectors_stroke_get_next (path, NULL); for (cur_stroke = gimp_path_stroke_get_next (path, NULL);
cur_stroke; cur_stroke;
cur_stroke = gimp_vectors_stroke_get_next (path, cur_stroke)) cur_stroke = gimp_path_stroke_get_next (path, cur_stroke))
{ {
stroke_ids[i] = gimp_stroke_get_id (cur_stroke); stroke_ids[i] = gimp_stroke_get_id (cur_stroke);
i++; i++;
@ -287,7 +287,7 @@ HELP
_("Remove path stroke"), _("Remove path stroke"),
path); path);
gimp_vectors_stroke_remove (path, stroke); gimp_path_stroke_remove (path, stroke);
} }
else else
success = FALSE; success = FALSE;
@ -325,9 +325,9 @@ HELP
_("Close path stroke"), _("Close path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_close (stroke); gimp_stroke_close (stroke);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -366,9 +366,9 @@ HELP
_("Reverse path stroke"), _("Reverse path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_reverse (stroke); gimp_stroke_reverse (stroke);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -413,9 +413,9 @@ HELP
_("Translate path stroke"), _("Translate path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_translate (stroke, off_x, off_y); gimp_stroke_translate (stroke, off_x, off_y);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -459,9 +459,9 @@ HELP
_("Scale path stroke"), _("Scale path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_scale (stroke, scale_x, scale_y); gimp_stroke_scale (stroke, scale_x, scale_y);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -506,9 +506,9 @@ HELP
_("Rotate path stroke"), _("Rotate path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_rotate (stroke, center_x, center_y, angle); gimp_stroke_rotate (stroke, center_x, center_y, angle);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -552,9 +552,9 @@ HELP
_("Flip path stroke"), _("Flip path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_flip (stroke, flip_type, axis); gimp_stroke_flip (stroke, flip_type, axis);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -603,9 +603,9 @@ HELP
_("Flip path stroke"), _("Flip path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_stroke_flip_free (stroke, x1, y1, x2, y2); gimp_stroke_flip_free (stroke, x1, y1, x2, y2);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -810,7 +810,7 @@ HELP
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -868,7 +868,7 @@ HELP
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -918,9 +918,9 @@ HELP
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_lineto (stroke, &coord0); gimp_bezier_stroke_lineto (stroke, &coord0);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -977,9 +977,9 @@ HELP
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_conicto (stroke, &coord0, &coord1); gimp_bezier_stroke_conicto (stroke, &coord0, &coord1);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -1042,9 +1042,9 @@ HELP
_("Extend path stroke"), _("Extend path stroke"),
path); path);
gimp_vectors_freeze (path); gimp_path_freeze (path);
gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2); gimp_bezier_stroke_cubicto (stroke, &coord0, &coord1, &coord2);
gimp_vectors_thaw (path); gimp_path_thaw (path);
} }
else else
success = FALSE; success = FALSE;
@ -1103,7 +1103,7 @@ HELP
_("Add path stroke"), _("Add path stroke"),
path); path);
gimp_vectors_stroke_add (path, stroke); gimp_path_stroke_add (path, stroke);
g_object_unref (stroke); g_object_unref (stroke);
stroke_id = gimp_stroke_get_id (stroke); stroke_id = gimp_stroke_get_id (stroke);
@ -1144,13 +1144,13 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("vectors/gimpvectors-import.h") ], headers => [ qw("vectors/gimppath-import.h") ],
code => <<'CODE' code => <<'CODE'
{ {
GList *path_list = NULL; GList *path_list = NULL;
/* FIXME tree */ /* FIXME tree */
success = gimp_vectors_import_file (image, file, success = gimp_path_import_file (image, file,
merge, scale, NULL, -1, merge, scale, NULL, -1,
&path_list, error); &path_list, error);
@ -1184,7 +1184,7 @@ sub path_import_from_string {
$blurb = 'Import paths from an SVG string.'; $blurb = 'Import paths from an SVG string.';
$help = <<'HELP'; $help = <<'HELP';
This procedure works like gimp_vectors_import_from_file() but takes a string This procedure works like gimp_path_import_from_file() but takes a string
rather than reading the SVG from a file. This allows you to write scripts that rather than reading the SVG from a file. This allows you to write scripts that
generate SVG and feed it to GIMP. generate SVG and feed it to GIMP.
HELP HELP
@ -1213,13 +1213,13 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("vectors/gimpvectors-import.h") ], headers => [ qw("vectors/gimppath-import.h") ],
code => <<'CODE' code => <<'CODE'
{ {
GList *path_list = NULL; GList *path_list = NULL;
/* FIXME tree */ /* FIXME tree */
success = gimp_vectors_import_buffer (image, string, length, success = gimp_path_import_buffer (image, string, length,
merge, scale, NULL, -1, merge, scale, NULL, -1,
&path_list, error); &path_list, error);
@ -1272,7 +1272,7 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("vectors/gimpvectors-export.h") ], headers => [ qw("vectors/gimppath-export.h") ],
code => <<'CODE' code => <<'CODE'
{ {
GList *path_list = NULL; GList *path_list = NULL;
@ -1280,7 +1280,7 @@ HELP
if (path != NULL) if (path != NULL)
path_list = g_list_prepend (path_list, path); path_list = g_list_prepend (path_list, path);
success = gimp_vectors_export_file (image, path_list, file, error); success = gimp_path_export_file (image, path_list, file, error);
g_list_free (path_list); g_list_free (path_list);
} }
@ -1314,7 +1314,7 @@ HELP
); );
%invoke = ( %invoke = (
headers => [ qw("vectors/gimpvectors-export.h") ], headers => [ qw("vectors/gimppath-export.h") ],
code => <<'CODE' code => <<'CODE'
{ {
GList *path_list = NULL; GList *path_list = NULL;
@ -1322,7 +1322,7 @@ HELP
if (path != NULL) if (path != NULL)
path_list = g_list_prepend (path_list, path); path_list = g_list_prepend (path_list, path);
string = gimp_vectors_export_string (image, path_list); string = gimp_path_export_string (image, path_list);
g_list_free (path_list); g_list_free (path_list);
success = (string != NULL); success = (string != NULL);
@ -1336,7 +1336,7 @@ CODE
"core/gimplist.h" "core/gimplist.h"
"core/gimpimage.h" "core/gimpimage.h"
"core/gimpimage-undo-push.h" "core/gimpimage-undo-push.h"
"text/gimptext-vectors.h" "text/gimptext-path.h"
"text/gimptextlayer.h" "text/gimptextlayer.h"
"vectors/gimpanchor.h" "vectors/gimpanchor.h"
"vectors/gimpstroke-new.h" "vectors/gimpstroke-new.h"

View File

@ -2558,7 +2558,7 @@ save_dialog (GimpImage *image,
} }
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
combo = gimp_vectors_combo_box_new (NULL, NULL, NULL); combo = gimp_path_combo_box_new (NULL, NULL, NULL);
/* Alert user if they have more than 998 paths */ /* Alert user if they have more than 998 paths */
if (g_list_length (paths) > 998) if (g_list_length (paths) > 998)

View File

@ -277,7 +277,7 @@ script_fu_arg_add_argument (SFArg *arg,
break; break;
case SF_VECTORS: case SF_VECTORS:
gimp_procedure_add_vectors_argument (procedure, name, gimp_procedure_add_path_argument (procedure, name,
nick, arg->label, nick, arg->label,
TRUE, TRUE,
G_PARAM_READWRITE); G_PARAM_READWRITE);

View File

@ -251,7 +251,7 @@ script_fu_interface_dialog (SFScript *script,
break; break;
case SF_VECTORS: case SF_VECTORS:
widget = gimp_vectors_combo_box_new (NULL, NULL, NULL); widget = gimp_path_combo_box_new (NULL, NULL, NULL);
ID_ptr = &arg->value.sfa_vectors; ID_ptr = &arg->value.sfa_vectors;
break; break;

View File

@ -245,9 +245,9 @@ app/dialogs/template-options-dialog.c
app/dialogs/tips-dialog.c app/dialogs/tips-dialog.c
app/dialogs/tips-parser.c app/dialogs/tips-parser.c
app/dialogs/user-install-dialog.c app/dialogs/user-install-dialog.c
app/dialogs/vectors-export-dialog.c app/dialogs/path-export-dialog.c
app/dialogs/vectors-import-dialog.c app/dialogs/path-import-dialog.c
app/dialogs/vectors-options-dialog.c app/dialogs/path-options-dialog.c
app/dialogs/welcome-dialog.c app/dialogs/welcome-dialog.c
app/display/display-enums.c app/display/display-enums.c
@ -530,8 +530,8 @@ app/tools/gimpwarptool.c
app/tools/tools-enums.c app/tools/tools-enums.c
app/vectors/gimppath.c app/vectors/gimppath.c
app/vectors/gimpvectors-export.c app/vectors/gimppath-export.c
app/vectors/gimpvectors-import.c app/vectors/gimppath-import.c
app/widgets/gimpactioneditor.c app/widgets/gimpactioneditor.c
app/widgets/gimpactiongroup.c app/widgets/gimpactiongroup.c
@ -641,7 +641,7 @@ app/widgets/gimptoolpreseteditor.c
app/widgets/gimptranslationstore.c app/widgets/gimptranslationstore.c
app/widgets/gimpuimanager.c app/widgets/gimpuimanager.c
app/widgets/gimpundoeditor.c app/widgets/gimpundoeditor.c
app/widgets/gimpvectorstreeview.c app/widgets/gimppathtreeview.c
app/widgets/gimpviewablebox.c app/widgets/gimpviewablebox.c
app/widgets/gimpwidgets-constructors.c app/widgets/gimpwidgets-constructors.c
app/widgets/gimpwidgets-utils.c app/widgets/gimpwidgets-utils.c