Commit c730839c authored by Michael Natterer's avatar Michael Natterer 😴

Implement GimpItem::is_content_locked()

A layer mask is locked if its parent layer is locked.
parent 03fafc01
......@@ -45,17 +45,18 @@ enum
};
static gboolean gimp_layer_mask_is_attached (GimpItem *item);
static GimpContainer *
gimp_layer_mask_get_container (GimpItem *item);
static GimpItem * gimp_layer_mask_duplicate (GimpItem *item,
GType new_type);
static gboolean gimp_layer_mask_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
GError **error);
static gboolean gimp_layer_mask_is_attached (GimpItem *item);
static gboolean gimp_layer_mask_is_content_locked (const GimpItem *item);
static GimpContainer * gimp_layer_mask_get_container (GimpItem *item);
static GimpItem * gimp_layer_mask_duplicate (GimpItem *item,
GType new_type);
static gboolean gimp_layer_mask_rename (GimpItem *item,
const gchar *new_name,
const gchar *undo_desc,
GError **error);
static void gimp_layer_mask_real_edit_changed (GimpLayerMask *layer_mask);
static void gimp_layer_mask_real_edit_changed (GimpLayerMask *layer_mask);
G_DEFINE_TYPE (GimpLayerMask, gimp_layer_mask, GIMP_TYPE_CHANNEL)
......@@ -99,13 +100,14 @@ gimp_layer_mask_class_init (GimpLayerMaskClass *klass)
viewable_class->default_stock_id = "gimp-layer-mask";
klass->edit_changed = gimp_layer_mask_real_edit_changed;
klass->edit_changed = gimp_layer_mask_real_edit_changed;
item_class->is_attached = gimp_layer_mask_is_attached;
item_class->get_container = gimp_layer_mask_get_container;
item_class->duplicate = gimp_layer_mask_duplicate;
item_class->rename = gimp_layer_mask_rename;
item_class->translate_desc = _("Move Layer Mask");
item_class->is_attached = gimp_layer_mask_is_attached;
item_class->is_content_locked = gimp_layer_mask_is_content_locked;
item_class->get_container = gimp_layer_mask_get_container;
item_class->duplicate = gimp_layer_mask_duplicate;
item_class->rename = gimp_layer_mask_rename;
item_class->translate_desc = _("Move Layer Mask");
}
static void
......@@ -117,6 +119,18 @@ gimp_layer_mask_init (GimpLayerMask *layer_mask)
layer_mask->show_mask = FALSE;
}
static gboolean
gimp_layer_mask_is_content_locked (const GimpItem *item)
{
GimpLayerMask *mask = GIMP_LAYER_MASK (item);
GimpLayer *layer = gimp_layer_mask_get_layer (mask);
if (layer)
return gimp_item_is_content_locked (GIMP_ITEM (layer));
return FALSE;
}
static gboolean
gimp_layer_mask_is_attached (GimpItem *item)
{
......
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