Commit 15d49080 authored by Ell's avatar Ell

app, pdb: Modify gimp_channel_border() to take a style parameter

isntead of the feather parameter, and pass it to
gimp_gegl_apply_border().

Make the necessary changes to the rest of the code to maintain the
current behavior.

Mass parameter alignment changes to gimpchannel.h. Sigh #2...
parent 45efe6c4
......@@ -569,7 +569,9 @@ select_border_callback (GtkWidget *widget,
}
gimp_channel_border (gimp_image_get_mask (image), radius_x, radius_y,
select_border_feather, select_border_edge_lock, TRUE);
! select_border_feather ? GIMP_CHANNEL_BORDER_STYLE_HARD :
GIMP_CHANNEL_BORDER_STYLE_FEATHERED,
select_border_edge_lock, TRUE);
gimp_image_flush (image);
}
......
......@@ -219,7 +219,7 @@ static void gimp_channel_real_invert (GimpChannel *channel,
static void gimp_channel_real_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo);
static void gimp_channel_real_grow (GimpChannel *channel,
......@@ -1406,12 +1406,12 @@ gimp_channel_real_invert (GimpChannel *channel,
}
static void
gimp_channel_real_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
gboolean edge_lock,
gboolean push_undo)
gimp_channel_real_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo)
{
gint x1, y1, x2, y2;
......@@ -1457,10 +1457,7 @@ gimp_channel_real_border (GimpChannel *channel,
NULL, NULL,
gimp_drawable_get_buffer (GIMP_DRAWABLE (channel)),
GEGL_RECTANGLE (x1, y1, x2 - x1, y2 - y1),
radius_x, radius_y,
! feather ? GIMP_CHANNEL_BORDER_STYLE_HARD :
GIMP_CHANNEL_BORDER_STYLE_FEATHERED,
edge_lock);
radius_x, radius_y, style, edge_lock);
channel->bounds_known = FALSE;
......@@ -2031,12 +2028,12 @@ gimp_channel_invert (GimpChannel *channel,
}
void
gimp_channel_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
gboolean edge_lock,
gboolean push_undo)
gimp_channel_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
......@@ -2044,7 +2041,7 @@ gimp_channel_border (GimpChannel *channel,
push_undo = FALSE;
GIMP_CHANNEL_GET_CLASS (channel)->border (channel,
radius_x, radius_y, feather, edge_lock,
radius_x, radius_y, style, edge_lock,
push_undo);
}
......
......@@ -60,50 +60,50 @@ struct _GimpChannelClass
GimpDrawableClass parent_class;
/* signals */
void (* color_changed) (GimpChannel *channel);
void (* color_changed) (GimpChannel *channel);
/* virtual functions */
gboolean (* boundary) (GimpChannel *channel,
const GimpBoundSeg **segs_in,
const GimpBoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean (* is_empty) (GimpChannel *channel);
void (* feather) (GimpChannel *channel,
gdouble radius_x,
gdouble radius_y,
gboolean push_undo);
void (* sharpen) (GimpChannel *channel,
gboolean push_undo);
void (* clear) (GimpChannel *channel,
const gchar *undo_desc,
gboolean push_undo);
void (* all) (GimpChannel *channel,
gboolean push_undo);
void (* invert) (GimpChannel *channel,
gboolean push_undo);
void (* border) (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
gboolean edge_lock,
gboolean push_undo);
void (* grow) (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean push_undo);
void (* shrink) (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean edge_lock,
gboolean push_undo);
void (* flood) (GimpChannel *channel,
gboolean push_undo);
gboolean (* boundary) (GimpChannel *channel,
const GimpBoundSeg **segs_in,
const GimpBoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean (* is_empty) (GimpChannel *channel);
void (* feather) (GimpChannel *channel,
gdouble radius_x,
gdouble radius_y,
gboolean push_undo);
void (* sharpen) (GimpChannel *channel,
gboolean push_undo);
void (* clear) (GimpChannel *channel,
const gchar *undo_desc,
gboolean push_undo);
void (* all) (GimpChannel *channel,
gboolean push_undo);
void (* invert) (GimpChannel *channel,
gboolean push_undo);
void (* border) (GimpChannel *channel,
gint radius_x,
gint radius_y,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo);
void (* grow) (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean push_undo);
void (* shrink) (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean edge_lock,
gboolean push_undo);
void (* flood) (GimpChannel *channel,
gboolean push_undo);
const gchar *feather_desc;
const gchar *sharpen_desc;
......@@ -162,53 +162,53 @@ void gimp_channel_push_undo (GimpChannel *mask,
/* selection mask functions */
GimpChannel * gimp_channel_new_mask (GimpImage *image,
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
const GimpBoundSeg **segs_in,
const GimpBoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_feather (GimpChannel *mask,
gdouble radius_x,
gdouble radius_y,
gboolean push_undo);
void gimp_channel_sharpen (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_clear (GimpChannel *mask,
const gchar *undo_desc,
gboolean push_undo);
void gimp_channel_all (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_invert (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_border (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean feather,
gboolean edge_lock,
gboolean push_undo);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean push_undo);
void gimp_channel_shrink (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock,
gboolean push_undo);
void gimp_channel_flood (GimpChannel *mask,
gboolean push_undo);
GimpChannel * gimp_channel_new_mask (GimpImage *image,
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
const GimpBoundSeg **segs_in,
const GimpBoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_feather (GimpChannel *mask,
gdouble radius_x,
gdouble radius_y,
gboolean push_undo);
void gimp_channel_sharpen (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_clear (GimpChannel *mask,
const gchar *undo_desc,
gboolean push_undo);
void gimp_channel_all (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_invert (GimpChannel *mask,
gboolean push_undo);
void gimp_channel_border (GimpChannel *mask,
gint radius_x,
gint radius_y,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean push_undo);
void gimp_channel_shrink (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock,
gboolean push_undo);
void gimp_channel_flood (GimpChannel *mask,
gboolean push_undo);
#endif /* __GIMP_CHANNEL_H__ */
......@@ -126,7 +126,7 @@ static void gimp_selection_invert (GimpChannel *channel,
static void gimp_selection_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo);
static void gimp_selection_grow (GimpChannel *channel,
......@@ -545,16 +545,16 @@ gimp_selection_invert (GimpChannel *channel,
}
static void
gimp_selection_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
gboolean feather,
gboolean edge_lock,
gboolean push_undo)
gimp_selection_border (GimpChannel *channel,
gint radius_x,
gint radius_y,
GimpChannelBorderStyle style,
gboolean edge_lock,
gboolean push_undo)
{
GIMP_CHANNEL_CLASS (parent_class)->border (channel,
radius_x, radius_y,
feather, edge_lock,
style, edge_lock,
push_undo);
}
......
......@@ -362,9 +362,11 @@ selection_border_invoker (GimpProcedure *procedure,
if (success)
{
/* FIXME: "feather" and "edge-lock" hardcoded to TRUE */
/* FIXME: "style" and "edge-lock" hardcoded to FEATHERED and TRUE, respectively. */
gimp_channel_border (gimp_image_get_mask (image),
radius, radius, TRUE, TRUE, TRUE);
radius, radius,
GIMP_CHANNEL_BORDER_STYLE_FEATHERED,
TRUE, TRUE);
}
return gimp_procedure_get_return_values (procedure, success,
......
......@@ -360,9 +360,11 @@ HELP
%invoke = (
code => <<'CODE'
{
/* FIXME: "feather" and "edge-lock" hardcoded to TRUE */
/* FIXME: "style" and "edge-lock" hardcoded to FEATHERED and TRUE, respectively. */
gimp_channel_border (gimp_image_get_mask (image),
radius, radius, TRUE, TRUE, TRUE);
radius, radius,
GIMP_CHANNEL_BORDER_STYLE_FEATHERED,
TRUE, TRUE);
}
CODE
);
......
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