removed GimpChannelLutType enum and export GimpHistogramChannel to the

2004-01-13  Michael Natterer  <mitch@gimp.org>

	* app/base/base-enums.h: removed GimpChannelLutType enum and
	export GimpHistogramChannel to the PDB. The removed enum was just
	there for libgimp compatibility.

	* tools/pdbgen/pdb/color.pdb: changed accordingly.

	* libgimp/gimpcompat.h
	* plug-ins/script-fu/siod-wrapper.c: added compat cruft.

	* app/pdb/color_cmds.c
	* libgimp/gimpcolor_pdb.[ch]
	* libgimp/gimpenums.h
	* plug-ins/pygimp/gimpenums.py
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
This commit is contained in:
Michael Natterer 2004-01-13 16:19:50 +00:00 committed by Michael Natterer
parent 7c5a13fef5
commit 8394e9e0f1
12 changed files with 173 additions and 139 deletions

View File

@ -1,3 +1,21 @@
2004-01-13 Michael Natterer <mitch@gimp.org>
* app/base/base-enums.h: removed GimpChannelLutType enum and
export GimpHistogramChannel to the PDB. The removed enum was just
there for libgimp compatibility.
* tools/pdbgen/pdb/color.pdb: changed accordingly.
* libgimp/gimpcompat.h
* plug-ins/script-fu/siod-wrapper.c: added compat cruft.
* app/pdb/color_cmds.c
* libgimp/gimpcolor_pdb.[ch]
* libgimp/gimpenums.h
* plug-ins/pygimp/gimpenums.py
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
2004-01-13 Sven Neumann <sven@gimp.org>
* libgimp/gimpcompat.h: fixed definition of gimp_use_xshm().

View File

@ -77,7 +77,7 @@ typedef enum /*< pdb-skip >*/
GType gimp_histogram_channel_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
typedef enum
{
GIMP_HISTOGRAM_VALUE = 0, /*< desc="Value" >*/
GIMP_HISTOGRAM_RED = 1, /*< desc="Red" >*/
@ -157,16 +157,6 @@ typedef enum /*< skip >*/
GIMP_NEGATIVE_CONVOL /* add 127 to values */
} GimpConvolutionType;
typedef enum /*< skip >*/
{
GIMP_VALUE_LUT,
GIMP_RED_LUT,
GIMP_GREEN_LUT,
GIMP_BLUE_LUT,
GIMP_ALPHA_LUT,
GIMP_GRAY_LUT = 0 /*< pdb-skip, skip >*/
} GimpChannelLutType;
typedef enum /*< skip >*/
{
GIMP_ALL_HUES,

View File

@ -90,13 +90,13 @@ gimp_brightness_contrast (gint32 drawable_ID,
* Returns: TRUE on success.
*/
gboolean
gimp_levels (gint32 drawable_ID,
GimpChannelLutType channel,
gint low_input,
gint high_input,
gdouble gamma,
gint low_output,
gint high_output)
gimp_levels (gint32 drawable_ID,
GimpHistogramChannel channel,
gint low_input,
gint high_input,
gdouble gamma,
gint low_output,
gint high_output)
{
GimpParam *return_vals;
gint nreturn_vals;
@ -307,10 +307,10 @@ gimp_invert (gint32 drawable_ID)
* Returns: TRUE on success.
*/
gboolean
gimp_curves_spline (gint32 drawable_ID,
GimpChannelLutType channel,
gint num_points,
const guint8 *control_pts)
gimp_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_points,
const guint8 *control_pts)
{
GimpParam *return_vals;
gint nreturn_vals;
@ -351,10 +351,10 @@ gimp_curves_spline (gint32 drawable_ID,
* Returns: TRUE on success.
*/
gboolean
gimp_curves_explicit (gint32 drawable_ID,
GimpChannelLutType channel,
gint num_bytes,
const guint8 *curve)
gimp_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_bytes,
const guint8 *curve)
{
GimpParam *return_vals;
gint nreturn_vals;
@ -459,16 +459,16 @@ gimp_color_balance (gint32 drawable_ID,
* Returns: TRUE on success.
*/
gboolean
gimp_histogram (gint32 drawable_ID,
GimpChannelLutType channel,
gint start_range,
gint end_range,
gdouble *mean,
gdouble *std_dev,
gdouble *median,
gdouble *pixels,
gdouble *count,
gdouble *percentile)
gimp_histogram (gint32 drawable_ID,
GimpHistogramChannel channel,
gint start_range,
gint end_range,
gdouble *mean,
gdouble *std_dev,
gdouble *median,
gdouble *pixels,
gdouble *count,
gdouble *percentile)
{
GimpParam *return_vals;
gint nreturn_vals;

View File

@ -29,55 +29,55 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_brightness_contrast (gint32 drawable_ID,
gint brightness,
gint contrast);
gboolean gimp_levels (gint32 drawable_ID,
GimpChannelLutType channel,
gint low_input,
gint high_input,
gdouble gamma,
gint low_output,
gint high_output);
gboolean gimp_levels_auto (gint32 drawable_ID);
gboolean gimp_posterize (gint32 drawable_ID,
gint levels);
gboolean gimp_desaturate (gint32 drawable_ID);
gboolean gimp_equalize (gint32 drawable_ID,
gboolean mask_only);
gboolean gimp_invert (gint32 drawable_ID);
gboolean gimp_curves_spline (gint32 drawable_ID,
GimpChannelLutType channel,
gint num_points,
const guint8 *control_pts);
gboolean gimp_curves_explicit (gint32 drawable_ID,
GimpChannelLutType channel,
gint num_bytes,
const guint8 *curve);
gboolean gimp_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean gimp_histogram (gint32 drawable_ID,
GimpChannelLutType channel,
gint start_range,
gint end_range,
gdouble *mean,
gdouble *std_dev,
gdouble *median,
gdouble *pixels,
gdouble *count,
gdouble *percentile);
gboolean gimp_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation);
gboolean gimp_threshold (gint32 drawable_ID,
gint low_threshold,
gint high_threshold);
gboolean gimp_brightness_contrast (gint32 drawable_ID,
gint brightness,
gint contrast);
gboolean gimp_levels (gint32 drawable_ID,
GimpHistogramChannel channel,
gint low_input,
gint high_input,
gdouble gamma,
gint low_output,
gint high_output);
gboolean gimp_levels_auto (gint32 drawable_ID);
gboolean gimp_posterize (gint32 drawable_ID,
gint levels);
gboolean gimp_desaturate (gint32 drawable_ID);
gboolean gimp_equalize (gint32 drawable_ID,
gboolean mask_only);
gboolean gimp_invert (gint32 drawable_ID);
gboolean gimp_curves_spline (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_points,
const guint8 *control_pts);
gboolean gimp_curves_explicit (gint32 drawable_ID,
GimpHistogramChannel channel,
gint num_bytes,
const guint8 *curve);
gboolean gimp_color_balance (gint32 drawable_ID,
GimpTransferMode transfer_mode,
gboolean preserve_lum,
gdouble cyan_red,
gdouble magenta_green,
gdouble yellow_blue);
gboolean gimp_histogram (gint32 drawable_ID,
GimpHistogramChannel channel,
gint start_range,
gint end_range,
gdouble *mean,
gdouble *std_dev,
gdouble *median,
gdouble *pixels,
gdouble *count,
gdouble *percentile);
gboolean gimp_hue_saturation (gint32 drawable_ID,
GimpHueRange hue_range,
gdouble hue_offset,
gdouble lightness,
gdouble saturation);
gboolean gimp_threshold (gint32 drawable_ID,
gint low_threshold,
gint high_threshold);
G_END_DECLS

View File

@ -208,6 +208,15 @@ enum
GIMP_SPIRAL_ANTICLOCKWISE = GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE
};
enum
{
GIMP_VALUE_LUT = GIMP_HISTOGRAM_VALUE,
GIMP_RED_LUT = GIMP_HISTOGRAM_RED,
GIMP_GREEN_LUT = GIMP_HISTOGRAM_GREEN,
GIMP_BLUE_LUT = GIMP_HISTOGRAM_BLUE,
GIMP_ALPHA_LUT = GIMP_HISTOGRAM_ALPHA
};
#endif /* GIMP_DISABLE_DEPRECATED */

View File

@ -55,15 +55,6 @@ typedef enum
GIMP_PATTERN_BUCKET_FILL
} GimpBucketFillMode;
typedef enum
{
GIMP_VALUE_LUT,
GIMP_RED_LUT,
GIMP_GREEN_LUT,
GIMP_BLUE_LUT,
GIMP_ALPHA_LUT
} GimpChannelLutType;
typedef enum
{
GIMP_CHANNEL_OP_ADD,
@ -148,6 +139,15 @@ typedef enum
GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE
} GimpGradientType;
typedef enum
{
GIMP_HISTOGRAM_VALUE,
GIMP_HISTOGRAM_RED,
GIMP_HISTOGRAM_GREEN,
GIMP_HISTOGRAM_BLUE,
GIMP_HISTOGRAM_ALPHA
} GimpHistogramChannel;
typedef enum
{
GIMP_ALL_HUES,

View File

@ -56,13 +56,6 @@ FG_BUCKET_FILL = 0
BG_BUCKET_FILL = 1
PATTERN_BUCKET_FILL = 2
# GimpChannelLutType
VALUE_LUT = 0
RED_LUT = 1
GREEN_LUT = 2
BLUE_LUT = 3
ALPHA_LUT = 4
# GimpChannelOps
CHANNEL_OP_ADD = 0
CHANNEL_OP_SUBTRACT = 1
@ -127,6 +120,13 @@ GRADIENT_SHAPEBURST_DIMPLED = 8
GRADIENT_SPIRAL_CLOCKWISE = 9
GRADIENT_SPIRAL_ANTICLOCKWISE = 10
# GimpHistogramChannel
HISTOGRAM_VALUE = 0
HISTOGRAM_RED = 1
HISTOGRAM_GREEN = 2
HISTOGRAM_BLUE = 3
HISTOGRAM_ALPHA = 4
# GimpHueRange
ALL_HUES = 0
RED_HUES = 1

View File

@ -281,12 +281,12 @@ init_constants (void)
setvar (cintern ("BLUR"), flocons (GIMP_BLUR_CONVOLVE), NIL);
setvar (cintern ("SHARPEN"), flocons (GIMP_SHARPEN_CONVOLVE), NIL);
setvar (cintern ("RGB_IMAGE"), flocons (GIMP_RGB_IMAGE), NIL);
setvar (cintern ("RGBA_IMAGE"), flocons (GIMP_RGBA_IMAGE), NIL);
setvar (cintern ("GRAY_IMAGE"), flocons (GIMP_GRAY_IMAGE), NIL);
setvar (cintern ("GRAYA_IMAGE"), flocons (GIMP_GRAYA_IMAGE), NIL);
setvar (cintern ("INDEXED_IMAGE"), flocons (GIMP_INDEXED_IMAGE), NIL);
setvar (cintern ("INDEXEDA_IMAGE"), flocons (GIMP_INDEXEDA_IMAGE), NIL);
setvar (cintern ("RGB-IMAGE"), flocons (GIMP_RGB_IMAGE), NIL);
setvar (cintern ("RGBA-IMAGE"), flocons (GIMP_RGBA_IMAGE), NIL);
setvar (cintern ("GRAY-IMAGE"), flocons (GIMP_GRAY_IMAGE), NIL);
setvar (cintern ("GRAYA-IMAGE"), flocons (GIMP_GRAYA_IMAGE), NIL);
setvar (cintern ("INDEXED-IMAGE"), flocons (GIMP_INDEXED_IMAGE), NIL);
setvar (cintern ("INDEXEDA-IMAGE"), flocons (GIMP_INDEXEDA_IMAGE), NIL);
setvar (cintern ("WHITE-MASK"), flocons (GIMP_ADD_WHITE_MASK), NIL);
setvar (cintern ("BLACK-MASK"), flocons (GIMP_ADD_BLACK_MASK), NIL);
@ -332,6 +332,12 @@ init_constants (void)
setvar (cintern ("SPIRAL-CLOCKWISE"), flocons (GIMP_GRADIENT_SPIRAL_CLOCKWISE), NIL);
setvar (cintern ("SPIRAL-ANTICLOCKWISE"), flocons (GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE), NIL);
setvar (cintern ("VALUE-LUT"), flocons (GIMP_HISTOGRAM_VALUE), NIL);
setvar (cintern ("RED-LUT"), flocons (GIMP_HISTOGRAM_RED), NIL);
setvar (cintern ("GREEN-LUT"), flocons (GIMP_HISTOGRAM_GREEN), NIL);
setvar (cintern ("BLUE-LUT"), flocons (GIMP_HISTOGRAM_BLUE), NIL);
setvar (cintern ("ALPHA-LUT"), flocons (GIMP_HISTOGRAM_ALPHA), NIL);
/* Useful misc stuff */
setvar (cintern ("TRUE"), flocons (TRUE), NIL);
setvar (cintern ("FALSE"), flocons (FALSE), NIL);

View File

@ -42,12 +42,6 @@ init_generated_constants (void)
setvar (cintern ("BG-BUCKET-FILL"), flocons (1), NIL);
setvar (cintern ("PATTERN-BUCKET-FILL"), flocons (2), NIL);
setvar (cintern ("VALUE-LUT"), flocons (0), NIL);
setvar (cintern ("RED-LUT"), flocons (1), NIL);
setvar (cintern ("GREEN-LUT"), flocons (2), NIL);
setvar (cintern ("BLUE-LUT"), flocons (3), NIL);
setvar (cintern ("ALPHA-LUT"), flocons (4), NIL);
setvar (cintern ("CHANNEL-OP-ADD"), flocons (0), NIL);
setvar (cintern ("CHANNEL-OP-SUBTRACT"), flocons (1), NIL);
setvar (cintern ("CHANNEL-OP-REPLACE"), flocons (2), NIL);
@ -102,6 +96,12 @@ init_generated_constants (void)
setvar (cintern ("GRADIENT-SPIRAL-CLOCKWISE"), flocons (9), NIL);
setvar (cintern ("GRADIENT-SPIRAL-ANTICLOCKWISE"), flocons (10), NIL);
setvar (cintern ("HISTOGRAM-VALUE"), flocons (0), NIL);
setvar (cintern ("HISTOGRAM-RED"), flocons (1), NIL);
setvar (cintern ("HISTOGRAM-GREEN"), flocons (2), NIL);
setvar (cintern ("HISTOGRAM-BLUE"), flocons (3), NIL);
setvar (cintern ("HISTOGRAM-ALPHA"), flocons (4), NIL);
setvar (cintern ("ALL-HUES"), flocons (0), NIL);
setvar (cintern ("RED-HUES"), flocons (1), NIL);
setvar (cintern ("YELLOW-HUES"), flocons (2), NIL);

View File

@ -281,12 +281,12 @@ init_constants (void)
setvar (cintern ("BLUR"), flocons (GIMP_BLUR_CONVOLVE), NIL);
setvar (cintern ("SHARPEN"), flocons (GIMP_SHARPEN_CONVOLVE), NIL);
setvar (cintern ("RGB_IMAGE"), flocons (GIMP_RGB_IMAGE), NIL);
setvar (cintern ("RGBA_IMAGE"), flocons (GIMP_RGBA_IMAGE), NIL);
setvar (cintern ("GRAY_IMAGE"), flocons (GIMP_GRAY_IMAGE), NIL);
setvar (cintern ("GRAYA_IMAGE"), flocons (GIMP_GRAYA_IMAGE), NIL);
setvar (cintern ("INDEXED_IMAGE"), flocons (GIMP_INDEXED_IMAGE), NIL);
setvar (cintern ("INDEXEDA_IMAGE"), flocons (GIMP_INDEXEDA_IMAGE), NIL);
setvar (cintern ("RGB-IMAGE"), flocons (GIMP_RGB_IMAGE), NIL);
setvar (cintern ("RGBA-IMAGE"), flocons (GIMP_RGBA_IMAGE), NIL);
setvar (cintern ("GRAY-IMAGE"), flocons (GIMP_GRAY_IMAGE), NIL);
setvar (cintern ("GRAYA-IMAGE"), flocons (GIMP_GRAYA_IMAGE), NIL);
setvar (cintern ("INDEXED-IMAGE"), flocons (GIMP_INDEXED_IMAGE), NIL);
setvar (cintern ("INDEXEDA-IMAGE"), flocons (GIMP_INDEXEDA_IMAGE), NIL);
setvar (cintern ("WHITE-MASK"), flocons (GIMP_ADD_WHITE_MASK), NIL);
setvar (cintern ("BLACK-MASK"), flocons (GIMP_ADD_BLACK_MASK), NIL);
@ -332,6 +332,12 @@ init_constants (void)
setvar (cintern ("SPIRAL-CLOCKWISE"), flocons (GIMP_GRADIENT_SPIRAL_CLOCKWISE), NIL);
setvar (cintern ("SPIRAL-ANTICLOCKWISE"), flocons (GIMP_GRADIENT_SPIRAL_ANTICLOCKWISE), NIL);
setvar (cintern ("VALUE-LUT"), flocons (GIMP_HISTOGRAM_VALUE), NIL);
setvar (cintern ("RED-LUT"), flocons (GIMP_HISTOGRAM_RED), NIL);
setvar (cintern ("GREEN-LUT"), flocons (GIMP_HISTOGRAM_GREEN), NIL);
setvar (cintern ("BLUE-LUT"), flocons (GIMP_HISTOGRAM_BLUE), NIL);
setvar (cintern ("ALPHA-LUT"), flocons (GIMP_HISTOGRAM_ALPHA), NIL);
/* Useful misc stuff */
setvar (cintern ("TRUE"), flocons (TRUE), NIL);
setvar (cintern ("FALSE"), flocons (FALSE), NIL);

View File

@ -107,6 +107,18 @@ package Gimp::CodeGen::enums;
GIMP_STACK_TRACE_QUERY => '1',
GIMP_STACK_TRACE_ALWAYS => '2' }
},
GimpHistogramChannel =>
{ contig => 1,
header => 'base/base-enums.h',
symbols => [ qw(GIMP_HISTOGRAM_VALUE GIMP_HISTOGRAM_RED
GIMP_HISTOGRAM_GREEN GIMP_HISTOGRAM_BLUE
GIMP_HISTOGRAM_ALPHA) ],
mapping => { GIMP_HISTOGRAM_VALUE => '0',
GIMP_HISTOGRAM_RED => '1',
GIMP_HISTOGRAM_GREEN => '2',
GIMP_HISTOGRAM_BLUE => '3',
GIMP_HISTOGRAM_ALPHA => '4' }
},
GimpLayerModeEffects =>
{ contig => 1,
header => 'base/base-enums.h',
@ -162,17 +174,6 @@ package Gimp::CodeGen::enums;
GIMP_ABSOLUTE_CONVOL => '1',
GIMP_NEGATIVE_CONVOL => '2' }
},
GimpChannelLutType =>
{ contig => 1,
header => 'base/base-enums.h',
symbols => [ qw(GIMP_VALUE_LUT GIMP_RED_LUT GIMP_GREEN_LUT
GIMP_BLUE_LUT GIMP_ALPHA_LUT) ],
mapping => { GIMP_VALUE_LUT => '0',
GIMP_RED_LUT => '1',
GIMP_GREEN_LUT => '2',
GIMP_BLUE_LUT => '3',
GIMP_ALPHA_LUT => '4' }
},
GimpHueRange =>
{ contig => 1,
header => 'base/base-enums.h',

View File

@ -25,7 +25,7 @@ sub drawable_arg () {{
sub channel_arg () {{
name => 'channel',
type => 'enum GimpChannelLutType',
type => 'enum GimpHistogramChannel',
desc => 'The channel to modify: { %%desc%% }'
}}
@ -125,9 +125,10 @@ HELP
code => <<'CODE'
{
if (gimp_drawable_is_indexed (drawable) ||
(! gimp_drawable_has_alpha (drawable) && channel == GIMP_ALPHA_LUT) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_GRAY_LUT && channel != GIMP_ALPHA_LUT))
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
@ -415,9 +416,10 @@ HELP
code => <<'CODE'
{
if (gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
(! gimp_drawable_has_alpha (drawable) && channel == GIMP_ALPHA_LUT) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_GRAY_LUT && channel != GIMP_ALPHA_LUT))
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
@ -495,9 +497,10 @@ HELP
code => <<'CODE'
{
if (gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
(! gimp_drawable_has_alpha (drawable) && channel == GIMP_ALPHA_LUT) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_GRAY_LUT && channel != GIMP_ALPHA_LUT))
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)
@ -670,9 +673,10 @@ HELP
code => <<'CODE'
{
if (gimp_drawable_is_indexed (drawable) ||
(! gimp_drawable_has_alpha (drawable) && channel == GIMP_ALPHA_LUT) ||
(! gimp_drawable_has_alpha (drawable) &&
channel == GIMP_HISTOGRAM_ALPHA) ||
(gimp_drawable_is_gray (drawable) &&
channel != GIMP_GRAY_LUT && channel != GIMP_ALPHA_LUT))
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
success = FALSE;
if (success)