diff --git a/ChangeLog b/ChangeLog index f75142ee99..cee32c3255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2007-12-06 Michael Natterer + + * app/paint/gimppaintcore-stroke.[ch]: added GError arguments and + fixed all functions to abort when the first call to + gimp_paint_core_start() fails (it won't succeed either for the + next path or whatever segemts). + + * app/core/gimpitem.[ch]: added GError to gimp_item_stroke() + + * app/core/gimpselection.c + * app/core/gimpchannel.c + * app/vectors/gimpvectors.c: don't gimp_message() in + GimpItem::stroke() but set the error. + + * app/dialogs/stroke-dialog.c + * app/actions/vectors-commands.c + * app/actions/select-commands.c: handle the returned errors. + + * tools/pdbgen/pdb/edit.pdb + * tools/pdbgen/pdb/paths.pdb + * tools/pdbgen/pdb/paint_tools.pdb: pass the error to the stroke + functions. + + * app/pdb/paint_tools_cmds.c + * app/pdb/edit_cmds.c + * app/pdb/paths_cmds.c: regenerated. + 2007-12-06 Michael Natterer Move some gimp_message() calls where they belong: diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c index 270c9cc051..a4d0b85eca 100644 --- a/app/actions/select-commands.c +++ b/app/actions/select-commands.c @@ -336,6 +336,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action, GimpContext *context; GtkWidget *widget; GimpStrokeDesc *desc; + GError *error = NULL; return_if_no_image (image, data); return_if_no_context (context, data); return_if_no_widget (widget, data); @@ -356,12 +357,19 @@ select_stroke_last_vals_cmd_callback (GtkAction *action, else desc = gimp_stroke_desc_new (image->gimp, context); - gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)), - drawable, context, desc, FALSE, NULL); + if (! gimp_item_stroke (GIMP_ITEM (gimp_image_get_mask (image)), + drawable, context, desc, FALSE, NULL, &error)) + { + gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING, + error->message); + g_clear_error (&error); + } + else + { + gimp_image_flush (image); + } g_object_unref (desc); - - gimp_image_flush (image); } diff --git a/app/actions/vectors-commands.c b/app/actions/vectors-commands.c index bc9e41cd3e..a66b42feb3 100644 --- a/app/actions/vectors-commands.c +++ b/app/actions/vectors-commands.c @@ -391,6 +391,7 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action, GimpContext *context; GtkWidget *widget; GimpStrokeDesc *desc; + GError *error = NULL; return_if_no_vectors (image, vectors, data); return_if_no_context (context, data); return_if_no_widget (widget, data); @@ -412,11 +413,19 @@ 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, NULL); + if (! gimp_item_stroke (GIMP_ITEM (vectors), drawable, context, desc, FALSE, + NULL, &error)) + { + gimp_message (image->gimp, G_OBJECT (widget), GIMP_MESSAGE_WARNING, + error->message); + g_clear_error (&error); + } + else + { + gimp_image_flush (image); + } g_object_unref (desc); - - gimp_image_flush (image); } void diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 6ad0a35aa7..18178c78af 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -120,7 +120,8 @@ static void gimp_channel_transform (GimpItem *item, static gboolean gimp_channel_stroke (GimpItem *item, GimpDrawable *drawable, GimpStrokeDesc *stroke_desc, - GimpProgress *progress); + GimpProgress *progress, + GError **error); static void gimp_channel_invalidate_boundary (GimpDrawable *drawable); static void gimp_channel_get_active_components (const GimpDrawable *drawable, @@ -668,10 +669,11 @@ gimp_channel_transform (GimpItem *item, } static gboolean -gimp_channel_stroke (GimpItem *item, - GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc, - GimpProgress *progress) +gimp_channel_stroke (GimpItem *item, + GimpDrawable *drawable, + GimpStrokeDesc *stroke_desc, + GimpProgress *progress, + GError **error) { GimpChannel *channel = GIMP_CHANNEL (item); @@ -686,9 +688,8 @@ gimp_channel_stroke (GimpItem *item, &n_segs_in, &n_segs_out, 0, 0, 0, 0)) { - gimp_message (gimp_item_get_image (item)->gimp, G_OBJECT (progress), - GIMP_MESSAGE_WARNING, - _("Cannot stroke empty channel.")); + g_set_error (error, 0, 0, + _("Cannot stroke empty channel.")); return FALSE; } @@ -713,7 +714,8 @@ gimp_channel_stroke (GimpItem *item, retval = gimp_paint_core_stroke_boundary (core, drawable, stroke_desc->paint_options, segs_in, n_segs_in, - offset_x, offset_y); + offset_x, offset_y, + error); g_object_unref (core); } diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c index 77147066a7..1660986be3 100644 --- a/app/core/gimpitem.c +++ b/app/core/gimpitem.c @@ -1000,12 +1000,13 @@ gimp_item_transform (GimpItem *item, } gboolean -gimp_item_stroke (GimpItem *item, - GimpDrawable *drawable, - GimpContext *context, - GimpStrokeDesc *stroke_desc, - gboolean use_default_values, - GimpProgress *progress) +gimp_item_stroke (GimpItem *item, + GimpDrawable *drawable, + GimpContext *context, + GimpStrokeDesc *stroke_desc, + gboolean use_default_values, + GimpProgress *progress, + GError **error) { GimpItemClass *item_class; gboolean retval = FALSE; @@ -1017,6 +1018,7 @@ gimp_item_stroke (GimpItem *item, 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); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); item_class = GIMP_ITEM_GET_CLASS (item); @@ -1029,7 +1031,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, progress); + retval = item_class->stroke (item, drawable, stroke_desc, progress, error); gimp_image_undo_group_end (image); diff --git a/app/core/gimpitem.h b/app/core/gimpitem.h index e4cf70f5ad..be6d2337bb 100644 --- a/app/core/gimpitem.h +++ b/app/core/gimpitem.h @@ -111,7 +111,8 @@ struct _GimpItemClass gboolean (* stroke) (GimpItem *item, GimpDrawable *drawable, GimpStrokeDesc *stroke_desc, - GimpProgress *progress); + GimpProgress *progress, + GError **error); const gchar *default_name; const gchar *rename_desc; @@ -215,7 +216,8 @@ gboolean gimp_item_stroke (GimpItem *item, GimpContext *context, GimpStrokeDesc *stroke_desc, gboolean use_default_values, - GimpProgress *progress); + GimpProgress *progress, + GError **error); gint gimp_item_get_ID (GimpItem *item); GimpItem * gimp_item_get_by_ID (Gimp *gimp, diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c index 64a95f17f6..319fa9748d 100644 --- a/app/core/gimpselection.c +++ b/app/core/gimpselection.c @@ -76,7 +76,8 @@ static void gimp_selection_rotate (GimpItem *item, static gboolean gimp_selection_stroke (GimpItem *item, GimpDrawable *drawable, GimpStrokeDesc *stroke_desc, - GimpProgress *progress); + GimpProgress *progress, + GError **error); static void gimp_selection_invalidate_boundary (GimpDrawable *drawable); @@ -256,10 +257,11 @@ gimp_selection_rotate (GimpItem *item, } static gboolean -gimp_selection_stroke (GimpItem *item, - GimpDrawable *drawable, - GimpStrokeDesc *stroke_desc, - GimpProgress *progress) +gimp_selection_stroke (GimpItem *item, + GimpDrawable *drawable, + GimpStrokeDesc *stroke_desc, + GimpProgress *progress, + GError **error) { GimpSelection *selection = GIMP_SELECTION (item); const BoundSeg *dummy_in; @@ -273,16 +275,15 @@ gimp_selection_stroke (GimpItem *item, &num_dummy_in, &num_dummy_out, 0, 0, 0, 0)) { - gimp_message (gimp_item_get_image (item)->gimp, G_OBJECT (progress), - GIMP_MESSAGE_WARNING, - _("There is no selection to stroke.")); + g_set_error (error, 0, 0, + _("There is no selection to stroke.")); return FALSE; } selection->stroking = TRUE; retval = GIMP_ITEM_CLASS (parent_class)->stroke (item, drawable, stroke_desc, - progress); + progress, error); selection->stroking = FALSE; diff --git a/app/dialogs/stroke-dialog.c b/app/dialogs/stroke-dialog.c index e993ccd159..3b725117bd 100644 --- a/app/dialogs/stroke-dialog.c +++ b/app/dialogs/stroke-dialog.c @@ -273,6 +273,7 @@ stroke_dialog_response (GtkWidget *widget, { GimpDrawable *drawable = gimp_image_get_active_drawable (image); GimpStrokeDesc *saved_desc; + GError *error = NULL; if (! drawable) { @@ -297,7 +298,16 @@ stroke_dialog_response (GtkWidget *widget, saved_desc, (GDestroyNotify) g_object_unref); - gimp_item_stroke (item, drawable, context, desc, FALSE, NULL); + if (! gimp_item_stroke (item, drawable, context, desc, FALSE, NULL, + &error)) + { + gimp_message (context->gimp, G_OBJECT (widget), + GIMP_MESSAGE_WARNING, + error->message); + g_clear_error (&error); + return; + } + gimp_image_flush (image); } /* fallthrough */ diff --git a/app/paint/gimppaintcore-stroke.c b/app/paint/gimppaintcore-stroke.c index b8c20eed45..05a71de790 100644 --- a/app/paint/gimppaintcore-stroke.c +++ b/app/paint/gimppaintcore-stroke.c @@ -38,11 +38,12 @@ static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES; gboolean -gimp_paint_core_stroke (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpCoords *strokes, - gint n_strokes) +gimp_paint_core_stroke (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpCoords *strokes, + gint n_strokes, + GError **error) { g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); @@ -50,8 +51,10 @@ gimp_paint_core_stroke (GimpPaintCore *core, g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE); g_return_val_if_fail (strokes != NULL, FALSE); g_return_val_if_fail (n_strokes > 0, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - if (gimp_paint_core_start (core, drawable, paint_options, &strokes[0], NULL)) + if (gimp_paint_core_start (core, drawable, paint_options, &strokes[0], + error)) { gint i; @@ -85,13 +88,14 @@ gimp_paint_core_stroke (GimpPaintCore *core, } gboolean -gimp_paint_core_stroke_boundary (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - const BoundSeg *bound_segs, - gint n_bound_segs, - gint offset_x, - gint offset_y) +gimp_paint_core_stroke_boundary (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + const BoundSeg *bound_segs, + gint n_bound_segs, + gint offset_x, + gint offset_y, + GError **error) { GimpImage *image; BoundSeg *stroke_segs; @@ -109,6 +113,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE); g_return_val_if_fail (bound_segs != NULL && n_bound_segs > 0, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); image = gimp_item_get_image (GIMP_ITEM (drawable)); @@ -157,7 +162,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, if (initialized || gimp_paint_core_start (core, drawable, paint_options, &coords[0], - NULL)) + error)) { gint i; @@ -182,6 +187,10 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, gimp_paint_core_paint (core, drawable, paint_options, GIMP_PAINT_STATE_FINISH, 0); } + else + { + break; + } n_coords = 0; seg++; @@ -203,14 +212,15 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, g_free (coords); g_free (stroke_segs); - return TRUE; + return initialized; } gboolean -gimp_paint_core_stroke_vectors (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpVectors *vectors) +gimp_paint_core_stroke_vectors (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpVectors *vectors, + GError **error) { GList *stroke; GArray *coords = NULL; @@ -224,6 +234,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); gimp_item_offsets (GIMP_ITEM (vectors), &vectors_off_x, &vectors_off_y); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); @@ -249,7 +260,7 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, if (initialized || gimp_paint_core_start (core, drawable, paint_options, &g_array_index (coords, GimpCoords, 0), - NULL)) + error)) { initialized = TRUE; @@ -272,6 +283,13 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, gimp_paint_core_paint (core, drawable, paint_options, GIMP_PAINT_STATE_FINISH, 0); } + else + { + if (coords) + g_array_free (coords, TRUE); + + break; + } } if (coords) @@ -285,5 +303,5 @@ gimp_paint_core_stroke_vectors (GimpPaintCore *core, gimp_paint_core_cleanup (core); } - return TRUE; + return initialized; } diff --git a/app/paint/gimppaintcore-stroke.h b/app/paint/gimppaintcore-stroke.h index 516fedc223..f5567e9036 100644 --- a/app/paint/gimppaintcore-stroke.h +++ b/app/paint/gimppaintcore-stroke.h @@ -20,22 +20,25 @@ #define __GIMP_PAINT_CORE_STROKE_H__ -gboolean gimp_paint_core_stroke (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpCoords *strokes, - gint n_strokes); -gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - const BoundSeg *bound_segs, - gint n_bound_segs, - gint offset_x, - gint offset_y); -gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core, - GimpDrawable *drawable, - GimpPaintOptions *paint_options, - GimpVectors *vectors); +gboolean gimp_paint_core_stroke (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpCoords *strokes, + gint n_strokes, + GError **error); +gboolean gimp_paint_core_stroke_boundary (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + const BoundSeg *bound_segs, + gint n_bound_segs, + gint offset_x, + gint offset_y, + GError **error); +gboolean gimp_paint_core_stroke_vectors (GimpPaintCore *core, + GimpDrawable *drawable, + GimpPaintOptions *paint_options, + GimpVectors *vectors, + GError **error); #endif /* __GIMP_PAINT_CORE_STROKE_H__ */ diff --git a/app/pdb/edit_cmds.c b/app/pdb/edit_cmds.c index c87da21c61..1e797c4e65 100644 --- a/app/pdb/edit_cmds.c +++ b/app/pdb/edit_cmds.c @@ -688,7 +688,8 @@ 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, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); } @@ -723,7 +724,8 @@ 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, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); } diff --git a/app/pdb/paint_tools_cmds.c b/app/pdb/paint_tools_cmds.c index 0201093529..3f060af0ba 100644 --- a/app/pdb/paint_tools_cmds.c +++ b/app/pdb/paint_tools_cmds.c @@ -44,13 +44,14 @@ static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES; static gboolean -paint_tools_stroke (Gimp *gimp, - GimpContext *context, - GimpPaintOptions *options, - GimpDrawable *drawable, - gint n_strokes, - const gdouble *strokes, - const gchar *first_property_name, +paint_tools_stroke (Gimp *gimp, + GimpContext *context, + GimpPaintOptions *options, + GimpDrawable *drawable, + gint n_strokes, + const gdouble *strokes, + GError **error, + const gchar *first_property_name, ...) { GimpPaintCore *core; @@ -84,7 +85,8 @@ paint_tools_stroke (Gimp *gimp, } retval = gimp_paint_core_stroke (core, drawable, options, - coords, n_strokes); + coords, n_strokes, + error); g_free (coords); @@ -129,7 +131,7 @@ airbrush_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -167,7 +169,7 @@ airbrush_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -217,7 +219,7 @@ clone_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, "src-drawable", src_drawable, "src-x", src_x, @@ -258,7 +260,7 @@ clone_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -305,7 +307,7 @@ convolve_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -343,7 +345,7 @@ convolve_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -393,7 +395,7 @@ dodgeburn_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -431,7 +433,7 @@ dodgeburn_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -478,7 +480,7 @@ eraser_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -516,7 +518,7 @@ eraser_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -560,7 +562,7 @@ heal_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, "src-drawable", src_drawable, "src-x", src_x, @@ -601,7 +603,7 @@ heal_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -653,7 +655,7 @@ paintbrush_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -691,7 +693,7 @@ paintbrush_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -729,7 +731,7 @@ pencil_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -773,7 +775,7 @@ smudge_invoker (GimpProcedure *procedure, NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -811,7 +813,7 @@ smudge_default_invoker (GimpProcedure *procedure, GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } diff --git a/app/pdb/paths_cmds.c b/app/pdb/paths_cmds.c index 34296d05eb..f437541300 100644 --- a/app/pdb/paths_cmds.c +++ b/app/pdb/paths_cmds.c @@ -332,7 +332,8 @@ 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, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); } diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb index 014b76db8b..cf2e11c9d4 100644 --- a/tools/pdbgen/pdb/edit.pdb +++ b/tools/pdbgen/pdb/edit.pdb @@ -790,7 +790,8 @@ 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, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); } @@ -829,7 +830,8 @@ HELP g_object_set (desc, "method", GIMP_STROKE_METHOD_PAINT_CORE, NULL); success = gimp_item_stroke (GIMP_ITEM (vectors), - drawable, context, desc, TRUE, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); } diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index ab2cf172ba..e762cfc424 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -67,7 +67,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -109,7 +109,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -170,7 +170,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, "src-drawable", src_drawable, "src-x", src_x, @@ -216,7 +216,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -258,7 +258,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -307,7 +307,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -347,7 +347,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -397,7 +397,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -448,7 +448,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -497,7 +497,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, "src-drawable", src_drawable, "src-x", src_x, @@ -543,7 +543,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -604,7 +604,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -654,7 +654,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -695,7 +695,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -739,7 +739,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -781,7 +781,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -832,7 +832,7 @@ HELP NULL); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -874,7 +874,7 @@ HELP GimpPaintOptions *options = gimp_paint_options_new (info); success = paint_tools_stroke (gimp, context, options, drawable, - num_strokes, strokes, + num_strokes, strokes, error, "undo-desc", info->blurb, NULL); } @@ -905,13 +905,14 @@ $extra{app}->{code} = <<'CODE'; static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES; static gboolean -paint_tools_stroke (Gimp *gimp, - GimpContext *context, - GimpPaintOptions *options, - GimpDrawable *drawable, - gint n_strokes, - const gdouble *strokes, - const gchar *first_property_name, +paint_tools_stroke (Gimp *gimp, + GimpContext *context, + GimpPaintOptions *options, + GimpDrawable *drawable, + gint n_strokes, + const gdouble *strokes, + GError **error, + const gchar *first_property_name, ...) { GimpPaintCore *core; @@ -945,7 +946,8 @@ paint_tools_stroke (Gimp *gimp, } retval = gimp_paint_core_stroke (core, drawable, options, - coords, n_strokes); + coords, n_strokes, + error); g_free (coords); diff --git a/tools/pdbgen/pdb/paths.pdb b/tools/pdbgen/pdb/paths.pdb index 873bb44a89..550f93c1a8 100644 --- a/tools/pdbgen/pdb/paths.pdb +++ b/tools/pdbgen/pdb/paths.pdb @@ -273,7 +273,8 @@ 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, progress); + drawable, context, desc, TRUE, progress, + error); g_object_unref (desc); }