Commit a4223766 authored by Michael Natterer's avatar Michael Natterer 😴

all,libgimp*: move GimpConvolveType and GimpInkBlobType to libgimpbase

and make GimpConvolveType's values sane.
parent f7d71e2e
......@@ -223,11 +223,11 @@ gimp_convolve_calculate_matrix (GimpConvolve *convolve,
/* get the appropriate convolution matrix and size and divisor */
switch (type)
{
case GIMP_BLUR_CONVOLVE:
case GIMP_CONVOLVE_BLUR:
convolve->matrix[4] = MIN_BLUR + percent * (MAX_BLUR - MIN_BLUR);
break;
case GIMP_SHARPEN_CONVOLVE:
case GIMP_CONVOLVE_SHARPEN:
convolve->matrix[4] = MIN_SHARPEN + percent * (MAX_SHARPEN - MIN_SHARPEN);
break;
}
......
......@@ -27,7 +27,7 @@
#include "gimpconvolveoptions.h"
#define DEFAULT_CONVOLVE_TYPE GIMP_BLUR_CONVOLVE
#define DEFAULT_CONVOLVE_TYPE GIMP_CONVOLVE_BLUR
#define DEFAULT_CONVOLVE_RATE 50.0
......
......@@ -99,66 +99,6 @@ gimp_source_align_mode_get_type (void)
return type;
}
GType
gimp_convolve_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_BLUR_CONVOLVE, "GIMP_BLUR_CONVOLVE", "blur-convolve" },
{ GIMP_SHARPEN_CONVOLVE, "GIMP_SHARPEN_CONVOLVE", "sharpen-convolve" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_BLUR_CONVOLVE, NC_("convolve-type", "Blur"), NULL },
{ GIMP_SHARPEN_CONVOLVE, NC_("convolve-type", "Sharpen"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpConvolveType", values);
gimp_type_set_translation_context (type, "convolve-type");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_ink_blob_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_INK_BLOB_TYPE_CIRCLE, "GIMP_INK_BLOB_TYPE_CIRCLE", "circle" },
{ GIMP_INK_BLOB_TYPE_SQUARE, "GIMP_INK_BLOB_TYPE_SQUARE", "square" },
{ GIMP_INK_BLOB_TYPE_DIAMOND, "GIMP_INK_BLOB_TYPE_DIAMOND", "diamond" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_INK_BLOB_TYPE_CIRCLE, NC_("ink-blob-type", "Circle"), NULL },
{ GIMP_INK_BLOB_TYPE_SQUARE, NC_("ink-blob-type", "Square"), NULL },
{ GIMP_INK_BLOB_TYPE_DIAMOND, NC_("ink-blob-type", "Diamond"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpInkBlobType", values);
gimp_type_set_translation_context (type, "ink-blob-type");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */
......@@ -31,7 +31,7 @@
/*
* these enums that are registered with the type system
* enums that are registered with the type system
*/
#define GIMP_TYPE_BRUSH_APPLICATION_MODE (gimp_brush_application_mode_get_type ())
......@@ -70,29 +70,6 @@ typedef enum /*< pdb-skip >*/
} GimpSourceAlignMode;
#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, /*< desc="Blur" >*/
GIMP_SHARPEN_CONVOLVE /*< desc="Sharpen" >*/
} GimpConvolveType;
#define GIMP_TYPE_INK_BLOB_TYPE (gimp_ink_blob_type_get_type ())
GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_INK_BLOB_TYPE_CIRCLE, /*< desc="Circle" >*/
GIMP_INK_BLOB_TYPE_SQUARE, /*< desc="Square" >*/
GIMP_INK_BLOB_TYPE_DIAMOND /*< desc="Diamond" >*/
} GimpInkBlobType;
/*
* non-registered enums; register them if needed
*/
......
......@@ -1142,7 +1142,7 @@ register_paint_tools_procs (GimpPDB *pdb)
"convolve type",
"Convolve type",
GIMP_TYPE_CONVOLVE_TYPE,
GIMP_BLUR_CONVOLVE,
GIMP_CONVOLVE_BLUR,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("num-strokes",
......
......@@ -99,7 +99,7 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
gimp_convolve_tool_status_update (tool, GIMP_BLUR_CONVOLVE);
gimp_convolve_tool_status_update (tool, GIMP_CONVOLVE_BLUR);
}
static void
......@@ -130,15 +130,12 @@ gimp_convolve_tool_modifier_key (GimpTool *tool,
switch (options->type)
{
case GIMP_BLUR_CONVOLVE:
g_object_set (options, "type", GIMP_SHARPEN_CONVOLVE, NULL);
case GIMP_CONVOLVE_BLUR:
g_object_set (options, "type", GIMP_CONVOLVE_SHARPEN, NULL);
break;
case GIMP_SHARPEN_CONVOLVE:
g_object_set (options, "type", GIMP_BLUR_CONVOLVE, NULL);
break;
default:
case GIMP_CONVOLVE_SHARPEN:
g_object_set (options, "type", GIMP_CONVOLVE_BLUR, NULL);
break;
}
}
......@@ -153,7 +150,7 @@ gimp_convolve_tool_cursor_update (GimpTool *tool,
GimpConvolveOptions *options = GIMP_CONVOLVE_TOOL_GET_OPTIONS (tool);
gimp_tool_control_set_toggled (tool->control,
(options->type == GIMP_SHARPEN_CONVOLVE));
options->type == GIMP_CONVOLVE_SHARPEN);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
}
......@@ -181,13 +178,13 @@ gimp_convolve_tool_status_update (GimpTool *tool,
switch (type)
{
case GIMP_BLUR_CONVOLVE:
case GIMP_CONVOLVE_BLUR:
paint_tool->status = _("Click to blur");
paint_tool->status_line = _("Click to blur the line");
paint_tool->status_ctrl = _("%s to sharpen");
break;
case GIMP_SHARPEN_CONVOLVE:
case GIMP_CONVOLVE_SHARPEN:
paint_tool->status = _("Click to sharpen");
paint_tool->status_line = _("Click to sharpen the line");
paint_tool->status_ctrl = _("%s to blur");
......
......@@ -66,14 +66,6 @@ The possible shapes generated brushes can take.
@GIMP_MONO_PALETTE:
@GIMP_CUSTOM_PALETTE:
<!-- ##### ENUM GimpConvolveType ##### -->
<para>
Operation modes of the convolve tool.
</para>
@GIMP_BLUR_CONVOLVE: Blur the drawable.
@GIMP_SHARPEN_CONVOLVE: Sharpen the drawable.
<!-- ##### ENUM GimpFillType ##### -->
<para>
......@@ -129,15 +121,6 @@ Operation modes of the convolve tool.
@GIMP_BLUE_HUES:
@GIMP_MAGENTA_HUES:
<!-- ##### ENUM GimpInkBlobType ##### -->
<para>
</para>
@GIMP_INK_BLOB_TYPE_CIRCLE:
@GIMP_INK_BLOB_TYPE_SQUARE:
@GIMP_INK_BLOB_TYPE_DIAMOND:
<!-- ##### ENUM GimpLayerModeEffects ##### -->
<para>
......
......@@ -149,7 +149,6 @@ EXPORTS
gimp_convert_palette_type_get_type
gimp_convolve
gimp_convolve_default
gimp_convolve_type_get_type
gimp_curves_explicit
gimp_curves_spline
gimp_default_display
......@@ -511,7 +510,6 @@ EXPORTS
gimp_image_undo_thaw
gimp_image_unset_active_channel
gimp_image_width
gimp_ink_blob_type_get_type
gimp_install_cmap
gimp_install_procedure
gimp_install_temp_proc
......
......@@ -89,17 +89,6 @@ typedef enum
} GimpConvertPaletteType;
#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_FILL_TYPE (gimp_fill_type_get_type ())
GType gimp_fill_type_get_type (void) G_GNUC_CONST;
......@@ -170,18 +159,6 @@ typedef enum
} GimpHueRange;
#define GIMP_TYPE_INK_BLOB_TYPE (gimp_ink_blob_type_get_type ())
GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_INK_BLOB_TYPE_CIRCLE,
GIMP_INK_BLOB_TYPE_SQUARE,
GIMP_INK_BLOB_TYPE_DIAMOND
} GimpInkBlobType;
#define GIMP_TYPE_LAYER_MODE_EFFECTS (gimp_layer_mode_effects_get_type ())
GType gimp_layer_mode_effects_get_type (void) G_GNUC_CONST;
......
......@@ -11,6 +11,7 @@ EXPORTS
gimp_check_type_get_type
gimp_checks_get_shades
gimp_clone_type_get_type
gimp_convolve_type_get_type
gimp_cpu_accel_get_support
gimp_cpu_accel_set_use
gimp_data_directory
......@@ -42,6 +43,7 @@ EXPORTS
gimp_image_base_type_get_type
gimp_image_type_get_type
gimp_installation_directory
gimp_ink_blob_type_get_type
gimp_interpolation_type_get_type
gimp_locale_directory
gimp_major_version
......
......@@ -256,6 +256,36 @@ gimp_check_type_get_type (void)
return type;
}
GType
gimp_convolve_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CONVOLVE_BLUR, "GIMP_CONVOLVE_BLUR", "blur-convolve" },
{ GIMP_CONVOLVE_SHARPEN, "GIMP_CONVOLVE_SHARPEN", "sharpen-convolve" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CONVOLVE_BLUR, NC_("convolve-type", "Blur"), NULL },
{ GIMP_CONVOLVE_SHARPEN, NC_("convolve-type", "Sharpen"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpConvolveType", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_type_set_translation_context (type, "convolve-type");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_clone_type_get_type (void)
{
......@@ -564,6 +594,38 @@ gimp_image_type_get_type (void)
return type;
}
GType
gimp_ink_blob_type_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_INK_BLOB_TYPE_CIRCLE, "GIMP_INK_BLOB_TYPE_CIRCLE", "circle" },
{ GIMP_INK_BLOB_TYPE_SQUARE, "GIMP_INK_BLOB_TYPE_SQUARE", "square" },
{ GIMP_INK_BLOB_TYPE_DIAMOND, "GIMP_INK_BLOB_TYPE_DIAMOND", "diamond" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_INK_BLOB_TYPE_CIRCLE, NC_("ink-blob-type", "Circle"), NULL },
{ GIMP_INK_BLOB_TYPE_SQUARE, NC_("ink-blob-type", "Square"), NULL },
{ GIMP_INK_BLOB_TYPE_DIAMOND, NC_("ink-blob-type", "Diamond"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpInkBlobType", values);
gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
gimp_type_set_translation_context (type, "ink-blob-type");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_interpolation_type_get_type (void)
{
......
......@@ -150,6 +150,21 @@ typedef enum /*< pdb-skip >*/
} GimpCheckType;
#define GIMP_TYPE_CONVOLVE_TYPE (gimp_convolve_type_get_type ())
GType gimp_convolve_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_CONVOLVE_BLUR, /*< nick=blur-convolve, desc="Blur" >*/
GIMP_CONVOLVE_SHARPEN, /*< nick=sharpen-convolve, desc="Sharpen" >*/
/* the following aliases are deprecated */
GIMP_BLUR_CONVOLVE = GIMP_CONVOLVE_BLUR, /*< skip, pdb-skip >*/
GIMP_SHARPEN_CONVOLVE = GIMP_CONVOLVE_SHARPEN /*< skip, pdb-skip >*/
} GimpConvolveType;
#define GIMP_TYPE_CLONE_TYPE (gimp_clone_type_get_type ())
GType gimp_clone_type_get_type (void) G_GNUC_CONST;
......@@ -276,6 +291,18 @@ typedef enum
} GimpImageType;
#define GIMP_TYPE_INK_BLOB_TYPE (gimp_ink_blob_type_get_type ())
GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_INK_BLOB_TYPE_CIRCLE, /*< desc="Circle" >*/
GIMP_INK_BLOB_TYPE_SQUARE, /*< desc="Square" >*/
GIMP_INK_BLOB_TYPE_DIAMOND /*< desc="Diamond" >*/
} GimpInkBlobType;
#define GIMP_TYPE_INTERPOLATION_TYPE (gimp_interpolation_type_get_type ())
GType gimp_interpolation_type_get_type (void) G_GNUC_CONST;
......
......@@ -120,6 +120,11 @@ add_compat_enums(PyObject *m)
PyModule_AddIntConstant(m, "PATTERN_BUCKET_FILL",
GIMP_BUCKET_FILL_PATTERN);
PyModule_AddIntConstant(m, "BLUR_CONVOLVE",
GIMP_CONVOLVE_BLUR);
PyModule_AddIntConstant(m, "SHARPEN_CONVOLVE",
GIMP_CONVOLVE_SHARPEN);
PyModule_AddIntConstant(m, "IMAGE_CLONE",
GIMP_CLONE_IMAGE);
PyModule_AddIntConstant(m, "PATTERN_CLONE",
......
......@@ -148,8 +148,8 @@ static const NamedConstant const old_constants[] =
{ "VALUE", GIMP_VALUE_MODE },
{ "DIVIDE", GIMP_DIVIDE_MODE },
{ "BLUR", GIMP_BLUR_CONVOLVE },
{ "SHARPEN", GIMP_SHARPEN_CONVOLVE },
{ "BLUR", GIMP_CONVOLVE_BLUR },
{ "SHARPEN", GIMP_CONVOLVE_SHARPEN },
{ "WHITE-MASK", GIMP_ADD_MASK_WHITE },
{ "BLACK-MASK", GIMP_ADD_MASK_BLACK },
......@@ -162,10 +162,10 @@ static const NamedConstant const old_constants[] =
{ "REPLACE", GIMP_CHANNEL_OP_REPLACE },
{ "INTERSECT", GIMP_CHANNEL_OP_INTERSECT },
{ "FG-BG-RGB", GIMP_BLEND_FG_BG_RGB },
{ "FG-BG-HSV", GIMP_BLEND_FG_BG_HSV },
{ "FG-TRANS", GIMP_BLEND_FG_TRANSPARENT },
{ "CUSTOM", GIMP_BLEND_CUSTOM },
{ "FG-BG-RGB", GIMP_BLEND_FG_BG_RGB },
{ "FG-BG-HSV", GIMP_BLEND_FG_BG_HSV },
{ "FG-TRANS", GIMP_BLEND_FG_TRANSPARENT },
{ "CUSTOM", GIMP_BLEND_CUSTOM },
{ "FG-IMAGE-FILL", GIMP_FOREGROUND_FILL },
{ "BG-IMAGE-FILL", GIMP_BACKGROUND_FILL },
......@@ -222,6 +222,9 @@ static const NamedConstant const old_constants[] =
{ "BG-BUCKET_FILL", GIMP_BUCKET_FILL_BG },
{ "PATTERN-BUCKET_FILL", GIMP_BUCKET_FILL_PATTERN },
{ "BLUR-CONVOLVE", GIMP_CONVOLVE_BLUR },
{ "SHARPEN-CONVOLVE", GIMP_CONVOLVE_SHARPEN },
{ "IMAGE-CLONE", GIMP_CLONE_IMAGE },
{ "PATTERN-CLONE", GIMP_CLONE_PATTERN },
......
......@@ -76,6 +76,13 @@ package Gimp::CodeGen::enums;
GIMP_INDEXED_CHANNEL => '4',
GIMP_ALPHA_CHANNEL => '5' }
},
GimpConvolveType =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',
symbols => [ qw(GIMP_CONVOLVE_BLUR GIMP_CONVOLVE_SHARPEN) ],
mapping => { GIMP_CONVOLVE_BLUR => '0',
GIMP_CONVOLVE_SHARPEN => '1' }
},
GimpCloneType =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',
......@@ -175,6 +182,16 @@ package Gimp::CodeGen::enums;
GIMP_INDEXED_IMAGE => '4',
GIMP_INDEXEDA_IMAGE => '5' }
},
GimpInkBlobType =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',
symbols => [ qw(GIMP_INK_BLOB_TYPE_CIRCLE
GIMP_INK_BLOB_TYPE_SQUARE
GIMP_INK_BLOB_TYPE_DIAMOND) ],
mapping => { GIMP_INK_BLOB_TYPE_CIRCLE => '0',
GIMP_INK_BLOB_TYPE_SQUARE => '1',
GIMP_INK_BLOB_TYPE_DIAMOND => '2' }
},
GimpInterpolationType =>
{ contig => 1,
header => 'libgimpbase/gimpbaseenums.h',
......@@ -651,23 +668,6 @@ package Gimp::CodeGen::enums;
symbols => [ qw(GIMP_BRUSH_HARD GIMP_BRUSH_SOFT) ],
mapping => { GIMP_BRUSH_HARD => '0',
GIMP_BRUSH_SOFT => '1' }
},
GimpConvolveType =>
{ contig => 1,
header => 'paint/paint-enums.h',
symbols => [ qw(GIMP_BLUR_CONVOLVE GIMP_SHARPEN_CONVOLVE) ],
mapping => { GIMP_BLUR_CONVOLVE => '0',
GIMP_SHARPEN_CONVOLVE => '1' }
},
GimpInkBlobType =>
{ contig => 1,
header => 'paint/paint-enums.h',
symbols => [ qw(GIMP_INK_BLOB_TYPE_CIRCLE
GIMP_INK_BLOB_TYPE_SQUARE
GIMP_INK_BLOB_TYPE_DIAMOND) ],
mapping => { GIMP_INK_BLOB_TYPE_CIRCLE => '0',
GIMP_INK_BLOB_TYPE_SQUARE => '1',
GIMP_INK_BLOB_TYPE_DIAMOND => '2' }
}
);
......
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