Commit f84608d5 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

If a procedure call fails, pass a string describing the error as the

2008-08-16  Sven Neumann  <sven@gimp.org>

	If a procedure call fails, pass a string describing the error as
	the second return value. First step towars fixing bug #344818.

	* app/pdb/gimpprocedure.[ch] (gimp_procedure_get_return_values):
	added a GError parameter. If it is set, pass the error message 
to
	the return values.

	* app/pdb/gimppdberror.h: added some more error codes.

	* app/pdb/gimppdb.c
	* app/xcf/xcf.c: pass errors to 
gimp_procedure_get_return_values().

	* app/plug-in/gimpplugin-message.c 
(gimp_plug_in_handle_proc_run):
	show a different error message for execution vs. calling errors.

	* app/plug-in/gimpplugin-progress.c
	(gimp_plug_in_progress_cancel_callback): pass the error
	GIMP_PDB_CANCELLED to gimp_procedure_get_return_values().

	* app/plug-in/gimppluginmanager-call.[ch]
	(gimp_plug_in_manager_call_run): removed the 
'destroy_return_vals'
	parameter.

	* app/plug-in/gimppluginprocedure.c: destroy the return values 
here.

	* app/plug-in/gimppluginprocframe.c: pass an error to
	gimp_procedure_get_return_values().

	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb/fileops.pdb: generate code that passes the
	error to gimp_procedure_get_return_values().

	* app/pdb/*-cmds.c: regenerated.
	
	* plug-ins/pygimp/pygimp-pdb.c: extract the error message from 
the
	return values and pass it to the exception that is thrown.


svn path=/trunk/; revision=26593
parent b9acd507
2008-08-16 Sven Neumann <sven@gimp.org>
If a procedure call fails, pass a string describing the error as
the second return value. First step towars fixing bug #344818.
* app/pdb/gimpprocedure.[ch] (gimp_procedure_get_return_values):
added a GError parameter. If it is set, pass the error message to
the return values.
* app/pdb/gimppdberror.h: added some more error codes.
* app/pdb/gimppdb.c
* app/xcf/xcf.c: pass errors to gimp_procedure_get_return_values().
* app/plug-in/gimpplugin-message.c (gimp_plug_in_handle_proc_run):
show a different error message for execution vs. calling errors.
* app/plug-in/gimpplugin-progress.c
(gimp_plug_in_progress_cancel_callback): pass the error
GIMP_PDB_CANCELLED to gimp_procedure_get_return_values().
* app/plug-in/gimppluginmanager-call.[ch]
(gimp_plug_in_manager_call_run): removed the 'destroy_return_vals'
parameter.
* app/plug-in/gimppluginprocedure.c: destroy the return values here.
* app/plug-in/gimppluginprocframe.c: pass an error to
gimp_procedure_get_return_values().
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/fileops.pdb: generate code that passes the
error to gimp_procedure_get_return_values().
* app/pdb/*-cmds.c: regenerated.
* plug-ins/pygimp/pygimp-pdb.c: extract the error message from the
return values and pass it to the exception that is thrown.
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/actions/view-commands.c (view_shrink_wrap_cmd_callback):
......
......@@ -65,7 +65,8 @@ brush_new_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], actual_name);
......@@ -107,7 +108,8 @@ brush_duplicate_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], copy_name);
......@@ -140,7 +142,8 @@ brush_is_generated_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (&return_vals->values[1], generated);
......@@ -178,7 +181,8 @@ brush_rename_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], actual_name);
......@@ -211,7 +215,8 @@ brush_delete_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -239,7 +244,8 @@ brush_is_editable_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (&return_vals->values[1], editable);
......@@ -280,7 +286,8 @@ brush_get_info_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -341,7 +348,8 @@ brush_get_pixels_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -383,7 +391,8 @@ brush_get_spacing_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], spacing);
......@@ -416,7 +425,8 @@ brush_set_spacing_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -444,7 +454,8 @@ brush_get_shape_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_enum (&return_vals->values[1], shape);
......@@ -483,7 +494,8 @@ brush_set_shape_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_enum (&return_vals->values[1], shape_out);
......@@ -516,7 +528,8 @@ brush_get_radius_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], radius);
......@@ -555,7 +568,8 @@ brush_set_radius_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], radius_out);
......@@ -588,7 +602,8 @@ brush_get_spikes_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], spikes);
......@@ -627,7 +642,8 @@ brush_set_spikes_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], spikes_out);
......@@ -660,7 +676,8 @@ brush_get_hardness_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], hardness);
......@@ -699,7 +716,8 @@ brush_set_hardness_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], hardness_out);
......@@ -732,7 +750,8 @@ brush_get_aspect_ratio_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], aspect_ratio);
......@@ -771,7 +790,8 @@ brush_set_aspect_ratio_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], aspect_ratio_out);
......@@ -804,7 +824,8 @@ brush_get_angle_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], angle);
......@@ -843,7 +864,8 @@ brush_set_angle_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], angle_out);
......
......@@ -70,7 +70,8 @@ brushes_popup_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -95,7 +96,8 @@ brushes_close_popup_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -132,7 +134,8 @@ brushes_set_popup_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
void
......
......@@ -50,7 +50,7 @@ brushes_refresh_invoker (GimpProcedure *procedure,
{
gimp_data_factory_data_refresh (gimp->brush_factory);
return gimp_procedure_get_return_values (procedure, TRUE);
return gimp_procedure_get_return_values (procedure, TRUE, NULL);
}
static GValueArray *
......@@ -75,7 +75,8 @@ brushes_get_list_invoker (GimpProcedure *procedure,
filter, &num_brushes);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -113,7 +114,8 @@ brushes_get_brush_invoker (GimpProcedure *procedure,
else
success = FALSE;
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -145,7 +147,8 @@ brushes_get_spacing_invoker (GimpProcedure *procedure,
else
success = FALSE;
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], spacing);
......@@ -171,7 +174,8 @@ brushes_set_spacing_invoker (GimpProcedure *procedure,
gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -220,7 +224,8 @@ brushes_get_brush_data_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......
......@@ -60,7 +60,8 @@ buffers_get_list_invoker (GimpProcedure *procedure,
filter, &num_buffers);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -101,7 +102,8 @@ buffer_rename_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], real_name);
......@@ -132,7 +134,8 @@ buffer_delete_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -160,7 +163,8 @@ buffer_get_width_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], width);
......@@ -193,7 +197,8 @@ buffer_get_height_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], height);
......@@ -226,7 +231,8 @@ buffer_get_bytes_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_int (&return_vals->values[1], bytes);
......@@ -259,7 +265,8 @@ buffer_get_image_type_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_enum (&return_vals->values[1], image_type);
......
......@@ -75,7 +75,8 @@ channel_new_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_channel (&return_vals->values[1], channel);
......@@ -114,7 +115,8 @@ channel_new_from_component_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_channel (&return_vals->values[1], channel);
......@@ -146,7 +148,8 @@ channel_copy_invoker (GimpProcedure *procedure,
success = FALSE;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_channel (&return_vals->values[1], channel_copy);
......@@ -181,7 +184,8 @@ channel_combine_masks_invoker (GimpProcedure *procedure,
gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -204,7 +208,8 @@ channel_get_show_masked_invoker (GimpProcedure *procedure,
show_masked = gimp_channel_get_show_masked (channel);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_boolean (&return_vals->values[1], show_masked);
......@@ -232,7 +237,8 @@ channel_set_show_masked_invoker (GimpProcedure *procedure,
gimp_channel_set_show_masked (channel, show_masked);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -255,7 +261,8 @@ channel_get_opacity_invoker (GimpProcedure *procedure,
opacity = gimp_channel_get_opacity (channel) * 100;
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_set_double (&return_vals->values[1], opacity);
......@@ -283,7 +290,8 @@ channel_set_opacity_invoker (GimpProcedure *procedure,
gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -307,7 +315,8 @@ channel_get_color_invoker (GimpProcedure *procedure,
gimp_rgb_set_alpha (&color, 1.0);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_rgb (&return_vals->values[1], &color);
......@@ -338,7 +347,8 @@ channel_set_color_invoker (GimpProcedure *procedure,
gimp_channel_set_color (channel, &rgb_color, TRUE);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
void
......
......@@ -76,7 +76,8 @@ brightness_contrast_invoker (GimpProcedure *procedure,
brightness, contrast);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -122,7 +123,8 @@ levels_invoker (GimpProcedure *procedure,
low_output, high_output);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -148,7 +150,8 @@ levels_auto_invoker (GimpProcedure *procedure,
gimp_drawable_levels_stretch (drawable, progress);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -174,7 +177,8 @@ levels_stretch_invoker (GimpProcedure *procedure,
gimp_drawable_levels_stretch (drawable, progress);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -202,7 +206,8 @@ posterize_invoker (GimpProcedure *procedure,
gimp_drawable_posterize (drawable, progress, levels);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -228,7 +233,8 @@ desaturate_invoker (GimpProcedure *procedure,
gimp_drawable_desaturate (drawable, progress, GIMP_DESATURATE_LIGHTNESS);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -256,7 +262,8 @@ desaturate_full_invoker (GimpProcedure *procedure,
gimp_drawable_desaturate (drawable, progress, desaturate_mode);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -284,7 +291,8 @@ equalize_invoker (GimpProcedure *procedure,
gimp_drawable_equalize (drawable, mask_only);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -310,7 +318,8 @@ invert_invoker (GimpProcedure *procedure,
gimp_drawable_invert (drawable, progress);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -347,7 +356,8 @@ curves_spline_invoker (GimpProcedure *procedure,
channel, control_pts, num_points);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -384,7 +394,8 @@ curves_explicit_invoker (GimpProcedure *procedure,
channel, curve, num_bytes);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -423,7 +434,8 @@ color_balance_invoker (GimpProcedure *procedure,
preserve_lum);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -456,7 +468,8 @@ colorize_invoker (GimpProcedure *procedure,
hue, saturation, lightness);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -516,7 +529,8 @@ histogram_invoker (GimpProcedure *procedure,
}
}
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
{
......@@ -563,7 +577,8 @@ hue_saturation_invoker (GimpProcedure *procedure,
hue_range, hue_offset, saturation, lightness);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -595,7 +610,8 @@ threshold_invoker (GimpProcedure *procedure,
low_threshold, high_threshold);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
void
......
......@@ -57,7 +57,8 @@ context_push_invoker (GimpProcedure *procedure,
else
success = FALSE;
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -76,7 +77,8 @@ context_pop_invoker (GimpProcedure *procedure,
else
success = FALSE;
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -94,7 +96,7 @@ context_list_paint_methods_invoker (GimpProcedure *procedure,
paint_methods = gimp_container_get_name_array (gimp->paint_info_list,
&num_paint_methods);
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
g_value_set_int (&return_vals->values[1], num_paint_methods);
gimp_value_take_stringarray (&return_vals->values[2], paint_methods, num_paint_methods);
......@@ -121,7 +123,8 @@ context_get_paint_method_invoker (GimpProcedure *procedure,
else
success = FALSE;
return_vals = gimp_procedure_get_return_values (procedure, success);
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
g_value_take_string (&return_vals->values[1], name);
......@@ -152,7 +155,8 @@ context_set_paint_method_invoker (GimpProcedure *procedure,
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -169,7 +173,7 @@ context_get_foreground_invoker (GimpProcedure *procedure,
gimp_context_get_foreground (context, &foreground);
gimp_rgb_set_alpha (&foreground, 1.0);
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
gimp_value_set_rgb (&return_vals->values[1], &foreground);
return return_vals;
......@@ -194,7 +198,8 @@ context_set_foreground_invoker (GimpProcedure *procedure,
gimp_context_set_foreground (context, &foreground);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GValueArray *
......@@ -211,7 +216,7 @@ context_get_background_invoker (GimpProcedure *procedure,
gimp_context_get_background (context, &background);
gimp_rgb_set_alpha (&background, 1.0);
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
gimp_value_set_rgb (&return_vals->values[1], &background);
return return_vals;
......@@ -236,7 +241,8 @@ context_set_background_invoker (GimpProcedure *procedure,
gimp_context_set_background (context, &background);
}
return gimp_procedure_get_return_values (procedure, success);
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}