Commit 069489fb authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

GimpItem undo group cleanup in preparation of fixing bug #138356:

2004-04-13  Michael Natterer  <mitch@gimp.org>

	GimpItem undo group cleanup in preparation of fixing bug #138356:

	* app/core/core-enums.[c]: renamed LAYER_SCALE and LAYER_RESIZE
	undo groups to ITEM_SCALE and ITEM_RESIZE.

	* app/core/gimpitem.[ch]: always push undo groups around
	GimpItem::translate(), scale(), resize(), flip(), rotate() and
	transform(). Added the resp. undo_desc strings to GimpItemClass.

	* app/core/gimpchannel.[ch]
	* app/core/gimpdrawable.[ch]
	* app/core/gimplayer.c: removed all undo groups from
	implementations of the above methods. Removed the undo_desc
	strings which were moved to GimpItemClass.

	* app/core/gimpimage-crop.c
	* app/core/gimpselection.c
	* app/gui/layers-commands.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.
parent fd7f5005
2004-04-13 Michael Natterer <mitch@gimp.org>
GimpItem undo group cleanup in preparation of fixing bug #138356:
* app/core/core-enums.[c]: renamed LAYER_SCALE and LAYER_RESIZE
undo groups to ITEM_SCALE and ITEM_RESIZE.
* app/core/gimpitem.[ch]: always push undo groups around
GimpItem::translate(), scale(), resize(), flip(), rotate() and
transform(). Added the resp. undo_desc strings to GimpItemClass.
* app/core/gimpchannel.[ch]
* app/core/gimpdrawable.[ch]
* app/core/gimplayer.c: removed all undo groups from
implementations of the above methods. Removed the undo_desc
strings which were moved to GimpItemClass.
* app/core/gimpimage-crop.c
* app/core/gimpselection.c
* app/gui/layers-commands.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/layer.pdb: changed accordingly.
* app/pdb/layer_cmds.c: regenerated.
2004-04-12 Sven Neumann <sven@gimp.org>
* configure.in: cleaned up the check for Xmu. Include <gdk/gdkx.h>
......
......@@ -379,7 +379,7 @@ layers_crop_cmd_callback (GtkWidget *widget,
off_x -= x1;
off_y -= y1;
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Crop Layer"));
if (gimp_layer_is_floating_sel (active_layer))
......@@ -1183,7 +1183,7 @@ scale_layer_query_ok_callback (GtkWidget *widget,
if (gimp_layer_is_floating_sel (layer))
{
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_SCALE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_SCALE,
_("Scale Layer"));
floating_sel_relax (layer, TRUE);
......@@ -1282,7 +1282,7 @@ resize_layer_query_ok_callback (GtkWidget *widget,
{
if (gimp_layer_is_floating_sel (layer))
{
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Resize Layer"));
floating_sel_relax (layer, TRUE);
......
......@@ -594,12 +594,12 @@ static const GEnumValue gimp_undo_type_enum_values[] =
{ GIMP_UNDO_GROUP_DRAWABLE, N_("Drawable"), "group-drawable" },
{ GIMP_UNDO_GROUP_DRAWABLE_MOD, N_("Drawable Mod"), "group-drawable-mod" },
{ GIMP_UNDO_GROUP_MASK, N_("Selection Mask"), "group-mask" },
{ GIMP_UNDO_GROUP_ITEM_PROPERTIES, N_("Item Properties"), "group-item-properties" },
{ GIMP_UNDO_GROUP_ITEM_DISPLACE, N_("Move Item"), "group-item-displace" },
{ GIMP_UNDO_GROUP_ITEM_VISIBILITY, N_("Item Visibility"), "group-item-visibility" },
{ GIMP_UNDO_GROUP_ITEM_LINKED, N_("Linked Item"), "group-item-linked" },
{ GIMP_UNDO_GROUP_LAYER_SCALE, N_("Scale Layer"), "group-layer-scale" },
{ GIMP_UNDO_GROUP_LAYER_RESIZE, N_("Resize Layer"), "group-layer-resize" },
{ GIMP_UNDO_GROUP_ITEM_PROPERTIES, N_("Item Properties"), "group-item-properties" },
{ GIMP_UNDO_GROUP_ITEM_DISPLACE, N_("Move Item"), "group-item-displace" },
{ GIMP_UNDO_GROUP_ITEM_SCALE, N_("Scale Item"), "group-item-scale" },
{ GIMP_UNDO_GROUP_ITEM_RESIZE, N_("Resize Item"), "group-item-resize" },
{ GIMP_UNDO_GROUP_LAYER_ADD_MASK, N_("Add Layer Mask"), "group-layer-add-mask" },
{ GIMP_UNDO_GROUP_LAYER_APPLY_MASK, N_("Apply Layer Mask"), "group-layer-apply-mask" },
{ GIMP_UNDO_GROUP_FS_TO_LAYER, N_("Floating Selection to Layer"), "group-fs-to-layer" },
......
......@@ -424,12 +424,12 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_DRAWABLE, /*< desc="Drawable" >*/
GIMP_UNDO_GROUP_DRAWABLE_MOD, /*< desc="Drawable Mod" >*/
GIMP_UNDO_GROUP_MASK, /*< desc="Selection Mask" >*/
GIMP_UNDO_GROUP_ITEM_PROPERTIES, /*< desc="Item Properties" >*/
GIMP_UNDO_GROUP_ITEM_DISPLACE, /*< desc="Move Item" >*/
GIMP_UNDO_GROUP_ITEM_VISIBILITY, /*< desc="Item Visibility" >*/
GIMP_UNDO_GROUP_ITEM_LINKED, /*< desc="Linked Item" >*/
GIMP_UNDO_GROUP_LAYER_SCALE, /*< desc="Scale Layer" >*/
GIMP_UNDO_GROUP_LAYER_RESIZE, /*< desc="Resize Layer" >*/
GIMP_UNDO_GROUP_ITEM_PROPERTIES, /*< desc="Item Properties" >*/
GIMP_UNDO_GROUP_ITEM_DISPLACE, /*< desc="Move Item" >*/
GIMP_UNDO_GROUP_ITEM_SCALE, /*< desc="Scale Item" >*/
GIMP_UNDO_GROUP_ITEM_RESIZE, /*< desc="Resize Item" >*/
GIMP_UNDO_GROUP_LAYER_ADD_MASK, /*< desc="Add Layer Mask" >*/
GIMP_UNDO_GROUP_LAYER_APPLY_MASK, /*< desc="Apply Layer Mask" >*/
GIMP_UNDO_GROUP_FS_TO_LAYER, /*< desc="Floating Selection to Layer" >*/
......
......@@ -240,17 +240,23 @@ gimp_channel_class_init (GimpChannelClass *klass)
viewable_class->default_stock_id = "gimp-channel";
item_class->is_attached = gimp_channel_is_attached;
item_class->duplicate = gimp_channel_duplicate;
item_class->translate = gimp_channel_translate;
item_class->scale = gimp_channel_scale;
item_class->resize = gimp_channel_resize;
item_class->flip = gimp_channel_flip;
item_class->rotate = gimp_channel_rotate;
item_class->transform = gimp_channel_transform;
item_class->stroke = gimp_channel_stroke;
item_class->default_name = _("Channel");
item_class->rename_desc = _("Rename Channel");
item_class->is_attached = gimp_channel_is_attached;
item_class->duplicate = gimp_channel_duplicate;
item_class->translate = gimp_channel_translate;
item_class->scale = gimp_channel_scale;
item_class->resize = gimp_channel_resize;
item_class->flip = gimp_channel_flip;
item_class->rotate = gimp_channel_rotate;
item_class->transform = gimp_channel_transform;
item_class->stroke = gimp_channel_stroke;
item_class->default_name = _("Channel");
item_class->rename_desc = _("Rename Channel");
item_class->translate_desc = _("Move Channel");
item_class->scale_desc = _("Scale Channel");
item_class->resize_desc = _("Resize Channel");
item_class->flip_desc = _("Flip Channel");
item_class->rotate_desc = _("Rotate Channel");
item_class->transform_desc = _("Transform Channel");
drawable_class->invalidate_boundary = gimp_channel_invalidate_boundary;
drawable_class->get_active_components = gimp_channel_get_active_components;
......@@ -258,8 +264,6 @@ gimp_channel_class_init (GimpChannelClass *klass)
drawable_class->replace_region = gimp_channel_replace_region;
drawable_class->set_tiles = gimp_channel_set_tiles;
drawable_class->swap_pixels = gimp_channel_swap_pixels;
drawable_class->scale_desc = _("Scale Channel");
drawable_class->resize_desc = _("Resize Channel");
klass->boundary = gimp_channel_real_boundary;
klass->bounds = gimp_channel_real_bounds;
......@@ -274,7 +278,6 @@ gimp_channel_class_init (GimpChannelClass *klass)
klass->grow = gimp_channel_real_grow;
klass->shrink = gimp_channel_real_shrink;
klass->translate_desc = _("Move Channel");
klass->feather_desc = _("Feather Channel");
klass->sharpen_desc = _("Sharpen Channel");
klass->clear_desc = _("Clear Channel");
......@@ -401,8 +404,7 @@ gimp_channel_translate (GimpItem *item,
gimp_drawable_update (GIMP_DRAWABLE (item), x1, y1, x2 - x1, y2 - y1);
if (push_undo)
gimp_channel_push_undo (channel,
GIMP_CHANNEL_GET_CLASS (channel)->translate_desc);
gimp_channel_push_undo (channel, NULL);
else
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (channel));
......@@ -519,17 +521,10 @@ gimp_channel_flip (GimpItem *item,
gdouble axis,
gboolean clip_result)
{
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Flip Channel"));
if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL)
clip_result = TRUE;
GIMP_ITEM_CLASS (parent_class)->flip (item, flip_type, axis, clip_result);
gimp_image_undo_group_end (gimage);
}
static void
......@@ -539,18 +534,11 @@ gimp_channel_rotate (GimpItem *item,
gdouble center_y,
gboolean clip_result)
{
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Rotate Channel"));
/* don't default to clip_result == TRUE here */
GIMP_ITEM_CLASS (parent_class)->rotate (item,
rotate_type, center_x, center_y,
clip_result);
gimp_image_undo_group_end (gimage);
}
static void
......@@ -564,11 +552,6 @@ gimp_channel_transform (GimpItem *item,
GimpProgressFunc progress_callback,
gpointer progress_data)
{
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Transform Channel"));
if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL)
clip_result = TRUE;
......@@ -577,8 +560,6 @@ gimp_channel_transform (GimpItem *item,
supersample, recursion_level,
clip_result,
progress_callback, progress_data);
gimp_image_undo_group_end (gimage);
}
static gboolean
......
......@@ -106,7 +106,6 @@ struct _GimpChannelClass
gboolean edge_lock,
gboolean push_undo);
const gchar *translate_desc;
const gchar *feather_desc;
const gchar *sharpen_desc;
const gchar *clear_desc;
......
......@@ -228,9 +228,6 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
klass->set_tiles = gimp_drawable_real_set_tiles;
klass->push_undo = gimp_drawable_real_push_undo;
klass->swap_pixels = gimp_drawable_real_swap_pixels;
klass->scale_desc = NULL;
klass->resize_desc = NULL;
}
static void
......@@ -385,8 +382,7 @@ gimp_drawable_scale (GimpItem *item,
GIMP_INTERPOLATION_NONE : interpolation_type,
progress_callback, progress_data);
gimp_drawable_set_tiles_full (drawable, TRUE,
GIMP_DRAWABLE_GET_CLASS (drawable)->scale_desc,
gimp_drawable_set_tiles_full (drawable, TRUE, NULL,
new_tiles, gimp_drawable_type (drawable),
new_offset_x, new_offset_y);
tile_manager_unref (new_tiles);
......@@ -452,8 +448,7 @@ gimp_drawable_resize (GimpItem *item,
copy_region (&srcPR, &destPR);
}
gimp_drawable_set_tiles_full (drawable, TRUE,
GIMP_DRAWABLE_GET_CLASS (drawable)->resize_desc,
gimp_drawable_set_tiles_full (drawable, TRUE, NULL,
new_tiles, gimp_drawable_type (drawable),
new_offset_x, new_offset_y);
tile_manager_unref (new_tiles);
......@@ -465,13 +460,11 @@ gimp_drawable_flip (GimpItem *item,
gdouble axis,
gboolean clip_result)
{
GimpDrawable *drawable;
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
drawable = GIMP_DRAWABLE (item);
gimp_item_offsets (item, &off_x, &off_y);
tile_manager_get_offsets (drawable->tiles, &old_off_x, &old_off_y);
......@@ -498,13 +491,11 @@ gimp_drawable_rotate (GimpItem *item,
gdouble center_y,
gboolean clip_result)
{
GimpDrawable *drawable;
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
drawable = GIMP_DRAWABLE (item);
gimp_item_offsets (item, &off_x, &off_y);
tile_manager_get_offsets (drawable->tiles, &old_off_x, &old_off_y);
......@@ -535,13 +526,11 @@ gimp_drawable_transform (GimpItem *item,
GimpProgressFunc progress_callback,
gpointer progress_data)
{
GimpDrawable *drawable;
GimpDrawable *drawable = GIMP_DRAWABLE (item);
TileManager *tiles;
gint off_x, off_y;
gint old_off_x, old_off_y;
drawable = GIMP_DRAWABLE (item);
gimp_item_offsets (item, &off_x, &off_y);
tile_manager_get_offsets (drawable->tiles, &old_off_x, &old_off_y);
......
......@@ -104,9 +104,6 @@ struct _GimpDrawableClass
gint y,
gint width,
gint height);
const gchar *scale_desc;
const gchar *resize_desc;
};
......
......@@ -113,7 +113,7 @@ gimp_image_crop (GimpImage *gimage,
if (gimp_layer_is_floating_sel (layer))
{
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Resize Layer"));
floating_sel_relax (layer, TRUE);
......
......@@ -194,6 +194,15 @@ gimp_item_class_init (GimpItemClass *klass)
klass->rotate = NULL;
klass->transform = NULL;
klass->stroke = NULL;
klass->default_name = NULL;
klass->rename_desc = NULL;
klass->translate_desc = NULL;
klass->scale_desc = NULL;
klass->resize_desc = NULL;
klass->flip_desc = NULL;
klass->rotate_desc = NULL;
klass->transform_desc = NULL;
}
static void
......@@ -557,12 +566,21 @@ gimp_item_translate (GimpItem *item,
gboolean push_undo)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
if (push_undo)
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE,
item_class->translate_desc);
item_class->translate (item, off_x, off_y, push_undo);
if (push_undo)
gimp_image_undo_group_end (gimage);
}
/**
......@@ -610,6 +628,7 @@ gimp_item_scale (GimpItem *item,
gpointer progress_data)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
......@@ -617,9 +636,15 @@ gimp_item_scale (GimpItem *item,
return;
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_SCALE,
item_class->scale_desc);
item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y,
interpolation, progress_callback, progress_data);
gimp_image_undo_group_end (gimage);
}
/**
......@@ -767,6 +792,7 @@ gimp_item_resize (GimpItem *item,
gint offset_y)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
......@@ -774,8 +800,14 @@ gimp_item_resize (GimpItem *item,
return;
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
item_class->resize_desc);
item_class->resize (item, new_width, new_height, offset_x, offset_y);
gimp_image_undo_group_end (gimage);
}
void
......@@ -785,12 +817,19 @@ gimp_item_flip (GimpItem *item,
gboolean clip_result)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
item_class->flip_desc);
item_class->flip (item, flip_type, axis, clip_result);
gimp_image_undo_group_end (gimage);
}
void
......@@ -801,12 +840,19 @@ gimp_item_rotate (GimpItem *item,
gboolean clip_result)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
item_class->rotate_desc);
item_class->rotate (item, rotate_type, center_x, center_y, clip_result);
gimp_image_undo_group_end (gimage);
}
void
......@@ -821,15 +867,22 @@ gimp_item_transform (GimpItem *item,
gpointer progress_data)
{
GimpItemClass *item_class;
GimpImage *gimage;
g_return_if_fail (GIMP_IS_ITEM (item));
item_class = GIMP_ITEM_GET_CLASS (item);
gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
item_class->transform_desc);
item_class->transform (item, matrix, direction, interpolation,
supersample, recursion_level,
clip_result,
progress_callback, progress_data);
gimp_image_undo_group_end (gimage);
}
gboolean
......
......@@ -117,6 +117,12 @@ struct _GimpItemClass
const gchar *default_name;
const gchar *rename_desc;
const gchar *translate_desc;
const gchar *scale_desc;
const gchar *resize_desc;
const gchar *flip_desc;
const gchar *rotate_desc;
const gchar *transform_desc;
};
......
......@@ -246,12 +246,16 @@ gimp_layer_class_init (GimpLayerClass *klass)
item_class->transform = gimp_layer_transform;
item_class->default_name = _("Layer");
item_class->rename_desc = _("Rename Layer");
item_class->translate_desc = _("Move Layer");
item_class->scale_desc = _("Scale Layer");
item_class->resize_desc = _("Resize Layer");
item_class->flip_desc = _("Flip Layer");
item_class->rotate_desc = _("Rotate Layer");
item_class->transform_desc = _("Transform Layer");
drawable_class->invalidate_boundary = gimp_layer_invalidate_boundary;
drawable_class->get_active_components = gimp_layer_get_active_components;
drawable_class->set_tiles = gimp_layer_set_tiles;
drawable_class->scale_desc = _("Scale Layer");
drawable_class->resize_desc = _("Resize Layer");
klass->opacity_changed = NULL;
klass->mode_changed = NULL;
......@@ -603,9 +607,7 @@ gimp_layer_translate (GimpItem *item,
GimpLayer *layer = GIMP_LAYER (item);
if (push_undo)
gimp_image_undo_push_item_displace (gimp_item_get_image (item),
_("Move Layer"),
item);
gimp_image_undo_push_item_displace (gimp_item_get_image (item), NULL, item);
/* update the old region */
gimp_drawable_update (GIMP_DRAWABLE (layer), 0, 0, item->width, item->height);
......@@ -638,12 +640,7 @@ gimp_layer_scale (GimpItem *item,
GimpProgressFunc progress_callback,
gpointer progress_data)
{
GimpLayer *layer = GIMP_LAYER (item);
GimpImage *gimage = gimp_item_get_image (item);
if (layer->mask)
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_SCALE,
_("Scale Layer"));
GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height,
new_offset_x, new_offset_y,
......@@ -651,14 +648,10 @@ gimp_layer_scale (GimpItem *item,
progress_callback, progress_data);
if (layer->mask)
{
gimp_item_scale (GIMP_ITEM (layer->mask),
new_width, new_height,
new_offset_x, new_offset_y,
interpolation_type, NULL, NULL);
gimp_image_undo_group_end (gimage);
}
gimp_item_scale (GIMP_ITEM (layer->mask),
new_width, new_height,
new_offset_x, new_offset_y,
interpolation_type, NULL, NULL);
}
static void
......@@ -669,22 +662,13 @@ gimp_layer_resize (GimpItem *item,
gint offset_y)
{
GimpLayer *layer = GIMP_LAYER (item);
GimpImage *gimage = gimp_item_get_image (item);
if (layer->mask)
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
_("Resize Layer"));
GIMP_ITEM_CLASS (parent_class)->resize (item, new_width, new_height,
offset_x, offset_y);
if (layer->mask)
{
gimp_item_resize (GIMP_ITEM (layer->mask),
new_width, new_height, offset_x, offset_y);
gimp_image_undo_group_end (gimage);
}
gimp_item_resize (GIMP_ITEM (layer->mask),
new_width, new_height, offset_x, offset_y);
}
static void
......@@ -693,19 +677,13 @@ gimp_layer_flip (GimpItem *item,
gdouble axis,
gboolean clip_result)
{
GimpLayer *layer = GIMP_LAYER (item);
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Flip Layer"));
GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->flip (item, flip_type, axis, clip_result);
if (layer->mask)
gimp_item_flip (GIMP_ITEM (layer->mask),
flip_type, axis, clip_result);
gimp_image_undo_group_end (gimage);
}
static void
......@@ -715,11 +693,7 @@ gimp_layer_rotate (GimpItem *item,
gdouble center_y,
gboolean clip_result)
{
GimpLayer *layer = GIMP_LAYER (item);
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Rotate Layer"));
GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->rotate (item,
rotate_type, center_x, center_y,
......@@ -728,8 +702,6 @@ gimp_layer_rotate (GimpItem *item,
if (layer->mask)
gimp_item_rotate (GIMP_ITEM (layer->mask),
rotate_type, center_x, center_y, clip_result);
gimp_image_undo_group_end (gimage);
}
static void
......@@ -743,11 +715,7 @@ gimp_layer_transform (GimpItem *item,
GimpProgressFunc progress_callback,
gpointer progress_data)
{
GimpLayer *layer = GIMP_LAYER (item);
GimpImage *gimage = gimp_item_get_image (item);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM,
_("Transform Layer"));
GimpLayer *layer = GIMP_LAYER (item);
GIMP_ITEM_CLASS (parent_class)->transform (item, matrix, direction,
interpolation_type,
......@@ -762,8 +730,6 @@ gimp_layer_transform (GimpItem *item,
supersample, recursion_level,
clip_result,
progress_callback, progress_data);
gimp_image_undo_group_end (gimage);
}
static void
......@@ -1386,7 +1352,7 @@ gimp_layer_resize_to_image (GimpLayer *layer)
if (! (gimage = gimp_item_get_image (GIMP_ITEM (layer))))
return;
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Layer to Image Size"));
if (gimp_layer_is_floating_sel (layer))
......
......@@ -177,6 +177,7 @@ gimp_selection_class_init (GimpSelectionClass *klass)
item_class->flip = gimp_selection_flip;
item_class->rotate = gimp_selection_rotate;
item_class->stroke = gimp_selection_stroke;
item_class->translate_desc = _("Move Selection");
drawable_class->invalidate_boundary = gimp_selection_invalidate_boundary;
......@@ -193,7 +194,6 @@ gimp_selection_class_init (GimpSelectionClass *klass)
channel_class->grow = gimp_selection_grow;
channel_class->shrink = gimp_selection_shrink;
channel_class->translate_desc = _("Move Selection");
channel_class->feather_desc = _("Feather Selection");
channel_class->sharpen_desc = _("Sharpen Selection");
channel_class->clear_desc = _("Select None");
......
......@@ -379,7 +379,7 @@ layers_crop_cmd_callback (GtkWidget *widget,
off_x -= x1;
off_y -= y1;
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Crop Layer"));
if (gimp_layer_is_floating_sel (active_layer))
......@@ -1183,7 +1183,7 @@ scale_layer_query_ok_callback (GtkWidget *widget,
if (gimp_layer_is_floating_sel (layer))
{
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_SCALE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_SCALE,
_("Scale Layer"));
floating_sel_relax (layer, TRUE);
......@@ -1282,7 +1282,7 @@ resize_layer_query_ok_callback (GtkWidget *widget,
{
if (gimp_layer_is_floating_sel (layer))
{
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Resize Layer"));
floating_sel_relax (layer, TRUE);
......
......@@ -449,7 +449,7 @@ layer_scale_invoker (Gimp *gimp,
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_SCALE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_SCALE,
_("Scale Layer"));
if (floating_layer)
......@@ -544,7 +544,7 @@ layer_resize_invoker (Gimp *gimp,
{
floating_layer = gimp_image_floating_sel (gimage);
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_RESIZE,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Resize Layer"));
if (floating_layer)
......
......@@ -230,6 +230,12 @@ gimp_vectors_class_init (GimpVectorsClass *klass)
item_class->stroke = gimp_vectors_stroke;
item_class->default_name = _("Path");
item_class->rename_desc = _("Rename Path");
item_class->translate_desc = _("Move Path");
item_class->scale_desc = _("Scale Path");
item_class->resize_desc = _("Resize Path");
item_class->flip_desc = _("Flip Path");
item_class->rotate_desc = _("Rotate Path");
item_class->transform_desc = _("Transform Path");
klass->freeze = NULL;
klass->thaw = gimp_vectors_real_thaw;
......@@ -392,7 +398,7 @@ gimp_vectors_scale (GimpItem *item,
gimp_vectors_freeze (vectors);
gimp_image_undo_push_vectors_mod (image, _("Scale Path"), vectors);
gimp_image_undo_push_vectors_mod (image, NULL, vectors);
for (list = vectors->strokes; list; list = g_list_next (list))
{
......@@ -424,7 +430,7 @@ gimp_vectors_resize (GimpItem *item,
gimp_vectors_freeze (vectors);
gimp_image_undo_push_vectors_mod (image, _("Resize Path"), vectors);
gimp_image_undo_push_vectors_mod (image, NULL, vectors);
for (list = vectors->strokes; list; list = g_list_next (list))
{
......
......@@ -99,10 +99,10 @@ HELP
}
if ($op eq 'scale') {
&layer_change_invoke("LAYER_\U$op\E", 'Scale Layer',
&layer_change_invoke("ITEM_\U$op\E", 'Scale Layer',
"gimp_item_scale_by_origin (GIMP_ITEM (layer), new_width, new_height, gimp->config->interpolation_type, NULL, NULL, $args);");
} else {
&layer_change_invoke("LAYER_\U$op\E", 'Resize Layer',
&layer_change_invoke("ITEM_\U$op\E", 'Resize Layer',
"gimp_item_resize (GIMP_ITEM (layer), new_width, new_height, $args);");
}
}
......
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