Commit 39af762f authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

More merging from SOC 2006's vector layer branch:

2008-10-25  Michael Natterer  <mitch@gimp.org>

	More merging from SOC 2006's vector layer branch:

	* app/core/gimpitem.[ch]: add "gboolean push_undo" to
	GimpItem::stroke().

	* app/core/gimpdrawable-stroke.[ch]
	* app/paint/gimppaintcore-stroke.[ch]
	* app/paint/gimppaintcore.[ch] (gimp_paint_core_finish): add
	"push_undo" parameters here too.

	* app/actions/select-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpchannel.c
	* app/core/gimpselection.c
	* app/dialogs/stroke-dialog.c
	* app/tools/gimppainttool.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/paint_tools.pdb
	* tools/pdbgen/pdb/paths.pdb: pass TRUE all over the place.

	* app/pdb/edit-cmds.c
	* app/pdb/paint-tools-cmds.c
	* app/pdb/paths-cmds.c: regenerated.


svn path=/trunk/; revision=27398
parent 85bbc9e3
2008-10-25 Michael Natterer <mitch@gimp.org>
More merging from SOC 2006's vector layer branch:
* app/core/gimpitem.[ch]: add "gboolean push_undo" to
GimpItem::stroke().
* app/core/gimpdrawable-stroke.[ch]
* app/paint/gimppaintcore-stroke.[ch]
* app/paint/gimppaintcore.[ch] (gimp_paint_core_finish): add
"push_undo" parameters here too.
* app/actions/select-commands.c
* app/actions/vectors-commands.c
* app/core/gimpchannel.c
* app/core/gimpselection.c
* app/dialogs/stroke-dialog.c
* app/tools/gimppainttool.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paint_tools.pdb
* tools/pdbgen/pdb/paths.pdb: pass TRUE all over the place.
* app/pdb/edit-cmds.c
* app/pdb/paint-tools-cmds.c
* app/pdb/paths-cmds.c: regenerated.
2008-10-25 Martin Nordholts <martinn@svn.gnome.org>
* app/gegl/gimpoperationlayermode.c: Make layer modes work on
......
......@@ -372,7 +372,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
options = gimp_stroke_options_new (image->gimp, context, TRUE);
if (! gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, options, FALSE, NULL, &error))
drawable, context, options, FALSE, TRUE, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
error->message);
......
......@@ -423,7 +423,7 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
options = gimp_stroke_options_new (image->gimp, context, TRUE);
if (! gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, options, FALSE,
NULL, &error))
TRUE, NULL, &error))
{
gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING,
error->message);
......
......@@ -126,6 +126,7 @@ static void gimp_channel_transform (GimpItem *item,
static gboolean gimp_channel_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error);
......@@ -699,9 +700,9 @@ static gboolean
gimp_channel_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error)
{
GimpChannel *channel = GIMP_CHANNEL (item);
const BoundSeg *segs_in;
......@@ -728,7 +729,8 @@ gimp_channel_stroke (GimpItem *item,
gimp_drawable_stroke_boundary (drawable,
stroke_options,
segs_in, n_segs_in,
offset_x, offset_y);
offset_x, offset_y,
push_undo);
retval = TRUE;
break;
......@@ -746,7 +748,7 @@ gimp_channel_stroke (GimpItem *item,
stroke_options->emulate_dynamics,
segs_in, n_segs_in,
offset_x, offset_y,
error);
push_undo, error);
g_object_unref (core);
}
......
......@@ -55,7 +55,9 @@
static void gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpScanConvert *scan_convert);
GimpScanConvert *scan_convert,
gboolean push_undo);
/* public functions */
......@@ -66,7 +68,8 @@ gimp_drawable_stroke_boundary (GimpDrawable *drawable,
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;
......@@ -135,7 +138,8 @@ gimp_drawable_stroke_boundary (GimpDrawable *drawable,
g_free (points);
g_free (stroke_segs);
gimp_drawable_stroke_scan_convert (drawable, options, scan_convert);
gimp_drawable_stroke_scan_convert (drawable, options, scan_convert,
push_undo);
gimp_scan_convert_free (scan_convert);
}
......@@ -143,7 +147,9 @@ gimp_drawable_stroke_boundary (GimpDrawable *drawable,
void
gimp_drawable_stroke_vectors (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpVectors *vectors)
GimpVectors *vectors,
gboolean push_undo)
{
GimpScanConvert *scan_convert;
GimpStroke *stroke;
......@@ -194,7 +200,8 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
}
if (num_coords > 0)
gimp_drawable_stroke_scan_convert (drawable, options, scan_convert);
gimp_drawable_stroke_scan_convert (drawable, options, scan_convert,
push_undo);
gimp_scan_convert_free (scan_convert);
}
......@@ -205,7 +212,8 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
static void
gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpScanConvert *scan_convert)
GimpScanConvert *scan_convert,
gboolean push_undo)
{
GimpContext *context = GIMP_CONTEXT (options);
GimpImage *image;
......@@ -321,7 +329,7 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable,
/* 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);
......
......@@ -28,11 +28,13 @@ void gimp_drawable_stroke_boundary (GimpDrawable *drawable,
const BoundSeg *bound_segs,
gint n_bound_segs,
gint offset_x,
gint offset_y);
gint offset_y,
gboolean push_undo);
void gimp_drawable_stroke_vectors (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpVectors *vectors);
GimpVectors *vectors,
gboolean push_undo);
#endif /* __GIMP_DRAWABLE_STROKE_H__ */
......@@ -1009,6 +1009,7 @@ gimp_item_stroke (GimpItem *item,
GimpContext *context,
GimpStrokeOptions *stroke_options,
gboolean use_default_values,
gboolean push_undo,
GimpProgress *progress,
GError **error)
{
......@@ -1032,13 +1033,15 @@ gimp_item_stroke (GimpItem *item,
gimp_stroke_options_prepare (stroke_options, context, use_default_values);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
item_class->stroke_desc);
if (push_undo)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
item_class->stroke_desc);
retval = item_class->stroke (item, drawable, stroke_options, progress,
error);
retval = item_class->stroke (item, drawable, stroke_options, push_undo,
progress, error);
gimp_image_undo_group_end (image);
if (push_undo)
gimp_image_undo_group_end (image);
gimp_stroke_options_finish (stroke_options);
}
......
......@@ -111,6 +111,7 @@ struct _GimpItemClass
gboolean (* stroke) (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error);
......@@ -215,6 +216,7 @@ gboolean gimp_item_stroke (GimpItem *item,
GimpContext *context,
GimpStrokeOptions *stroke_options,
gboolean use_default_values,
gboolean push_undo,
GimpProgress *progress,
GError **error);
......
......@@ -76,6 +76,7 @@ static void gimp_selection_rotate (GimpItem *item,
static gboolean gimp_selection_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error);
static void gimp_selection_invalidate_boundary (GimpDrawable *drawable);
......@@ -256,6 +257,7 @@ static gboolean
gimp_selection_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error)
{
......@@ -280,7 +282,7 @@ gimp_selection_stroke (GimpItem *item,
retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable,
stroke_options,
progress, error);
push_undo, progress, error);
selection->stroking = FALSE;
......
......@@ -315,8 +315,8 @@ stroke_dialog_response (GtkWidget *widget,
saved_options,
(GDestroyNotify) g_object_unref);
if (! gimp_item_stroke (item, drawable, context, options, FALSE, NULL,
&error))
if (! gimp_item_stroke (item, drawable, context, options, FALSE, TRUE,
NULL, &error))
{
gimp_message (context->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING,
......
......@@ -46,6 +46,7 @@ gimp_paint_core_stroke (GimpPaintCore *core,
GimpPaintOptions *paint_options,
GimpCoords *strokes,
gint n_strokes,
gboolean push_undo,
GError **error)
{
g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE);
......@@ -80,7 +81,7 @@ gimp_paint_core_stroke (GimpPaintCore *core,
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);
......@@ -99,6 +100,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
gint n_bound_segs,
gint offset_x,
gint offset_y,
gboolean push_undo,
GError **error)
{
GimpImage *image;
......@@ -212,7 +214,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
if (initialized)
{
gimp_paint_core_finish (core, drawable);
gimp_paint_core_finish (core, drawable, push_undo);
gimp_paint_core_cleanup (core);
}
......@@ -229,6 +231,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core,
GimpPaintOptions *paint_options,
gboolean emulate_dynamics,
GimpVectors *vectors,
gboolean push_undo,
GError **error)
{
GList *stroke;
......@@ -313,7 +316,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core,
if (initialized)
{
gimp_paint_core_finish (core, drawable);
gimp_paint_core_finish (core, drawable, push_undo);
gimp_paint_core_cleanup (core);
}
......
......@@ -25,6 +25,7 @@ gboolean gimp_paint_core_stroke (GimpPaintCore *core,
GimpPaintOptions *paint_options,
GimpCoords *strokes,
gint n_strokes,
gboolean push_undo,
GError **error);
gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core,
GimpDrawable *drawable,
......@@ -34,12 +35,14 @@ gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core,
gint n_bound_segs,
gint offset_x,
gint offset_y,
gboolean push_undo,
GError **error);
gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
gboolean emulate_dynamics,
GimpVectors *vectors,
gboolean push_undo,
GError **error);
......
......@@ -402,7 +402,8 @@ gimp_paint_core_start (GimpPaintCore *core,
void
gimp_paint_core_finish (GimpPaintCore *core,
GimpDrawable *drawable)
GimpDrawable *drawable,
gboolean push_undo)
{
GimpImage *image;
......@@ -418,21 +419,25 @@ gimp_paint_core_finish (GimpPaintCore *core,
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_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_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)
{
tile_manager_unref (core->saved_proj_tiles);
......
......@@ -122,7 +122,8 @@ gboolean gimp_paint_core_start (GimpPaintCore *core,
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);
......
......@@ -754,8 +754,8 @@ edit_stroke_invoker (GimpProcedure *procedure,
NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......@@ -794,8 +794,8 @@ edit_stroke_vectors_invoker (GimpProcedure *procedure,
NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......
......@@ -83,7 +83,7 @@ paint_tools_stroke (Gimp *gimp,
}
retval = gimp_paint_core_stroke (core, drawable, options,
coords, n_strokes,
coords, n_strokes, TRUE,
error);
g_free (coords);
......
......@@ -340,8 +340,8 @@ path_stroke_current_invoker (GimpProcedure *procedure,
NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......
......@@ -423,7 +423,7 @@ gimp_paint_tool_button_release (GimpTool *tool,
if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
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);
......
......@@ -108,6 +108,7 @@ static void gimp_vectors_transform (GimpItem *item,
static gboolean gimp_vectors_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error);
......@@ -495,6 +496,7 @@ static gboolean
gimp_vectors_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeOptions *stroke_options,
gboolean push_undo,
GimpProgress *progress,
GError **error)
{
......@@ -510,7 +512,7 @@ gimp_vectors_stroke (GimpItem *item,
case GIMP_STROKE_METHOD_LIBART:
gimp_drawable_stroke_vectors (drawable,
stroke_options,
vectors);
vectors, push_undo);
retval = TRUE;
break;
......@@ -526,7 +528,7 @@ gimp_vectors_stroke (GimpItem *item,
retval = gimp_paint_core_stroke_vectors (core, drawable,
stroke_options->paint_options,
stroke_options->emulate_dynamics,
vectors, error);
vectors, push_undo, error);
g_object_unref (core);
}
......
......@@ -840,8 +840,8 @@ HELP
NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......@@ -883,8 +883,8 @@ HELP
NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......
......@@ -928,7 +928,7 @@ paint_tools_stroke (Gimp *gimp,
}
retval = gimp_paint_core_stroke (core, drawable, options,
coords, n_strokes,
coords, n_strokes, TRUE,
error);
g_free (coords);
......
......@@ -275,8 +275,8 @@ sub path_stroke_current {
NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, options, TRUE, progress,
error);
drawable, context, options, TRUE, TRUE,
progress, error);
g_object_unref (options);
}
......@@ -287,7 +287,7 @@ CODE
);
}
sub path_get_point_at_dist {
sub path_get_point_at_dist {
&std_pdb_deprecated('gimp-vectors-stroke-get-point-at-dist');
@inargs = (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment