Bug 769738 - Add color tags/labels for layers/channels/paths

Forgot to add XCF saving and loading of color tags.
This commit is contained in:
Michael Natterer 2016-11-14 23:02:43 +01:00
parent 54dc424b31
commit 4f9095798d
3 changed files with 37 additions and 1 deletions

View File

@ -1019,6 +1019,15 @@ xcf_load_layer_props (XcfInfo *info,
}
break;
case PROP_COLOR_TAG:
{
GimpColorTag color_tag;
info->cp += xcf_read_int32 (info->input, (guint32 *) &color_tag, 1);
gimp_item_set_color_tag (GIMP_ITEM (*layer), color_tag, FALSE);
}
break;
case PROP_LOCK_CONTENT:
{
gboolean lock_content;
@ -1295,6 +1304,15 @@ xcf_load_channel_props (XcfInfo *info,
}
break;
case PROP_COLOR_TAG:
{
GimpColorTag color_tag;
info->cp += xcf_read_int32 (info->input, (guint32 *) &color_tag, 1);
gimp_item_set_color_tag (GIMP_ITEM (*channel), color_tag, FALSE);
}
break;
case PROP_LINKED:
{
gboolean linked;

View File

@ -57,7 +57,8 @@ typedef enum
PROP_ITEM_PATH = 30,
PROP_GROUP_ITEM_FLAGS = 31,
PROP_LOCK_POSITION = 32,
PROP_FLOAT_OPACITY = 33
PROP_FLOAT_OPACITY = 33,
PROP_COLOR_TAG = 34,
} PropType;
typedef enum

View File

@ -500,6 +500,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_COLOR_TAG, error,
gimp_item_get_color_tag (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,
@ -596,6 +598,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_COLOR_TAG, error,
gimp_item_get_color_tag (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_LOCK_POSITION, error,
@ -757,6 +761,19 @@ xcf_save_prop (XcfInfo *info,
}
break;
case PROP_COLOR_TAG:
{
gint32 color_tag;
color_tag = va_arg (args, gint32);
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, &color_tag, 1);
}
break;
case PROP_LOCK_CONTENT:
{
guint32 lock_content;