renamed GimpInterpolationType values to something sane and unexported it

2002-02-12  Sven Neumann  <sven@gimp.org>

	* app/base/base-enums.h: renamed GimpInterpolationType values to
	something sane and unexported it from the PDB since it was never
	used in any PDB calls.

	* app/gimprc.c
	* app/config/gimpcoreconfig.c
	* app/core/gimpcoreconfig.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimplayer.c
	* app/gui/preferences-dialog.c
	* app/gui/resize-dialog.c
	* app/paint-funcs/paint-funcs.c
	* app/pdb/transform_tools_cmds.c
	* app/tools/transform_options.c
	* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.

	* libgimp/gimpenums.h
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
This commit is contained in:
Sven Neumann 2002-02-12 03:30:52 +00:00 committed by Sven Neumann
parent 6083787ba0
commit 04c995fb70
20 changed files with 102 additions and 104 deletions

View File

@ -1,7 +1,30 @@
2002-02-12 Sven Neumann <sven@gimp.org>
* app/base/base-enums.h: renamed GimpInterpolationType values to
something sane and unexported it from the PDB since it was never
used in any PDB calls.
* app/gimprc.c
* app/config/gimpcoreconfig.c
* app/core/gimpcoreconfig.c
* app/core/gimpdrawable-transform.c
* app/core/gimplayer.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.c
* app/paint-funcs/paint-funcs.c
* app/pdb/transform_tools_cmds.c
* app/tools/transform_options.c
* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
2002-02-11 Nathan Summers <rock@gimp.org>
* app/plug-in/plug-in.[ch]
* libgimp/gimp.c: added support for the init function in plug-ins.
* libgimp/gimp.c: added support for the init function in plug-ins
(fixes bug #66859).
2002-02-12 Michael Natterer <mitch@gimp.org>

View File

@ -40,11 +40,11 @@
GType gimp_interpolation_type_get_type (void) G_GNUC_CONST;
typedef enum
typedef enum /*< pdb-skip >*/
{
GIMP_LINEAR_INTERPOLATION,
GIMP_CUBIC_INTERPOLATION,
GIMP_NEAREST_NEIGHBOR_INTERPOLATION
GIMP_INTERPOLATION_NONE,
GIMP_INTERPOLATION_LINEAR,
GIMP_INTERPOLATION_CUBIC
} GimpInterpolationType;

View File

@ -123,7 +123,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_INTERPOLATION_TYPE,
"interpolation-type",
GIMP_TYPE_INTERPOLATION_TYPE,
GIMP_LINEAR_INTERPOLATION);
GIMP_INTERPOLATION_LINEAR);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
"plug-in-path",
gimp_config_build_plug_in_path ("plug-ins"));

View File

@ -124,9 +124,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* turn interpolation off for simple transformations (e.g. rot90) */
if (gimp_matrix3_is_simple (matrix))
{
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
}
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Get the background color */
gimp_image_get_background (gimage, drawable, bg_col);
@ -144,8 +142,8 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
case GIMP_INDEXED:
bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_I_PIX;
/* If the gimage is indexed color, ignore smoothing value */
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
/* If the gimage is indexed color, ignore interpolation value */
interpolation_type = GIMP_INTERPOLATION_NONE;
break;
default:
g_assert_not_reached ();
@ -233,18 +231,18 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* initialise the pixel_surround accessor */
switch (interpolation_type)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_NONE:
/* not actually useful, keeps the code cleaner */
pixel_surround_init (&surround, float_tiles, 1, 1, bg_col);
break;
case GIMP_INTERPOLATION_CUBIC:
pixel_surround_init (&surround, float_tiles, 4, 4, bg_col);
break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
pixel_surround_init (&surround, float_tiles, 2, 2, bg_col);
break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
/* not actually useful, keeps the code cleaner */
pixel_surround_init (&surround, float_tiles, 1, 1, bg_col);
break;
}
width = tile_manager_width (tiles);
@ -294,7 +292,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
switch (interpolation_type)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_CUBIC:
/* ttx & tty are the subpixel coordinates of the point in
* the original selection's floating buffer.
* We need the four integer pixel coords around them:
@ -391,7 +389,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
itx = floor (ttx);
ity = floor (tty);
@ -477,7 +475,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
case GIMP_INTERPOLATION_NONE:
itx = floor (ttx);
ity = floor (tty);

View File

@ -33,7 +33,7 @@ gimp_core_config_init (Gimp *gimp)
gimp->config = g_new0 (GimpCoreConfig, 1);
gimp->config->interpolation_type = GIMP_LINEAR_INTERPOLATION;
gimp->config->interpolation_type = GIMP_INTERPOLATION_LINEAR;
gimp->config->tool_plug_in_path = NULL;
gimp->config->plug_in_path = NULL;

View File

@ -124,9 +124,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* turn interpolation off for simple transformations (e.g. rot90) */
if (gimp_matrix3_is_simple (matrix))
{
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
}
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Get the background color */
gimp_image_get_background (gimage, drawable, bg_col);
@ -144,8 +142,8 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
case GIMP_INDEXED:
bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY;
alpha = ALPHA_I_PIX;
/* If the gimage is indexed color, ignore smoothing value */
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
/* If the gimage is indexed color, ignore interpolation value */
interpolation_type = GIMP_INTERPOLATION_NONE;
break;
default:
g_assert_not_reached ();
@ -233,18 +231,18 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
/* initialise the pixel_surround accessor */
switch (interpolation_type)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_NONE:
/* not actually useful, keeps the code cleaner */
pixel_surround_init (&surround, float_tiles, 1, 1, bg_col);
break;
case GIMP_INTERPOLATION_CUBIC:
pixel_surround_init (&surround, float_tiles, 4, 4, bg_col);
break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
pixel_surround_init (&surround, float_tiles, 2, 2, bg_col);
break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
/* not actually useful, keeps the code cleaner */
pixel_surround_init (&surround, float_tiles, 1, 1, bg_col);
break;
}
width = tile_manager_width (tiles);
@ -294,7 +292,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
switch (interpolation_type)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_CUBIC:
/* ttx & tty are the subpixel coordinates of the point in
* the original selection's floating buffer.
* We need the four integer pixel coords around them:
@ -391,7 +389,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
itx = floor (ttx);
ity = floor (tty);
@ -477,7 +475,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
case GIMP_INTERPOLATION_NONE:
itx = floor (ttx);
ity = floor (tty);

View File

@ -918,7 +918,7 @@ gimp_layer_scale_lowlevel (GimpLayer *layer,
*/
if (GIMP_IMAGE_TYPE_IS_INDEXED (GIMP_DRAWABLE (layer)->type))
{
scale_region (&srcPR, &destPR, GIMP_NEAREST_NEIGHBOR_INTERPOLATION);
scale_region (&srcPR, &destPR, GIMP_INTERPOLATION_NONE);
}
else
{

View File

@ -2536,11 +2536,11 @@ preferences_dialog_create (Gimp *gimp)
GINT_TO_POINTER (gimp->config->interpolation_type),
_("Nearest Neighbor (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE), NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR), NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC), NULL,
NULL);

View File

@ -674,15 +674,15 @@ resize_widget_new (GimpImage *gimage,
GINT_TO_POINTER (resize->interpolation),
_("Nearest Neighbor (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE),
NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR),
NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC),
NULL,
NULL);

View File

@ -1266,12 +1266,12 @@ parse_interpolation_type (gpointer val1p,
return ERROR;
token = get_next_token ();
if (strcmp (token_sym, "nearest-neighbor") == 0)
*typep = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
if (strcmp (token_sym, "none") == 0)
*typep = GIMP_INTERPOLATION_NONE;
else if (strcmp (token_sym, "linear") == 0)
*typep = GIMP_LINEAR_INTERPOLATION;
*typep = GIMP_INTERPOLATION_LINEAR;
else if (strcmp (token_sym, "cubic") == 0)
*typep = GIMP_CUBIC_INTERPOLATION;
*typep = GIMP_INTERPOLATION_CUBIC;
else
return ERROR;
@ -2583,12 +2583,12 @@ interpolation_type_to_str (gpointer val1p,
type = *((GimpInterpolationType *)val1p);
switch (type)
{
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_NONE:
return g_strdup ("none");
case GIMP_INTERPOLATION_LINEAR:
return g_strdup ("linear");
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_CUBIC:
return g_strdup ("cubic");
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
return g_strdup ("nearest-neighbor");
default:
return g_strdup ("bad interpolation type");
}

View File

@ -2536,11 +2536,11 @@ preferences_dialog_create (Gimp *gimp)
GINT_TO_POINTER (gimp->config->interpolation_type),
_("Nearest Neighbor (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE), NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR), NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION), NULL,
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC), NULL,
NULL);

View File

@ -674,15 +674,15 @@ resize_widget_new (GimpImage *gimage,
GINT_TO_POINTER (resize->interpolation),
_("Nearest Neighbor (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE),
NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR),
NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC),
NULL,
NULL);

View File

@ -2803,7 +2803,7 @@ expand_line (gdouble *dest,
each x */
switch(interp)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_CUBIC:
for (x = 0; x < width; x++)
{
src_col = ((int)((x) * ratio + 2.0 - 0.5)) - 2;
@ -2817,7 +2817,7 @@ expand_line (gdouble *dest,
}
break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
for (x = 0; x < width; x++)
{
src_col = ((int)((x) * ratio + 2.0 - 0.5)) - 2;
@ -2831,8 +2831,8 @@ expand_line (gdouble *dest,
}
break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
g_error("sampling_type can't be GIMP_NEAREST_NEIGHBOR_INTERPOLATION");
case GIMP_INTERPOLATION_NONE:
g_assert_not_reached ();
break;
}
}
@ -2942,7 +2942,7 @@ scale_region (PixelRegion *srcPR,
gint old_y = -4, new_y;
gint x, y;
if (interpolation_type == GIMP_NEAREST_NEIGHBOR_INTERPOLATION)
if (interpolation_type == GIMP_INTERPOLATION_NONE)
{
scale_region_no_resample (srcPR, destPR);
return;
@ -3031,7 +3031,7 @@ scale_region (PixelRegion *srcPR,
}
switch(interpolation_type)
{
case GIMP_CUBIC_INTERPOLATION:
case GIMP_INTERPOLATION_CUBIC:
{
double p0, p1, p2, p3;
double dy = ((y) * y_rat - .5) - new_y;
@ -3044,7 +3044,7 @@ scale_region (PixelRegion *srcPR,
p2 * src[2][x] + p3 * src[3][x];
} break;
case GIMP_LINEAR_INTERPOLATION:
case GIMP_INTERPOLATION_LINEAR:
{
double idy = ((y) * y_rat - 0.5) - new_y;
double dy = 1.0 - idy;
@ -3052,9 +3052,8 @@ scale_region (PixelRegion *srcPR,
accum[x] = dy * src[1][x] + idy * src[2][x];
} break;
case GIMP_NEAREST_NEIGHBOR_INTERPOLATION:
g_error ("sampling_type can't be "
"GIMP_NEAREST_NEIGHBOR_INTERPOLATION");
case GIMP_INTERPOLATION_NONE:
g_assert_not_reached ();
break;
}
}

View File

@ -182,7 +182,7 @@ perspective_invoker (Gimp *gimp,
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Perspective the selection */
success = gimp_drawable_transform_affine (drawable,
@ -313,7 +313,7 @@ rotate_invoker (Gimp *gimp,
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Rotate the selection */
success = gimp_drawable_transform_affine (drawable,
@ -420,7 +420,7 @@ scale_invoker (Gimp *gimp,
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Scale the selection */
success = gimp_drawable_transform_affine (drawable,
@ -545,7 +545,7 @@ shear_invoker (Gimp *gimp,
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Shear the selection */
success = gimp_drawable_transform_affine (drawable,
@ -662,7 +662,7 @@ transform_2d_invoker (Gimp *gimp,
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Transform the selection */
success = gimp_drawable_transform_affine (drawable,

View File

@ -126,15 +126,15 @@ transform_options_init (TransformOptions *options,
GINT_TO_POINTER (options->interpolation),
_("None (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE),
NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR),
NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC),
NULL,
NULL);

View File

@ -126,15 +126,15 @@ transform_options_init (TransformOptions *options,
GINT_TO_POINTER (options->interpolation),
_("None (Fastest)"),
GINT_TO_POINTER (GIMP_NEAREST_NEIGHBOR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_NONE),
NULL,
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_LINEAR),
NULL,
_("Cubic (Slowest & Best)"),
GINT_TO_POINTER (GIMP_CUBIC_INTERPOLATION),
GINT_TO_POINTER (GIMP_INTERPOLATION_CUBIC),
NULL,
NULL);

View File

@ -167,13 +167,6 @@ typedef enum
GIMP_INDEXEDA_IMAGE
} GimpImageType;
typedef enum
{
GIMP_LINEAR_INTERPOLATION,
GIMP_CUBIC_INTERPOLATION,
GIMP_NEAREST_NEIGHBOR_INTERPOLATION
} GimpInterpolationType;
typedef enum
{
GIMP_NORMAL_MODE,

View File

@ -115,10 +115,6 @@ init_generated_constants (void)
setvar (cintern ("INDEXED-IMAGE"), flocons (4), NIL);
setvar (cintern ("INDEXEDA-IMAGE"), flocons (5), NIL);
setvar (cintern ("LINEAR-INTERPOLATION"), flocons (0), NIL);
setvar (cintern ("CUBIC-INTERPOLATION"), flocons (1), NIL);
setvar (cintern ("NEAREST-NEIGHBOR-INTERPOLATION"), flocons (2), NIL);
setvar (cintern ("NORMAL-MODE"), flocons (0), NIL);
setvar (cintern ("DISSOLVE-MODE"), flocons (1), NIL);
setvar (cintern ("BEHIND-MODE"), flocons (2), NIL);

View File

@ -107,15 +107,6 @@ package Gimp::CodeGen::enums;
GIMP_STACK_TRACE_QUERY => '1',
GIMP_STACK_TRACE_ALWAYS => '2' }
},
GimpInterpolationType =>
{ contig => 1,
header => 'base/base-enums.h',
symbols => [ qw(GIMP_LINEAR_INTERPOLATION GIMP_CUBIC_INTERPOLATION
GIMP_NEAREST_NEIGHBOR_INTERPOLATION) ],
mapping => { GIMP_LINEAR_INTERPOLATION => '0',
GIMP_CUBIC_INTERPOLATION => '1',
GIMP_NEAREST_NEIGHBOR_INTERPOLATION => '2' }
},
GimpLayerModeEffects =>
{ contig => 1,
header => 'base/base-enums.h',

View File

@ -146,7 +146,7 @@ HELP
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Perspective the selection */
success = gimp_drawable_transform_affine (drawable,
@ -202,7 +202,7 @@ HELP
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Rotate the selection */
success = gimp_drawable_transform_affine (drawable,
@ -273,7 +273,7 @@ HELP
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Scale the selection */
success = gimp_drawable_transform_affine (drawable,
@ -344,7 +344,7 @@ HELP
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Shear the selection */
success = gimp_drawable_transform_affine (drawable,
@ -415,7 +415,7 @@ HELP
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
else
interpolation_type = GIMP_NEAREST_NEIGHBOR_INTERPOLATION;
interpolation_type = GIMP_INTERPOLATION_NONE;
/* Transform the selection */
success = gimp_drawable_transform_affine (drawable,