Commit 1c04c3f6 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed the _clear() wrapper.

2003-09-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-mask-select.[ch]: removed the _clear() wrapper.

	* app/core/gimpimage-mask.[ch]: changed accordingly. Added
	"const gchar *undo desc" parameter to
	gimp_image_mask_select_vectors().

	* app/core/gimpimage-qmask.c
	* app/gui/vectors-commands.c
	* app/text/gimptext-compat.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimprectselecttool.c
	* app/widgets/gimpvectorstreeview.c
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/selection.pdb: changed accordingly. Also
	replaced some wrappers which still exist.

	* tools/pdbgen/pdb/paths.pdb: stroke using gimp_item_stroke().

	* app/pdb/paths_cmds.c
	* app/pdb/selection_cmds.c: regenerated.
parent 22e904aa
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask-select.[ch]: removed the _clear() wrapper.
* app/core/gimpimage-mask.[ch]: changed accordingly. Added
"const gchar *undo desc" parameter to
gimp_image_mask_select_vectors().
* app/core/gimpimage-qmask.c
* app/gui/vectors-commands.c
* app/text/gimptext-compat.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpfreeselecttool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimprectselecttool.c
* app/widgets/gimpvectorstreeview.c
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/selection.pdb: changed accordingly. Also
replaced some wrappers which still exist.
* tools/pdbgen/pdb/paths.pdb: stroke using gimp_item_stroke().
* app/pdb/paths_cmds.c
* app/pdb/selection_cmds.c: regenerated.
2003-09-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-mask.[ch]: removed the feather(), sharpen(),
......@@ -152,6 +152,7 @@ vectors_to_selection_cmd_callback (GtkWidget *widget,
op = (GimpChannelOps) action;
gimp_image_mask_select_vectors (gimage,
_("Path to Selection"),
active_vectors,
op,
TRUE,
......
......@@ -49,11 +49,15 @@ gimp_image_mask_select_rectangle (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, _("Rect Select"));
gimp_channel_clear (selection, _("Rect Select"), TRUE);
else
gimp_image_mask_push_undo (gimage, _("Rect Select"));
......@@ -73,12 +77,12 @@ gimp_image_mask_select_rectangle (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h);
gimp_channel_combine_rect (selection, op, x, y, w, h);
}
gimp_image_mask_changed (gimage);
......@@ -96,11 +100,15 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, _("Ellipse Select"));
gimp_channel_clear (selection, _("Ellipse Select"), TRUE);
else
gimp_image_mask_push_undo (gimage, _("Ellipse Select"));
......@@ -121,13 +129,12 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op,
x, y, w, h, antialias);
gimp_channel_combine_ellipse (selection, op, x, y, w, h, antialias);
}
gimp_image_mask_changed (gimage);
......@@ -135,7 +142,7 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
void
gimp_image_mask_select_polygon (GimpImage *gimage,
const gchar *undo_name,
const gchar *undo_desc,
gint n_points,
GimpVector2 *points,
GimpChannelOps op,
......@@ -144,18 +151,21 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
GimpScanConvert *scan_convert;
GimpChannel *mask;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection
* or insure that a floating selection is anchored down...
*/
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_name);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_name);
gimp_image_mask_push_undo (gimage, undo_desc);
#define SUPERSAMPLE 3
......@@ -178,7 +188,7 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
......@@ -187,6 +197,7 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
void
gimp_image_mask_select_vectors (GimpImage *gimage,
const gchar *undo_desc,
GimpVectors *vectors,
GimpChannelOps op,
gboolean antialias,
......@@ -194,25 +205,26 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords=0;
const gchar *undo_name = "Select Vectors"; /* this probably should be an
argument */
GimpChannel *selection;
GimpScanConvert *scan_convert;
GimpChannel *mask = NULL;
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords = 0;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_VECTORS (vectors));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection
* or insure that a floating selection is anchored down...
*/
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_name);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_name);
gimp_image_mask_push_undo (gimage, undo_desc);
#define SUPERSAMPLE 3
......@@ -262,7 +274,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
......@@ -280,12 +292,16 @@ gimp_image_mask_select_channel (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_CHANNEL (channel));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_desc);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_desc);
......@@ -303,13 +319,12 @@ gimp_image_mask_select_channel (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_mask (gimp_image_get_mask (gimage), channel,
op, offset_x, offset_y);
gimp_channel_combine_mask (selection, channel, op, offset_x, offset_y);
}
gimp_image_mask_changed (gimage);
......
......@@ -52,6 +52,7 @@ void gimp_image_mask_select_polygon (GimpImage *gimage,
gdouble feather_radius_y);
void gimp_image_mask_select_vectors (GimpImage *gimage,
const gchar *undo_desc,
GimpVectors *vectors,
GimpChannelOps op,
gboolean antialias,
......
......@@ -49,11 +49,15 @@ gimp_image_mask_select_rectangle (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, _("Rect Select"));
gimp_channel_clear (selection, _("Rect Select"), TRUE);
else
gimp_image_mask_push_undo (gimage, _("Rect Select"));
......@@ -73,12 +77,12 @@ gimp_image_mask_select_rectangle (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_rect (gimp_image_get_mask (gimage), op, x, y, w, h);
gimp_channel_combine_rect (selection, op, x, y, w, h);
}
gimp_image_mask_changed (gimage);
......@@ -96,11 +100,15 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, _("Ellipse Select"));
gimp_channel_clear (selection, _("Ellipse Select"), TRUE);
else
gimp_image_mask_push_undo (gimage, _("Ellipse Select"));
......@@ -121,13 +129,12 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_ellipse (gimp_image_get_mask (gimage), op,
x, y, w, h, antialias);
gimp_channel_combine_ellipse (selection, op, x, y, w, h, antialias);
}
gimp_image_mask_changed (gimage);
......@@ -135,7 +142,7 @@ gimp_image_mask_select_ellipse (GimpImage *gimage,
void
gimp_image_mask_select_polygon (GimpImage *gimage,
const gchar *undo_name,
const gchar *undo_desc,
gint n_points,
GimpVector2 *points,
GimpChannelOps op,
......@@ -144,18 +151,21 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
GimpScanConvert *scan_convert;
GimpChannel *mask;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection
* or insure that a floating selection is anchored down...
*/
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_name);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_name);
gimp_image_mask_push_undo (gimage, undo_desc);
#define SUPERSAMPLE 3
......@@ -178,7 +188,7 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
......@@ -187,6 +197,7 @@ gimp_image_mask_select_polygon (GimpImage *gimage,
void
gimp_image_mask_select_vectors (GimpImage *gimage,
const gchar *undo_desc,
GimpVectors *vectors,
GimpChannelOps op,
gboolean antialias,
......@@ -194,25 +205,26 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords=0;
const gchar *undo_name = "Select Vectors"; /* this probably should be an
argument */
GimpChannel *selection;
GimpScanConvert *scan_convert;
GimpChannel *mask = NULL;
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords = 0;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_VECTORS (vectors));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection
* or insure that a floating selection is anchored down...
*/
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_name);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_name);
gimp_image_mask_push_undo (gimage, undo_desc);
#define SUPERSAMPLE 3
......@@ -262,7 +274,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
......@@ -280,12 +292,16 @@ gimp_image_mask_select_channel (GimpImage *gimage,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GimpChannel *selection;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_return_if_fail (GIMP_IS_CHANNEL (channel));
selection = gimp_image_get_mask (gimage);
/* if applicable, replace the current selection */
if (op == GIMP_CHANNEL_OP_REPLACE)
gimp_image_mask_clear (gimage, undo_desc);
gimp_channel_clear (selection, undo_desc, TRUE);
else
gimp_image_mask_push_undo (gimage, undo_desc);
......@@ -303,13 +319,12 @@ gimp_image_mask_select_channel (GimpImage *gimage,
feather_radius_y,
FALSE /* no undo */);
gimp_channel_combine_mask (gimp_image_get_mask (gimage), mask, op, 0, 0);
gimp_channel_combine_mask (selection, mask, op, 0, 0);
g_object_unref (mask);
}
else
{
gimp_channel_combine_mask (gimp_image_get_mask (gimage), channel,
op, offset_x, offset_y);
gimp_channel_combine_mask (selection, channel, op, offset_x, offset_y);
}
gimp_image_mask_changed (gimage);
......
......@@ -52,6 +52,7 @@ void gimp_image_mask_select_polygon (GimpImage *gimage,
gdouble feather_radius_y);
void gimp_image_mask_select_vectors (GimpImage *gimage,
const gchar *undo_desc,
GimpVectors *vectors,
GimpChannelOps op,
gboolean antialias,
......
......@@ -91,15 +91,6 @@ gimp_image_mask_is_empty (GimpImage *gimage)
return gimp_channel_is_empty (gimp_image_get_mask (gimage));
}
void
gimp_image_mask_clear (GimpImage *gimage,
const gchar *undo_desc)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
gimp_channel_clear (gimp_image_get_mask (gimage), undo_desc, TRUE);
}
void
gimp_image_mask_push_undo (GimpImage *gimage,
const gchar *undo_desc)
......@@ -231,7 +222,7 @@ gimp_image_mask_extract (GimpImage *gimage,
if (cut_image)
{
/* Clear the region */
gimp_image_mask_clear (gimage, NULL);
gimp_channel_clear (sel_mask, NULL, TRUE);
/* Update the region */
gimp_image_update (gimage,
......@@ -316,7 +307,7 @@ gimp_image_mask_float (GimpImage *gimage,
/* Clear the selection as if we had cut the pixels */
if (! cut_image)
gimp_image_mask_clear (gimage, NULL);
gimp_channel_clear (mask, NULL, TRUE);
/* Create a new layer from the buffer, using the drawable's type
* because it may be different from the image's type if we cut from
......
......@@ -37,9 +37,6 @@ gint gimp_image_mask_value (GimpImage *gimage,
gint y);
gboolean gimp_image_mask_is_empty (GimpImage *gimage);
void gimp_image_mask_clear (GimpImage *gimage,
const gchar *undo_name);
/* pure wrappers around the resp. GimpSelection functions: */
......
......@@ -51,6 +51,7 @@ void
gimp_image_set_qmask_state (GimpImage *gimage,
gboolean qmask_state)
{
GimpChannel *selection;
GimpChannel *mask;
GimpRGB color;
......@@ -59,6 +60,8 @@ gimp_image_set_qmask_state (GimpImage *gimage,
if (qmask_state == gimage->qmask_state)
return;
selection = gimp_image_get_mask (gimage);
if (qmask_state)
{
/* Set the defaults */
......@@ -71,8 +74,10 @@ gimp_image_set_qmask_state (GimpImage *gimage,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_QMASK,
_("Enable QuickMask"));
if (gimp_image_mask_is_empty (gimage)) /* if no selection */
if (gimp_channel_is_empty (selection))
{
/* if no selection */
GimpLayer *layer;
if ((layer = gimp_image_floating_sel (gimage)))
......@@ -90,12 +95,16 @@ gimp_image_set_qmask_state (GimpImage *gimage,
gimp_get_current_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
}
else /* if selection */
else
{
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (gimp_image_get_mask (gimage)),
G_TYPE_FROM_INSTANCE (gimp_image_get_mask (gimage)),
/* if selection */
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
GIMP_TYPE_CHANNEL,
FALSE));
gimp_image_mask_clear (gimage, NULL); /* Clear the selection */
/* Clear the selection */
gimp_channel_clear (selection, NULL, TRUE);
gimp_channel_set_color (mask, &color, FALSE);
gimp_item_rename (GIMP_ITEM (mask), "Qmask");
......
......@@ -51,6 +51,7 @@ void
gimp_image_set_qmask_state (GimpImage *gimage,
gboolean qmask_state)
{
GimpChannel *selection;
GimpChannel *mask;
GimpRGB color;
......@@ -59,6 +60,8 @@ gimp_image_set_qmask_state (GimpImage *gimage,
if (qmask_state == gimage->qmask_state)
return;
selection = gimp_image_get_mask (gimage);
if (qmask_state)
{
/* Set the defaults */
......@@ -71,8 +74,10 @@ gimp_image_set_qmask_state (GimpImage *gimage,
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_QMASK,
_("Enable QuickMask"));
if (gimp_image_mask_is_empty (gimage)) /* if no selection */
if (gimp_channel_is_empty (selection))
{
/* if no selection */
GimpLayer *layer;
if ((layer = gimp_image_floating_sel (gimage)))
......@@ -90,12 +95,16 @@ gimp_image_set_qmask_state (GimpImage *gimage,
gimp_get_current_context (gimage->gimp),
GIMP_TRANSPARENT_FILL);
}
else /* if selection */
else
{
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (gimp_image_get_mask (gimage)),
G_TYPE_FROM_INSTANCE (gimp_image_get_mask (gimage)),
/* if selection */
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection),
GIMP_TYPE_CHANNEL,
FALSE));
gimp_image_mask_clear (gimage, NULL); /* Clear the selection */
/* Clear the selection */
gimp_channel_clear (selection, NULL, TRUE);
gimp_channel_set_color (mask, &color, FALSE);
gimp_item_rename (GIMP_ITEM (mask), "Qmask");
......
......@@ -152,6 +152,7 @@ vectors_to_selection_cmd_callback (GtkWidget *widget,
op = (GimpChannelOps) action;
gimp_image_mask_select_vectors (gimage,
_("Path to Selection"),
active_vectors,
op,
TRUE,
......
......@@ -34,10 +34,8 @@
#include "core/gimpimage-mask-select.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
#include "paint/gimppaintcore-stroke.h"
#include "paint/gimppaintoptions.h"
#include "gimp-intl.h"
#include "vectors/gimpanchor.h"
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpvectors-compat.h"
......@@ -612,26 +610,12 @@ path_stroke_current_invoker (Gimp *gimp,
if (vectors && drawable)
{
GimpToolInfo *tool_info;
GimpPaintOptions *paint_options;
GimpPaintCore *core;
GimpToolInfo *tool_info;
tool_info = gimp_context_get_tool (gimp_get_current_context (gimp));
if (! (tool_info && GIMP_IS_PAINT_OPTIONS (tool_info->tool_options)))
{
tool_info = (GimpToolInfo *)
gimp_container_get_child_by_name (gimp->tool_info_list,
"gimp-paintbrush-tool");
}
paint_options = GIMP_PAINT_OPTIONS (tool_info->tool_options);
core = g_object_new (tool_info->paint_info->paint_type, NULL);
gimp_paint_core_stroke_vectors (core, drawable, paint_options, vectors);
g_object_unref (core);
success = gimp_item_stroke (GIMP_ITEM (vectors), drawable,
tool_info->paint_info);
}
else
success = FALSE;
......@@ -1165,6 +1149,7 @@ path_to_selection_invoker (Gimp *gimp,
if (vectors)
gimp_image_mask_select_vectors (gimage,
_("Path to Selection"),
vectors,
op,
antialias,
......
......@@ -96,7 +96,7 @@ selection_bounds_invoker (Gimp *gimp,
success = FALSE;
if (success)
non_empty = gimp_image_mask_bounds (gimage, &x1, &y1, &x2, &y2);
non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), &x1, &y1, &x2, &y2);
return_args = procedural_db_return_args (&selection_bounds_proc, success);
......@@ -187,7 +187,7 @@ selection_value_invoker (Gimp *gimp,
return_args = procedural_db_return_args (&selection_value_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_image_mask_value (gimage, x, y);
return_args[1].value.pdb_int = gimp_channel_value (gimp_image_get_mask (gimage), x, y);
return return_args;
}
......@@ -251,7 +251,7 @@ selection_is_empty_invoker (Gimp *gimp,
return_args = procedural_db_return_args (&selection_is_empty_proc, success);
if (success)
return_args[1].value.pdb_int = gimp_image_mask_is_empty (gimage);
return_args[1].value.pdb_int = gimp_channel_is_empty (gimp_image_get_mask (gimage));
return return_args;
}
......@@ -439,7 +439,7 @@ selection_clear_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_image_mask_clear (gimage, NULL);
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
return procedural_db_return_args (&selection_clear_proc, success);
}
......@@ -607,7 +607,7 @@ selection_none_invoker (Gimp *gimp,
success = FALSE;
if (success)
gimp_image_mask_clear (gimage, NULL);
gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE);
return procedural_db_return_args (&selection_none_proc, success);
}
......
......@@ -28,10 +28,9 @@
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable-bucket-fill.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimphelp-ids.h"
......@@ -261,11 +260,13 @@ gimp_bucket_fill_tool_cursor_update (GimpTool *tool,
if (gimp_display_coords_in_active_drawable (gdisp, coords))
{
GimpChannel *selection = gimp_image_get_mask (gdisp->gimage);
/* One more test--is there a selected region?
* if so, is cursor inside?
*/
if (gimp_image_mask_is_empty (gdisp->gimage) ||
gimp_image_mask_value (gdisp->gimage, coords->x, coords->y))
if (gimp_channel_is_empty (selection) ||
gimp_channel_value (selection, coords->x, coords->y))
{
switch (options->fill_mode)
{
......
......@@ -31,7 +31,6 @@
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimptoolinfo.h"
......@@ -252,7 +251,8 @@ gimp_free_select_tool_button_release (GimpTool *tool,
floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage));
/* Otherwise, clear the selection mask */
else
gimp_image_mask_clear (gdisp->gimage, NULL);
gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL,
TRUE);
gimp_image_flush (gdisp->gimage);
return;
......
......@@ -34,7 +34,6 @@
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-contiguous-region.h"
#include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimptoolinfo.h"
......@@ -276,7 +275,8 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool,
floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage));
/* Otherwise, clear the selection mask */
else
gimp_image_mask_clear (gdisp->gimage, NULL);
gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL,