app/core/core-enums.[ch] app/core/gimpimage-undo-push.[ch] eek, my

2005-03-24  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]
	* app/core/gimplayermask.[ch]: eek, my fault... removed
	GIMP_UNDO_LAYER_MASK_EDIT stuff again because that just determines
	the active drawable, which must not affect undo.

	* app/pdb/pdb_glue.h
	* app/actions/layers-commands.c (layers_mask_edit_cmd_callback):
	changed accordingly.

	(layers_mask_disable_cmd_callback): reverted last change. the old
	code was correct.
This commit is contained in:
Michael Natterer 2005-03-24 22:34:36 +00:00 committed by Michael Natterer
parent b17e5b4aad
commit 46a25c2c60
9 changed files with 23 additions and 43 deletions

View File

@ -1,3 +1,18 @@
2005-03-24 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch]
* app/core/gimpimage-undo-push.[ch]
* app/core/gimplayermask.[ch]: eek, my fault... removed
GIMP_UNDO_LAYER_MASK_EDIT stuff again because that just determines
the active drawable, which must not affect undo.
* app/pdb/pdb_glue.h
* app/actions/layers-commands.c (layers_mask_edit_cmd_callback):
changed accordingly.
(layers_mask_disable_cmd_callback): reverted last change. the old
code was correct.
2005-03-24 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch] (enum GimpUndoType) : reordered values

View File

@ -611,7 +611,7 @@ layers_mask_edit_cmd_callback (GtkAction *action,
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
gimp_layer_mask_set_edit (mask, active, TRUE);
gimp_layer_mask_set_edit (mask, active);
gimp_image_flush (gimage);
}
}
@ -655,12 +655,8 @@ layers_mask_disable_cmd_callback (GtkAction *action,
active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (active == gimp_layer_mask_get_apply (mask))
{
gimp_layer_mask_set_apply (mask, ! active, TRUE);
gimp_image_flush (gimage);
}
gimp_layer_mask_set_apply (mask, ! active, TRUE);
gimp_image_flush (gimage);
}
}

View File

@ -741,7 +741,6 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_LAYER_MASK_ADD, "GIMP_UNDO_LAYER_MASK_ADD", "layer-mask-add" },
{ GIMP_UNDO_LAYER_MASK_REMOVE, "GIMP_UNDO_LAYER_MASK_REMOVE", "layer-mask-remove" },
{ GIMP_UNDO_LAYER_MASK_APPLY, "GIMP_UNDO_LAYER_MASK_APPLY", "layer-mask-apply" },
{ GIMP_UNDO_LAYER_MASK_EDIT, "GIMP_UNDO_LAYER_MASK_EDIT", "layer-mask-edit" },
{ GIMP_UNDO_LAYER_MASK_SHOW, "GIMP_UNDO_LAYER_MASK_SHOW", "layer-mask-show" },
{ GIMP_UNDO_CHANNEL_ADD, "GIMP_UNDO_CHANNEL_ADD", "channel-add" },
{ GIMP_UNDO_CHANNEL_REMOVE, "GIMP_UNDO_CHANNEL_REMOVE", "channel-remove" },
@ -827,7 +826,6 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_LAYER_MASK_ADD, N_("Add layer mask"), NULL },
{ GIMP_UNDO_LAYER_MASK_REMOVE, N_("Delete layer mask"), NULL },
{ GIMP_UNDO_LAYER_MASK_APPLY, N_("Apply layer mask"), NULL },
{ GIMP_UNDO_LAYER_MASK_EDIT, N_("Edit layer mask"), NULL },
{ GIMP_UNDO_LAYER_MASK_SHOW, N_("Show layer mask"), NULL },
{ GIMP_UNDO_CHANNEL_ADD, N_("New channel"), NULL },
{ GIMP_UNDO_CHANNEL_REMOVE, N_("Delete channel"), NULL },

View File

@ -391,7 +391,6 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_LAYER_MASK_ADD, /*< desc="Add layer mask" >*/
GIMP_UNDO_LAYER_MASK_REMOVE, /*< desc="Delete layer mask" >*/
GIMP_UNDO_LAYER_MASK_APPLY, /*< desc="Apply layer mask" >*/
GIMP_UNDO_LAYER_MASK_EDIT, /*< desc="Edit layer mask" >*/
GIMP_UNDO_LAYER_MASK_SHOW, /*< desc="Show layer mask" >*/
GIMP_UNDO_CHANNEL_ADD, /*< desc="New channel" >*/
GIMP_UNDO_CHANNEL_REMOVE, /*< desc="Delete channel" >*/

View File

@ -2043,7 +2043,6 @@ typedef struct _LayerMaskPropertyUndo LayerMaskPropertyUndo;
struct _LayerMaskPropertyUndo
{
gboolean old_apply;
gboolean old_edit;
gboolean old_show;
};
@ -2066,15 +2065,6 @@ gimp_image_undo_push_layer_mask_apply (GimpImage *gimage,
undo_desc, mask);
}
gboolean
gimp_image_undo_push_layer_mask_edit (GimpImage *gimage,
const gchar *undo_desc,
GimpLayerMask *mask)
{
return undo_push_layer_mask_properties (gimage, GIMP_UNDO_LAYER_MASK_EDIT,
undo_desc, mask);
}
gboolean
gimp_image_undo_push_layer_mask_show (GimpImage *gimage,
const gchar *undo_desc,
@ -2111,7 +2101,6 @@ undo_push_layer_mask_properties (GimpImage *gimage,
LayerMaskPropertyUndo *lmp_undo = new->data;
lmp_undo->old_apply = gimp_layer_mask_get_apply (mask);
lmp_undo->old_edit = gimp_layer_mask_get_edit (mask);
lmp_undo->old_show = gimp_layer_mask_get_show (mask);
return TRUE;
@ -2139,12 +2128,6 @@ undo_pop_layer_mask_properties (GimpUndo *undo,
lmp_undo->old_apply = val;
break;
case GIMP_UNDO_LAYER_MASK_EDIT:
val = gimp_layer_mask_get_edit (mask);
gimp_layer_mask_set_edit (mask, lmp_undo->old_edit, FALSE);
lmp_undo->old_edit = val;
break;
case GIMP_UNDO_LAYER_MASK_SHOW:
val = gimp_layer_mask_get_show (mask);
gimp_layer_mask_set_show (mask, lmp_undo->old_show, FALSE);

View File

@ -130,9 +130,6 @@ gboolean gimp_image_undo_push_layer_mask_remove (GimpImage *gimage,
gboolean gimp_image_undo_push_layer_mask_apply (GimpImage *gimage,
const gchar *undo_desc,
GimpLayerMask *mask);
gboolean gimp_image_undo_push_layer_mask_edit (GimpImage *gimage,
const gchar *undo_desc,
GimpLayerMask *mask);
gboolean gimp_image_undo_push_layer_mask_show (GimpImage *gimage,
const gchar *undo_desc,
GimpLayerMask *mask);

View File

@ -290,19 +290,12 @@ gimp_layer_mask_get_apply (const GimpLayerMask *layer_mask)
void
gimp_layer_mask_set_edit (GimpLayerMask *layer_mask,
gboolean edit,
gboolean push_undo)
gboolean edit)
{
g_return_if_fail (GIMP_IS_LAYER_MASK (layer_mask));
if (layer_mask->edit_mask != edit)
{
GimpImage *gimage = GIMP_ITEM (layer_mask)->gimage;
if (push_undo)
gimp_image_undo_push_layer_mask_edit (gimage, _("Edit Layer Mask"),
layer_mask);
layer_mask->edit_mask = edit ? TRUE : FALSE;
g_signal_emit (layer_mask, layer_mask_signals[EDIT_CHANGED], 0);

View File

@ -74,8 +74,7 @@ void gimp_layer_mask_set_apply (GimpLayerMask *layer_mask,
gboolean gimp_layer_mask_get_apply (const GimpLayerMask *layer_mask);
void gimp_layer_mask_set_edit (GimpLayerMask *layer_mask,
gboolean apply,
gboolean push_undo);
gboolean edit);
gboolean gimp_layer_mask_get_edit (const GimpLayerMask *layer_mask);
void gimp_layer_mask_set_show (GimpLayerMask *layer_mask,

View File

@ -24,9 +24,9 @@
#define gimp_layer_get_show_mask(l) (l)->mask ? gimp_layer_mask_get_show((l)->mask) : FALSE;
#define gimp_layer_get_edit_mask(l) (l)->mask ? gimp_layer_mask_get_edit((l)->mask) : FALSE;
#define gimp_layer_set_apply_mask(l,a) { if((l)->mask) gimp_layer_mask_set_apply((l)->mask,(a), TRUE); else success = FALSE; }
#define gimp_layer_set_show_mask(l,s) { if((l)->mask) gimp_layer_mask_set_show((l)->mask,(s), TRUE); else success = FALSE; }
#define gimp_layer_set_edit_mask(l,e) { if((l)->mask) gimp_layer_mask_set_edit((l)->mask,(e), TRUE); else success = FALSE; }
#define gimp_layer_set_apply_mask(l,a) { if((l)->mask) gimp_layer_mask_set_apply((l)->mask,(a),TRUE); else success = FALSE; }
#define gimp_layer_set_show_mask(l,s) { if((l)->mask) gimp_layer_mask_set_show((l)->mask,(s),TRUE); else success = FALSE; }
#define gimp_layer_set_edit_mask(l,e) { if((l)->mask) gimp_layer_mask_set_edit((l)->mask,(e)); else success = FALSE; }
#endif /* __PDB_GLUE_H__ */