Commit 67116466 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

Don't store human readable and translatable enum/flag strings in

2004-10-25  Michael Natterer  <mitch@gimp.org>

	Don't store human readable and translatable enum/flag strings in
	GEnumValue's and GTypeValue's fields but attach them to their
	GType using separate structs and utility functions:

	* tools/gimp-mkenums: added params and perl voodoo to support
	generating a second array of values, which is used by the
	Makefiles below to create and register arrays of value
	descriptions.

	* libgimpbase/gimpbasetypes.[ch]: added API to attach/retreive
	arrays of translatable strings to/from enum and flags types. Added
	structs GimpEnumDesc and GimpFlagsDesc for that purpose.

	* libgimpbase/gimputils.[ch]: changed existing enum utility
	functions, added new ones and added a symmetric API for flags.

	* app/base/Makefile.am
	* app/core/Makefile.am
	* app/display/Makefile.am
	* app/paint/Makefile.am
	* app/text/Makefile.am
	* app/tools/Makefile.am
	* app/widgets/Makefile.am
	* libgimp/Makefile.am
	* libgimpbase/Makefile.am: changed *-enums.c generation rules
	accordingly.

	* app/base/base-enums.c
	* app/core/core-enums.c
	* app/display/display-enums.c
	* app/paint/paint-enums.c
	* app/text/text-enums.c
	* app/tools/tools-enums.c
	* app/widgets/widgets-enums.c
	* libgimpbase/gimpbaseenums.c: regenerated.

	* app/widgets/gimpenumstore.c
	* app/widgets/gimpenumwidgets.c
	* app/widgets/gimptemplateeditor.c
	* libgimpwidgets/gimppreviewarea.c: follow the enum utility
	function API changes.
parent 14b1e0c2
2004-10-25 Michael Natterer <mitch@gimp.org>
Don't store human readable and translatable enum/flag strings in
GEnumValue's and GTypeValue's fields but attach them to their
GType using separate structs and utility functions:
* tools/gimp-mkenums: added params and perl voodoo to support
generating a second array of values, which is used by the
Makefiles below to create and register arrays of value
descriptions.
* libgimpbase/gimpbasetypes.[ch]: added API to attach/retreive
arrays of translatable strings to/from enum and flags types. Added
structs GimpEnumDesc and GimpFlagsDesc for that purpose.
* libgimpbase/gimputils.[ch]: changed existing enum utility
functions, added new ones and added a symmetric API for flags.
* app/base/Makefile.am
* app/core/Makefile.am
* app/display/Makefile.am
* app/paint/Makefile.am
* app/text/Makefile.am
* app/tools/Makefile.am
* app/widgets/Makefile.am
* libgimp/Makefile.am
* libgimpbase/Makefile.am: changed *-enums.c generation rules
accordingly.
* app/base/base-enums.c
* app/core/core-enums.c
* app/display/display-enums.c
* app/paint/paint-enums.c
* app/text/text-enums.c
* app/tools/tools-enums.c
* app/widgets/widgets-enums.c
* libgimpbase/gimpbaseenums.c: regenerated.
* app/widgets/gimpenumstore.c
* app/widgets/gimpenumwidgets.c
* app/widgets/gimptemplateeditor.c
* libgimpwidgets/gimppreviewarea.c: follow the enum utility
function API changes.
2004-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_cmd_gimp_guides.c
......
......@@ -90,11 +90,14 @@ CLEANFILES = $(EXTRA_PROGRAMS) $(gen_sources)
$(srcdir)/base-enums.c: $(srcdir)/base-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"base-enums.h\"\n#include \"gimp-intl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"base-enums.h\"\n#include \"gimp-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@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\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 (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/base-enums.h > xgen-bec \
&& cp xgen-bec $(@F) \
&& rm -f xgen-bec
......@@ -3,6 +3,7 @@
#include "config.h"
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "base-enums.h"
#include "gimp-intl.h"
......@@ -12,15 +13,25 @@ gimp_curve_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CURVE_SMOOTH, N_("Smooth"), "smooth" },
{ GIMP_CURVE_FREE, N_("Freehand"), "free" },
{ GIMP_CURVE_SMOOTH, "GIMP_CURVE_SMOOTH", "smooth" },
{ GIMP_CURVE_FREE, "GIMP_CURVE_FREE", "free" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CURVE_SMOOTH, N_("Smooth"), NULL },
{ GIMP_CURVE_FREE, N_("Freehand"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpCurveType", values);
{
type = g_enum_register_static ("GimpCurveType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -30,19 +41,33 @@ gimp_histogram_channel_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_HISTOGRAM_VALUE, N_("Value"), "value" },
{ GIMP_HISTOGRAM_RED, N_("Red"), "red" },
{ GIMP_HISTOGRAM_GREEN, N_("Green"), "green" },
{ GIMP_HISTOGRAM_BLUE, N_("Blue"), "blue" },
{ GIMP_HISTOGRAM_ALPHA, N_("Alpha"), "alpha" },
{ GIMP_HISTOGRAM_RGB, N_("RGB"), "rgb" },
{ GIMP_HISTOGRAM_VALUE, "GIMP_HISTOGRAM_VALUE", "value" },
{ GIMP_HISTOGRAM_RED, "GIMP_HISTOGRAM_RED", "red" },
{ GIMP_HISTOGRAM_GREEN, "GIMP_HISTOGRAM_GREEN", "green" },
{ GIMP_HISTOGRAM_BLUE, "GIMP_HISTOGRAM_BLUE", "blue" },
{ GIMP_HISTOGRAM_ALPHA, "GIMP_HISTOGRAM_ALPHA", "alpha" },
{ GIMP_HISTOGRAM_RGB, "GIMP_HISTOGRAM_RGB", "rgb" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_HISTOGRAM_VALUE, N_("Value"), NULL },
{ GIMP_HISTOGRAM_RED, N_("Red"), NULL },
{ GIMP_HISTOGRAM_GREEN, N_("Green"), NULL },
{ GIMP_HISTOGRAM_BLUE, N_("Blue"), NULL },
{ GIMP_HISTOGRAM_ALPHA, N_("Alpha"), NULL },
{ GIMP_HISTOGRAM_RGB, N_("RGB"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpHistogramChannel", values);
{
type = g_enum_register_static ("GimpHistogramChannel", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -52,16 +77,27 @@ gimp_interpolation_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_INTERPOLATION_NONE, N_("None (Fastest)"), "none" },
{ GIMP_INTERPOLATION_LINEAR, N_("Linear"), "linear" },
{ GIMP_INTERPOLATION_CUBIC, N_("Cubic (Best)"), "cubic" },
{ GIMP_INTERPOLATION_NONE, "GIMP_INTERPOLATION_NONE", "none" },
{ GIMP_INTERPOLATION_LINEAR, "GIMP_INTERPOLATION_LINEAR", "linear" },
{ GIMP_INTERPOLATION_CUBIC, "GIMP_INTERPOLATION_CUBIC", "cubic" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_INTERPOLATION_NONE, N_("None (Fastest)"), NULL },
{ GIMP_INTERPOLATION_LINEAR, N_("Linear"), NULL },
{ GIMP_INTERPOLATION_CUBIC, N_("Cubic (Best)"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpInterpolationType", values);
{
type = g_enum_register_static ("GimpInterpolationType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -97,10 +133,41 @@ gimp_layer_mode_effects_get_type (void)
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_NORMAL_MODE, "GIMP_NORMAL_MODE", NULL },
{ GIMP_DISSOLVE_MODE, "GIMP_DISSOLVE_MODE", NULL },
{ GIMP_BEHIND_MODE, "GIMP_BEHIND_MODE", NULL },
{ GIMP_MULTIPLY_MODE, "GIMP_MULTIPLY_MODE", NULL },
{ GIMP_SCREEN_MODE, "GIMP_SCREEN_MODE", NULL },
{ GIMP_OVERLAY_MODE, "GIMP_OVERLAY_MODE", NULL },
{ GIMP_DIFFERENCE_MODE, "GIMP_DIFFERENCE_MODE", NULL },
{ GIMP_ADDITION_MODE, "GIMP_ADDITION_MODE", NULL },
{ GIMP_SUBTRACT_MODE, "GIMP_SUBTRACT_MODE", NULL },
{ GIMP_DARKEN_ONLY_MODE, "GIMP_DARKEN_ONLY_MODE", NULL },
{ GIMP_LIGHTEN_ONLY_MODE, "GIMP_LIGHTEN_ONLY_MODE", NULL },
{ GIMP_HUE_MODE, "GIMP_HUE_MODE", NULL },
{ GIMP_SATURATION_MODE, "GIMP_SATURATION_MODE", NULL },
{ GIMP_COLOR_MODE, "GIMP_COLOR_MODE", NULL },
{ GIMP_VALUE_MODE, "GIMP_VALUE_MODE", NULL },
{ GIMP_DIVIDE_MODE, "GIMP_DIVIDE_MODE", NULL },
{ GIMP_DODGE_MODE, "GIMP_DODGE_MODE", NULL },
{ GIMP_BURN_MODE, "GIMP_BURN_MODE", NULL },
{ GIMP_HARDLIGHT_MODE, "GIMP_HARDLIGHT_MODE", NULL },
{ GIMP_SOFTLIGHT_MODE, "GIMP_SOFTLIGHT_MODE", NULL },
{ GIMP_GRAIN_EXTRACT_MODE, "GIMP_GRAIN_EXTRACT_MODE", NULL },
{ GIMP_GRAIN_MERGE_MODE, "GIMP_GRAIN_MERGE_MODE", NULL },
{ GIMP_COLOR_ERASE_MODE, "GIMP_COLOR_ERASE_MODE", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpLayerModeEffects", values);
{
type = g_enum_register_static ("GimpLayerModeEffects", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -110,16 +177,27 @@ gimp_transfer_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_SHADOWS, N_("Shadows"), "shadows" },
{ GIMP_MIDTONES, N_("Midtones"), "midtones" },
{ GIMP_HIGHLIGHTS, N_("Highlights"), "highlights" },
{ GIMP_SHADOWS, "GIMP_SHADOWS", "shadows" },
{ GIMP_MIDTONES, "GIMP_MIDTONES", "midtones" },
{ GIMP_HIGHLIGHTS, "GIMP_HIGHLIGHTS", "highlights" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_SHADOWS, N_("Shadows"), NULL },
{ GIMP_MIDTONES, N_("Midtones"), NULL },
{ GIMP_HIGHLIGHTS, N_("Highlights"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpTransferMode", values);
{
type = g_enum_register_static ("GimpTransferMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......
......@@ -253,11 +253,14 @@ $(srcdir)/gimpmarshal.c: $(srcdir)/gimpmarshal.h
$(srcdir)/core-enums.c: $(srcdir)/core-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"core-enums.h\"\n#include \"gimp-intl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"core-enums.h\"\n#include \"gimp-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@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\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 (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/core-enums.h > xgen-cec \
&& cp xgen-cec $(@F) \
&& rm -f xgen-cec
This diff is collapsed.
......@@ -86,11 +86,14 @@ CLEANFILES = $(gen_sources)
$(srcdir)/display-enums.c: $(srcdir)/display-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"display-enums.h\"\n#include\"gimp-intl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"display-enums.h\"\n#include\"gimp-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@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\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 (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/display-enums.h > xgen-dec \
&& cp xgen-dec $(@F) \
&& rm -f xgen-dec
......@@ -3,6 +3,7 @@
#include "config.h"
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "display-enums.h"
#include"gimp-intl.h"
......@@ -12,16 +13,27 @@ gimp_cursor_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CURSOR_MODE_TOOL_ICON, N_("Tool icon"), "tool-icon" },
{ GIMP_CURSOR_MODE_TOOL_CROSSHAIR, N_("Tool icon with crosshair"), "tool-crosshair" },
{ GIMP_CURSOR_MODE_CROSSHAIR, N_("Crosshair only"), "crosshair" },
{ GIMP_CURSOR_MODE_TOOL_ICON, "GIMP_CURSOR_MODE_TOOL_ICON", "tool-icon" },
{ GIMP_CURSOR_MODE_TOOL_CROSSHAIR, "GIMP_CURSOR_MODE_TOOL_CROSSHAIR", "tool-crosshair" },
{ GIMP_CURSOR_MODE_CROSSHAIR, "GIMP_CURSOR_MODE_CROSSHAIR", "crosshair" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CURSOR_MODE_TOOL_ICON, N_("Tool icon"), NULL },
{ GIMP_CURSOR_MODE_TOOL_CROSSHAIR, N_("Tool icon with crosshair"), NULL },
{ GIMP_CURSOR_MODE_CROSSHAIR, N_("Crosshair only"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpCursorMode", values);
{
type = g_enum_register_static ("GimpCursorMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -31,17 +43,29 @@ gimp_canvas_padding_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CANVAS_PADDING_MODE_DEFAULT, N_("From theme"), "default" },
{ GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, N_("Light check color"), "light-check" },
{ GIMP_CANVAS_PADDING_MODE_DARK_CHECK, N_("Dark check color"), "dark-check" },
{ GIMP_CANVAS_PADDING_MODE_CUSTOM, N_("Custom color"), "custom" },
{ GIMP_CANVAS_PADDING_MODE_DEFAULT, "GIMP_CANVAS_PADDING_MODE_DEFAULT", "default" },
{ GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, "GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK", "light-check" },
{ GIMP_CANVAS_PADDING_MODE_DARK_CHECK, "GIMP_CANVAS_PADDING_MODE_DARK_CHECK", "dark-check" },
{ GIMP_CANVAS_PADDING_MODE_CUSTOM, "GIMP_CANVAS_PADDING_MODE_CUSTOM", "custom" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CANVAS_PADDING_MODE_DEFAULT, N_("From theme"), NULL },
{ GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, N_("Light check color"), NULL },
{ GIMP_CANVAS_PADDING_MODE_DARK_CHECK, N_("Dark check color"), NULL },
{ GIMP_CANVAS_PADDING_MODE_CUSTOM, N_("Custom color"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpCanvasPaddingMode", values);
{
type = g_enum_register_static ("GimpCanvasPaddingMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......
......@@ -83,11 +83,14 @@ CLEANFILES = $(gen_sources)
$(srcdir)/paint-enums.c: $(srcdir)/paint-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"paint-enums.h\"\n#include \"gimp-intl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"paint-enums.h\"\n#include \"gimp-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@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\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 (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/paint-enums.h > xgen-pec \
&& cp xgen-pec $(@F) \
&& rm -f xgen-pec
......@@ -3,6 +3,7 @@
#include "config.h"
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "paint-enums.h"
#include "gimp-intl.h"
......@@ -12,15 +13,25 @@ gimp_clone_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_IMAGE_CLONE, N_("Image source"), "image-clone" },
{ GIMP_PATTERN_CLONE, N_("Pattern source"), "pattern-clone" },
{ 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, N_("Image source"), NULL },
{ GIMP_PATTERN_CLONE, N_("Pattern source"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpCloneType", values);
{
type = g_enum_register_static ("GimpCloneType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -30,16 +41,27 @@ gimp_clone_align_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CLONE_ALIGN_NO, N_("Non-aligned"), "no" },
{ GIMP_CLONE_ALIGN_YES, N_("Aligned"), "yes" },
{ GIMP_CLONE_ALIGN_REGISTERED, N_("Registered"), "registered" },
{ GIMP_CLONE_ALIGN_NO, "GIMP_CLONE_ALIGN_NO", "no" },
{ GIMP_CLONE_ALIGN_YES, "GIMP_CLONE_ALIGN_YES", "yes" },
{ GIMP_CLONE_ALIGN_REGISTERED, "GIMP_CLONE_ALIGN_REGISTERED", "registered" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CLONE_ALIGN_NO, N_("Non-aligned"), NULL },
{ GIMP_CLONE_ALIGN_YES, N_("Aligned"), NULL },
{ GIMP_CLONE_ALIGN_REGISTERED, N_("Registered"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpCloneAlignMode", values);
{
type = g_enum_register_static ("GimpCloneAlignMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -49,15 +71,25 @@ gimp_dodge_burn_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_DODGE, N_("Dodge"), "dodge" },
{ GIMP_BURN, N_("Burn"), "burn" },
{ GIMP_DODGE, "GIMP_DODGE", "dodge" },
{ GIMP_BURN, "GIMP_BURN", "burn" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_DODGE, N_("Dodge"), NULL },
{ GIMP_BURN, N_("Burn"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpDodgeBurnType", values);
{
type = g_enum_register_static ("GimpDodgeBurnType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -67,15 +99,25 @@ gimp_convolve_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_BLUR_CONVOLVE, N_("Blur"), "blur-convolve" },
{ GIMP_SHARPEN_CONVOLVE, N_("Sharpen"), "sharpen-convolve" },
{ 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, N_("Blur"), NULL },
{ GIMP_SHARPEN_CONVOLVE, N_("Sharpen"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpConvolveType", values);
{
type = g_enum_register_static ("GimpConvolveType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -91,10 +133,21 @@ gimp_ink_blob_type_get_type (void)
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_INK_BLOB_TYPE_ELLIPSE, "GIMP_INK_BLOB_TYPE_ELLIPSE", NULL },
{ GIMP_INK_BLOB_TYPE_SQUARE, "GIMP_INK_BLOB_TYPE_SQUARE", NULL },
{ GIMP_INK_BLOB_TYPE_DIAMOND, "GIMP_INK_BLOB_TYPE_DIAMOND", NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpInkBlobType", values);
{
type = g_enum_register_static ("GimpInkBlobType", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......@@ -104,15 +157,25 @@ gimp_paint_application_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_PAINT_CONSTANT, N_("Constant"), "constant" },
{ GIMP_PAINT_INCREMENTAL, N_("Incremental"), "incremental" },
{ GIMP_PAINT_CONSTANT, "GIMP_PAINT_CONSTANT", "constant" },
{ GIMP_PAINT_INCREMENTAL, "GIMP_PAINT_INCREMENTAL", "incremental" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_PAINT_CONSTANT, N_("Constant"), NULL },
{ GIMP_PAINT_INCREMENTAL, N_("Incremental"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (! type)
type = g_enum_register_static ("GimpPaintApplicationMode", values);
{
type = g_enum_register_static ("GimpPaintApplicationMode", values);
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
......
......@@ -538,7 +538,11 @@ plug_in_close (PlugIn *plug_in,
/* If necessary, kill the filter. */
#ifndef G_OS_WIN32
if (kill_it && plug_in->pid)
status = kill (plug_in->pid, SIGKILL);
{
g_warning ("Terminating %s ...",
gimp_filename_to_utf8 (plug_in->prog));
status = kill (plug_in->pid, SIGKILL);
}
/* Wait for the process to exit. This will happen
* immediately if it was just killed.
......
......@@ -538,7 +538,11 @@ plug_in_close (PlugIn *plug_in,
/* If necessary, kill the filter. */
#ifndef G_OS_WIN32
if (kill_it && plug_in->pid)
status = kill (plug_in->pid, SIGKILL);
{
g_warning ("Terminating %s ...",
gimp_filename_to_utf8 (plug_in->prog));
status = kill (plug_in->pid, SIGKILL);
}
/* Wait for the process to exit. This will happen
* immediately if it was just killed.
......
......@@ -64,11 +64,14 @@ CLEANFILES = $(gen_sources)
$(srcdir)/text-enums.c: $(srcdir)/text-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"text-enums.h\"\n#include \"gimp-intl.h\"" \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpbase/gimpbase.h\"\n#include \"text-enums.h\"\n#include \"gimp-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@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (! type)\n type = g_@type@_register_static (\"@EnumName@\", values);\n\n return type;\n}\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 (! type)\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \
$(srcdir)/text-enums.h > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec
......@@ -3,6 +3,7 @@
#include "config.h"