libgimp, plug-ins: make generic gimp_procedure_add_argument() private.

Same for gimp_procedure_add_aux_argument() and gimp_procedure_add_return_value().

We now have specific public functions for every supported type and it's
in fact much better to use them. The generic functions gave the feeling
that we could use any GParamSpec as procedure argument, whereas we in
fact depend on what the PDB support, and only these subtypes.
This commit is contained in:
Jehan
2024-07-05 22:29:35 +02:00
parent 6d36d143e8
commit ac030a0cd7
9 changed files with 472 additions and 604 deletions

View File

@ -734,8 +734,6 @@ EXPORTS
gimp_plug_in_remove_temp_procedure gimp_plug_in_remove_temp_procedure
gimp_plug_in_set_help_domain gimp_plug_in_set_help_domain
gimp_plug_in_set_pdb_error_handler gimp_plug_in_set_pdb_error_handler
gimp_procedure_add_argument
gimp_procedure_add_aux_argument
gimp_procedure_add_boolean_argument gimp_procedure_add_boolean_argument
gimp_procedure_add_boolean_aux_argument gimp_procedure_add_boolean_aux_argument
gimp_procedure_add_boolean_return_value gimp_procedure_add_boolean_return_value
@ -818,7 +816,6 @@ EXPORTS
gimp_procedure_add_resource_argument gimp_procedure_add_resource_argument
gimp_procedure_add_resource_aux_argument gimp_procedure_add_resource_aux_argument
gimp_procedure_add_resource_return_value gimp_procedure_add_resource_return_value
gimp_procedure_add_return_value
gimp_procedure_add_selection_argument gimp_procedure_add_selection_argument
gimp_procedure_add_selection_aux_argument gimp_procedure_add_selection_aux_argument
gimp_procedure_add_selection_return_value gimp_procedure_add_selection_return_value

View File

@ -229,14 +229,14 @@ _gimp_pdb_procedure_new (GimpPDB *pdb,
{ {
GParamSpec *pspec = _gimp_pdb_get_proc_argument (name, i); GParamSpec *pspec = _gimp_pdb_get_proc_argument (name, i);
gimp_procedure_add_argument (procedure, pspec); _gimp_procedure_add_argument (procedure, pspec);
} }
for (i = 0; i < n_return_vals; i++) for (i = 0; i < n_return_vals; i++)
{ {
GParamSpec *pspec = _gimp_pdb_get_proc_return_value (name, i); GParamSpec *pspec = _gimp_pdb_get_proc_return_value (name, i);
gimp_procedure_add_return_value (procedure, pspec); _gimp_procedure_add_return_value (procedure, pspec);
} }
if (type != GIMP_PDB_PROC_TYPE_INTERNAL) if (type != GIMP_PDB_PROC_TYPE_INTERNAL)

File diff suppressed because it is too large Load Diff

View File

@ -1278,13 +1278,12 @@ gimp_procedure_get_date (GimpProcedure *procedure)
} }
/** /**
* gimp_procedure_add_argument: * _gimp_procedure_add_argument:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @pspec: (transfer floating): the argument specification. * @pspec: (transfer floating): the argument specification.
* *
* Add a new argument to @procedure according to @pspec specifications. * Add a new argument to @procedure according to @pspec specifications.
* The arguments will be ordered according to the call order to * The arguments will be ordered according to the calls order.
* [method@Procedure.add_argument].
* *
* If @pspec is floating, ownership will be taken over by @procedure, * If @pspec is floating, ownership will be taken over by @procedure,
* allowing to pass directly `g*_param_spec_*()` calls as arguments. * allowing to pass directly `g*_param_spec_*()` calls as arguments.
@ -1294,8 +1293,8 @@ gimp_procedure_get_date (GimpProcedure *procedure)
* Since: 3.0 * Since: 3.0
**/ **/
GParamSpec * GParamSpec *
gimp_procedure_add_argument (GimpProcedure *procedure, _gimp_procedure_add_argument (GimpProcedure *procedure,
GParamSpec *pspec) GParamSpec *pspec)
{ {
g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), NULL); g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), NULL);
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL); g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
@ -1333,7 +1332,7 @@ gimp_procedure_add_argument (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_add_aux_argument: * _gimp_procedure_add_aux_argument:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @pspec: (transfer full): the argument specification. * @pspec: (transfer full): the argument specification.
* *
@ -1351,8 +1350,8 @@ gimp_procedure_add_argument (GimpProcedure *procedure,
* Since: 3.0 * Since: 3.0
**/ **/
GParamSpec * GParamSpec *
gimp_procedure_add_aux_argument (GimpProcedure *procedure, _gimp_procedure_add_aux_argument (GimpProcedure *procedure,
GParamSpec *pspec) GParamSpec *pspec)
{ {
g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), pspec); g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), pspec);
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), pspec); g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), pspec);
@ -1388,23 +1387,22 @@ gimp_procedure_add_aux_argument (GimpProcedure *procedure,
} }
/** /**
* gimp_procedure_add_return_value: * _gimp_procedure_add_return_value:
* @procedure: the #GimpProcedure. * @procedure: the #GimpProcedure.
* @pspec: (transfer full): the return value specification. * @pspec: (transfer full): the return value specification.
* *
* Add a new return value to @procedure according to @pspec * Add a new return value to @procedure according to @pspec
* specifications. * specifications.
* *
* The returned values will be ordered according to the call order to * The returned values will be ordered according to the calls order.
* [method@Procedure.add_return_value].
* *
* Returns: (transfer none): the same @pspec. * Returns: (transfer none): the same @pspec.
* *
* Since: 3.0 * Since: 3.0
**/ **/
GParamSpec * GParamSpec *
gimp_procedure_add_return_value (GimpProcedure *procedure, _gimp_procedure_add_return_value (GimpProcedure *procedure,
GParamSpec *pspec) GParamSpec *pspec)
{ {
g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), pspec); g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), pspec);
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), pspec); g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), pspec);
@ -1522,8 +1520,7 @@ gimp_procedure_find_return_value (GimpProcedure *procedure,
* @n_arguments: (out): Returns the number of arguments. * @n_arguments: (out): Returns the number of arguments.
* *
* Returns: (transfer none) (array length=n_arguments): An array * Returns: (transfer none) (array length=n_arguments): An array
* of @GParamSpec in the order added with * of @GParamSpec in the order they were added in.
* [method@Procedure.add_argument].
* *
* Since: 3.0 * Since: 3.0
**/ **/
@ -1545,8 +1542,7 @@ gimp_procedure_get_arguments (GimpProcedure *procedure,
* @n_arguments: (out): Returns the number of auxiliary arguments. * @n_arguments: (out): Returns the number of auxiliary arguments.
* *
* Returns: (transfer none) (array length=n_arguments): An array * Returns: (transfer none) (array length=n_arguments): An array
* of @GParamSpec in the order added with * of @GParamSpec in the order they were added in.
* gimp_procedure_add_aux_argument().
* *
* Since: 3.0 * Since: 3.0
**/ **/
@ -1568,8 +1564,7 @@ gimp_procedure_get_aux_arguments (GimpProcedure *procedure,
* @n_return_values: (out): Returns the number of return values. * @n_return_values: (out): Returns the number of return values.
* *
* Returns: (transfer none) (array length=n_return_values): An array * Returns: (transfer none) (array length=n_return_values): An array
* of @GParamSpec in the order added with * of @GParamSpec in the order they were added in.
* [method@Procedure.add_return_value].
* *
* Since: 3.0 * Since: 3.0
**/ **/
@ -1680,8 +1675,7 @@ gimp_procedure_get_argument_sync (GimpProcedure *procedure,
* @status is either #GIMP_PDB_EXECUTION_ERROR or * @status is either #GIMP_PDB_EXECUTION_ERROR or
* #GIMP_PDB_CALLING_ERROR. * #GIMP_PDB_CALLING_ERROR.
* *
* Format the expected return values from procedures, using the return * Format the expected return values from procedures.
* values set with [method@Procedure.add_return_value].
* *
* Returns: (transfer full): the expected #GimpValueArray as could be returned * Returns: (transfer full): the expected #GimpValueArray as could be returned
* by a [callback@RunFunc]. * by a [callback@RunFunc].

View File

@ -189,13 +189,6 @@ const gchar * gimp_procedure_get_authors (GimpProcedure *proced
const gchar * gimp_procedure_get_copyright (GimpProcedure *procedure); const gchar * gimp_procedure_get_copyright (GimpProcedure *procedure);
const gchar * gimp_procedure_get_date (GimpProcedure *procedure); const gchar * gimp_procedure_get_date (GimpProcedure *procedure);
GParamSpec * gimp_procedure_add_argument (GimpProcedure *procedure,
GParamSpec *pspec);
GParamSpec * gimp_procedure_add_aux_argument (GimpProcedure *procedure,
GParamSpec *pspec);
GParamSpec * gimp_procedure_add_return_value (GimpProcedure *procedure,
GParamSpec *pspec);
GParamSpec * gimp_procedure_find_argument (GimpProcedure *procedure, GParamSpec * gimp_procedure_find_argument (GimpProcedure *procedure,
const gchar *name); const gchar *name);
GParamSpec * gimp_procedure_find_aux_argument (GimpProcedure *procedure, GParamSpec * gimp_procedure_find_aux_argument (GimpProcedure *procedure,
@ -237,6 +230,13 @@ GimpProcedureConfig *
/* Internal use */ /* Internal use */
G_GNUC_INTERNAL GParamSpec * _gimp_procedure_add_argument (GimpProcedure *procedure,
GParamSpec *pspec);
G_GNUC_INTERNAL GParamSpec * _gimp_procedure_add_aux_argument (GimpProcedure *procedure,
GParamSpec *pspec);
G_GNUC_INTERNAL GParamSpec * _gimp_procedure_add_return_value (GimpProcedure *procedure,
GParamSpec *pspec);
G_GNUC_INTERNAL GimpProcedureConfig * _gimp_procedure_create_run_config (GimpProcedure *procedure); G_GNUC_INTERNAL GimpProcedureConfig * _gimp_procedure_create_run_config (GimpProcedure *procedure);
G_GNUC_INTERNAL GimpValueArray * _gimp_procedure_run_array (GimpProcedure *procedure, G_GNUC_INTERNAL GimpValueArray * _gimp_procedure_run_array (GimpProcedure *procedure,

View File

@ -286,14 +286,12 @@ psd_create_procedure (GimpPlugIn *plug_in,
gimp_procedure_add_int_argument (procedure, "size", gimp_procedure_add_int_argument (procedure, "size",
"Metadata size", "Metadata size",
NULL, NULL,
0, G_MAXINT, 0, 0, G_MAXINT, 0,
G_PARAM_READWRITE); G_PARAM_READWRITE);
gimp_procedure_add_argument (procedure, gimp_procedure_add_image_argument (procedure, "image",
gimp_param_spec_image ("image", "image", "The image",
"image", FALSE,
"The image", GIMP_PARAM_READWRITE);
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_boolean_argument (procedure, "metadata-type", gimp_procedure_add_boolean_argument (procedure, "metadata-type",
"Metadata type", "Metadata type",
"If the metadata contains image or " "If the metadata contains image or "

View File

@ -239,80 +239,73 @@ script_fu_arg_reset (SFArg *arg, gboolean should_reset_ids)
* this should convey what SFArg denotes about desired widget kind, * this should convey what SFArg denotes about desired widget kind,
* but it doesn't fully do that yet. * but it doesn't fully do that yet.
*/ */
GParamSpec * void
script_fu_arg_get_param_spec (SFArg *arg, script_fu_arg_add_argument (SFArg *arg,
const gchar *name, GimpProcedure *procedure,
const gchar *nick) const gchar *name,
const gchar *nick)
{ {
GParamSpec * pspec = NULL;
switch (arg->type) switch (arg->type)
{ {
/* No defaults for GIMP objects: Image, Item subclasses, Display */ /* No defaults for GIMP objects: Image, Item subclasses, Display */
case SF_IMAGE: case SF_IMAGE:
pspec = gimp_param_spec_image (name, gimp_procedure_add_image_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE, /* None is valid. */
TRUE, /* None is valid. */ G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_DRAWABLE: case SF_DRAWABLE:
pspec = gimp_param_spec_drawable (name, gimp_procedure_add_drawable_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE,
TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_LAYER: case SF_LAYER:
pspec = gimp_param_spec_layer (name, gimp_procedure_add_layer_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE,
TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_CHANNEL: case SF_CHANNEL:
pspec = gimp_param_spec_channel (name, gimp_procedure_add_channel_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE,
TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_VECTORS: case SF_VECTORS:
pspec = gimp_param_spec_vectors (name, gimp_procedure_add_vectors_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE,
TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_DISPLAY: case SF_DISPLAY:
pspec = gimp_param_spec_display (name, gimp_procedure_add_display_argument (procedure, name,
nick, nick, arg->label,
arg->label, TRUE,
TRUE, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_COLOR: case SF_COLOR:
{ {
GeglColor *color = sf_color_arg_get_default_color (arg); GeglColor *color = sf_color_arg_get_default_color (arg);
pspec = gimp_param_spec_color (name, nick, arg->label, TRUE, color, G_PARAM_READWRITE); gimp_procedure_add_color_argument (procedure, name, nick, arg->label, TRUE,
color, G_PARAM_READWRITE);
g_object_unref (color); g_object_unref (color);
} }
break; break;
case SF_TOGGLE: case SF_TOGGLE:
/* Implicit conversion from gint32 to gboolean. */ /* Implicit conversion from gint32 to gboolean. */
pspec = g_param_spec_boolean (name, gimp_procedure_add_boolean_argument (procedure, name,
nick, nick, arg->label,
arg->label, arg->default_value.sfa_toggle,
arg->default_value.sfa_toggle, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
/* FUTURE special widgets for multiline text. /* FUTURE special widgets for multiline text.
@ -321,11 +314,10 @@ script_fu_arg_get_param_spec (SFArg *arg,
case SF_VALUE: case SF_VALUE:
case SF_STRING: case SF_STRING:
case SF_TEXT: case SF_TEXT:
pspec = g_param_spec_string (name, gimp_procedure_add_string_argument (procedure, name,
nick, nick, arg->label,
arg->label, arg->default_value.sfa_value,
arg->default_value.sfa_value, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
/* Subclasses of GimpResource. Special widgets. */ /* Subclasses of GimpResource. Special widgets. */
@ -335,42 +327,37 @@ script_fu_arg_get_param_spec (SFArg *arg,
* each should pass arg sf_resource_get_name_of_default (arg). * each should pass arg sf_resource_get_name_of_default (arg).
*/ */
case SF_FONT: case SF_FONT:
pspec = gimp_param_spec_font (name, gimp_procedure_add_font_argument (procedure, name,
nick, nick, arg->label,
arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_PALETTE:
pspec = gimp_param_spec_palette (name,
nick,
arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_PATTERN:
pspec = gimp_param_spec_pattern (name,
nick,
arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_GRADIENT:
pspec = gimp_param_spec_gradient (name,
nick,
arg->label,
FALSE, /* none OK */ FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE); G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break; break;
case SF_PALETTE:
gimp_procedure_add_palette_argument (procedure, name,
nick, arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_PATTERN:
gimp_procedure_add_pattern_argument (procedure, name,
nick, arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_GRADIENT:
gimp_procedure_add_gradient_argument (procedure, name,
nick, arg->label,
FALSE, /* none OK */
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break;
case SF_BRUSH: case SF_BRUSH:
pspec = gimp_param_spec_brush (name, gimp_procedure_add_brush_argument (procedure, name,
nick, nick, arg->label,
arg->label, FALSE, /* none OK */
FALSE, /* none OK */ G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
G_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE);
break; break;
case SF_ADJUSTMENT: case SF_ADJUSTMENT:
@ -379,29 +366,32 @@ script_fu_arg_get_param_spec (SFArg *arg,
* Decimal places == 0 means type integer, else float * Decimal places == 0 means type integer, else float
*/ */
if (arg->default_value.sfa_adjustment.digits == 0) if (arg->default_value.sfa_adjustment.digits == 0)
pspec = g_param_spec_int (name, nick, arg->label, gimp_procedure_add_int_argument (procedure, name, nick, arg->label,
arg->default_value.sfa_adjustment.lower, arg->default_value.sfa_adjustment.lower,
arg->default_value.sfa_adjustment.upper, arg->default_value.sfa_adjustment.upper,
arg->default_value.sfa_adjustment.value, arg->default_value.sfa_adjustment.value,
G_PARAM_READWRITE); G_PARAM_READWRITE);
else else
pspec = g_param_spec_double (name, nick, arg->label, gimp_procedure_add_double_argument (procedure, name, nick, arg->label,
arg->default_value.sfa_adjustment.lower, arg->default_value.sfa_adjustment.lower,
arg->default_value.sfa_adjustment.upper, arg->default_value.sfa_adjustment.upper,
arg->default_value.sfa_adjustment.value, arg->default_value.sfa_adjustment.value,
G_PARAM_READWRITE); G_PARAM_READWRITE);
break; break;
case SF_FILENAME: case SF_FILENAME:
case SF_DIRNAME: case SF_DIRNAME:
pspec = g_param_spec_object (name, {
nick, GParamSpec *pspec = NULL;
arg->label,
G_TYPE_FILE, gimp_procedure_add_file_argument (procedure, name,
G_PARAM_READWRITE | nick, arg->label,
GIMP_PARAM_NO_VALIDATE); G_PARAM_READWRITE |
pspec_set_default_file (pspec, arg->default_value.sfa_file.filename); GIMP_PARAM_NO_VALIDATE);
/* FUTURE: Default not now appear in PDB browser, but appears in widgets? */ pspec = gimp_procedure_find_argument (procedure, name);
pspec_set_default_file (pspec, arg->default_value.sfa_file.filename);
/* FUTURE: Default not now appear in PDB browser, but appears in widgets? */
}
break; break;
/* Not necessary to have a more specific pspec: /* Not necessary to have a more specific pspec:
@ -410,28 +400,24 @@ script_fu_arg_get_param_spec (SFArg *arg,
case SF_ENUM: case SF_ENUM:
/* history is the last used value AND the default. */ /* history is the last used value AND the default. */
pspec = g_param_spec_enum (name, gimp_procedure_add_enum_argument (procedure, name,
nick, nick, arg->label,
arg->label, g_type_from_name (arg->default_value.sfa_enum.type_name),
g_type_from_name (arg->default_value.sfa_enum.type_name), arg->default_value.sfa_enum.history,
arg->default_value.sfa_enum.history, G_PARAM_READWRITE);
G_PARAM_READWRITE);
break; break;
case SF_OPTION: case SF_OPTION:
pspec = g_param_spec_int (name, gimp_procedure_add_int_argument (procedure, name,
nick, nick, arg->label,
arg->label, 0, /* Always zero based. */
0, /* Always zero based. */ g_slist_length (arg->default_value.sfa_option.list) - 1,
g_slist_length (arg->default_value.sfa_option.list) - 1, arg->default_value.sfa_option.history,
arg->default_value.sfa_option.history, G_PARAM_READWRITE);
G_PARAM_READWRITE);
/* FUTURE: Model values not now appear in PDB browser NOR in widgets? */ /* FUTURE: Model values not now appear in PDB browser NOR in widgets? */
/* FUTURE: Does not show a combo box widget ??? */ /* FUTURE: Does not show a combo box widget ??? */
break; break;
} }
return pspec;
} }

View File

@ -18,25 +18,26 @@
#ifndef __SCRIPT_FU_ARG_H__ #ifndef __SCRIPT_FU_ARG_H__
#define __SCRIPT_FU_ARG_H__ #define __SCRIPT_FU_ARG_H__
void script_fu_arg_free (SFArg *arg); void script_fu_arg_free (SFArg *arg);
void script_fu_arg_reset (SFArg *arg, void script_fu_arg_reset (SFArg *arg,
gboolean should_reset_ids); gboolean should_reset_ids);
GParamSpec *script_fu_arg_get_param_spec (SFArg *arg, void script_fu_arg_add_argument (SFArg *arg,
const gchar *name, GimpProcedure *procedure,
const gchar *nick); const gchar *name,
void script_fu_arg_append_repr_from_gvalue (SFArg *arg, const gchar *nick);
GString *result_string, void script_fu_arg_append_repr_from_gvalue (SFArg *arg,
GValue *gvalue); GString *result_string,
void script_fu_arg_append_repr_from_self (SFArg *arg, GValue *gvalue);
GString *result_string); void script_fu_arg_append_repr_from_self (SFArg *arg,
GString *result_string);
void script_fu_arg_reset_name_generator (void); void script_fu_arg_reset_name_generator (void);
void script_fu_arg_generate_name_and_nick (SFArg *arg, void script_fu_arg_generate_name_and_nick (SFArg *arg,
const gchar **name, const gchar **name,
const gchar **nick); const gchar **nick);
void script_fu_arg_init_resource (SFArg *arg, void script_fu_arg_init_resource (SFArg *arg,
GType resource_type); GType resource_type);
#endif /* __SCRIPT_FU_ARG__ */ #endif /* __SCRIPT_FU_ARG__ */

View File

@ -191,13 +191,11 @@ script_fu_script_create_PDB_procedure (GimpPlugIn *plug_in,
script_fu_script_set_proc_metadata (procedure, script); script_fu_script_set_proc_metadata (procedure, script);
gimp_procedure_add_argument (procedure, gimp_procedure_add_enum_argument (procedure, "run-mode",
g_param_spec_enum ("run-mode", "Run mode", "The run mode",
"Run mode", GIMP_TYPE_RUN_MODE,
"The run mode", GIMP_RUN_INTERACTIVE,
GIMP_TYPE_RUN_MODE, G_PARAM_READWRITE);
GIMP_RUN_INTERACTIVE,
G_PARAM_READWRITE));
script_fu_script_set_proc_args (procedure, script, 0); script_fu_script_set_proc_args (procedure, script, 0);
@ -608,15 +606,11 @@ script_fu_script_set_proc_args (GimpProcedure *procedure,
script_fu_arg_reset_name_generator (); script_fu_arg_reset_name_generator ();
for (gint i = first_conveyed_arg; i < script->n_args; i++) for (gint i = first_conveyed_arg; i < script->n_args; i++)
{ {
GParamSpec *pspec = NULL; const gchar *name = NULL;
const gchar *name = NULL; const gchar *nick = NULL;
const gchar *nick = NULL;
script_fu_arg_generate_name_and_nick (&script->args[i], &name, &nick); script_fu_arg_generate_name_and_nick (&script->args[i], &name, &nick);
pspec = script_fu_arg_get_param_spec (&script->args[i], script_fu_arg_add_argument (&script->args[i], procedure, name, nick);
name,
nick);
gimp_procedure_add_argument (procedure, pspec);
} }
} }