From d2292ffe3535924daeb9242c987b3a9b25960281 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 5 Jul 2004 20:55:05 +0000 Subject: [PATCH] removed enum SizeType. 2004-07-05 Michael Natterer * app/core/core-types.h: removed enum SizeType. * app/text/text-enums.h: added it as enum GimpSizeType and added comment that it's for backward compatibility only. * tools/pdbgen/Makefile.am * tools/pdbgen/pdb/text_tool.pdb: changed accordingly. * libgimp/gimpenums.h * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated (pdbgen insisted on reordering the enums). --- ChangeLog | 16 ++++++++++++++++ app/core/core-types.h | 9 --------- app/text/text-enums.h | 17 +++++++++++++---- libgimp/gimpenums.h | 12 ++++++------ plug-ins/pygimp/gimpenums.py | 8 ++++---- plug-ins/script-fu/script-fu-constants.c | 6 +++--- tools/pdbgen/Makefile.am | 2 +- tools/pdbgen/enums.pl | 4 ++-- tools/pdbgen/pdb/text_tool.pdb | 2 +- 9 files changed, 46 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6989940d8..24f6254f89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2004-07-05 Michael Natterer + + * app/core/core-types.h: removed enum SizeType. + + * app/text/text-enums.h: added it as enum GimpSizeType and added + comment that it's for backward compatibility only. + + * tools/pdbgen/Makefile.am + * tools/pdbgen/pdb/text_tool.pdb: changed accordingly. + + * libgimp/gimpenums.h + * plug-ins/pygimp/gimpenums.py + * plug-ins/script-fu/script-fu-constants.c + * tools/pdbgen/enums.pl: regenerated (pdbgen insisted on + reordering the enums). + 2004-07-05 Michael Natterer * app/core/core-types.h: #define MIN and MAX values for diff --git a/app/core/core-types.h b/app/core/core-types.h index e3d7d5510e..9bebb3b93c 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -47,15 +47,6 @@ #define GIMP_COORDS_DEFAULT_WHEEL 0.5 -/* enums */ - -typedef enum -{ - GIMP_PIXELS, - GIMP_POINTS -} SizeType; - - /* base objects */ typedef struct _GimpObject GimpObject; diff --git a/app/text/text-enums.h b/app/text/text-enums.h index d1e9385480..ffa9e018f3 100644 --- a/app/text/text-enums.h +++ b/app/text/text-enums.h @@ -24,7 +24,7 @@ GType gimp_text_box_mode_get_type (void) G_GNUC_CONST; -typedef enum +typedef enum /*< pdb-skip >*/ { GIMP_TEXT_BOX_DYNAMIC, GIMP_TEXT_BOX_FIXED @@ -35,7 +35,7 @@ typedef enum GType gimp_text_direction_get_type (void) G_GNUC_CONST; -typedef enum +typedef enum /*< pdb-skip >*/ { GIMP_TEXT_DIRECTION_LTR, /*< desc="From left to right" >*/ GIMP_TEXT_DIRECTION_RTL /*< desc="From right to left" >*/ @@ -46,7 +46,7 @@ typedef enum GType gimp_text_justification_get_type (void) G_GNUC_CONST; -typedef enum +typedef enum /*< pdb-skip >*/ { GIMP_TEXT_JUSTIFY_LEFT, /*< desc="Left justified" >*/ GIMP_TEXT_JUSTIFY_RIGHT, /*< desc="Right justified" >*/ @@ -59,7 +59,7 @@ typedef enum GType gimp_text_outline_get_type (void) G_GNUC_CONST; -typedef enum +typedef enum /*< pdb-skip >*/ { GIMP_TEXT_OUTLINE_NONE, GIMP_TEXT_OUTLINE_STROKE_ONLY, @@ -67,4 +67,13 @@ typedef enum } GimpTextOutline; +/* backward compatibility enums */ + +typedef enum /*< skip >*/ +{ + GIMP_PIXELS, + GIMP_POINTS +} GimpSizeType; + + #endif /* __TEXT_ENUMS_H__ */ diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h index a63f6b5a06..91313eb21f 100644 --- a/libgimp/gimpenums.h +++ b/libgimp/gimpenums.h @@ -280,6 +280,12 @@ typedef enum GIMP_RUN_WITH_LAST_VALS } GimpRunMode; +typedef enum +{ + GIMP_PIXELS, + GIMP_POINTS +} GimpSizeType; + typedef enum { GIMP_SHADOWS, @@ -287,12 +293,6 @@ typedef enum GIMP_HIGHLIGHTS } GimpTransferMode; -typedef enum -{ - GIMP_PIXELS, - GIMP_POINTS -} GimpSizeType; - G_END_DECLS diff --git a/plug-ins/pygimp/gimpenums.py b/plug-ins/pygimp/gimpenums.py index 719a9795a3..f0fbd184dd 100644 --- a/plug-ins/pygimp/gimpenums.py +++ b/plug-ins/pygimp/gimpenums.py @@ -272,6 +272,10 @@ RUN_INTERACTIVE = 0 RUN_NONINTERACTIVE = 1 RUN_WITH_LAST_VALS = 2 +# GimpSizeType +PIXELS = 0 +POINTS = 1 + # GimpStackTraceMode STACK_TRACE_NEVER = 0 STACK_TRACE_QUERY = 1 @@ -290,7 +294,3 @@ UNIT_POINT = 3 UNIT_PICA = 4 UNIT_END = 5 -# GimpSizeType -PIXELS = 0 -POINTS = 1 - diff --git a/plug-ins/script-fu/script-fu-constants.c b/plug-ins/script-fu/script-fu-constants.c index 2540c44bc4..b5d0c48f18 100644 --- a/plug-ins/script-fu/script-fu-constants.c +++ b/plug-ins/script-fu/script-fu-constants.c @@ -228,6 +228,9 @@ init_generated_constants (void) setvar (cintern ("RUN-NONINTERACTIVE"), flocons (1), NIL); setvar (cintern ("RUN-WITH-LAST-VALS"), flocons (2), NIL); + setvar (cintern ("PIXELS"), flocons (0), NIL); + setvar (cintern ("POINTS"), flocons (1), NIL); + setvar (cintern ("STACK-TRACE-NEVER"), flocons (0), NIL); setvar (cintern ("STACK-TRACE-QUERY"), flocons (1), NIL); setvar (cintern ("STACK-TRACE-ALWAYS"), flocons (2), NIL); @@ -243,8 +246,5 @@ init_generated_constants (void) setvar (cintern ("UNIT-PICA"), flocons (4), NIL); setvar (cintern ("UNIT-END"), flocons (5), NIL); - setvar (cintern ("PIXELS"), flocons (0), NIL); - setvar (cintern ("POINTS"), flocons (1), NIL); - return; } diff --git a/tools/pdbgen/Makefile.am b/tools/pdbgen/Makefile.am index b350b52bef..2d23aead46 100644 --- a/tools/pdbgen/Makefile.am +++ b/tools/pdbgen/Makefile.am @@ -60,7 +60,7 @@ enum_headers = \ ../../app/paint-funcs/paint-funcs-types.h \ ../../app/base/base-enums.h \ ../../app/core/core-enums.h \ - ../../app/core/core-types.h \ + ../../app/text/text-enums.h \ ../../app/paint/paint-enums.h \ ../../app/plug-in/plug-in-types.h diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 75babd6668..7b3b286f3f 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -406,9 +406,9 @@ package Gimp::CodeGen::enums; mapping => { GIMP_OFFSET_BACKGROUND => '0', GIMP_OFFSET_TRANSPARENT => '1' } }, - SizeType => + GimpSizeType => { contig => 1, - header => 'core/core-types.h', + header => 'text/text-enums.h', symbols => [ qw(GIMP_PIXELS GIMP_POINTS) ], mapping => { GIMP_PIXELS => '0', GIMP_POINTS => '1' } diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index f685932342..4ec7a63205 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -40,7 +40,7 @@ sub fontname_arg () {{ sub size_args () {( { name => 'size', type => '0 < float', desc => 'The size of text in either pixels or points' }, - { name => 'size_type', type => 'enum SizeType', + { name => 'size_type', type => 'enum GimpSizeType', desc => 'The units of specified size: %%desc%%' } )}