Override the "lock-content" property to default to TRUE

This commit is contained in:
Michael Natterer 2009-08-23 20:02:36 +02:00
parent 922375ceca
commit 819abf2fa0
1 changed files with 59 additions and 0 deletions

View File

@ -33,6 +33,21 @@
#include "gimp-intl.h"
enum
{
PROP_0,
PROP_LOCK_CONTENT
};
static void gimp_group_layer_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_group_layer_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_group_layer_finalize (GObject *object);
static gint64 gimp_group_layer_get_memsize (GimpObject *object,
@ -57,6 +72,8 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
GimpItemClass *item_class = GIMP_ITEM_CLASS (klass);
object_class->set_property = gimp_group_layer_set_property;
object_class->get_property = gimp_group_layer_get_property;
object_class->finalize = gimp_group_layer_finalize;
gimp_object_class->get_memsize = gimp_group_layer_get_memsize;
@ -74,14 +91,56 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
item_class->flip_desc = _("Flip Group Layer");
item_class->rotate_desc = _("Rotate Group Layer");
item_class->transform_desc = _("Transform Group Layer");
g_object_class_install_property (object_class, PROP_LOCK_CONTENT,
g_param_spec_boolean ("lock-content",
NULL, NULL,
TRUE,
GIMP_PARAM_READABLE));
}
static void
gimp_group_layer_init (GimpGroupLayer *layer)
{
GIMP_ITEM (layer)->lock_content = TRUE;
layer->children = gimp_drawable_stack_new (GIMP_TYPE_LAYER);
}
static void
gimp_group_layer_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_group_layer_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpItem *item = GIMP_ITEM (object);
switch (property_id)
{
case PROP_LOCK_CONTENT:
g_value_set_boolean (value, gimp_item_get_lock_content (item));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_group_layer_finalize (GObject *object)
{