From e53b269f1c2e685b13030317948b613e2fb5b930 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 9 Jan 2017 01:05:48 +0100 Subject: [PATCH] libgimpbase: add new files gimpcompatenums.[ch] Which are entirely private (not installed). They contain compat values for enums where values have been renamed in gimpbaseenums.h. The old names get the old nicks generated so the new values in gimpbaseenums.h can have proper new nicks. Register them as compat enums using mechanism introduced for the GimpLayerMode change. --- libgimpbase/Makefile.am | 19 ++- libgimpbase/gimpbase-private.c | 19 ++- libgimpbase/gimpbaseenums.c | 46 +++---- libgimpbase/gimpbaseenums.h | 46 +++---- libgimpbase/gimpcompatenums.c | 215 +++++++++++++++++++++++++++++++++ libgimpbase/gimpcompatenums.h | 109 +++++++++++++++++ 6 files changed, 405 insertions(+), 49 deletions(-) create mode 100644 libgimpbase/gimpcompatenums.c create mode 100644 libgimpbase/gimpcompatenums.h diff --git a/libgimpbase/Makefile.am b/libgimpbase/Makefile.am index c97e68f08d..a28270008e 100644 --- a/libgimpbase/Makefile.am +++ b/libgimpbase/Makefile.am @@ -84,6 +84,7 @@ lib_LTLIBRARIES = libgimpbase-@GIMP_API_VERSION@.la libgimpbase_sources = \ gimpbase.h \ gimpbaseenums.h \ + gimpcompatnums.h \ gimpbasetypes.h \ gimpbasetypes.c \ gimplimits.h \ @@ -127,7 +128,8 @@ libgimpbase_sources = \ gimpwire.h libgimpbase_built_sources = \ - gimpbaseenums.c + gimpbaseenums.c \ + gimpcompatenums.c libgimpbase_@GIMP_API_VERSION@_la_SOURCES = \ $(libgimpbase_sources) \ @@ -214,4 +216,19 @@ $(srcdir)/gimpbaseenums.c: $(srcdir)/gimpbaseenums.h $(GIMP_MKENUMS) && rm -f xgen-bec +$(srcdir)/gimpcompatenums.c: $(srcdir)/gimpcompatenums.h $(GIMP_MKENUMS) + $(GIMP_MKENUMS) \ + --fhead "#include \"config.h\"\n#include \n#include \"gimpbasetypes.h\"\n#include \"gimpcompatenums.h\"\n#include \"libgimp/libgimp-intl.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n" \ + --dhead " static const Gimp@Type@Desc descs[] =\n {" \ + --dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \ + --dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_domain (type, GETTEXT_PACKAGE \"-libgimp\");\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \ + $(srcdir)/gimpcompatenums.h > xgen-bec \ + && cp xgen-bec $(@F) \ + && rm -f xgen-bec + + DISTCLEANFILES = gimpversion.h diff --git a/libgimpbase/gimpbase-private.c b/libgimpbase/gimpbase-private.c index b9df767db0..c4544f83bc 100644 --- a/libgimpbase/gimpbase-private.c +++ b/libgimpbase/gimpbase-private.c @@ -23,11 +23,10 @@ #include -#include "libgimpbase/gimpbase.h" - #include "gimpbasetypes.h" #include "gimpbase-private.h" +#include "gimpcompatenums.h" GimpUnitVtable _gimp_unit_vtable = { NULL, }; @@ -37,6 +36,7 @@ void gimp_base_init (GimpUnitVtable *vtable) { static gboolean gimp_base_initialized = FALSE; + GQuark quark; g_return_if_fail (vtable != NULL); @@ -45,5 +45,20 @@ gimp_base_init (GimpUnitVtable *vtable) _gimp_unit_vtable = *vtable; + quark = g_quark_from_static_string ("gimp-compat-enum"); + + g_type_set_qdata (GIMP_TYPE_ADD_MASK_TYPE, quark, + (gpointer) GIMP_TYPE_ADD_MASK_TYPE_COMPAT); + g_type_set_qdata (GIMP_TYPE_BLEND_MODE, quark, + (gpointer) GIMP_TYPE_BLEND_MODE_COMPAT); + g_type_set_qdata (GIMP_TYPE_BUCKET_FILL_MODE, quark, + (gpointer) GIMP_TYPE_BUCKET_FILL_MODE_COMPAT); + g_type_set_qdata (GIMP_TYPE_CLONE_TYPE, quark, + (gpointer) GIMP_TYPE_CLONE_TYPE_COMPAT); + g_type_set_qdata (GIMP_TYPE_CONVOLVE_TYPE, quark, + (gpointer) GIMP_TYPE_CONVOLVE_TYPE_COMPAT); + g_type_set_qdata (GIMP_TYPE_FILL_TYPE, quark, + (gpointer) GIMP_TYPE_FILL_TYPE_COMPAT); + gimp_base_initialized = TRUE; } diff --git a/libgimpbase/gimpbaseenums.c b/libgimpbase/gimpbaseenums.c index cd2191d44d..0f4e3fbf33 100644 --- a/libgimpbase/gimpbaseenums.c +++ b/libgimpbase/gimpbaseenums.c @@ -13,13 +13,13 @@ gimp_add_mask_type_get_type (void) { static const GEnumValue values[] = { - { GIMP_ADD_MASK_WHITE, "GIMP_ADD_MASK_WHITE", "white-mask" }, - { GIMP_ADD_MASK_BLACK, "GIMP_ADD_MASK_BLACK", "black-mask" }, - { GIMP_ADD_MASK_ALPHA, "GIMP_ADD_MASK_ALPHA", "alpha-mask" }, - { GIMP_ADD_MASK_ALPHA_TRANSFER, "GIMP_ADD_MASK_ALPHA_TRANSFER", "alpha-transfer-mask" }, - { GIMP_ADD_MASK_SELECTION, "GIMP_ADD_MASK_SELECTION", "selection-mask" }, - { GIMP_ADD_MASK_COPY, "GIMP_ADD_MASK_COPY", "copy-mask" }, - { GIMP_ADD_MASK_CHANNEL, "GIMP_ADD_MASK_CHANNEL", "channel-mask" }, + { GIMP_ADD_MASK_WHITE, "GIMP_ADD_MASK_WHITE", "white" }, + { GIMP_ADD_MASK_BLACK, "GIMP_ADD_MASK_BLACK", "black" }, + { GIMP_ADD_MASK_ALPHA, "GIMP_ADD_MASK_ALPHA", "alpha" }, + { GIMP_ADD_MASK_ALPHA_TRANSFER, "GIMP_ADD_MASK_ALPHA_TRANSFER", "alpha-transfer" }, + { GIMP_ADD_MASK_SELECTION, "GIMP_ADD_MASK_SELECTION", "selection" }, + { GIMP_ADD_MASK_COPY, "GIMP_ADD_MASK_COPY", "copy" }, + { GIMP_ADD_MASK_CHANNEL, "GIMP_ADD_MASK_CHANNEL", "channel" }, { 0, NULL, NULL } }; @@ -53,10 +53,10 @@ gimp_blend_mode_get_type (void) { static const GEnumValue values[] = { - { GIMP_BLEND_FG_BG_RGB, "GIMP_BLEND_FG_BG_RGB", "fg-bg-rgb-mode" }, - { GIMP_BLEND_FG_BG_HSV, "GIMP_BLEND_FG_BG_HSV", "fg-bg-hsv-mode" }, - { GIMP_BLEND_FG_TRANSPARENT, "GIMP_BLEND_FG_TRANSPARENT", "fg-transparent-mode" }, - { GIMP_BLEND_CUSTOM, "GIMP_BLEND_CUSTOM", "custom-mode" }, + { GIMP_BLEND_FG_BG_RGB, "GIMP_BLEND_FG_BG_RGB", "fg-bg-rgb" }, + { GIMP_BLEND_FG_BG_HSV, "GIMP_BLEND_FG_BG_HSV", "fg-bg-hsv" }, + { GIMP_BLEND_FG_TRANSPARENT, "GIMP_BLEND_FG_TRANSPARENT", "fg-transparent" }, + { GIMP_BLEND_CUSTOM, "GIMP_BLEND_CUSTOM", "custom" }, { 0, NULL, NULL } }; @@ -119,9 +119,9 @@ gimp_bucket_fill_mode_get_type (void) { static const GEnumValue values[] = { - { GIMP_BUCKET_FILL_FG, "GIMP_BUCKET_FILL_FG", "fg-bucket-fill" }, - { GIMP_BUCKET_FILL_BG, "GIMP_BUCKET_FILL_BG", "bg-bucket-fill" }, - { GIMP_BUCKET_FILL_PATTERN, "GIMP_BUCKET_FILL_PATTERN", "pattern-bucket-fill" }, + { GIMP_BUCKET_FILL_FG, "GIMP_BUCKET_FILL_FG", "fg" }, + { GIMP_BUCKET_FILL_BG, "GIMP_BUCKET_FILL_BG", "bg" }, + { GIMP_BUCKET_FILL_PATTERN, "GIMP_BUCKET_FILL_PATTERN", "pattern" }, { 0, NULL, NULL } }; @@ -325,8 +325,8 @@ gimp_clone_type_get_type (void) { static const GEnumValue values[] = { - { GIMP_CLONE_IMAGE, "GIMP_CLONE_IMAGE", "image-clone" }, - { GIMP_CLONE_PATTERN, "GIMP_CLONE_PATTERN", "pattern-clone" }, + { GIMP_CLONE_IMAGE, "GIMP_CLONE_IMAGE", "image" }, + { GIMP_CLONE_PATTERN, "GIMP_CLONE_PATTERN", "pattern" }, { 0, NULL, NULL } }; @@ -471,8 +471,8 @@ gimp_convolve_type_get_type (void) { static const GEnumValue values[] = { - { GIMP_CONVOLVE_BLUR, "GIMP_CONVOLVE_BLUR", "blur-convolve" }, - { GIMP_CONVOLVE_SHARPEN, "GIMP_CONVOLVE_SHARPEN", "sharpen-convolve" }, + { GIMP_CONVOLVE_BLUR, "GIMP_CONVOLVE_BLUR", "blur" }, + { GIMP_CONVOLVE_SHARPEN, "GIMP_CONVOLVE_SHARPEN", "sharpen" }, { 0, NULL, NULL } }; @@ -565,11 +565,11 @@ gimp_fill_type_get_type (void) { static const GEnumValue values[] = { - { GIMP_FILL_FOREGROUND, "GIMP_FILL_FOREGROUND", "foreground-fill" }, - { GIMP_FILL_BACKGROUND, "GIMP_FILL_BACKGROUND", "background-fill" }, - { GIMP_FILL_WHITE, "GIMP_FILL_WHITE", "white-fill" }, - { GIMP_FILL_TRANSPARENT, "GIMP_FILL_TRANSPARENT", "transparent-fill" }, - { GIMP_FILL_PATTERN, "GIMP_FILL_PATTERN", "pattern-fill" }, + { GIMP_FILL_FOREGROUND, "GIMP_FILL_FOREGROUND", "foreground" }, + { GIMP_FILL_BACKGROUND, "GIMP_FILL_BACKGROUND", "background" }, + { GIMP_FILL_WHITE, "GIMP_FILL_WHITE", "white" }, + { GIMP_FILL_TRANSPARENT, "GIMP_FILL_TRANSPARENT", "transparent" }, + { GIMP_FILL_PATTERN, "GIMP_FILL_PATTERN", "pattern" }, { 0, NULL, NULL } }; diff --git a/libgimpbase/gimpbaseenums.h b/libgimpbase/gimpbaseenums.h index d6fa70b752..3ec8e8409f 100644 --- a/libgimpbase/gimpbaseenums.h +++ b/libgimpbase/gimpbaseenums.h @@ -40,13 +40,13 @@ GType gimp_add_mask_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_ADD_MASK_WHITE, /*< nick=white-mask, desc="_White (full opacity)" >*/ - GIMP_ADD_MASK_BLACK, /*< nick=black-mask, desc="_Black (full transparency)" >*/ - GIMP_ADD_MASK_ALPHA, /*< nick=alpha-mask, desc="Layer's _alpha channel" >*/ - GIMP_ADD_MASK_ALPHA_TRANSFER, /*< nick=alpha-transfer-mask, desc="_Transfer layer's alpha channel" >*/ - GIMP_ADD_MASK_SELECTION, /*< nick=selection-mask, desc="_Selection" >*/ - GIMP_ADD_MASK_COPY, /*< nick=copy-mask, desc="_Grayscale copy of layer" >*/ - GIMP_ADD_MASK_CHANNEL, /*< nick=channel-mask, desc="C_hannel" >*/ + GIMP_ADD_MASK_WHITE, /*< desc="_White (full opacity)" >*/ + GIMP_ADD_MASK_BLACK, /*< desc="_Black (full transparency)" >*/ + GIMP_ADD_MASK_ALPHA, /*< desc="Layer's _alpha channel" >*/ + GIMP_ADD_MASK_ALPHA_TRANSFER, /*< desc="_Transfer layer's alpha channel" >*/ + GIMP_ADD_MASK_SELECTION, /*< desc="_Selection" >*/ + GIMP_ADD_MASK_COPY, /*< desc="_Grayscale copy of layer" >*/ + GIMP_ADD_MASK_CHANNEL, /*< desc="C_hannel" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, /*< skip, pdb-skip >*/ @@ -66,10 +66,10 @@ GType gimp_blend_mode_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_BLEND_FG_BG_RGB, /*< nick=fg-bg-rgb-mode, desc="FG to BG (RGB)" >*/ - GIMP_BLEND_FG_BG_HSV, /*< nick=fg-bg-hsv-mode, desc="FG to BG (HSV)" >*/ - GIMP_BLEND_FG_TRANSPARENT, /*< nick=fg-transparent-mode, desc="FG to transparent" >*/ - GIMP_BLEND_CUSTOM, /*< nick=custom-mode, desc="Custom gradient" >*/ + GIMP_BLEND_FG_BG_RGB, /*< desc="FG to BG (RGB)" >*/ + GIMP_BLEND_FG_BG_HSV, /*< desc="FG to BG (HSV)" >*/ + GIMP_BLEND_FG_TRANSPARENT, /*< desc="FG to transparent" >*/ + GIMP_BLEND_CUSTOM, /*< desc="Custom gradient" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_FG_BG_RGB_MODE = GIMP_BLEND_FG_BG_RGB, /*< skip, pdb-skip >*/ @@ -98,9 +98,9 @@ GType gimp_bucket_fill_mode_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_BUCKET_FILL_FG, /*< nick=fg-bucket-fill, desc="FG color fill" >*/ - GIMP_BUCKET_FILL_BG, /*< nick=bg-bucket-fill, desc="BG color fill" >*/ - GIMP_BUCKET_FILL_PATTERN, /*< nick=pattern-bucket-fill, desc="Pattern fill" >*/ + GIMP_BUCKET_FILL_FG, /*< desc="FG color fill" >*/ + GIMP_BUCKET_FILL_BG, /*< desc="BG color fill" >*/ + GIMP_BUCKET_FILL_PATTERN, /*< desc="Pattern fill" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_FG_BUCKET_FILL = GIMP_BUCKET_FILL_FG, /*< skip, pdb-skip >*/ @@ -183,8 +183,8 @@ GType gimp_clone_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_CLONE_IMAGE, /*< nick=image-clone, desc="Image" >*/ - GIMP_CLONE_PATTERN, /*< nick=pattern-clone, desc="Pattern" >*/ + GIMP_CLONE_IMAGE, /*< desc="Image" >*/ + GIMP_CLONE_PATTERN, /*< desc="Pattern" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_IMAGE_CLONE = GIMP_CLONE_IMAGE, /*< skip, pdb-skip >*/ @@ -246,8 +246,8 @@ GType gimp_convolve_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_CONVOLVE_BLUR, /*< nick=blur-convolve, desc="Blur" >*/ - GIMP_CONVOLVE_SHARPEN, /*< nick=sharpen-convolve, desc="Sharpen" >*/ + GIMP_CONVOLVE_BLUR, /*< desc="Blur" >*/ + GIMP_CONVOLVE_SHARPEN, /*< desc="Sharpen" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_BLUR_CONVOLVE = GIMP_CONVOLVE_BLUR, /*< skip, pdb-skip >*/ @@ -295,11 +295,11 @@ GType gimp_fill_type_get_type (void) G_GNUC_CONST; typedef enum { - GIMP_FILL_FOREGROUND, /*< nick=foreground-fill, desc="Foreground color" >*/ - GIMP_FILL_BACKGROUND, /*< nick=background-fill, desc="Background color" >*/ - GIMP_FILL_WHITE, /*< nick=white-fill, desc="White" >*/ - GIMP_FILL_TRANSPARENT, /*< nick=transparent-fill, desc="Transparency" >*/ - GIMP_FILL_PATTERN, /*< nick=pattern-fill, desc="Pattern" >*/ + GIMP_FILL_FOREGROUND, /*< desc="Foreground color" >*/ + GIMP_FILL_BACKGROUND, /*< desc="Background color" >*/ + GIMP_FILL_WHITE, /*< desc="White" >*/ + GIMP_FILL_TRANSPARENT, /*< desc="Transparency" >*/ + GIMP_FILL_PATTERN, /*< desc="Pattern" >*/ #ifndef GIMP_DISABLE_DEPRECATED GIMP_FOREGROUND_FILL = GIMP_FILL_FOREGROUND, /*< skip, pdb-skip >*/ diff --git a/libgimpbase/gimpcompatenums.c b/libgimpbase/gimpcompatenums.c new file mode 100644 index 0000000000..7782863bdb --- /dev/null +++ b/libgimpbase/gimpcompatenums.c @@ -0,0 +1,215 @@ + +/* Generated data (by gimp-mkenums) */ + +#include "config.h" +#include +#include "gimpbasetypes.h" +#include "gimpcompatenums.h" +#include "libgimp/libgimp-intl.h" + +/* enumerations from "./gimpcompatenums.h" */ +GType +gimp_add_mask_type_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_ADD_WHITE_MASK, "GIMP_ADD_WHITE_MASK", "white-mask" }, + { GIMP_ADD_BLACK_MASK, "GIMP_ADD_BLACK_MASK", "black-mask" }, + { GIMP_ADD_ALPHA_MASK, "GIMP_ADD_ALPHA_MASK", "alpha-mask" }, + { GIMP_ADD_ALPHA_TRANSFER_MASK, "GIMP_ADD_ALPHA_TRANSFER_MASK", "alpha-transfer-mask" }, + { GIMP_ADD_SELECTION_MASK, "GIMP_ADD_SELECTION_MASK", "selection-mask" }, + { GIMP_ADD_COPY_MASK, "GIMP_ADD_COPY_MASK", "copy-mask" }, + { GIMP_ADD_CHANNEL_MASK, "GIMP_ADD_CHANNEL_MASK", "channel-mask" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_ADD_WHITE_MASK, "GIMP_ADD_WHITE_MASK", NULL }, + { GIMP_ADD_BLACK_MASK, "GIMP_ADD_BLACK_MASK", NULL }, + { GIMP_ADD_ALPHA_MASK, "GIMP_ADD_ALPHA_MASK", NULL }, + { GIMP_ADD_ALPHA_TRANSFER_MASK, "GIMP_ADD_ALPHA_TRANSFER_MASK", NULL }, + { GIMP_ADD_SELECTION_MASK, "GIMP_ADD_SELECTION_MASK", NULL }, + { GIMP_ADD_COPY_MASK, "GIMP_ADD_COPY_MASK", NULL }, + { GIMP_ADD_CHANNEL_MASK, "GIMP_ADD_CHANNEL_MASK", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpAddMaskTypeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "add-mask-type-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_blend_mode_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_FG_BG_RGB_MODE, "GIMP_FG_BG_RGB_MODE", "fg-bg-rgb-mode" }, + { GIMP_FG_BG_HSV_MODE, "GIMP_FG_BG_HSV_MODE", "fg-bg-hsv-mode" }, + { GIMP_FG_TRANSPARENT_MODE, "GIMP_FG_TRANSPARENT_MODE", "fg-transparent-mode" }, + { GIMP_CUSTOM_MODE, "GIMP_CUSTOM_MODE", "custom-mode" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_FG_BG_RGB_MODE, "GIMP_FG_BG_RGB_MODE", NULL }, + { GIMP_FG_BG_HSV_MODE, "GIMP_FG_BG_HSV_MODE", NULL }, + { GIMP_FG_TRANSPARENT_MODE, "GIMP_FG_TRANSPARENT_MODE", NULL }, + { GIMP_CUSTOM_MODE, "GIMP_CUSTOM_MODE", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpBlendModeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "blend-mode-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_bucket_fill_mode_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_FG_BUCKET_FILL, "GIMP_FG_BUCKET_FILL", "fg-bucket-fill" }, + { GIMP_BG_BUCKET_FILL, "GIMP_BG_BUCKET_FILL", "bg-bucket-fill" }, + { GIMP_PATTERN_BUCKET_FILL, "GIMP_PATTERN_BUCKET_FILL", "pattern-bucket-fill" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_FG_BUCKET_FILL, "GIMP_FG_BUCKET_FILL", NULL }, + { GIMP_BG_BUCKET_FILL, "GIMP_BG_BUCKET_FILL", NULL }, + { GIMP_PATTERN_BUCKET_FILL, "GIMP_PATTERN_BUCKET_FILL", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpBucketFillModeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "bucket-fill-mode-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_clone_type_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_IMAGE_CLONE, "GIMP_IMAGE_CLONE", "image-clone" }, + { GIMP_PATTERN_CLONE, "GIMP_PATTERN_CLONE", "pattern-clone" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_IMAGE_CLONE, "GIMP_IMAGE_CLONE", NULL }, + { GIMP_PATTERN_CLONE, "GIMP_PATTERN_CLONE", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpCloneTypeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "clone-type-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_convolve_type_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_BLUR_CONVOLVE, "GIMP_BLUR_CONVOLVE", "blur-convolve" }, + { GIMP_SHARPEN_CONVOLVE, "GIMP_SHARPEN_CONVOLVE", "sharpen-convolve" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_BLUR_CONVOLVE, "GIMP_BLUR_CONVOLVE", NULL }, + { GIMP_SHARPEN_CONVOLVE, "GIMP_SHARPEN_CONVOLVE", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpConvolveTypeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "convolve-type-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_fill_type_compat_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_FOREGROUND_FILL, "GIMP_FOREGROUND_FILL", "foreground-fill" }, + { GIMP_BACKGROUND_FILL, "GIMP_BACKGROUND_FILL", "background-fill" }, + { GIMP_WHITE_FILL, "GIMP_WHITE_FILL", "white-fill" }, + { GIMP_TRANSPARENT_FILL, "GIMP_TRANSPARENT_FILL", "transparent-fill" }, + { GIMP_PATTERN_FILL, "GIMP_PATTERN_FILL", "pattern-fill" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_FOREGROUND_FILL, "GIMP_FOREGROUND_FILL", NULL }, + { GIMP_BACKGROUND_FILL, "GIMP_BACKGROUND_FILL", NULL }, + { GIMP_WHITE_FILL, "GIMP_WHITE_FILL", NULL }, + { GIMP_TRANSPARENT_FILL, "GIMP_TRANSPARENT_FILL", NULL }, + { GIMP_PATTERN_FILL, "GIMP_PATTERN_FILL", NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpFillTypeCompat", values); + gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp"); + gimp_type_set_translation_context (type, "fill-type-compat"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + + +/* Generated data ends here */ + diff --git a/libgimpbase/gimpcompatenums.h b/libgimpbase/gimpcompatenums.h new file mode 100644 index 0000000000..1abd1fd716 --- /dev/null +++ b/libgimpbase/gimpcompatenums.h @@ -0,0 +1,109 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * This library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef __GIMP_COMPAT_ENUMS_H__ +#define __GIMP_COMPAT_ENUMS_H__ + + +G_BEGIN_DECLS + +/* These enums exist only for compatibility, their nicks are needed + * for config file parsing; they are registered in gimp_base_init(). + */ + + +#define GIMP_TYPE_ADD_MASK_TYPE_COMPAT (gimp_add_mask_type_compat_get_type ()) + +GType gimp_add_mask_type_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_ADD_WHITE_MASK = GIMP_ADD_MASK_WHITE, + GIMP_ADD_BLACK_MASK = GIMP_ADD_MASK_BLACK, + GIMP_ADD_ALPHA_MASK = GIMP_ADD_MASK_ALPHA, + GIMP_ADD_ALPHA_TRANSFER_MASK = GIMP_ADD_MASK_ALPHA_TRANSFER, + GIMP_ADD_SELECTION_MASK = GIMP_ADD_MASK_SELECTION, + GIMP_ADD_COPY_MASK = GIMP_ADD_MASK_COPY, + GIMP_ADD_CHANNEL_MASK = GIMP_ADD_MASK_CHANNEL +} GimpAddMaskTypeCompat; + + +#define GIMP_TYPE_BLEND_MODE_COMPAT (gimp_blend_mode_compat_get_type ()) + +GType gimp_blend_mode_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_FG_BG_RGB_MODE = GIMP_BLEND_FG_BG_RGB, + GIMP_FG_BG_HSV_MODE = GIMP_BLEND_FG_BG_HSV, + GIMP_FG_TRANSPARENT_MODE = GIMP_BLEND_FG_TRANSPARENT, + GIMP_CUSTOM_MODE = GIMP_BLEND_CUSTOM +} GimpBlendModeCompat; + + +#define GIMP_TYPE_BUCKET_FILL_MODE_COMPAT (gimp_bucket_fill_mode_compat_get_type ()) + +GType gimp_bucket_fill_mode_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_FG_BUCKET_FILL = GIMP_BUCKET_FILL_FG, + GIMP_BG_BUCKET_FILL = GIMP_BUCKET_FILL_BG, + GIMP_PATTERN_BUCKET_FILL = GIMP_BUCKET_FILL_PATTERN +} GimpBucketFillModeCompat; + + +#define GIMP_TYPE_CLONE_TYPE_COMPAT (gimp_clone_type_compat_get_type ()) + +GType gimp_clone_type_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_IMAGE_CLONE = GIMP_CLONE_IMAGE, + GIMP_PATTERN_CLONE = GIMP_CLONE_PATTERN +} GimpCloneTypeCompat; + + +#define GIMP_TYPE_CONVOLVE_TYPE_COMPAT (gimp_convolve_type_compat_get_type ()) + +GType gimp_convolve_type_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_BLUR_CONVOLVE = GIMP_CONVOLVE_BLUR, + GIMP_SHARPEN_CONVOLVE = GIMP_CONVOLVE_SHARPEN +} GimpConvolveTypeCompat; + + +#define GIMP_TYPE_FILL_TYPE_COMPAT (gimp_fill_type_compat_get_type ()) + +GType gimp_fill_type_compat_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_FOREGROUND_FILL = GIMP_FILL_FOREGROUND, + GIMP_BACKGROUND_FILL = GIMP_FILL_BACKGROUND, + GIMP_WHITE_FILL = GIMP_FILL_WHITE, + GIMP_TRANSPARENT_FILL = GIMP_FILL_TRANSPARENT, + GIMP_PATTERN_FILL = GIMP_FILL_PATTERN +} GimpFillTypeCompat; + + +G_END_DECLS + +#endif /* __GIMP_COMPAT_ENUMS_H__ */