? app/core/gimpfilloptions.c ? app/core/gimpfilloptions.h ? app/dialogs/vectorlayer-options-dialog.c ? app/dialogs/vectorlayer-options-dialog.h ? app/vectors/gimpvectorlayer-xcf.c ? app/vectors/gimpvectorlayer-xcf.h ? app/vectors/gimpvectorlayer.c ? app/vectors/gimpvectorlayer.h ? app/vectors/gimpvectorlayeroptions-parasite.c ? app/vectors/gimpvectorlayeroptions-parasite.h ? app/vectors/gimpvectorlayeroptions.c ? app/vectors/gimpvectorlayeroptions.h Index: app/actions/layers-actions.c =================================================================== RCS file: /cvs/gnome/gimp/app/actions/layers-actions.c,v retrieving revision 1.39 diff -u -p -r1.39 layers-actions.c --- app/actions/layers-actions.c 14 Sep 2006 08:23:53 -0000 1.39 +++ app/actions/layers-actions.c 8 Dec 2006 00:58:26 -0000 @@ -31,6 +31,8 @@ #include "text/gimptextlayer.h" +#include "vectors/gimpvectorlayer.h" + #include "widgets/gimphelp-ids.h" #include "widgets/gimpactiongroup.h" @@ -63,6 +65,12 @@ static const GimpActionEntry layers_acti N_("Activate the text tool on this text layer"), G_CALLBACK (layers_text_tool_cmd_callback), GIMP_HELP_TOOL_TEXT }, + + { "layers-vector-tool", GIMP_STOCK_TOOL_PATH, + N_("Path Tool"), NULL, + N_("Activate the path tool on this vector layer's path"), + G_CALLBACK (layers_vector_tool_cmd_callback), + GIMP_HELP_TOOL_PATH }, { "layers-edit-attributes", GTK_STOCK_EDIT, N_("_Edit Layer Attributes..."), NULL, @@ -160,6 +168,18 @@ static const GimpActionEntry layers_acti G_CALLBACK (layers_text_along_vectors_cmd_callback), GIMP_HELP_LAYER_TEXT_ALONG_PATH }, + { "layers-vector-fill-stroke", NULL, + N_("Fill / Stroke"), NULL, + N_("Edit the fill and stroke of this vector layer"), + G_CALLBACK (layers_vector_fill_stroke_cmd_callback), + NULL }, + + { "layers-vector-discard", NULL, + N_("Discard Vector Information"), NULL, + N_("Turn this vector layer into a normal layer"), + G_CALLBACK (layers_vector_discard_cmd_callback), + NULL }, + { "layers-resize", GIMP_STOCK_RESIZE, N_("Layer B_oundary Size..."), NULL, N_("Adjust the layer dimensions"), @@ -456,18 +476,19 @@ void layers_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *image = action_data_get_image (data); - GimpLayer *layer = NULL; - GimpLayerMask *mask = NULL; /* layer mask */ - gboolean fs = FALSE; /* floating sel */ - gboolean ac = FALSE; /* active channel */ - gboolean sel = FALSE; - gboolean alpha = FALSE; /* alpha channel present */ - gboolean indexed = FALSE; /* is indexed */ - gboolean lock_alpha = FALSE; - gboolean text_layer = FALSE; - GList *next = NULL; - GList *prev = NULL; + GimpImage *image = action_data_get_image (data); + GimpLayer *layer = NULL; + GimpLayerMask *mask = NULL; /* layer mask */ + gboolean fs = FALSE; /* floating sel */ + gboolean ac = FALSE; /* active channel */ + gboolean sel = FALSE; + gboolean alpha = FALSE; /* alpha channel present */ + gboolean indexed = FALSE; /* is indexed */ + gboolean lock_alpha = FALSE; + gboolean text_layer = FALSE; + gboolean vector_layer = FALSE; + GList *next = NULL; + GList *prev = NULL; if (image) { @@ -495,7 +516,10 @@ layers_actions_update (GimpActionGroup * } if (layer) + { text_layer = gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)); + vector_layer = gimp_drawable_is_vector_layer (GIMP_DRAWABLE (layer)); + } } } @@ -507,6 +531,7 @@ layers_actions_update (GimpActionGroup * gimp_action_group_set_action_active (group, action, (condition) != 0) SET_VISIBLE ("layers-text-tool", text_layer && !ac); + SET_VISIBLE ("layers-vector-tool", vector_layer && !ac); SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac); SET_SENSITIVE ("layers-new", image); @@ -536,6 +561,9 @@ layers_actions_update (GimpActionGroup * SET_VISIBLE ("layers-text-selection-add", text_layer && !ac); SET_VISIBLE ("layers-text-selection-subtract", text_layer && !ac); SET_VISIBLE ("layers-text-selection-intersect", text_layer && !ac); + + SET_VISIBLE ("layers-vector-fill-stroke", vector_layer && !ac); + SET_VISIBLE ("layers-vector-discard", vector_layer && !ac); SET_SENSITIVE ("layers-resize", layer && !ac); SET_SENSITIVE ("layers-resize-to-image", layer && !ac); Index: app/actions/layers-commands.c =================================================================== RCS file: /cvs/gnome/gimp/app/actions/layers-commands.c,v retrieving revision 1.166 diff -u -p -r1.166 layers-commands.c --- app/actions/layers-commands.c 15 Oct 2006 16:51:30 -0000 1.166 +++ app/actions/layers-commands.c 8 Dec 2006 00:58:27 -0000 @@ -33,6 +33,7 @@ #include "core/gimp.h" #include "core/gimpchannel-select.h" #include "core/gimpcontext.h" +#include "core/gimpcontainer.h" #include "core/gimpimage.h" #include "core/gimpimage-merge.h" #include "core/gimpimage-undo.h" @@ -49,6 +50,8 @@ #include "text/gimptext-vectors.h" #include "text/gimptextlayer.h" +#include "vectors/gimpvectorlayer.h" +#include "vectors/gimpvectorlayeroptions.h" #include "vectors/gimpvectors-warp.h" #include "widgets/gimpaction.h" @@ -60,8 +63,10 @@ #include "display/gimpdisplayshell.h" #include "tools/gimptexttool.h" +#include "tools/gimpvectortool.h" #include "tools/tool_manager.h" +#include "dialogs/vectorlayer-options-dialog.h" #include "dialogs/layer-add-mask-dialog.h" #include "dialogs/layer-options-dialog.h" #include "dialogs/resize-dialog.h" @@ -183,6 +188,45 @@ layers_text_tool_cmd_callback (GtkAction } void +layers_vector_tool_cmd_callback (GtkAction *action, + gpointer data) +{ + GimpImage *image; + GimpLayer *layer; + GtkWidget *widget; + GimpTool *active_tool; + return_if_no_layer (image, layer, data); + return_if_no_widget (widget, data); + + if (! gimp_drawable_is_vector_layer (GIMP_DRAWABLE (layer))) + { + layers_edit_attributes_cmd_callback (action, data); + return; + } + + active_tool = tool_manager_get_active (image->gimp); + + if (! GIMP_IS_VECTOR_TOOL (active_tool)) + { + GimpToolInfo *tool_info; + + tool_info = (GimpToolInfo *) + gimp_container_get_child_by_name (image->gimp->tool_info_list, + "gimp-vector-tool"); + + if (GIMP_IS_TOOL_INFO (tool_info)) + { + gimp_context_set_tool (action_data_get_context (data), tool_info); + active_tool = tool_manager_get_active (image->gimp); + } + } + + if (GIMP_IS_VECTOR_TOOL (active_tool)) + gimp_vector_tool_set_vectors (GIMP_VECTOR_TOOL (active_tool), + GIMP_VECTOR_LAYER (layer)->options->vectors); +} + +void layers_edit_attributes_cmd_callback (GtkAction *action, gpointer data) { @@ -510,6 +554,38 @@ layers_text_along_vectors_cmd_callback ( gimp_image_flush (image); } +} + +void +layers_vector_fill_stroke_cmd_callback (GtkAction *action, + gpointer data) +{ + GimpImage *image; + GimpLayer *layer; + GtkWidget *widget; + GtkWidget *dialog; + return_if_no_layer (image, layer, data); + return_if_no_widget (widget, data); + + dialog = vectorlayer_options_dialog_new (GIMP_ITEM (layer), + action_data_get_context (data), + _("Fill / Stroke"), + GTK_STOCK_OK, + NULL, + widget); + gtk_widget_show (dialog); +} + +void +layers_vector_discard_cmd_callback (GtkAction *action, + gpointer data) +{ + GimpImage *image; + GimpLayer *layer; + return_if_no_layer (image, layer, data); + + if (GIMP_IS_VECTOR_LAYER (layer)) + gimp_vector_layer_discard (GIMP_VECTOR_LAYER (layer)); } void Index: app/actions/layers-commands.h =================================================================== RCS file: /cvs/gnome/gimp/app/actions/layers-commands.h,v retrieving revision 1.31 diff -u -p -r1.31 layers-commands.h --- app/actions/layers-commands.h 13 May 2006 19:48:17 -0000 1.31 +++ app/actions/layers-commands.h 8 Dec 2006 00:58:27 -0000 @@ -22,6 +22,8 @@ void layers_text_tool_cmd_callback (GtkAction *action, gpointer data); +void layers_vector_tool_cmd_callback (GtkAction *action, + gpointer data); void layers_edit_attributes_cmd_callback (GtkAction *action, gpointer data); void layers_new_cmd_callback (GtkAction *action, @@ -55,6 +57,11 @@ void layers_text_discard_cmd_callback void layers_text_to_vectors_cmd_callback (GtkAction *action, gpointer data); void layers_text_along_vectors_cmd_callback (GtkAction *action, + gpointer data); + +void layers_vector_fill_stroke_cmd_callback (GtkAction *action, + gpointer data); +void layers_vector_discard_cmd_callback (GtkAction *action, gpointer data); void layers_resize_cmd_callback (GtkAction *action, Index: app/actions/select-commands.c =================================================================== RCS file: /cvs/gnome/gimp/app/actions/select-commands.c,v retrieving revision 1.56 diff -u -p -r1.56 select-commands.c --- app/actions/select-commands.c 9 Oct 2006 18:49:03 -0000 1.56 +++ app/actions/select-commands.c 8 Dec 2006 00:58:27 -0000 @@ -330,7 +330,7 @@ select_stroke_last_vals_cmd_callback (Gt desc = gimp_stroke_desc_new (image->gimp, context); gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)), - drawable, context, desc, FALSE); + drawable, context, desc, FALSE, TRUE); g_object_unref (desc); Index: app/actions/vectors-actions.c =================================================================== RCS file: /cvs/gnome/gimp/app/actions/vectors-actions.c,v retrieving revision 1.24 diff -u -p -r1.24 vectors-actions.c --- app/actions/vectors-actions.c 10 Apr 2006 08:06:18 -0000 1.24 +++ app/actions/vectors-actions.c 8 Dec 2006 00:58:27 -0000 @@ -138,7 +138,12 @@ static const GimpActionEntry vectors_act { "vectors-import", GTK_STOCK_OPEN, N_("I_mport Path..."), "", NULL, G_CALLBACK (vectors_import_cmd_callback), - GIMP_HELP_PATH_IMPORT } + GIMP_HELP_PATH_IMPORT }, + + { "vectors-to-vector-layer", NULL, + N_("Path to Vector Layer"), "", NULL, + G_CALLBACK (vectors_to_vector_layer_cmd_callback), + NULL } }; static const GimpToggleActionEntry vectors_toggle_actions[] = @@ -294,6 +299,8 @@ vectors_actions_update (GimpActionGroup SET_SENSITIVE ("vectors-paste", image); SET_SENSITIVE ("vectors-export", vectors); SET_SENSITIVE ("vectors-import", image); + + SET_SENSITIVE ("vectors-to-vector-layer", vectors); SET_SENSITIVE ("vectors-visible", vectors); SET_SENSITIVE ("vectors-linked", vectors); Index: app/actions/vectors-commands.c =================================================================== RCS file: /cvs/gnome/gimp/app/actions/vectors-commands.c,v retrieving revision 1.127 diff -u -p -r1.127 vectors-commands.c --- app/actions/vectors-commands.c 25 Oct 2006 15:13:10 -0000 1.127 +++ app/actions/vectors-commands.c 8 Dec 2006 00:58:27 -0000 @@ -35,6 +35,7 @@ #include "core/gimpimage-merge.h" #include "core/gimpimage-undo.h" #include "core/gimpitemundo.h" +#include "core/gimplayer.h" #include "core/gimpparamspecs.h" #include "core/gimpprogress.h" #include "core/gimpstrokedesc.h" @@ -46,6 +47,7 @@ #include "vectors/gimpvectors.h" #include "vectors/gimpvectors-export.h" #include "vectors/gimpvectors-import.h" +#include "vectors/gimpvectorlayer.h" #include "widgets/gimpaction.h" #include "widgets/gimpclipboard.h" @@ -282,6 +284,25 @@ vectors_merge_visible_cmd_callback (GtkA } void +vectors_to_vector_layer_cmd_callback (GtkAction *action, + gpointer data) +{ + GimpImage *image; + GimpVectors *vectors; + GimpVectorLayer *layer; + return_if_no_vectors (image, vectors, data); + + layer = gimp_vector_layer_new (image, + vectors, + gimp_get_user_context (image->gimp)); + gimp_image_add_layer(image, GIMP_LAYER(layer), -1); + gimp_vector_layer_refresh (layer); + + + gimp_image_flush (image); +} + +void vectors_to_selection_cmd_callback (GtkAction *action, gint value, gpointer data) @@ -404,7 +425,7 @@ vectors_stroke_last_vals_cmd_callback (G else desc = gimp_stroke_desc_new (image->gimp, context); - gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE); + gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE, TRUE); g_object_unref (desc); Index: app/actions/vectors-commands.h =================================================================== RCS file: /cvs/gnome/gimp/app/actions/vectors-commands.h,v retrieving revision 1.21 diff -u -p -r1.21 vectors-commands.h --- app/actions/vectors-commands.h 19 Sep 2005 21:33:03 -0000 1.21 +++ app/actions/vectors-commands.h 8 Dec 2006 00:58:27 -0000 @@ -44,6 +44,8 @@ void vectors_delete_cmd_callback gpointer data); void vectors_merge_visible_cmd_callback (GtkAction *action, gpointer data); +void vectors_to_vector_layer_cmd_callback (GtkAction *action, + gpointer data); void vectors_to_selection_cmd_callback (GtkAction *action, gint value, gpointer data); Index: app/core/Makefile.am =================================================================== RCS file: /cvs/gnome/gimp/app/core/Makefile.am,v retrieving revision 1.126 diff -u -p -r1.126 Makefile.am --- app/core/Makefile.am 26 Oct 2006 09:40:16 -0000 1.126 +++ app/core/Makefile.am 8 Dec 2006 00:58:27 -0000 @@ -122,6 +122,8 @@ libappcore_a_sources = \ gimpdrawable-transform.h \ gimpdrawableundo.c \ gimpdrawableundo.h \ + gimpfilloptions.c \ + gimpfilloptions.h \ gimpgradient.c \ gimpgradient.h \ gimpgradient-load.c \ Index: app/core/core-types.h =================================================================== RCS file: /cvs/gnome/gimp/app/core/core-types.h,v retrieving revision 1.104 diff -u -p -r1.104 core-types.h --- app/core/core-types.h 20 Oct 2006 08:56:58 -0000 1.104 +++ app/core/core-types.h 8 Dec 2006 00:58:27 -0000 @@ -73,6 +73,7 @@ typedef struct _GimpDocumentList Gimp /* context objects */ typedef struct _GimpContext GimpContext; +typedef struct _GimpFillOptions GimpFillOptions; typedef struct _GimpStrokeOptions GimpStrokeOptions; typedef struct _GimpToolOptions GimpToolOptions; Index: app/core/gimpchannel.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpchannel.c,v retrieving revision 1.200 diff -u -p -r1.200 gimpchannel.c --- app/core/gimpchannel.c 9 Oct 2006 18:49:05 -0000 1.200 +++ app/core/gimpchannel.c 8 Dec 2006 00:58:27 -0000 @@ -120,7 +120,8 @@ static void gimp_channel_transform GimpProgress *progress); static gboolean gimp_channel_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc); + GimpStrokeDesc *stroke_desc, + gboolean push_undo); static void gimp_channel_invalidate_boundary (GimpDrawable *drawable); static void gimp_channel_get_active_components (const GimpDrawable *drawable, @@ -669,8 +670,8 @@ gimp_channel_transform (GimpItem static gboolean gimp_channel_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc) - + GimpStrokeDesc *stroke_desc, + gboolean push_undo) { GimpChannel *channel = GIMP_CHANNEL (item); const BoundSeg *segs_in; @@ -698,7 +699,8 @@ gimp_channel_stroke (GimpItem *ite gimp_drawable_stroke_boundary (drawable, stroke_desc->stroke_options, segs_in, n_segs_in, - offset_x, offset_y); + offset_x, offset_y, + push_undo); retval = TRUE; break; @@ -711,7 +713,8 @@ gimp_channel_stroke (GimpItem *ite retval = gimp_paint_core_stroke_boundary (core, drawable, stroke_desc->paint_options, segs_in, n_segs_in, - offset_x, offset_y); + offset_x, offset_y, + push_undo); g_object_unref (core); } Index: app/core/gimpdrawable-stroke.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpdrawable-stroke.c,v retrieving revision 1.35 diff -u -p -r1.35 gimpdrawable-stroke.c --- app/core/gimpdrawable-stroke.c 25 Oct 2006 22:14:35 -0000 1.35 +++ app/core/gimpdrawable-stroke.c 8 Dec 2006 00:58:27 -0000 @@ -51,10 +51,17 @@ /* local function prototypes */ - -static void gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, - GimpStrokeOptions *options, - GimpScanConvert *scan_convert); +static void gimp_drawable_render_vectors (GimpDrawable *drawable, + GimpFillOptions *options, + GimpVectors *vectors, + gboolean do_stroke, + gboolean push_undo); + +static void gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, + GimpFillOptions *options, + GimpScanConvert *scan_convert, + gboolean do_stroke, + gboolean push_undo); /* public functions */ @@ -65,7 +72,8 @@ gimp_drawable_stroke_boundary (GimpDrawa const BoundSeg *bound_segs, gint n_bound_segs, gint offset_x, - gint offset_y) + gint offset_y, + gboolean push_undo) { GimpScanConvert *scan_convert; BoundSeg *stroke_segs; @@ -134,24 +142,64 @@ gimp_drawable_stroke_boundary (GimpDrawa g_free (points); g_free (stroke_segs); - gimp_drawable_stroke_scan_convert (drawable, options, scan_convert); + gimp_drawable_stroke_scan_convert (drawable, GIMP_FILL_OPTIONS(options), scan_convert, TRUE, push_undo); gimp_scan_convert_free (scan_convert); } + + +void +gimp_drawable_fill_vectors (GimpDrawable *drawable, + GimpFillOptions *options, + GimpVectors *vectors, + gboolean push_undo) +{ + g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); + g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); + g_return_if_fail (GIMP_IS_FILL_OPTIONS (options)); + g_return_if_fail (GIMP_IS_VECTORS (vectors)); + g_return_if_fail (options->style != GIMP_STROKE_STYLE_PATTERN || gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL); + + gimp_drawable_render_vectors (drawable, + options, + vectors, + FALSE, + push_undo); +} + void gimp_drawable_stroke_vectors (GimpDrawable *drawable, GimpStrokeOptions *options, - GimpVectors *vectors) + GimpVectors *vectors, + gboolean push_undo) { - GimpScanConvert *scan_convert; - GimpStroke *stroke; - gint num_coords = 0; - g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); g_return_if_fail (GIMP_IS_STROKE_OPTIONS (options)); g_return_if_fail (GIMP_IS_VECTORS (vectors)); + g_return_if_fail (GIMP_FILL_OPTIONS (options)->style != GIMP_STROKE_STYLE_PATTERN || gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL); + + gimp_drawable_render_vectors (drawable, + GIMP_FILL_OPTIONS(options), + vectors, + TRUE, + push_undo); +} + + +/* private functions */ + +static void +gimp_drawable_render_vectors (GimpDrawable *drawable, + GimpFillOptions *options, + GimpVectors *vectors, + gboolean do_stroke, + gboolean push_undo) +{ + GimpScanConvert *scan_convert; + GimpStroke *stroke; + gint num_coords = 0; scan_convert = gimp_scan_convert_new (); @@ -184,7 +232,7 @@ gimp_drawable_stroke_vectors (GimpDrawab } gimp_scan_convert_add_polyline (scan_convert, coords->len, - points, closed); + points, closed || !do_stroke); g_free (points); } @@ -194,29 +242,27 @@ gimp_drawable_stroke_vectors (GimpDrawab } if (num_coords > 0) - gimp_drawable_stroke_scan_convert (drawable, options, scan_convert); + gimp_drawable_stroke_scan_convert (drawable, GIMP_FILL_OPTIONS(options), scan_convert, do_stroke, push_undo); gimp_scan_convert_free (scan_convert); } - -/* private functions */ - static void -gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, - GimpStrokeOptions *options, - GimpScanConvert *scan_convert) +gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, + GimpFillOptions *options, + GimpScanConvert *scan_convert, + gboolean do_stroke, + gboolean push_undo) { - GimpContext *context = GIMP_CONTEXT (options); - GimpImage *image; - gdouble width; - TileManager *base; - TileManager *mask; - gint x, y, w, h; - gint bytes; - gint off_x, off_y; - guchar bg[1] = { 0, }; - PixelRegion maskPR, basePR; + GimpContext *context = GIMP_CONTEXT (options); + GimpImage *image; + TileManager *base; + TileManager *mask; + gint x, y, w, h; + gint bytes; + gint off_x, off_y; + guchar bg[1] = { 0, }; + PixelRegion maskPR, basePR; image = gimp_item_get_image (GIMP_ITEM (drawable)); @@ -238,24 +284,29 @@ gimp_drawable_stroke_scan_convert (GimpD gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); - width = options->width; - - if (options->unit != GIMP_UNIT_PIXEL) + if (do_stroke) { - gimp_scan_convert_set_pixel_ratio (scan_convert, - image->yresolution / - image->xresolution); + GimpStrokeOptions *stroke_options = GIMP_STROKE_OPTIONS(options); + + gdouble width = stroke_options->width; - width *= (image->yresolution / - _gimp_unit_get_factor (image->gimp, options->unit)); - } + if (stroke_options->unit != GIMP_UNIT_PIXEL) + { + gimp_scan_convert_set_pixel_ratio (scan_convert, + image->yresolution / + image->xresolution); - gimp_scan_convert_stroke (scan_convert, width, - options->join_style, - options->cap_style, - options->miter_limit, - options->dash_offset, - options->dash_info); + width *= (image->yresolution / + _gimp_unit_get_factor (image->gimp, stroke_options->unit)); + } + + gimp_scan_convert_stroke (scan_convert, width, + stroke_options->join_style, + stroke_options->cap_style, + stroke_options->miter_limit, + stroke_options->dash_offset, + stroke_options->dash_info); + } /* fill a 1-bpp Tilemanager with black, this will describe the shape * of the stroke. @@ -267,7 +318,7 @@ gimp_drawable_stroke_scan_convert (GimpD /* render the stroke into it */ gimp_scan_convert_render (scan_convert, mask, x + off_x, y + off_y, - options->antialias); + GIMP_FILL_OPTIONS(options)->antialias); bytes = gimp_drawable_bytes_with_alpha (drawable); @@ -275,7 +326,7 @@ gimp_drawable_stroke_scan_convert (GimpD pixel_region_init (&basePR, base, 0, 0, w, h, TRUE); pixel_region_init (&maskPR, mask, 0, 0, w, h, FALSE); - switch (options->style) + switch (GIMP_FILL_OPTIONS(options)->style) { case GIMP_STROKE_STYLE_SOLID: { @@ -317,7 +368,7 @@ gimp_drawable_stroke_scan_convert (GimpD /* Apply to drawable */ pixel_region_init (&basePR, base, 0, 0, w, h, FALSE); gimp_drawable_apply_region (drawable, &basePR, - TRUE, _("Render Stroke"), + push_undo, _("Render Stroke"), gimp_context_get_opacity (context), gimp_context_get_paint_mode (context), NULL, x, y); Index: app/core/gimpdrawable-stroke.h =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpdrawable-stroke.h,v retrieving revision 1.5 diff -u -p -r1.5 gimpdrawable-stroke.h --- app/core/gimpdrawable-stroke.h 30 Sep 2003 15:16:50 -0000 1.5 +++ app/core/gimpdrawable-stroke.h 8 Dec 2006 00:58:27 -0000 @@ -28,11 +28,18 @@ void gimp_drawable_stroke_boundary (Gi const BoundSeg *bound_segs, gint n_bound_segs, gint offset_x, - gint offset_y); + gint offset_y, + gboolean push_undo); + +void gimp_drawable_fill_vectors (GimpDrawable *drawable, + GimpFillOptions *options, + GimpVectors *vectors, + gboolean push_undo); void gimp_drawable_stroke_vectors (GimpDrawable *drawable, GimpStrokeOptions *options, - GimpVectors *vectors); + GimpVectors *vectors, + gboolean push_undo); #endif /* __GIMP_DRAWABLE_STROKE_H__ */ Index: app/core/gimpitem.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpitem.c,v retrieving revision 1.88 diff -u -p -r1.88 gimpitem.c --- app/core/gimpitem.c 4 Nov 2006 18:18:32 -0000 1.88 +++ app/core/gimpitem.c 8 Dec 2006 00:58:27 -0000 @@ -1006,7 +1006,8 @@ gimp_item_stroke (GimpItem *item, GimpDrawable *drawable, GimpContext *context, GimpStrokeDesc *stroke_desc, - gboolean use_default_values) + gboolean use_default_values, + gboolean push_undo) { GimpItemClass *item_class; gboolean retval = FALSE; @@ -1025,13 +1026,15 @@ gimp_item_stroke (GimpItem *item, GimpImage *image = gimp_item_get_image (item); gimp_stroke_desc_prepare (stroke_desc, context, use_default_values); - - gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, - item_class->stroke_desc); - - retval = item_class->stroke (item, drawable, stroke_desc); - - gimp_image_undo_group_end (image); + + if (push_undo) + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, + item_class->stroke_desc); + + retval = item_class->stroke (item, drawable, stroke_desc, push_undo); + + if (push_undo) + gimp_image_undo_group_end (image); gimp_stroke_desc_finish (stroke_desc); } Index: app/core/gimpitem.h =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpitem.h,v retrieving revision 1.48 diff -u -p -r1.48 gimpitem.h --- app/core/gimpitem.h 16 Oct 2006 17:09:07 -0000 1.48 +++ app/core/gimpitem.h 8 Dec 2006 00:58:27 -0000 @@ -111,7 +111,8 @@ struct _GimpItemClass GimpProgress *progress); gboolean (* stroke) (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc); + GimpStrokeDesc *stroke_desc, + gboolean push_undo); const gchar *default_name; const gchar *rename_desc; @@ -215,7 +216,8 @@ gboolean gimp_item_stroke GimpDrawable *drawable, GimpContext *context, GimpStrokeDesc *stroke_desc, - gboolean use_default_values); + gboolean use_default_values, + gboolean push_undo); gint gimp_item_get_ID (GimpItem *item); GimpItem * gimp_item_get_by_ID (Gimp *gimp, Index: app/core/gimpselection.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpselection.c,v retrieving revision 1.44 diff -u -p -r1.44 gimpselection.c --- app/core/gimpselection.c 25 Oct 2006 22:14:35 -0000 1.44 +++ app/core/gimpselection.c 8 Dec 2006 00:58:27 -0000 @@ -74,7 +74,8 @@ static void gimp_selection_rotate gboolean clip_result); static gboolean gimp_selection_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc); + GimpStrokeDesc *stroke_desc, + gboolean push_undo); static void gimp_selection_invalidate_boundary (GimpDrawable *drawable); @@ -255,7 +256,8 @@ gimp_selection_rotate (GimpItem static gboolean gimp_selection_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc) + GimpStrokeDesc *stroke_desc, + gboolean push_undo) { GimpSelection *selection = GIMP_SELECTION (item); const BoundSeg *dummy_in; @@ -277,7 +279,7 @@ gimp_selection_stroke (GimpItem *i selection->stroking = TRUE; - retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc); + retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc, push_undo); selection->stroking = FALSE; Index: app/core/gimpstrokedesc.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpstrokedesc.c,v retrieving revision 1.11 diff -u -p -r1.11 gimpstrokedesc.c --- app/core/gimpstrokedesc.c 28 Jun 2006 06:27:15 -0000 1.11 +++ app/core/gimpstrokedesc.c 8 Dec 2006 00:58:27 -0000 @@ -54,18 +54,29 @@ enum static void gimp_stroke_desc_config_iface_init (gpointer iface, gpointer iface_data); -static GObject * gimp_stroke_desc_constructor (GType type, - guint n_params, - GObjectConstructParam *params); -static void gimp_stroke_desc_finalize (GObject *object); -static void gimp_stroke_desc_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); -static void gimp_stroke_desc_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); +static GObject * gimp_stroke_desc_constructor (GType type, + guint n_params, + GObjectConstructParam *params); +static void gimp_stroke_desc_finalize (GObject *object); +static void gimp_stroke_desc_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void gimp_stroke_desc_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); +static gboolean gimp_stroke_desc_serialize_property (GimpConfig *config, + guint property_id, + const GValue *value, + GParamSpec *pspec, + GimpConfigWriter *writer); +static gboolean gimp_stroke_desc_deserialize_property (GimpConfig *object, + guint property_id, + GValue *value, + GParamSpec *pspec, + GScanner *scanner, + GTokenType *expected); static GimpConfig * gimp_stroke_desc_duplicate (GimpConfig *config); @@ -121,7 +132,9 @@ gimp_stroke_desc_config_iface_init (gpoi { GimpConfigInterface *config_iface = (GimpConfigInterface *) iface; - config_iface->duplicate = gimp_stroke_desc_duplicate; + config_iface->duplicate = gimp_stroke_desc_duplicate; + config_iface->serialize_property = gimp_stroke_desc_serialize_property; + config_iface->deserialize_property = gimp_stroke_desc_deserialize_property; } static void @@ -272,6 +285,89 @@ gimp_stroke_desc_duplicate (GimpConfig * return GIMP_CONFIG (new_desc); } +static gboolean +gimp_stroke_desc_serialize_property (GimpConfig *config, + guint property_id, + const GValue *value, + GParamSpec *pspec, + GimpConfigWriter *writer) +{ + GimpObject *serialize_obj; + + if (property_id == PROP_PAINT_INFO) + serialize_obj = g_value_get_object (value); + else + return FALSE; + + gimp_config_writer_open (writer, pspec->name); + + if (serialize_obj) + gimp_config_writer_string (writer, gimp_object_get_name (serialize_obj)); + else + gimp_config_writer_print (writer, "NULL", 4); + + gimp_config_writer_close (writer); + + return TRUE; +} + +static gboolean +gimp_stroke_desc_deserialize_property (GimpConfig *object, + guint property_id, + GValue *value, + GParamSpec *pspec, + GScanner *scanner, + GTokenType *expected) +{ + GimpStrokeDesc *stroke_desc = GIMP_STROKE_DESC (object); + GimpContainer *container; + GimpObject *current; + gboolean no_data = FALSE; + gchar *object_name; + + if (property_id == PROP_PAINT_INFO) + { + container = stroke_desc->gimp->paint_info_list; + current = (GimpObject *) (GIMP_CONTEXT (stroke_desc->stroke_options)->paint_info); + no_data = TRUE; + } + else + return FALSE; + + if (! no_data) + no_data = stroke_desc->gimp->no_data; + + if (gimp_scanner_parse_identifier (scanner, "NULL")) + { + g_value_set_object (value, NULL); + } + else if (gimp_scanner_parse_string (scanner, &object_name)) + { + GimpObject *deserialize_obj; + + if (! object_name) + object_name = g_strdup (""); + + deserialize_obj = gimp_container_get_child_by_name (container, + object_name); + + if (! deserialize_obj && ! no_data) + { + deserialize_obj = current; + } + + g_value_set_object (value, deserialize_obj); + + g_free (object_name); + } + else + { + *expected = G_TOKEN_STRING; + } + + return TRUE; +} + /* public functions */ @@ -286,13 +382,11 @@ gimp_stroke_desc_new (Gimp *gimp, g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL); if (context) - { paint_info = gimp_context_get_paint_info (context); - - if (! paint_info) - paint_info = gimp_paint_info_get_standard (gimp); - } - + + if (! paint_info) + paint_info = gimp_paint_info_get_standard (gimp); + desc = g_object_new (GIMP_TYPE_STROKE_DESC, "gimp", gimp, "paint-info", paint_info, Index: app/core/gimpstrokeoptions.c =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpstrokeoptions.c,v retrieving revision 1.22 diff -u -p -r1.22 gimpstrokeoptions.c --- app/core/gimpstrokeoptions.c 15 May 2006 09:46:15 -0000 1.22 +++ app/core/gimpstrokeoptions.c 8 Dec 2006 00:58:27 -0000 @@ -67,7 +67,7 @@ static void gimp_stroke_options_get_pr GParamSpec *pspec); -G_DEFINE_TYPE (GimpStrokeOptions, gimp_stroke_options, GIMP_TYPE_CONTEXT) +G_DEFINE_TYPE (GimpStrokeOptions, gimp_stroke_options, GIMP_TYPE_FILL_OPTIONS) static guint stroke_options_signals[LAST_SIGNAL] = { 0 }; @@ -93,11 +93,6 @@ gimp_stroke_options_class_init (GimpStro G_TYPE_NONE, 1, GIMP_TYPE_DASH_PRESET); - GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_STYLE, - "style", NULL, - GIMP_TYPE_STROKE_STYLE, - GIMP_STROKE_STYLE_SOLID, - GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_WIDTH, "width", NULL, 0.0, 2000.0, 6.0, @@ -122,10 +117,6 @@ gimp_stroke_options_class_init (GimpStro "line-width from the actual join point."), 0.0, 100.0, 10.0, GIMP_PARAM_STATIC_STRINGS); - GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ANTIALIAS, - "antialias", NULL, - TRUE, - GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_DASH_OFFSET, "dash-offset", NULL, 0.0, 2000.0, 0.0, @@ -156,9 +147,6 @@ gimp_stroke_options_set_property (GObjec switch (property_id) { - case PROP_STYLE: - options->style = g_value_get_enum (value); - break; case PROP_WIDTH: options->width = g_value_get_double (value); break; @@ -174,9 +162,6 @@ gimp_stroke_options_set_property (GObjec case PROP_MITER_LIMIT: options->miter_limit = g_value_get_double (value); break; - case PROP_ANTIALIAS: - options->antialias = g_value_get_boolean (value); - break; case PROP_DASH_OFFSET: options->dash_offset = g_value_get_double (value); break; @@ -202,9 +187,6 @@ gimp_stroke_options_get_property (GObjec switch (property_id) { - case PROP_STYLE: - g_value_set_enum (value, options->style); - break; case PROP_WIDTH: g_value_set_double (value, options->width); break; @@ -219,9 +201,6 @@ gimp_stroke_options_get_property (GObjec break; case PROP_MITER_LIMIT: g_value_set_double (value, options->miter_limit); - break; - case PROP_ANTIALIAS: - g_value_set_boolean (value, options->antialias); break; case PROP_DASH_OFFSET: g_value_set_double (value, options->dash_offset); Index: app/core/gimpstrokeoptions.h =================================================================== RCS file: /cvs/gnome/gimp/app/core/gimpstrokeoptions.h,v retrieving revision 1.9 diff -u -p -r1.9 gimpstrokeoptions.h --- app/core/gimpstrokeoptions.h 19 May 2005 15:17:30 -0000 1.9 +++ app/core/gimpstrokeoptions.h 8 Dec 2006 00:58:27 -0000 @@ -23,7 +23,7 @@ #define __GIMP_STROKE_OPTIONS_H__ -#include "gimpcontext.h" +#include "gimpfilloptions.h" #define GIMP_TYPE_STROKE_OPTIONS (gimp_stroke_options_get_type ()) @@ -38,9 +38,7 @@ typedef struct _GimpStrokeOptionsClass G struct _GimpStrokeOptions { - GimpContext parent_instance; - - GimpStrokeStyle style; + GimpFillOptions parent_instance; gdouble width; GimpUnit unit; @@ -50,15 +48,13 @@ struct _GimpStrokeOptions gdouble miter_limit; - gboolean antialias; - gdouble dash_offset; GArray *dash_info; }; struct _GimpStrokeOptionsClass { - GimpContextClass parent_class; + GimpFillOptionsClass parent_class; void (* dash_info_changed) (GimpStrokeOptions *stroke_options, GimpDashPreset preset); Index: app/dialogs/Makefile.am =================================================================== RCS file: /cvs/gnome/gimp/app/dialogs/Makefile.am,v retrieving revision 1.23 diff -u -p -r1.23 Makefile.am --- app/dialogs/Makefile.am 21 Oct 2006 18:46:37 -0000 1.23 +++ app/dialogs/Makefile.am 8 Dec 2006 00:58:27 -0000 @@ -82,6 +82,8 @@ libappdialogs_a_sources = \ tips-parser.h \ user-install-dialog.c \ user-install-dialog.h \ + vectorlayer-options-dialog.c \ + vectorlayer-options-dialog.h \ vectors-export-dialog.c \ vectors-export-dialog.h \ vectors-import-dialog.c \ Index: app/dialogs/stroke-dialog.c =================================================================== RCS file: /cvs/gnome/gimp/app/dialogs/stroke-dialog.c,v retrieving revision 1.41 diff -u -p -r1.41 stroke-dialog.c --- app/dialogs/stroke-dialog.c 9 Oct 2006 08:16:43 -0000 1.41 +++ app/dialogs/stroke-dialog.c 8 Dec 2006 00:58:28 -0000 @@ -299,7 +299,7 @@ stroke_dialog_response (GtkWidget *widg saved_desc, (GDestroyNotify) g_object_unref); - gimp_item_stroke (item, drawable, context, desc, FALSE); + gimp_item_stroke (item, drawable, context, desc, FALSE, TRUE); gimp_image_flush (image); } /* fallthrough */ Index: app/paint/gimppaintcore-stroke.c =================================================================== RCS file: /cvs/gnome/gimp/app/paint/gimppaintcore-stroke.c,v retrieving revision 1.31 diff -u -p -r1.31 gimppaintcore-stroke.c --- app/paint/gimppaintcore-stroke.c 26 Sep 2006 20:55:35 -0000 1.31 +++ app/paint/gimppaintcore-stroke.c 8 Dec 2006 00:58:28 -0000 @@ -42,7 +42,8 @@ gimp_paint_core_stroke (GimpPaintCore GimpDrawable *drawable, GimpPaintOptions *paint_options, GimpCoords *strokes, - gint n_strokes) + gint n_strokes, + gboolean push_undo) { g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); @@ -74,7 +75,7 @@ gimp_paint_core_stroke (GimpPaintCore gimp_paint_core_paint (core, drawable, paint_options, GIMP_PAINT_STATE_FINISH, 0); - gimp_paint_core_finish (core, drawable); + gimp_paint_core_finish (core, drawable, push_undo); gimp_paint_core_cleanup (core); @@ -91,7 +92,8 @@ gimp_paint_core_stroke_boundary (GimpPai const BoundSeg *bound_segs, gint n_bound_segs, gint offset_x, - gint offset_y) + gint offset_y, + gboolean push_undo) { GimpImage *image; BoundSeg *stroke_segs; @@ -195,7 +197,7 @@ gimp_paint_core_stroke_boundary (GimpPai if (initialized) { - gimp_paint_core_finish (core, drawable); + gimp_paint_core_finish (core, drawable, push_undo); gimp_paint_core_cleanup (core); } @@ -210,7 +212,8 @@ gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *paint_options, - GimpVectors *vectors) + GimpVectors *vectors, + gboolean push_undo) { GList *stroke; GArray *coords = NULL; @@ -280,7 +283,7 @@ gimp_paint_core_stroke_vectors (GimpPain if (initialized) { - gimp_paint_core_finish (core, drawable); + gimp_paint_core_finish (core, drawable, push_undo); gimp_paint_core_cleanup (core); } Index: app/paint/gimppaintcore-stroke.h =================================================================== RCS file: /cvs/gnome/gimp/app/paint/gimppaintcore-stroke.h,v retrieving revision 1.4 diff -u -p -r1.4 gimppaintcore-stroke.h --- app/paint/gimppaintcore-stroke.h 30 Aug 2003 13:22:20 -0000 1.4 +++ app/paint/gimppaintcore-stroke.h 8 Dec 2006 00:58:28 -0000 @@ -24,18 +24,21 @@ gboolean gimp_paint_core_stroke GimpDrawable *drawable, GimpPaintOptions *paint_options, GimpCoords *strokes, - gint n_strokes); + gint n_strokes, + gboolean push_undo); gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *paint_options, const BoundSeg *bound_segs, gint n_bound_segs, gint offset_x, - gint offset_y); + gint offset_y, + gboolean push_undo); gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core, GimpDrawable *drawable, GimpPaintOptions *paint_options, - GimpVectors *vectors); + GimpVectors *vectors, + gboolean push_undo); #endif /* __GIMP_PAINT_CORE_STROKE_H__ */ Index: app/paint/gimppaintcore.c =================================================================== RCS file: /cvs/gnome/gimp/app/paint/gimppaintcore.c,v retrieving revision 1.131 diff -u -p -r1.131 gimppaintcore.c --- app/paint/gimppaintcore.c 26 Sep 2006 20:55:35 -0000 1.131 +++ app/paint/gimppaintcore.c 8 Dec 2006 00:58:28 -0000 @@ -381,7 +381,8 @@ gimp_paint_core_start (GimpPaintCore void gimp_paint_core_finish (GimpPaintCore *core, - GimpDrawable *drawable) + GimpDrawable *drawable, + gboolean push_undo) { GimpImage *image; @@ -397,20 +398,24 @@ gimp_paint_core_finish (GimpPaintCore *c if ((core->x2 == core->x1) || (core->y2 == core->y1)) return; - gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, core->undo_desc); + if (push_undo) + { + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, + core->undo_desc); + + GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, image, NULL); + + gimp_drawable_push_undo (drawable, NULL, + core->x1, core->y1, + core->x2, core->y2, + core->undo_tiles, + TRUE); - GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, image, NULL); - - gimp_drawable_push_undo (drawable, NULL, - core->x1, core->y1, - core->x2, core->y2, - core->undo_tiles, - TRUE); + gimp_image_undo_group_end (image); + } tile_manager_unref (core->undo_tiles); core->undo_tiles = NULL; - - gimp_image_undo_group_end (image); if (core->saved_proj_tiles) { Index: app/paint/gimppaintcore.h =================================================================== RCS file: /cvs/gnome/gimp/app/paint/gimppaintcore.h,v retrieving revision 1.53 diff -u -p -r1.53 gimppaintcore.h --- app/paint/gimppaintcore.h 26 Sep 2006 20:55:35 -0000 1.53 +++ app/paint/gimppaintcore.h 8 Dec 2006 00:58:28 -0000 @@ -122,7 +122,8 @@ gboolean gimp_paint_core_start GimpCoords *coords, GError **error); void gimp_paint_core_finish (GimpPaintCore *core, - GimpDrawable *drawable); + GimpDrawable *drawable, + gboolean push_undo); void gimp_paint_core_cancel (GimpPaintCore *core, GimpDrawable *drawable); void gimp_paint_core_cleanup (GimpPaintCore *core); Index: app/pdb/edit_cmds.c =================================================================== RCS file: /cvs/gnome/gimp/app/pdb/edit_cmds.c,v retrieving revision 1.87 diff -u -p -r1.87 edit_cmds.c --- app/pdb/edit_cmds.c 31 Oct 2006 19:02:45 -0000 1.87 +++ app/pdb/edit_cmds.c 8 Dec 2006 00:58:28 -0000 @@ -675,7 +675,7 @@ edit_stroke_invoker (GimpProcedure * g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); } @@ -709,7 +709,7 @@ edit_stroke_vectors_invoker (GimpProcedu g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (vectors), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); } Index: app/pdb/paint_tools_cmds.c =================================================================== RCS file: /cvs/gnome/gimp/app/pdb/paint_tools_cmds.c,v retrieving revision 1.73 diff -u -p -r1.73 paint_tools_cmds.c --- app/pdb/paint_tools_cmds.c 31 Oct 2006 19:02:52 -0000 1.73 +++ app/pdb/paint_tools_cmds.c 8 Dec 2006 00:58:28 -0000 @@ -84,7 +84,7 @@ paint_tools_stroke (Gimp *gi } retval = gimp_paint_core_stroke (core, drawable, options, - coords, n_strokes); + coords, n_strokes, TRUE); g_free (coords); Index: app/pdb/paths_cmds.c =================================================================== RCS file: /cvs/gnome/gimp/app/pdb/paths_cmds.c,v retrieving revision 1.92 diff -u -p -r1.92 paths_cmds.c --- app/pdb/paths_cmds.c 23 Nov 2006 22:26:50 -0000 1.92 +++ app/pdb/paths_cmds.c 8 Dec 2006 00:58:28 -0000 @@ -323,7 +323,7 @@ path_stroke_current_invoker (GimpProcedu g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (vectors), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); } Index: app/tools/gimppainttool.c =================================================================== RCS file: /cvs/gnome/gimp/app/tools/gimppainttool.c,v retrieving revision 1.157 diff -u -p -r1.157 gimppainttool.c --- app/tools/gimppainttool.c 3 Dec 2006 19:23:50 -0000 1.157 +++ app/tools/gimppainttool.c 8 Dec 2006 00:58:28 -0000 @@ -410,7 +410,7 @@ gimp_paint_tool_button_release (GimpTool if (state & GDK_BUTTON3_MASK) gimp_paint_core_cancel (core, drawable); else - gimp_paint_core_finish (core, drawable); + gimp_paint_core_finish (core, drawable, TRUE); gimp_image_flush (display->image); Index: app/tools/gimpvectortool.c =================================================================== RCS file: /cvs/gnome/gimp/app/tools/gimpvectortool.c,v retrieving revision 1.140 diff -u -p -r1.140 gimpvectortool.c --- app/tools/gimpvectortool.c 22 Nov 2006 20:50:39 -0000 1.140 +++ app/tools/gimpvectortool.c 8 Dec 2006 00:58:29 -0000 @@ -641,6 +641,7 @@ gimp_vector_tool_motion (GimpTool GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (tool); GimpVectorOptions *options = GIMP_VECTOR_TOOL_GET_OPTIONS (tool); GimpAnchor *anchor; + GimpImage *image; if (vector_tool->function == VECTORS_FINISHED) return; @@ -734,6 +735,9 @@ gimp_vector_tool_motion (GimpTool vector_tool->last_y = coords->y; gimp_vectors_thaw (vector_tool->vectors); + + image = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); + gimp_image_flush (image); } static gboolean Index: app/vectors/Makefile.am =================================================================== RCS file: /cvs/gnome/gimp/app/vectors/Makefile.am,v retrieving revision 1.22 diff -u -p -r1.22 Makefile.am --- app/vectors/Makefile.am 26 Oct 2006 17:23:34 -0000 1.22 +++ app/vectors/Makefile.am 8 Dec 2006 00:58:29 -0000 @@ -26,6 +26,14 @@ libappvectors_a_SOURCES = \ gimpstroke.c \ gimpstroke-new.h \ gimpstroke-new.c \ + gimpvectorlayer.h \ + gimpvectorlayer.c \ + gimpvectorlayer-xcf.h \ + gimpvectorlayer-xcf.c \ + gimpvectorlayeroptions.h \ + gimpvectorlayeroptions.c \ + gimpvectorlayeroptions-parasite.h \ + gimpvectorlayeroptions-parasite.c \ gimpvectors.c \ gimpvectors.h \ gimpvectors-compat.c \ Index: app/vectors/gimpvectors.c =================================================================== RCS file: /cvs/gnome/gimp/app/vectors/gimpvectors.c,v retrieving revision 1.93 diff -u -p -r1.93 gimpvectors.c --- app/vectors/gimpvectors.c 15 May 2006 09:46:21 -0000 1.93 +++ app/vectors/gimpvectors.c 8 Dec 2006 00:58:29 -0000 @@ -108,7 +108,8 @@ static void gimp_vectors_transform GimpProgress *progress); static gboolean gimp_vectors_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc); + GimpStrokeDesc *stroke_desc, + gboolean push_undo); static void gimp_vectors_real_thaw (GimpVectors *vectors); static void gimp_vectors_real_stroke_add (GimpVectors *vectors, @@ -492,7 +493,8 @@ gimp_vectors_transform (GimpItem static gboolean gimp_vectors_stroke (GimpItem *item, GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc) + GimpStrokeDesc *stroke_desc, + gboolean push_undo) { GimpVectors *vectors = GIMP_VECTORS (item); gboolean retval = FALSE; @@ -506,7 +508,8 @@ gimp_vectors_stroke (GimpItem *ite case GIMP_STROKE_METHOD_LIBART: gimp_drawable_stroke_vectors (drawable, stroke_desc->stroke_options, - vectors); + vectors, + push_undo); retval = TRUE; break; @@ -518,7 +521,8 @@ gimp_vectors_stroke (GimpItem *ite retval = gimp_paint_core_stroke_vectors (core, drawable, stroke_desc->paint_options, - vectors); + vectors, + push_undo); g_object_unref (core); } Index: app/vectors/vectors-types.h =================================================================== RCS file: /cvs/gnome/gimp/app/vectors/vectors-types.h,v retrieving revision 1.9 diff -u -p -r1.9 vectors-types.h --- app/vectors/vectors-types.h 24 Oct 2006 14:23:09 -0000 1.9 +++ app/vectors/vectors-types.h 8 Dec 2006 00:58:29 -0000 @@ -32,5 +32,8 @@ typedef struct _GimpVectors GimpVec typedef struct _GimpStroke GimpStroke; typedef struct _GimpBezierStroke GimpBezierStroke; +typedef struct _GimpVectorLayer GimpVectorLayer; +typedef struct _GimpVectorLayerOptions GimpVectorLayerOptions; + #endif /* __VECTORS_TYPES_H__ */ Index: app/xcf/xcf-load.c =================================================================== RCS file: /cvs/gnome/gimp/app/xcf/xcf-load.c,v retrieving revision 1.82 diff -u -p -r1.82 xcf-load.c --- app/xcf/xcf-load.c 22 Nov 2006 10:19:53 -0000 1.82 +++ app/xcf/xcf-load.c 8 Dec 2006 00:58:29 -0000 @@ -59,6 +59,8 @@ #include "vectors/gimpbezierstroke.h" #include "vectors/gimpvectors.h" #include "vectors/gimpvectors-compat.h" +#include "vectors/gimpvectorlayer.h" +#include "vectors/gimpvectorlayer-xcf.h" #include "xcf-private.h" #include "xcf-load.h" @@ -952,7 +954,7 @@ xcf_load_layer (XcfInfo *info, xcf_progress_update (info); - /* call the evil text layer hack that might change our layer pointer */ + /* call the evil text and vector layer hacks that might change our layer pointer */ active = (info->active_layer == layer); floating = (info->floating_sel == layer); @@ -961,6 +963,13 @@ xcf_load_layer (XcfInfo *info, gimp_text_layer_set_xcf_flags (GIMP_TEXT_LAYER (layer), text_layer_flags); + if (active) + info->active_layer = layer; + if (floating) + info->floating_sel = layer; + } + else if (gimp_vector_layer_xcf_load_hack (&layer)) + { if (active) info->active_layer = layer; if (floating) Index: app/xcf/xcf-save.c =================================================================== RCS file: /cvs/gnome/gimp/app/xcf/xcf-save.c,v retrieving revision 1.60 diff -u -p -r1.60 xcf-save.c --- app/xcf/xcf-save.c 6 Nov 2006 08:14:45 -0000 1.60 +++ app/xcf/xcf-save.c 8 Dec 2006 00:58:30 -0000 @@ -57,6 +57,8 @@ #include "vectors/gimpbezierstroke.h" #include "vectors/gimpvectors.h" #include "vectors/gimpvectors-compat.h" +#include "vectors/gimpvectorlayer.h" +#include "vectors/gimpvectorlayer-xcf.h" #include "xcf-private.h" #include "xcf-read.h" @@ -578,6 +580,12 @@ xcf_save_layer_props (XcfInfo *info, xcf_check_error (xcf_save_prop (info, image, PROP_TEXT_LAYER_FLAGS, error, flags)); + } + else if (GIMP_IS_VECTOR_LAYER (layer) && GIMP_VECTOR_LAYER (layer)->options) + { + GimpVectorLayer *vector_layer = GIMP_VECTOR_LAYER (layer); + + gimp_vector_layer_xcf_save_prepare (vector_layer); } if (gimp_parasite_list_length (GIMP_ITEM (layer)->parasites) > 0) Index: menus/image-menu.xml.in =================================================================== RCS file: /cvs/gnome/gimp/menus/image-menu.xml.in,v retrieving revision 1.86 diff -u -p -r1.86 image-menu.xml.in --- menus/image-menu.xml.in 5 Nov 2006 11:35:57 -0000 1.86 +++ menus/image-menu.xml.in 8 Dec 2006 00:58:30 -0000 @@ -338,10 +338,14 @@ - - - + + + + + + + Index: menus/layers-menu.xml =================================================================== RCS file: /cvs/gnome/gimp/menus/layers-menu.xml,v retrieving revision 1.8 diff -u -p -r1.8 layers-menu.xml --- menus/layers-menu.xml 16 Jun 2006 17:02:14 -0000 1.8 +++ menus/layers-menu.xml 8 Dec 2006 00:58:30 -0000 @@ -4,6 +4,7 @@ + @@ -22,6 +23,9 @@ + + + Index: menus/vectors-menu.xml =================================================================== RCS file: /cvs/gnome/gimp/menus/vectors-menu.xml,v retrieving revision 1.5 diff -u -p -r1.5 vectors-menu.xml --- menus/vectors-menu.xml 16 Jun 2006 17:02:14 -0000 1.5 +++ menus/vectors-menu.xml 8 Dec 2006 00:58:30 -0000 @@ -13,6 +13,7 @@ + Index: tools/pdbgen/pdb/edit.pdb =================================================================== RCS file: /cvs/gnome/gimp/tools/pdbgen/pdb/edit.pdb,v retrieving revision 1.57 diff -u -p -r1.57 edit.pdb --- tools/pdbgen/pdb/edit.pdb 25 Oct 2006 22:43:20 -0000 1.57 +++ tools/pdbgen/pdb/edit.pdb 8 Dec 2006 00:58:30 -0000 @@ -793,7 +793,7 @@ HELP g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); } @@ -832,7 +832,7 @@ HELP g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (vectors), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); } Index: tools/pdbgen/pdb/paint_tools.pdb =================================================================== RCS file: /cvs/gnome/gimp/tools/pdbgen/pdb/paint_tools.pdb,v retrieving revision 1.93 diff -u -p -r1.93 paint_tools.pdb --- tools/pdbgen/pdb/paint_tools.pdb 13 Sep 2006 17:56:40 -0000 1.93 +++ tools/pdbgen/pdb/paint_tools.pdb 8 Dec 2006 00:58:30 -0000 @@ -945,7 +945,7 @@ paint_tools_stroke (Gimp *gi } retval = gimp_paint_core_stroke (core, drawable, options, - coords, n_strokes); + coords, n_strokes, TRUE); g_free (coords); Index: tools/pdbgen/pdb/paths.pdb =================================================================== RCS file: /cvs/gnome/gimp/tools/pdbgen/pdb/paths.pdb,v retrieving revision 1.68 diff -u -p -r1.68 paths.pdb --- tools/pdbgen/pdb/paths.pdb 23 Nov 2006 22:26:55 -0000 1.68 +++ tools/pdbgen/pdb/paths.pdb 8 Dec 2006 00:58:30 -0000 @@ -273,7 +273,7 @@ sub path_stroke_current { g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (vectors), - drawable, context, desc, TRUE); + drawable, context, desc, TRUE, TRUE); g_object_unref (desc); }