From 46a25c2c6081b310bb522c8d956e789f46ced0f9 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 24 Mar 2005 22:34:36 +0000 Subject: [PATCH] app/core/core-enums.[ch] app/core/gimpimage-undo-push.[ch] eek, my 2005-03-24 Michael Natterer * 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. --- ChangeLog | 15 +++++++++++++++ app/actions/layers-commands.c | 10 +++------- app/core/core-enums.c | 2 -- app/core/core-enums.h | 1 - app/core/gimpimage-undo-push.c | 17 ----------------- app/core/gimpimage-undo-push.h | 3 --- app/core/gimplayermask.c | 9 +-------- app/core/gimplayermask.h | 3 +-- app/pdb/pdb_glue.h | 6 +++--- 9 files changed, 23 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44a9e86e4f..63183ac7a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-03-24 Michael Natterer + + * 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 * app/core/core-enums.[ch] (enum GimpUndoType) : reordered values diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 2b53488195..0141f6849c 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -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); } } diff --git a/app/core/core-enums.c b/app/core/core-enums.c index 41b9502914..a911c22e09 100644 --- a/app/core/core-enums.c +++ b/app/core/core-enums.c @@ -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 }, diff --git a/app/core/core-enums.h b/app/core/core-enums.h index 183b1c3e95..89591f96ae 100644 --- a/app/core/core-enums.h +++ b/app/core/core-enums.h @@ -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" >*/ diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 91acdf2630..9f3ff9bd44 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -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); diff --git a/app/core/gimpimage-undo-push.h b/app/core/gimpimage-undo-push.h index 37db4e0001..70977855c0 100644 --- a/app/core/gimpimage-undo-push.h +++ b/app/core/gimpimage-undo-push.h @@ -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); diff --git a/app/core/gimplayermask.c b/app/core/gimplayermask.c index 35780aa303..3b2795e0e8 100644 --- a/app/core/gimplayermask.c +++ b/app/core/gimplayermask.c @@ -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); diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index 7d2e46298e..b6a2da1a50 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -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, diff --git a/app/pdb/pdb_glue.h b/app/pdb/pdb_glue.h index d69076b345..9c626601a2 100644 --- a/app/pdb/pdb_glue.h +++ b/app/pdb/pdb_glue.h @@ -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__ */