app: Add GimpChannelBorderStyle enum

Will be used as a parameter to control the behavior of
gimp_channel_border(), and the corresponding "Select -> Border..."
action, instead of the feather flag.

Can be one of:

  - GIMP_CHANNEL_BORDER_STYLE_HARD: Current behavior, unfeathered.
  - GIMP_CHANNEL_BORDER_STYLE_SMOOTH: Smooth border, better handling
    partial selection, implemented as explained in the next commit.
  - GIMP_CHANNEL_BORDER_STYLE_FEATHERED: Current behavior, feathered.
This commit is contained in:
Ell 2016-04-04 14:53:56 +00:00
parent d37d39bc71
commit 46a9690353
2 changed files with 43 additions and 0 deletions

View File

@ -1195,6 +1195,37 @@ gimp_image_map_region_get_type (void)
return type;
}
GType
gimp_channel_border_style_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_CHANNEL_BORDER_STYLE_HARD, "GIMP_CHANNEL_BORDER_STYLE_HARD", "hard" },
{ GIMP_CHANNEL_BORDER_STYLE_SMOOTH, "GIMP_CHANNEL_BORDER_STYLE_SMOOTH", "smooth" },
{ GIMP_CHANNEL_BORDER_STYLE_FEATHERED, "GIMP_CHANNEL_BORDER_STYLE_FEATHERED", "feathered" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_CHANNEL_BORDER_STYLE_HARD, NC_("channel-border-style", "Hard"), NULL },
{ GIMP_CHANNEL_BORDER_STYLE_SMOOTH, NC_("channel-border-style", "Smooth"), NULL },
{ GIMP_CHANNEL_BORDER_STYLE_FEATHERED, NC_("channel-border-style", "Feathered"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpChannelBorderStyle", values);
gimp_type_set_translation_context (type, "channel-border-style");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */

View File

@ -553,6 +553,18 @@ typedef enum /*< pdb-skip >*/
} GimpImageMapRegion;
#define GIMP_TYPE_CHANNEL_BORDER_STYLE (gimp_channel_border_style_get_type ())
GType gimp_channel_border_style_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_CHANNEL_BORDER_STYLE_HARD, /*< desc="Hard" >*/
GIMP_CHANNEL_BORDER_STYLE_SMOOTH, /*< desc="Smooth" >*/
GIMP_CHANNEL_BORDER_STYLE_FEATHERED /*< desc="Feathered" >*/
} GimpChannelBorderStyle;
/*
* non-registered enums; register them if needed
*/