Commit a3eef872 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

tools/pdbgen/enumcode.pl register all enums in libgimp/gimenums.h with the

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

	* tools/pdbgen/enumcode.pl
	* libgimp/Makefile.am: register all enums in libgimp/gimenums.h
	with the type system.

	* libgimp/gimpenums.h: regenerated.
parent e11bcb15
2004-10-25 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/enumcode.pl
* libgimp/Makefile.am: register all enums in libgimp/gimenums.h
with the type system.
* libgimp/gimpenums.h: regenerated.
2004-10-25 Sven Neumann <sven@gimp.org>
* configure.in: gimp_user_version should be 2.2.
......
......@@ -6,3 +6,4 @@ _libs
.libs
.deps
*.la
gimpenums.c
......@@ -162,11 +162,12 @@ PDB_WRAPPERS_H = \
gimpundo_pdb.h \
gimpunit_pdb.h
libgimp_2_0_la_SOURCES = \
libgimp_2_0_la_sources = \
gimp.c \
gimp.h \
gimpcompat.h \
gimptypes.h \
gimpenums.h \
${PDB_WRAPPERS_C} \
${PDB_WRAPPERS_H} \
gimpbrushes.c \
......@@ -218,6 +219,13 @@ libgimp_2_0_la_SOURCES = \
stdplugins-intl.h \
libgimp-intl.h
libgimp_2_0_la_built_sources = \
gimpenums.c
libgimp_2_0_la_SOURCES = \
$(libgimp_2_0_la_sources) \
$(libgimp_2_0_la_built_sources)
libgimpui_2_0_la_SOURCES = \
gimpui.c \
gimpui.h \
......@@ -253,12 +261,12 @@ gimpinclude_HEADERS = \
gimp.h \
gimpcompat.h \
gimptypes.h \
gimpenums.h \
${PDB_WRAPPERS_H} \
gimpbrushes.h \
gimpbrushselect.h \
gimpchannel.h \
gimpdrawable.h \
gimpenums.h \
gimpfontselect.h \
gimpgradients.h \
gimpgradientselect.h \
......@@ -316,3 +324,21 @@ libgimpui_2_0_la_DEPENDENCIES = $(gimpui_def) $(libgimp) $(libgimpwidgets) $(lib
install-data-local: install-ms-lib install-libtool-import-lib
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
#
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-cec
CLEANFILES = $(gen_sources)
$(srcdir)/gimpenums.c: $(srcdir)/gimpenums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"gimpenums.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" \
$(srcdir)/gimpenums.h > xgen-cec \
&& cp xgen-cec $(@F) \
&& rm -f xgen-cec
......@@ -24,6 +24,11 @@
G_BEGIN_DECLS
#define GIMP_TYPE_ADD_MASK_TYPE (gimp_add_mask_type_get_type ())
GType gimp_add_mask_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ADD_WHITE_MASK,
......@@ -34,6 +39,11 @@ typedef enum
GIMP_ADD_COPY_MASK
} GimpAddMaskType;
#define GIMP_TYPE_BLEND_MODE (gimp_blend_mode_get_type ())
GType gimp_blend_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_FG_BG_RGB_MODE,
......@@ -42,12 +52,22 @@ typedef enum
GIMP_CUSTOM_MODE
} GimpBlendMode;
#define GIMP_TYPE_BRUSH_APPLICATION_MODE (gimp_brush_application_mode_get_type ())
GType gimp_brush_application_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_BRUSH_HARD,
GIMP_BRUSH_SOFT
} GimpBrushApplicationMode;
#define GIMP_TYPE_BUCKET_FILL_MODE (gimp_bucket_fill_mode_get_type ())
GType gimp_bucket_fill_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_FG_BUCKET_FILL,
......@@ -55,6 +75,11 @@ typedef enum
GIMP_PATTERN_BUCKET_FILL
} GimpBucketFillMode;
#define GIMP_TYPE_CHANNEL_OPS (gimp_channel_ops_get_type ())
GType gimp_channel_ops_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_CHANNEL_OP_ADD,
......@@ -63,6 +88,11 @@ typedef enum
GIMP_CHANNEL_OP_INTERSECT
} GimpChannelOps;
#define GIMP_TYPE_CHANNEL_TYPE (gimp_channel_type_get_type ())
GType gimp_channel_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_RED_CHANNEL,
......@@ -73,12 +103,22 @@ typedef enum
GIMP_ALPHA_CHANNEL
} GimpChannelType;
#define GIMP_TYPE_CLONE_TYPE (gimp_clone_type_get_type ())
GType gimp_clone_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_IMAGE_CLONE,
GIMP_PATTERN_CLONE
} GimpCloneType;
#define GIMP_TYPE_CONVERT_DITHER_TYPE (gimp_convert_dither_type_get_type ())
GType gimp_convert_dither_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_NO_DITHER,
......@@ -87,6 +127,11 @@ typedef enum
GIMP_FIXED_DITHER
} GimpConvertDitherType;
#define GIMP_TYPE_CONVERT_PALETTE_TYPE (gimp_convert_palette_type_get_type ())
GType gimp_convert_palette_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_MAKE_PALETTE,
......@@ -96,6 +141,11 @@ typedef enum
GIMP_CUSTOM_PALETTE
} GimpConvertPaletteType;
#define GIMP_TYPE_CONVOLUTION_TYPE (gimp_convolution_type_get_type ())
GType gimp_convolution_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_NORMAL_CONVOL,
......@@ -103,18 +153,33 @@ typedef enum
GIMP_NEGATIVE_CONVOL
} GimpConvolutionType;
#define GIMP_TYPE_CONVOLVE_TYPE (gimp_convolve_type_get_type ())
GType gimp_convolve_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_BLUR_CONVOLVE,
GIMP_SHARPEN_CONVOLVE
} GimpConvolveType;
#define GIMP_TYPE_DODGE_BURN_TYPE (gimp_dodge_burn_type_get_type ())
GType gimp_dodge_burn_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_DODGE,
GIMP_BURN
} GimpDodgeBurnType;
#define GIMP_TYPE_FILL_TYPE (gimp_fill_type_get_type ())
GType gimp_fill_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_FOREGROUND_FILL,
......@@ -124,6 +189,11 @@ typedef enum
GIMP_PATTERN_FILL
} GimpFillType;
#define GIMP_TYPE_GRADIENT_SEGMENT_COLOR (gimp_gradient_segment_color_get_type ())
GType gimp_gradient_segment_color_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_SEGMENT_RGB,
......@@ -131,6 +201,11 @@ typedef enum
GIMP_GRADIENT_SEGMENT_HSV_CW
} GimpGradientSegmentColor;
#define GIMP_TYPE_GRADIENT_SEGMENT_TYPE (gimp_gradient_segment_type_get_type ())
GType gimp_gradient_segment_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_SEGMENT_LINEAR,
......@@ -140,6 +215,11 @@ typedef enum
GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING
} GimpGradientSegmentType;
#define GIMP_TYPE_GRADIENT_TYPE (gimp_gradient_type_get_type ())
GType gimp_gradient_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_GRADIENT_LINEAR,
......@@ -155,6 +235,11 @@ typedef enum
GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE
} GimpGradientType;
#define GIMP_TYPE_HISTOGRAM_CHANNEL (gimp_histogram_channel_get_type ())
GType gimp_histogram_channel_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_HISTOGRAM_VALUE,
......@@ -164,6 +249,11 @@ typedef enum
GIMP_HISTOGRAM_ALPHA
} GimpHistogramChannel;
#define GIMP_TYPE_HUE_RANGE (gimp_hue_range_get_type ())
GType gimp_hue_range_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ALL_HUES,
......@@ -175,6 +265,11 @@ typedef enum
GIMP_MAGENTA_HUES
} GimpHueRange;
#define GIMP_TYPE_ICON_TYPE (gimp_icon_type_get_type ())
GType gimp_icon_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ICON_TYPE_STOCK_ID,
......@@ -182,6 +277,11 @@ typedef enum
GIMP_ICON_TYPE_IMAGE_FILE
} GimpIconType;
#define GIMP_TYPE_LAYER_MODE_EFFECTS (gimp_layer_mode_effects_get_type ())
GType gimp_layer_mode_effects_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_NORMAL_MODE,
......@@ -209,12 +309,22 @@ typedef enum
GIMP_COLOR_ERASE_MODE
} GimpLayerModeEffects;
#define GIMP_TYPE_MASK_APPLY_MODE (gimp_mask_apply_mode_get_type ())
GType gimp_mask_apply_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_MASK_APPLY,
GIMP_MASK_DISCARD
} GimpMaskApplyMode;
#define GIMP_TYPE_MERGE_TYPE (gimp_merge_type_get_type ())
GType gimp_merge_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_EXPAND_AS_NECESSARY,
......@@ -223,12 +333,22 @@ typedef enum
GIMP_FLATTEN_IMAGE
} GimpMergeType;
#define GIMP_TYPE_OFFSET_TYPE (gimp_offset_type_get_type ())
GType gimp_offset_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_OFFSET_BACKGROUND,
GIMP_OFFSET_TRANSPARENT
} GimpOffsetType;
#define GIMP_TYPE_ORIENTATION_TYPE (gimp_orientation_type_get_type ())
GType gimp_orientation_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ORIENTATION_HORIZONTAL,
......@@ -236,12 +356,22 @@ typedef enum
GIMP_ORIENTATION_UNKNOWN
} GimpOrientationType;
#define GIMP_TYPE_PAINT_APPLICATION_MODE (gimp_paint_application_mode_get_type ())
GType gimp_paint_application_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_PAINT_CONSTANT,
GIMP_PAINT_INCREMENTAL
} GimpPaintApplicationMode;
#define GIMP_TYPE_REPEAT_MODE (gimp_repeat_mode_get_type ())
GType gimp_repeat_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_REPEAT_NONE,
......@@ -249,6 +379,11 @@ typedef enum
GIMP_REPEAT_TRIANGULAR
} GimpRepeatMode;
#define GIMP_TYPE_ROTATION_TYPE (gimp_rotation_type_get_type ())
GType gimp_rotation_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ROTATE_90,
......@@ -256,6 +391,11 @@ typedef enum
GIMP_ROTATE_270
} GimpRotationType;
#define GIMP_TYPE_RUN_MODE (gimp_run_mode_get_type ())
GType gimp_run_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_RUN_INTERACTIVE,
......@@ -263,12 +403,22 @@ typedef enum
GIMP_RUN_WITH_LAST_VALS
} GimpRunMode;
#define GIMP_TYPE_SIZE_TYPE (gimp_size_type_get_type ())
GType gimp_size_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_PIXELS,
GIMP_POINTS
} GimpSizeType;
#define GIMP_TYPE_TRANSFER_MODE (gimp_transfer_mode_get_type ())
GType gimp_transfer_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_SHADOWS,
......
......@@ -123,23 +123,26 @@ HEADER
foreach (sort keys %enums) {
if (! ($enums{$_}->{header} =~ /libgimp/)) {
my $gtype = $func = $_;
for ($gtype) { s/Gimp//; s/([A-Z][^A-Z]+)/\U\1\E_/g; s/_$// }
for ($func) { s/Gimp//; s/([A-Z][^A-Z]+)/\L\1\E_/g; s/_$// }
print ENUMFILE "\n#define GIMP_TYPE_$gtype (gimp_$func\_get_type ())\n\n";
print ENUMFILE "GType gimp_$func\_get_type (void) G_GNUC_CONST;\n\n";
print ENUMFILE "typedef enum\n{\n";
my $enum = $enums{$_}; my $body = "";
foreach $symbol (@{$enum->{symbols}}) {
my $sym = $symbol;
if ($sym =~ /^GIMP\_/) {
$body .= " $sym";
} else {
$body .= " GIMP_$sym";
}
$body .= " = $enum->{mapping}->{$symbol}" if !$enum->{contig};
$body .= ",\n";
}
$body =~ s/,\n$//s;
$body .= "\n} ";
$body .= "Gimp" unless /^Gimp/;
$body .= "$_;\n\n";
print ENUMFILE $body
}
......
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