Commit 169faefb authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

renamed procedural_db_return_args() to procedural_db_return_values() and

2006-03-27  Michael Natterer  <mitch@gimp.org>

	* app/pdb/procedural_db.[ch]: renamed procedural_db_return_args()
	to procedural_db_return_values() and added
	procedural_db_arguments(), which returns a newly allocated,
	initialized array of the procedure's arguments.

	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* app/plug-in/plug-in-run.c
	* app/widgets/gimphelp.c
	* app/xcf/xcf.c
	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb/fileops.pdb: changed accordingly, some cleanup.

	* app/pdb/*_cmds.c: regenerated.
parent c3bbd70f
2006-03-27 Michael Natterer <mitch@gimp.org>
* app/pdb/procedural_db.[ch]: renamed procedural_db_return_args()
to procedural_db_return_values() and added
procedural_db_arguments(), which returns a newly allocated,
initialized array of the procedure's arguments.
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* app/plug-in/plug-in-run.c
* app/widgets/gimphelp.c
* app/xcf/xcf.c
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/fileops.pdb: changed accordingly, some cleanup.
* app/pdb/*_cmds.c: regenerated.
2006-03-27 Michael Natterer <mitch@gimp.org>
* app/pdb/procedural_db.h (ArgMarshal): pass the ProcRecord as
......
......@@ -67,7 +67,6 @@ plug_in_run_cmd_callback (GtkAction *action,
Argument *args;
gint n_args = 0;
GimpDisplay *gdisp = NULL;
gint i;
gimp = action_data_get_gimp (data);
if (! gimp)
......@@ -75,12 +74,7 @@ plug_in_run_cmd_callback (GtkAction *action,
proc_rec = &proc_def->db_info;
/* construct the procedures arguments */
args = g_new0 (Argument, proc_rec->num_args);
/* initialize the argument types */
for (i = 0; i < proc_rec->num_args; i++)
args[i].arg_type = proc_rec->args[i].arg_type;
args = procedural_db_arguments (proc_rec);
/* initialize the first argument */
args[n_args].value.pdb_int = GIMP_RUN_INTERACTIVE;
......
......@@ -330,19 +330,16 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
gdisp = gimp_context_get_display (action_data_get_context (data));
/* plug-in arguments as if called by <Image>/Filters/... */
args = g_new (Argument, 3);
args = procedural_db_arguments (proc_rec);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
args[2].value.pdb_int = -1; /* unused */
plug_in_run (gimage->gimp, action_data_get_context (data),
GIMP_PROGRESS (gdisp),
proc_rec, args, 3, FALSE, TRUE,
gdisp ? gimp_display_get_ID (gdisp) : 0);
proc_rec, args, 3 /* not proc_rec->num_args */,
FALSE, TRUE, gdisp ? gimp_display_get_ID (gdisp) : 0);
g_free (args);
}
......
......@@ -93,7 +93,7 @@ brush_new_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gchar *actual_name = NULL;
......@@ -116,12 +116,12 @@ brush_new_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_pointer = actual_name;
return_vals[1].value.pdb_pointer = actual_name;
return return_args;
return return_vals;
}
static ProcArg brush_new_inargs[] =
......@@ -168,7 +168,7 @@ brush_duplicate_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gchar *copy_name = NULL;
......@@ -196,12 +196,12 @@ brush_duplicate_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_pointer = copy_name;
return_vals[1].value.pdb_pointer = copy_name;
return return_args;
return return_vals;
}
static ProcArg brush_duplicate_inargs[] =
......@@ -248,7 +248,7 @@ brush_is_generated_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gboolean generated = FALSE;
......@@ -267,12 +267,12 @@ brush_is_generated_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = generated;
return_vals[1].value.pdb_int = generated;
return return_args;
return return_vals;
}
static ProcArg brush_is_generated_inargs[] =
......@@ -319,7 +319,7 @@ brush_rename_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gchar *new_name;
gchar *actual_name = NULL;
......@@ -346,12 +346,12 @@ brush_rename_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_pointer = actual_name;
return_vals[1].value.pdb_pointer = actual_name;
return return_args;
return return_vals;
}
static ProcArg brush_rename_inargs[] =
......@@ -432,7 +432,7 @@ brush_delete_invoker (ProcRecord *proc_record,
success = FALSE;
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brush_delete_inargs[] =
......@@ -470,7 +470,7 @@ brush_is_editable_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gboolean editable = FALSE;
......@@ -489,12 +489,12 @@ brush_is_editable_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = editable;
return_vals[1].value.pdb_int = editable;
return return_args;
return return_vals;
}
static ProcArg brush_is_editable_inargs[] =
......@@ -541,7 +541,7 @@ brush_get_info_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 width = 0;
gint32 height = 0;
......@@ -568,17 +568,17 @@ brush_get_info_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
{
return_args[1].value.pdb_int = width;
return_args[2].value.pdb_int = height;
return_args[3].value.pdb_int = mask_bpp;
return_args[4].value.pdb_int = color_bpp;
return_vals[1].value.pdb_int = width;
return_vals[2].value.pdb_int = height;
return_vals[3].value.pdb_int = mask_bpp;
return_vals[4].value.pdb_int = color_bpp;
}
return return_args;
return return_vals;
}
static ProcArg brush_get_info_inargs[] =
......@@ -640,7 +640,7 @@ brush_get_pixels_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 width = 0;
gint32 height = 0;
......@@ -680,21 +680,21 @@ brush_get_pixels_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
{
return_args[1].value.pdb_int = width;
return_args[2].value.pdb_int = height;
return_args[3].value.pdb_int = mask_bpp;
return_args[4].value.pdb_int = num_mask_bytes;
return_args[5].value.pdb_pointer = mask_bytes;
return_args[6].value.pdb_int = color_bpp;
return_args[7].value.pdb_int = num_color_bytes;
return_args[8].value.pdb_pointer = color_bytes;
return_vals[1].value.pdb_int = width;
return_vals[2].value.pdb_int = height;
return_vals[3].value.pdb_int = mask_bpp;
return_vals[4].value.pdb_int = num_mask_bytes;
return_vals[5].value.pdb_pointer = mask_bytes;
return_vals[6].value.pdb_int = color_bpp;
return_vals[7].value.pdb_int = num_color_bytes;
return_vals[8].value.pdb_pointer = color_bytes;
}
return return_args;
return return_vals;
}
static ProcArg brush_get_pixels_inargs[] =
......@@ -776,7 +776,7 @@ brush_get_spacing_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 spacing = 0;
......@@ -795,12 +795,12 @@ brush_get_spacing_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = spacing;
return_vals[1].value.pdb_int = spacing;
return return_args;
return return_vals;
}
static ProcArg brush_get_spacing_inargs[] =
......@@ -869,7 +869,7 @@ brush_set_spacing_invoker (ProcRecord *proc_record,
success = FALSE;
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brush_set_spacing_inargs[] =
......@@ -912,7 +912,7 @@ brush_get_shape_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 shape = 0;
......@@ -931,12 +931,12 @@ brush_get_shape_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = shape;
return_vals[1].value.pdb_int = shape;
return return_args;
return return_vals;
}
static ProcArg brush_get_shape_inargs[] =
......@@ -983,7 +983,7 @@ brush_get_radius_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble radius = 0.0;
......@@ -1002,12 +1002,12 @@ brush_get_radius_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = radius;
return_vals[1].value.pdb_float = radius;
return return_args;
return return_vals;
}
static ProcArg brush_get_radius_inargs[] =
......@@ -1054,7 +1054,7 @@ brush_get_spikes_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 spikes = 0;
......@@ -1073,12 +1073,12 @@ brush_get_spikes_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = spikes;
return_vals[1].value.pdb_int = spikes;
return return_args;
return return_vals;
}
static ProcArg brush_get_spikes_inargs[] =
......@@ -1125,7 +1125,7 @@ brush_get_hardness_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble hardness = 0.0;
......@@ -1144,12 +1144,12 @@ brush_get_hardness_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = hardness;
return_vals[1].value.pdb_float = hardness;
return return_args;
return return_vals;
}
static ProcArg brush_get_hardness_inargs[] =
......@@ -1196,7 +1196,7 @@ brush_get_aspect_ratio_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble aspect_ratio = 0.0;
......@@ -1215,12 +1215,12 @@ brush_get_aspect_ratio_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = aspect_ratio;
return_vals[1].value.pdb_float = aspect_ratio;
return return_args;
return return_vals;
}
static ProcArg brush_get_aspect_ratio_inargs[] =
......@@ -1267,7 +1267,7 @@ brush_get_angle_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble angle = 0.0;
......@@ -1286,12 +1286,12 @@ brush_get_angle_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = angle;
return_vals[1].value.pdb_float = angle;
return return_args;
return return_vals;
}
static ProcArg brush_get_angle_inargs[] =
......@@ -1338,7 +1338,7 @@ brush_set_shape_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 shape_in;
gint32 shape_out = 0;
......@@ -1366,12 +1366,12 @@ brush_set_shape_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = shape_out;
return_vals[1].value.pdb_int = shape_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_shape_inargs[] =
......@@ -1423,7 +1423,7 @@ brush_set_radius_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble radius_in;
gdouble radius_out = 0.0;
......@@ -1449,12 +1449,12 @@ brush_set_radius_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = radius_out;
return_vals[1].value.pdb_float = radius_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_radius_inargs[] =
......@@ -1506,7 +1506,7 @@ brush_set_spikes_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gint32 spikes_in;
gint32 spikes_out = 0;
......@@ -1532,12 +1532,12 @@ brush_set_spikes_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = spikes_out;
return_vals[1].value.pdb_int = spikes_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_spikes_inargs[] =
......@@ -1589,7 +1589,7 @@ brush_set_hardness_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble hardness_in;
gdouble hardness_out = 0.0;
......@@ -1615,12 +1615,12 @@ brush_set_hardness_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = hardness_out;
return_vals[1].value.pdb_float = hardness_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_hardness_inargs[] =
......@@ -1672,7 +1672,7 @@ brush_set_aspect_ratio_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble aspect_ratio_in;
gdouble aspect_ratio_out = 0.0;
......@@ -1698,12 +1698,12 @@ brush_set_aspect_ratio_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = aspect_ratio_out;
return_vals[1].value.pdb_float = aspect_ratio_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_aspect_ratio_inargs[] =
......@@ -1755,7 +1755,7 @@ brush_set_angle_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;
gdouble angle_in;
gdouble angle_out = 0.0;
......@@ -1781,12 +1781,12 @@ brush_set_angle_invoker (ProcRecord *proc_record,
success = FALSE;
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_float = angle_out;
return_vals[1].value.pdb_float = angle_out;
return return_args;
return return_vals;
}
static ProcArg brush_set_angle_inargs[] =
......
......@@ -93,7 +93,7 @@ brushes_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brushes_popup_inargs[] =
......@@ -171,7 +171,7 @@ brushes_close_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brushes_close_popup_inargs[] =
......@@ -248,7 +248,7 @@ brushes_set_popup_invoker (ProcRecord *proc_record,
success = FALSE;
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brushes_set_popup_inargs[] =
......
......@@ -61,7 +61,7 @@ brushes_refresh_invoker (ProcRecord *proc_record,
Argument *args)
{
gimp_data_factory_data_refresh (gimp->brush_factory);
return procedural_db_return_args (proc_record, TRUE);
return procedural_db_return_values (proc_record, TRUE);
}
static ProcRecord brushes_refresh_proc =
......@@ -90,7 +90,7 @@ brushes_get_list_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *filter;
gint32 num_brushes = 0;
gchar **brush_list = NULL;
......@@ -105,15 +105,15 @@ brushes_get_list_invoker (ProcRecord *proc_record,
filter, &num_brushes);
}
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
{
return_args[1].value.pdb_int = num_brushes;
return_args[2].value.pdb_pointer = brush_list;
return_vals[1].value.pdb_int = num_brushes;
return_vals[2].value.pdb_pointer = brush_list;
}
return return_args;
return return_vals;
}
static ProcArg brushes_get_list_inargs[] =
......@@ -165,7 +165,7 @@ brushes_get_brush_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name = NULL;
gint32 width = 0;
gint32 height = 0;
......@@ -183,17 +183,17 @@ brushes_get_brush_invoker (ProcRecord *proc_record,
else
success = FALSE;
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
{
return_args[1].value.pdb_pointer = name;
return_args[2].value.pdb_int = width;
return_args[3].value.pdb_int = height;
return_args[4].value.pdb_int = spacing;
return_vals[1].value.pdb_pointer = name;
return_vals[2].value.pdb_int = width;
return_vals[3].value.pdb_int = height;
return_vals[4].value.pdb_int = spacing;
}
return return_args;
return return_vals;
}
static ProcArg brushes_get_brush_outargs[] =
......@@ -246,7 +246,7 @@ brushes_get_spacing_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gint32 spacing = 0;
GimpBrush *brush = gimp_context_get_brush (context);
......@@ -256,12 +256,12 @@ brushes_get_spacing_invoker (ProcRecord *proc_record,
else
success = FALSE;
return_args = procedural_db_return_args (proc_record, success);
return_vals = procedural_db_return_values (proc_record, success);
if (success)
return_args[1].value.pdb_int = spacing;
return_vals[1].value.pdb_int = spacing;
return return_args;
return return_vals;
}
static ProcArg brushes_get_spacing_outargs[] =
......@@ -310,7 +310,7 @@ brushes_set_spacing_invoker (ProcRecord *proc_record,
gimp_brush_set_spacing (gimp_context_get_brush (context), spacing);
}
return procedural_db_return_args (proc_record, success);
return procedural_db_return_values (proc_record, success);
}
static ProcArg brushes_set_spacing_inargs[] =
......@@ -348,7 +348,7 @@ brushes_get_brush_data_invoker (ProcRecord *proc_record,
Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
Argument *return_vals;
gchar *name;