Commit 7a6a8d9d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Moved the undo step implementations to the core and pass around lots of

2003-02-14  Michael Natterer  <mitch@gimp.org>

	Moved the undo step implementations to the core and pass around
	lots of "const gchar *undo_desc". Fixes bug #104367.

	* app/Makefile.am
	* app/undo.[ch]: removed...

	* app/core/Makefile.am
	* app/core/gimpimage-undo-push.[ch]: ...and added here.

	* app/paint/Makefile.am
	* app/tools/Makefile.am
	* app/paint/gimppaintcore-undo.[ch]
	* app/tools/gimptransformtool-undo.[ch]: new files for the
	paint and transform undos.

	* app/core/gimppaintinfo.[ch]: added a blurb.

	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore.c
	* app/paint/gimppencil.c
	* app/paint/gimpsmudge.c
	* app/paint/paint-types.h
	* app/paint/paint.c: pass the blurb when registering the core.

	* app/core/gimpdrawable.[ch]
	* app/core/gimpimage.[ch]
	* app/core/gimpimage-mask-select.[ch]
	* app/core/gimpimage-mask.[ch]
	* app/core/gimpimagemap.[ch]
	* app/core/gimplayer-floating-sel.[ch]: added "undo_desc" parameters
	to all undo pushing helper functions.

	* app/undo_history.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-desaturate.c
	* app/core/gimpdrawable-equalize.c
	* app/core/gimpdrawable-invert.c
	* app/core/gimpdrawable-offset.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpedit.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-guides.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-qmask.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage-undo.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/display/gimpdisplayshell-dnd.c
	* app/file/file-open.c
	* app/file/file-save.c
	* app/gui/channels-commands.c
	* app/gui/file-commands.c
	* app/gui/file-open-dialog.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/paths-dialog.c
	* app/gui/select-commands.c
	* app/gui/vectors-commands.c
	* app/text/gimptext-compat.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimprectselecttool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.c
	* app/widgets/gimpchannellistview.c
	* app/widgets/gimpdrawablelistview.c
	* app/widgets/gimpselectioneditor.c
	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/guides.pdb
	* tools/pdbgen/pdb/layer.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/selection_tools.pdb: changed accordingly: pass
	"undo_desc" strings, changed includes or simply removed inclusion
	of "undo.h". Some random cleanups.

	* tools/pdbgen/pdb/guides.pdb: cleaned up a lot. Fixed
	gimp_image_find_next_guide() to not return guides with
	position < 0 (and made it shorter and readable).

	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/guides_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/selection_cmds.c
	* app/pdb/selection_tools_cmds.c: regenerated.
parent ebd0d76c
2003-02-14 Michael Natterer <mitch@gimp.org>
Moved the undo step implementations to the core and pass around
lots of "const gchar *undo_desc". Fixes bug #104367.
* app/Makefile.am
* app/undo.[ch]: removed...
* app/core/Makefile.am
* app/core/gimpimage-undo-push.[ch]: ...and added here.
* app/paint/Makefile.am
* app/tools/Makefile.am
* app/paint/gimppaintcore-undo.[ch]
* app/tools/gimptransformtool-undo.[ch]: new files for the
paint and transform undos.
* app/core/gimppaintinfo.[ch]: added a blurb.
* app/paint/gimpairbrush.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimppaintbrush.c
* app/paint/gimppaintcore.c
* app/paint/gimppencil.c
* app/paint/gimpsmudge.c
* app/paint/paint-types.h
* app/paint/paint.c: pass the blurb when registering the core.
* app/core/gimpdrawable.[ch]
* app/core/gimpimage.[ch]
* app/core/gimpimage-mask-select.[ch]
* app/core/gimpimage-mask.[ch]
* app/core/gimpimagemap.[ch]
* app/core/gimplayer-floating-sel.[ch]: added "undo_desc" parameters
to all undo pushing helper functions.
* app/undo_history.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-desaturate.c
* app/core/gimpdrawable-equalize.c
* app/core/gimpdrawable-invert.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable-transform.c
* app/core/gimpedit.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-guides.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-qmask.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-scale.c
* app/core/gimpimage-undo.c
* app/core/gimpitem.c
* app/core/gimplayer.c
* app/core/gimplayermask.c
* app/display/gimpdisplayshell-dnd.c
* app/file/file-open.c
* app/file/file-save.c
* app/gui/channels-commands.c
* app/gui/file-commands.c
* app/gui/file-open-dialog.c
* app/gui/image-commands.c
* app/gui/layers-commands.c
* app/gui/paths-dialog.c
* app/gui/select-commands.c
* app/gui/vectors-commands.c
* app/text/gimptext-compat.c
* app/tools/gimpbezierselecttool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimpimagemaptool.c
* app/tools/gimpinktool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c
* app/tools/gimprectselecttool.c
* app/tools/gimptexttool.c
* app/tools/gimptransformtool.c
* app/widgets/gimpchannellistview.c
* app/widgets/gimpdrawablelistview.c
* app/widgets/gimpselectioneditor.c
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/layer.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/selection_tools.pdb: changed accordingly: pass
"undo_desc" strings, changed includes or simply removed inclusion
of "undo.h". Some random cleanups.
* tools/pdbgen/pdb/guides.pdb: cleaned up a lot. Fixed
gimp_image_find_next_guide() to not return guides with
position < 0 (and made it shorter and readable).
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/guides_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/selection_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
2003-02-14 Sven Neumann <sven@gimp.org>
* app/core/gimplayermask.c (gimp_layer_mask_duplicate): return the
......
......@@ -51,9 +51,7 @@ bye_sources = \
path.c \
path.h \
pathP.h \
path_transform.h \
undo.c \
undo.h
path_transform.h
##
## stuff
......
......@@ -33,6 +33,7 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimpimage-mask-select.h"
#include "widgets/gimpcolorpanel.h"
......@@ -43,8 +44,6 @@
#include "channels-commands.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -150,6 +149,7 @@ channels_channel_to_sel (GtkWidget *widget,
return_if_no_channel (gimage, active_channel, data);
gimp_image_mask_select_channel (gimage,
_("Channel to Selection"),
active_channel,
0, 0,
op,
......@@ -425,7 +425,9 @@ edit_channel_query_ok_callback (GtkWidget *widget,
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (channel))))
{
undo_push_item_rename (options->gimage, GIMP_ITEM (channel));
gimp_image_undo_push_item_rename (options->gimage,
_("Rename Channel"),
GIMP_ITEM (channel));
gimp_object_set_name (GIMP_OBJECT (channel), new_name);
}
......
......@@ -47,8 +47,6 @@
#include "file-save-dialog.h"
#include "menus.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......
......@@ -45,8 +45,6 @@
#include "image-commands.h"
#include "resize-dialog.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......
......@@ -34,6 +34,7 @@
#include "core/gimpimage-mask.h"
#include "core/gimpimage-merge.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimplayer.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimplayermask.h"
......@@ -50,8 +51,6 @@
#include "layers-commands.h"
#include "resize-dialog.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -768,7 +767,9 @@ edit_layer_query_ok_callback (GtkWidget *widget,
floating_sel_to_layer (layer);
}
undo_push_item_rename (options->gimage, GIMP_ITEM (layer));
gimp_image_undo_push_item_rename (options->gimage,
_("Rename Layer"),
GIMP_ITEM (layer));
gimp_object_set_name (GIMP_OBJECT (layer), new_name);
......
......@@ -116,7 +116,7 @@ select_none_cmd_callback (GtkWidget *widget,
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, NULL);
gimp_image_flush (gimage);
}
......
......@@ -32,6 +32,7 @@
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimplist.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
......@@ -52,8 +53,6 @@
#include "vectors-commands.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -533,7 +532,9 @@ edit_vectors_query_ok_callback (GtkWidget *widget,
if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors))))
{
undo_push_item_rename (options->gimage, GIMP_ITEM (vectors));
gimp_image_undo_push_item_rename (options->gimage,
_("Rename Path"),
GIMP_ITEM (vectors));
gimp_object_set_name (GIMP_OBJECT (vectors), new_name);
}
......
......@@ -115,6 +115,8 @@ libappcore_a_sources = \
gimpimage-scale.h \
gimpimage-undo.c \
gimpimage-undo.h \
gimpimage-undo-push.c \
gimpimage-undo-push.h \
gimpimagefile.c \
gimpimagefile.h \
gimpimagemap.c \
......
......@@ -42,8 +42,6 @@
#include "gimplayer-floating-sel.h"
#include "gimplist.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -222,7 +220,7 @@ gimp_edit_paste (GimpImage *gimage,
* it seems like the correct behavior.
*/
if (! gimp_image_mask_is_empty (gimage) && ! paste_into)
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, NULL);
/* if there's a drawable, add a new floating selection */
if (drawable != NULL)
......@@ -314,7 +312,8 @@ gimp_edit_clear (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
gimp_image_apply_image (gimage, drawable, &bufPR,
TRUE, _("Clear"),
GIMP_OPACITY_OPAQUE, GIMP_ERASE_MODE,
NULL, x1, y1);
......@@ -389,7 +388,8 @@ gimp_edit_fill (GimpImage *gimage,
color_region (&bufPR, col);
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
gimp_image_apply_image (gimage, drawable, &bufPR,
TRUE, _("Fill"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE,
NULL, x1, y1);
......
......@@ -39,11 +39,10 @@
#include "gimpimage.h"
#include "gimpimage-mask.h"
#include "gimpimage-undo.h"
#include "gimpimage-undo-push.h"
#include "gimplayer.h"
#include "gimplayer-floating-sel.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -802,9 +801,11 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
/* Push an undo */
if (layer)
undo_push_layer_mod (gimage, layer);
gimp_image_undo_push_layer_mod (gimage, _("Transform Layer"),
layer);
else if (channel)
undo_push_channel_mod (gimage, channel);
gimp_image_undo_push_channel_mod (gimage, _("Transform Channel"),
channel);
/* set the current layer's data */
drawable->tiles = tiles;
......
......@@ -39,12 +39,11 @@
#include "paint-funcs/paint-funcs.h"
#include "gimpimage.h"
#include "gimpimage-undo-push.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimpparasitelist.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -59,7 +58,8 @@ static GimpItem * gimp_channel_duplicate (GimpItem *item,
GType new_type,
gboolean add_alpha);
static void gimp_channel_push_undo (GimpChannel *mask);
static void gimp_channel_push_undo (GimpChannel *mask,
const gchar *undo_desc);
static void gimp_channel_validate (TileManager *tm,
Tile *tile);
......@@ -212,7 +212,8 @@ gimp_channel_duplicate (GimpItem *item,
}
static void
gimp_channel_push_undo (GimpChannel *mask)
gimp_channel_push_undo (GimpChannel *mask,
const gchar *undo_desc)
{
GimpImage *gimage;
......@@ -220,7 +221,7 @@ gimp_channel_push_undo (GimpChannel *mask)
g_return_if_fail (gimage != NULL);
undo_push_mask (gimage, mask);
gimp_image_undo_push_mask (gimage, undo_desc, mask);
mask->boundary_known = FALSE;
......@@ -382,7 +383,9 @@ gimp_channel_scale (GimpChannel *channel,
scale_region (&srcPR, &destPR, interpolation_type);
/* Push the channel on the undo stack */
undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)), channel);
gimp_image_undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)),
_("Scale Channel"),
channel);
/* Configure the new channel */
GIMP_DRAWABLE (channel)->tiles = new_tiles;
......@@ -488,7 +491,9 @@ gimp_channel_resize (GimpChannel *channel,
copy_region (&srcPR, &destPR);
/* Push the channel on the undo stack */
undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)), channel);
gimp_image_undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)),
_("Resize Channel"),
channel);
/* Configure the new channel */
GIMP_DRAWABLE (channel)->tiles = new_tiles;
......@@ -1293,7 +1298,7 @@ gimp_channel_feather (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Feather Channel"));
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
......@@ -1315,7 +1320,7 @@ gimp_channel_sharpen (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Sharpen Channel"));
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
......@@ -1340,7 +1345,7 @@ gimp_channel_clear (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Clear Channel"));
if (mask->bounds_known && !mask->empty)
{
......@@ -1378,7 +1383,7 @@ gimp_channel_all (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Fill Channel"));
/* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
......@@ -1403,7 +1408,7 @@ gimp_channel_invert (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Invert Channel"));
if (mask->bounds_known && mask->empty)
{
......@@ -1469,7 +1474,7 @@ gimp_channel_border (GimpChannel *mask,
y2 += radius_y;
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Border Channel"));
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1,
(x2-x1), (y2-y1), TRUE);
......@@ -1526,7 +1531,7 @@ gimp_channel_grow (GimpChannel *mask,
y2 = GIMP_DRAWABLE (mask)->height;
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Grow Channel"));
/* need full extents for grow, not! */
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
......@@ -1577,7 +1582,7 @@ gimp_channel_shrink (GimpChannel *mask,
y2++;
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Shrink Channel"));
pixel_region_init (&bPR, GIMP_DRAWABLE (mask)->tiles, x1, y1, (x2 - x1),
(y2 - y1), TRUE);
......@@ -1602,7 +1607,7 @@ gimp_channel_translate (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Translate Channel"));
gimp_channel_bounds (mask, &x1, &y1, &x2, &y2);
x1 = CLAMP ((x1 + off_x), 0, GIMP_DRAWABLE (mask)->width);
......@@ -1678,7 +1683,7 @@ gimp_channel_load (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (channel));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Channel Load"));
/* copy the channel to the mask */
pixel_region_init (&srcPR, GIMP_DRAWABLE (channel)->tiles,
......@@ -1707,7 +1712,7 @@ gimp_channel_layer_alpha (GimpChannel *mask,
g_return_if_fail (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Channel from Alpha"));
/* clear the mask if it is not already known to be empty */
if (! (mask->bounds_known && mask->empty))
......@@ -1744,7 +1749,7 @@ gimp_channel_layer_mask (GimpChannel *mask,
g_return_if_fail (gimp_layer_get_mask (layer));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Channel from Mask"));
/* clear the mask if it is not already known to be empty */
if (! (mask->bounds_known && mask->empty))
......
......@@ -32,6 +32,8 @@
#include "vectors/gimpstroke.h"
#include "vectors/gimpvectors.h"
#include "libgimp/gimpintl.h"
void
gimp_image_mask_select_rectangle (GimpImage *gimage,
......@@ -48,9 +50,9 @@ gimp_image_mask_select_rectangle (GimpImage *gimage,
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, _("Rectangular Selection"));
else
gimp_image_mask_push_undo (gimage);
gimp_image_mask_push_undo (gimage, _("Rectangular Selection"));
/* if feathering for rect, make a new mask with the
* rectangle and feather that with the old mask
......@@ -95,9 +97,9 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, _("Ellipse Selection"));
else
gimp_image_mask_push_undo (gimage);
gimp_image_mask_push_undo (gimage, _("Ellipse Selection"));
/* if feathering for rect, make a new mask with the
* rectangle and feather that with the old mask
......@@ -129,14 +131,15 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
}
void
gimp_image_mask_select_polygon (GimpImage *gimage,
gint n_points,
GimpVector2 *points,
GimpChannelOps op,
gboolean antialias,
gboolean feather,
gdouble feather_radius_x,
gdouble feather_radius_y)
gimp_image_mask_select_polygon (GimpImage *gimage,
const gchar *undo_name,
gint n_points,
GimpVector2 *points,
GimpChannelOps op,
gboolean antialias,
gboolean feather,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpScanConvert *scan_convert;
GimpChannel *mask;
......@@ -147,9 +150,9 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
* or insure that a floating selection is anchored down...
*/
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, undo_name);
else
gimp_image_mask_push_undo (gimage);
gimp_image_mask_push_undo (gimage, undo_name);
#define SUPERSAMPLE 3
......@@ -219,6 +222,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
}
gimp_image_mask_select_polygon (GIMP_ITEM (vectors)->gimage,
_("Selection from Path"),
coords->len,
points,
op,
......@@ -234,6 +238,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
void
gimp_image_mask_select_channel (GimpImage *gimage,
const gchar *undo_desc,
GimpChannel *channel,
gint offset_x,
gint offset_y,
......@@ -247,9 +252,9 @@ gimp_image_mask_select_channel (GimpImage *gimage,
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage);
gimp_image_mask_clear (gimage, undo_desc);
else
gimp_image_mask_push_undo (gimage);
gimp_image_mask_push_undo (gimage, undo_desc);
if (feather)
gimp_channel_feather (channel,
......@@ -302,6 +307,7 @@ gimp_image_mask_select_fuzzy (GimpImage *gimage,
}
gimp_image_mask_select_channel (gimage,
_("Select Fuzzy"),
mask,
mask_x,
mask_y,
......@@ -352,6 +358,7 @@ gimp_image_mask_select_by_color (GimpImage *gimage,
}
gimp_image_mask_select_channel (gimage,
_("Select by Color"),
mask,
mask_x,
mask_y,
......
......@@ -42,6 +42,7 @@ void gimp_image_mask_select_ellipse (GimpImage *gimage,
gdouble feather_radius_y);
void gimp_image_mask_select_polygon (GimpImage *gimage,
const gchar *undo_desc,
gint n_points,
GimpVector2 *points,
GimpChannelOps op,
......@@ -59,6 +60,7 @@ void gimp_image_mask_select_vectors (GimpImage *gimage,
gdouble feather_radius_y);
void gimp_image_mask_select_channel (GimpImage *gimage,
const gchar *undo_desc,
GimpChannel *channel,
gint offset_x,
gint offset_y,
......
......@@ -39,12 +39,11 @@
#include "paint-funcs/paint-funcs.h"
#include "gimpimage.h"
#include "gimpimage-undo-push.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimpparasitelist.h"
#include "undo.h"
#include "libgimp/gimpintl.h"
......@@ -59,7 +58,8 @@ static GimpItem * gimp_channel_duplicate (GimpItem *item,
GType new_type,
gboolean add_alpha);
static void gimp_channel_push_undo (GimpChannel *mask);
static void gimp_channel_push_undo (GimpChannel *mask,
const gchar *undo_desc);
static void gimp_channel_validate (TileManager *tm,
Tile *tile);
......@@ -212,7 +212,8 @@ gimp_channel_duplicate (GimpItem *item,
}
static void
gimp_channel_push_undo (GimpChannel *mask)
gimp_channel_push_undo (GimpChannel *mask,
const gchar *undo_desc)
{
GimpImage *gimage;
......@@ -220,7 +221,7 @@ gimp_channel_push_undo (GimpChannel *mask)
g_return_if_fail (gimage != NULL);
undo_push_mask (gimage, mask);
gimp_image_undo_push_mask (gimage, undo_desc, mask);
mask->boundary_known = FALSE;
......@@ -382,7 +383,9 @@ gimp_channel_scale (GimpChannel *channel,
scale_region (&srcPR, &destPR, interpolation_type);
/* Push the channel on the undo stack */
undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)), channel);
gimp_image_undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)),
_("Scale Channel"),
channel);
/* Configure the new channel */
GIMP_DRAWABLE (channel)->tiles = new_tiles;
......@@ -488,7 +491,9 @@ gimp_channel_resize (GimpChannel *channel,
copy_region (&srcPR, &destPR);
/* Push the channel on the undo stack */
undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)), channel);
gimp_image_undo_push_channel_mod (gimp_item_get_image (GIMP_ITEM (channel)),
_("Resize Channel"),
channel);
/* Configure the new channel */
GIMP_DRAWABLE (channel)->tiles = new_tiles;
......@@ -1293,7 +1298,7 @@ gimp_channel_feather (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Feather Channel"));
pixel_region_init (&srcPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
......@@ -1315,7 +1320,7 @@ gimp_channel_sharpen (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Sharpen Channel"));
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
......@@ -1340,7 +1345,7 @@ gimp_channel_clear (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Clear Channel"));
if (mask->bounds_known && !mask->empty)
{
......@@ -1378,7 +1383,7 @@ gimp_channel_all (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Fill Channel"));
/* clear the mask */
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
......@@ -1403,7 +1408,7 @@ gimp_channel_invert (GimpChannel *mask,
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (push_undo)
gimp_channel_push_undo (mask);
gimp_channel_push_undo (mask, _("Invert Channel"));