app, libgimp, libgimpbase, pdb: s/GimpDistanceMetric/GeglDistanceMetric/

GeglDistanceMetric has just been added as a public enum in GEGL. Basing
our code on this, and getting rid of the newly added GimpDistanceMetric.
This commit is contained in:
Jehan 2018-03-17 14:57:31 +01:00
parent f2c80e1878
commit 9b11fb2b91
9 changed files with 6 additions and 62 deletions

View File

@ -89,7 +89,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
* API needs to stay compatible.
*/
shapeburst =
gimp_drawable_blend_shapeburst_distmap (drawable, GIMP_DISTANCE_METRIC_MANHATTAN,
gimp_drawable_blend_shapeburst_distmap (drawable, GEGL_DISTANCE_MANHATTAN,
GEGL_RECTANGLE (x, y, width, height),
progress);
}
@ -139,7 +139,7 @@ gimp_drawable_blend (GimpDrawable *drawable,
GeglBuffer *
gimp_drawable_blend_shapeburst_distmap (GimpDrawable *drawable,
GimpDistanceMetric metric,
GeglDistanceMetric metric,
const GeglRectangle *region,
GimpProgress *progress)
{

View File

@ -40,7 +40,7 @@ void gimp_drawable_blend (GimpDrawable *drawable,
GeglBuffer *
gimp_drawable_blend_shapeburst_distmap (GimpDrawable *drawable,
GimpDistanceMetric metric,
GeglDistanceMetric metric,
const GeglRectangle *region,
GimpProgress *progress);

View File

@ -100,8 +100,8 @@ gimp_blend_options_class_init (GimpBlendOptionsClass *klass)
"distance-metric",
_("Metric"),
_("Metric to use for the distance calculation"),
GIMP_TYPE_DISTANCE_METRIC,
GIMP_DISTANCE_METRIC_EUCLIDEAN,
GEGL_TYPE_DISTANCE_METRIC,
GEGL_DISTANCE_EUCLIDEAN,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_ENUM (object_class, PROP_GRADIENT_REPEAT,
"gradient-repeat",

View File

@ -39,7 +39,7 @@ struct _GimpBlendOptions
gdouble offset;
GimpGradientType gradient_type;
GimpDistanceMetric distance_metric;
GeglDistanceMetric distance_metric;
gboolean supersample;
gint supersample_depth;

View File

@ -20,7 +20,6 @@ static const GimpGetTypeFunc get_type_funcs[] =
gimp_convert_palette_type_get_type,
gimp_convolve_type_get_type,
gimp_desaturate_mode_get_type,
gimp_distance_metric_get_type,
gimp_dodge_burn_type_get_type,
gimp_fill_type_get_type,
gimp_foreground_extract_mode_get_type,
@ -87,7 +86,6 @@ static const gchar * const type_names[] =
"GimpConvertPaletteType",
"GimpConvolveType",
"GimpDesaturateMode",
"GimpDistanceMetric",
"GimpDodgeBurnType",
"GimpFillType",
"GimpForegroundExtractMode",

View File

@ -36,7 +36,6 @@ EXPORTS
gimp_desaturate_mode_get_type
gimp_directory
gimp_directory_file
gimp_distance_metric_get_type
gimp_dodge_burn_type_compat_get_type
gimp_dodge_burn_type_get_type
gimp_enum_get_desc

View File

@ -532,38 +532,6 @@ gimp_desaturate_mode_get_type (void)
return type;
}
GType
gimp_distance_metric_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_DISTANCE_METRIC_EUCLIDEAN, "GIMP_DISTANCE_METRIC_EUCLIDEAN", "euclidean" },
{ GIMP_DISTANCE_METRIC_MANHATTAN, "GIMP_DISTANCE_METRIC_MANHATTAN", "manhattan" },
{ GIMP_DISTANCE_METRIC_CHESSBOARD, "GIMP_DISTANCE_METRIC_CHESSBOARD", "chessboard" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_DISTANCE_METRIC_EUCLIDEAN, NC_("distance-metric", "Euclidean"), NULL },
{ GIMP_DISTANCE_METRIC_MANHATTAN, NC_("distance-metric", "Manhattan"), NULL },
{ GIMP_DISTANCE_METRIC_CHESSBOARD, NC_("distance-metric", "Chessboard"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpDistanceMetric", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_type_set_translation_context (type, "distance-metric");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_dodge_burn_type_get_type (void)
{

View File

@ -290,17 +290,6 @@ typedef enum
#endif /* GIMP_DISABLE_DEPRECATED */
} GimpDesaturateMode;
#define GIMP_TYPE_DISTANCE_METRIC (gimp_distance_metric_get_type ())
GType gimp_distance_metric_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_DISTANCE_METRIC_EUCLIDEAN, /*< desc="Euclidean" >*/
GIMP_DISTANCE_METRIC_MANHATTAN, /*< desc="Manhattan" >*/
GIMP_DISTANCE_METRIC_CHESSBOARD /*< desc="Chessboard" >*/
} GimpDistanceMetric;
#define GIMP_TYPE_DODGE_BURN_TYPE (gimp_dodge_burn_type_get_type ())
GType gimp_dodge_burn_type_get_type (void) G_GNUC_CONST;

View File

@ -165,16 +165,6 @@ package Gimp::CodeGen::enums;
GIMP_DESATURATE_LUMINANCE => '3',
GIMP_DESATURATE_VALUE => '4' }
},
GimpDistanceMetric =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',
symbols => [ qw(GIMP_DISTANCE_METRIC_EUCLIDEAN
GIMP_DISTANCE_METRIC_MANHATTAN
GIMP_DISTANCE_METRIC_CHESSBOARD) ],
mapping => { GIMP_DISTANCE_METRIC_EUCLIDEAN => '0',
GIMP_DISTANCE_METRIC_MANHATTAN => '1',
GIMP_DISTANCE_METRIC_CHESSBOARD => '2' }
},
GimpDodgeBurnType =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',