Commit 03d00c5e authored by Michael Natterer's avatar Michael Natterer 😴

Save the "lock-content" property on layers and channels in the XCF

Add XCF property PROP_LOCK_CONTENT and save/load it for all layers and
channels. Vectors saving needs some refactoring here I'm afraid, so I
ignored it for now.
parent 8f9fc5e2
......@@ -668,6 +668,15 @@ xcf_load_layer_props (XcfInfo *info,
}
break;
case PROP_LOCK_CONTENT:
{
gboolean lock_content;
info->cp += xcf_read_int32 (info->fp, (guint32 *) &lock_content, 1);
gimp_item_set_lock_content (GIMP_ITEM (layer), lock_content, FALSE);
}
break;
case PROP_LOCK_ALPHA:
{
gboolean lock_alpha;
......@@ -843,6 +852,16 @@ xcf_load_channel_props (XcfInfo *info,
}
break;
case PROP_LOCK_CONTENT:
{
gboolean lock_content;
info->cp += xcf_read_int32 (info->fp, (guint32 *) &lock_content, 1);
gimp_item_set_lock_content (GIMP_ITEM (*channel),
lock_content ? TRUE : FALSE, FALSE);
}
break;
case PROP_SHOW_MASKED:
{
gboolean show_masked;
......
......@@ -48,7 +48,8 @@ typedef enum
PROP_USER_UNIT = 24,
PROP_VECTORS = 25,
PROP_TEXT_LAYER_FLAGS = 26,
PROP_SAMPLE_POINTS = 27
PROP_SAMPLE_POINTS = 27,
PROP_LOCK_CONTENT = 28
} PropType;
typedef enum
......
......@@ -477,6 +477,8 @@ xcf_save_layer_props (XcfInfo *info,
gimp_item_get_visible (GIMP_ITEM (layer))));
xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error,
gimp_item_get_linked (GIMP_ITEM (layer))));
xcf_check_error (xcf_save_prop (info, image, PROP_LOCK_CONTENT, error,
gimp_item_get_lock_content (GIMP_ITEM (layer))));
xcf_check_error (xcf_save_prop (info, image, PROP_LOCK_ALPHA, error,
gimp_layer_get_lock_alpha (layer)));
......@@ -561,6 +563,8 @@ xcf_save_channel_props (XcfInfo *info,
gimp_item_get_visible (GIMP_ITEM (channel))));
xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error,
gimp_item_get_linked (GIMP_ITEM (channel))));
xcf_check_error (xcf_save_prop (info, image, PROP_LOCK_CONTENT, error,
gimp_item_get_lock_content (GIMP_ITEM (channel))));
xcf_check_error (xcf_save_prop (info, image, PROP_SHOW_MASKED, error,
gimp_channel_get_show_masked (channel)));
......@@ -697,6 +701,19 @@ xcf_save_prop (XcfInfo *info,
}
break;
case PROP_LOCK_CONTENT:
{
guint32 lock_content;
lock_content = va_arg (args, guint32);
size = 4;
xcf_write_prop_type_check_error (info, prop_type);
xcf_write_int32_check_error (info, &size, 1);
xcf_write_int32_check_error (info, &lock_content, 1);
}
break;
case PROP_LOCK_ALPHA:
{
guint32 lock_alpha;
......
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