Move the quick mask members to GimpImagePrivate
and add API to access the "inverted" state.
This commit is contained in:
@ -25,6 +25,7 @@
|
||||
#include "actions-types.h"
|
||||
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-quick-mask.h"
|
||||
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
@ -95,7 +96,18 @@ void
|
||||
quick_mask_actions_update (GimpActionGroup *group,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
gboolean quick_mask_state = FALSE;
|
||||
gboolean quick_mask_inverted = FALSE;
|
||||
GimpRGB quick_mask_color;
|
||||
|
||||
if (image)
|
||||
{
|
||||
quick_mask_state = gimp_image_get_quick_mask_state (image);
|
||||
quick_mask_inverted = gimp_image_get_quick_mask_inverted (image);
|
||||
|
||||
gimp_image_get_quick_mask_color (image, &quick_mask_color);
|
||||
}
|
||||
|
||||
#define SET_SENSITIVE(action,sensitive) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0)
|
||||
@ -105,12 +117,12 @@ quick_mask_actions_update (GimpActionGroup *group,
|
||||
gimp_action_group_set_action_color (group, action, (color), FALSE)
|
||||
|
||||
SET_SENSITIVE ("quick-mask-toggle", image);
|
||||
SET_ACTIVE ("quick-mask-toggle", image && image->quick_mask_state);
|
||||
SET_ACTIVE ("quick-mask-toggle", quick_mask_state);
|
||||
|
||||
SET_SENSITIVE ("quick-mask-invert-on", image);
|
||||
SET_SENSITIVE ("quick-mask-invert-off", image);
|
||||
|
||||
if (image && image->quick_mask_inverted)
|
||||
if (quick_mask_inverted)
|
||||
SET_ACTIVE ("quick-mask-invert-on", TRUE);
|
||||
else
|
||||
SET_ACTIVE ("quick-mask-invert-off", TRUE);
|
||||
@ -118,7 +130,7 @@ quick_mask_actions_update (GimpActionGroup *group,
|
||||
SET_SENSITIVE ("quick-mask-configure", image);
|
||||
|
||||
if (image)
|
||||
SET_COLOR ("quick-mask-configure", &image->quick_mask_color);
|
||||
SET_COLOR ("quick-mask-configure", &quick_mask_color);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
#undef SET_ACTIVE
|
||||
|
Reference in New Issue
Block a user