Handle the core part of bug #434274:

2007-05-03  Sven Neumann  <sven@gimp.org>

	Handle the core part of bug #434274:

	* app/core/gimpchannel.c (gimp_channel_real_boundary): return
	FALSE for an empty channel.

	* app/core/gimpitem.[ch]: added a progress parameter to
	gimp_item_stroke.

	* app/core/gimpchannel.c (gimp_channel_stroke)
	* app/core/gimpselection.c (gimp_selection_stroke): pass progress
	to gimp_message().

	* app/actions/vectors-commands.c
	* app/actions/select-commands.c
	* app/dialogs/stroke-dialog.c
	* app/vectors/gimpvectors.c
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/paths.pdb: changed accordingly.

	* app/pdb/edit_cmds.c
	* app/pdb/paths_cmds.c: regenerated.

	* app/core/gimplayermaskundo.c: added a missing cast.

svn path=/trunk/; revision=22389
This commit is contained in:
Sven Neumann 2007-05-03 15:17:07 +00:00 committed by Sven Neumann
parent cdf18a62c1
commit 6c427acf21
14 changed files with 65 additions and 30 deletions

View File

@ -1,3 +1,29 @@
2007-05-03 Sven Neumann <sven@gimp.org>
Handle the core part of bug #434274:
* app/core/gimpchannel.c (gimp_channel_real_boundary): return
FALSE for an empty channel.
* app/core/gimpitem.[ch]: added a progress parameter to
gimp_item_stroke.
* app/core/gimpchannel.c (gimp_channel_stroke)
* app/core/gimpselection.c (gimp_selection_stroke): pass progress
to gimp_message().
* app/actions/vectors-commands.c
* app/actions/select-commands.c
* app/dialogs/stroke-dialog.c
* app/vectors/gimpvectors.c
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/paths.pdb: changed accordingly.
* app/pdb/edit_cmds.c
* app/pdb/paths_cmds.c: regenerated.
* app/core/gimplayermaskundo.c: added a missing cast.
2007-05-03 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolorframe.c (gimp_color_frame_update): hide the

View File

@ -347,7 +347,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
desc = gimp_stroke_desc_new (image->gimp, context);
gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, desc, FALSE);
drawable, context, desc, FALSE, NULL);
g_object_unref (desc);

View File

@ -404,7 +404,7 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
else
desc = gimp_stroke_desc_new (image->gimp, context);
gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE);
gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE, NULL);
g_object_unref (desc);

View File

@ -120,7 +120,8 @@ static void gimp_channel_transform (GimpItem *item,
GimpProgress *progress);
static gboolean gimp_channel_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc);
GimpStrokeDesc *stroke_desc,
GimpProgress *progress);
static void gimp_channel_invalidate_boundary (GimpDrawable *drawable);
static void gimp_channel_get_active_components (const GimpDrawable *drawable,
@ -670,7 +671,8 @@ gimp_channel_transform (GimpItem *item,
static gboolean
gimp_channel_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc)
GimpStrokeDesc *stroke_desc,
GimpProgress *progress)
{
GimpChannel *channel = GIMP_CHANNEL (item);
@ -685,7 +687,7 @@ gimp_channel_stroke (GimpItem *item,
&n_segs_in, &n_segs_out,
0, 0, 0, 0))
{
gimp_message (gimp_item_get_image (item)->gimp, NULL,
gimp_message (gimp_item_get_image (item)->gimp, G_OBJECT (progress),
GIMP_MESSAGE_WARNING,
_("Cannot stroke empty channel."));
return FALSE;
@ -861,16 +863,14 @@ gimp_channel_real_boundary (GimpChannel *channel,
gint x2,
gint y2)
{
gint x3, y3, x4, y4;
PixelRegion bPR;
gint x3, y3, x4, y4;
PixelRegion bPR;
if (! channel->boundary_known)
{
/* free the out of date boundary segments */
if (channel->segs_in)
g_free (channel->segs_in);
if (channel->segs_out)
g_free (channel->segs_out);
g_free (channel->segs_in);
g_free (channel->segs_out);
if (gimp_channel_bounds (channel, &x3, &y3, &x4, &y4))
{
@ -920,7 +920,7 @@ gimp_channel_real_boundary (GimpChannel *channel,
*num_segs_in = channel->num_segs_in;
*num_segs_out = channel->num_segs_out;
return TRUE;
return (! channel->empty);
}
static gboolean

View File

@ -1007,7 +1007,8 @@ gimp_item_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpContext *context,
GimpStrokeDesc *stroke_desc,
gboolean use_default_values)
gboolean use_default_values,
GimpProgress *progress)
{
GimpItemClass *item_class;
gboolean retval = FALSE;
@ -1018,6 +1019,7 @@ gimp_item_stroke (GimpItem *item,
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE_DESC (stroke_desc), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
item_class = GIMP_ITEM_GET_CLASS (item);
@ -1030,7 +1032,7 @@ gimp_item_stroke (GimpItem *item,
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT,
item_class->stroke_desc);
retval = item_class->stroke (item, drawable, stroke_desc);
retval = item_class->stroke (item, drawable, stroke_desc, progress);
gimp_image_undo_group_end (image);

View File

@ -111,7 +111,8 @@ struct _GimpItemClass
GimpProgress *progress);
gboolean (* stroke) (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc);
GimpStrokeDesc *stroke_desc,
GimpProgress *progress);
const gchar *default_name;
const gchar *rename_desc;
@ -215,7 +216,8 @@ gboolean gimp_item_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpContext *context,
GimpStrokeDesc *stroke_desc,
gboolean use_default_values);
gboolean use_default_values,
GimpProgress *progress);
gint gimp_item_get_ID (GimpItem *item);
GimpItem * gimp_item_get_by_ID (Gimp *gimp,

View File

@ -119,7 +119,7 @@ gimp_layer_mask_undo_set_property (GObject *object,
switch (property_id)
{
case PROP_LAYER_MASK:
layer_mask_undo->layer_mask = g_value_dup_object (value);
layer_mask_undo->layer_mask = GIMP_LAYER_MASK (g_value_dup_object (value));
break;
default:

View File

@ -75,7 +75,8 @@ static void gimp_selection_rotate (GimpItem *item,
gboolean clip_result);
static gboolean gimp_selection_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc);
GimpStrokeDesc *stroke_desc,
GimpProgress *progress);
static void gimp_selection_invalidate_boundary (GimpDrawable *drawable);
@ -257,7 +258,8 @@ gimp_selection_rotate (GimpItem *item,
static gboolean
gimp_selection_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc)
GimpStrokeDesc *stroke_desc,
GimpProgress *progress)
{
GimpSelection *selection = GIMP_SELECTION (item);
const BoundSeg *dummy_in;
@ -271,7 +273,7 @@ gimp_selection_stroke (GimpItem *item,
&num_dummy_in, &num_dummy_out,
0, 0, 0, 0))
{
gimp_message (gimp_item_get_image (item)->gimp, NULL,
gimp_message (gimp_item_get_image (item)->gimp, G_OBJECT (progress),
GIMP_MESSAGE_WARNING,
_("There is no selection to stroke."));
return FALSE;
@ -279,7 +281,8 @@ gimp_selection_stroke (GimpItem *item,
selection->stroking = TRUE;
retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc);
retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc,
progress);
selection->stroking = FALSE;

View File

@ -299,7 +299,7 @@ stroke_dialog_response (GtkWidget *widget,
saved_desc,
(GDestroyNotify) g_object_unref);
gimp_item_stroke (item, drawable, context, desc, FALSE);
gimp_item_stroke (item, drawable, context, desc, FALSE, NULL);
gimp_image_flush (image);
}
/* fallthrough */

View File

@ -670,7 +670,7 @@ edit_stroke_invoker (GimpProcedure *procedure,
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}
@ -704,7 +704,7 @@ edit_stroke_vectors_invoker (GimpProcedure *procedure,
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}

View File

@ -325,7 +325,7 @@ path_stroke_current_invoker (GimpProcedure *procedure,
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}

View File

@ -108,7 +108,8 @@ static void gimp_vectors_transform (GimpItem *item,
GimpProgress *progress);
static gboolean gimp_vectors_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc);
GimpStrokeDesc *stroke_desc,
GimpProgress *progress);
static void gimp_vectors_real_thaw (GimpVectors *vectors);
static void gimp_vectors_real_stroke_add (GimpVectors *vectors,
@ -492,7 +493,8 @@ gimp_vectors_transform (GimpItem *item,
static gboolean
gimp_vectors_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpStrokeDesc *stroke_desc)
GimpStrokeDesc *stroke_desc,
GimpProgress *progress)
{
GimpVectors *vectors = GIMP_VECTORS (item);
gboolean retval = FALSE;

View File

@ -788,7 +788,7 @@ HELP
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}
@ -827,7 +827,7 @@ HELP
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}

View File

@ -273,7 +273,7 @@ sub path_stroke_current {
g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL);
success = gimp_item_stroke (GIMP_ITEM (vectors),
drawable, context, desc, TRUE);
drawable, context, desc, TRUE, progress);
g_object_unref (desc);
}