added struct GimpArray which can keep static or allocated data. Added

2006-04-01  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpparamspecs.[ch]: added struct GimpArray which can
	keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY
	and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32,
	int16, int8, float and string arrays. Added functions to get, dup,
	set and set_static the various arrays from/to GValues.

	* app/pdb/gimpprocedure.c
	* app/pdb/procedural_db.c
	* app/plug-in/plug-in-params.c
	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value
	functions to keep arrays in GimpArguments.

	* app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed
	parameter "gboolean full_destroy". It's not needed any longer
	because the GValues fully memory-manage all their data now.

	* app/batch.c
	* app/actions/plug-in-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimppdbprogress.c
	* app/dialogs/about-dialog.c
	* app/dialogs/print-size-dialog.c
	* app/dialogs/resize-dialog.c
	* app/display/gimpdisplayshell-handlers.c
	* app/file/file-open.c
	* app/file/file-save.c
	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-run.c
	* app/plug-in/plug-ins.c
	* app/widgets/gimphelp.c
	* app/widgets/gimppdbdialog.c
	* tools/pdbgen/pdb/fileops.pdb: changed accordingly.

	* app/pdb/brush_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/buffer_cmds.c
	* app/pdb/color_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/fileops_cmds.c
	* app/pdb/fonts_cmds.c
	* app/pdb/gimpargument.c
	* app/pdb/gimpargument.h
	* app/pdb/gimpprocedure.c
	* app/pdb/gradient_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/paint_tools_cmds.c
	* app/pdb/palettes_cmds.c
	* app/pdb/parasite_cmds.c
	* app/pdb/paths_cmds.c
	* app/pdb/pattern_cmds.c
	* app/pdb/patterns_cmds.c
	* app/pdb/plug_in_cmds.c
	* app/pdb/procedural_db.c
	* app/pdb/procedural_db_cmds.c
	* app/pdb/selection_tools_cmds.c
	* app/pdb/vectors_cmds.c: regenerated.

	... and ported everything to perl btw...
This commit is contained in:
Michael Natterer 2006-04-01 01:33:28 +00:00 committed by Michael Natterer
parent 03c28ec7fc
commit d05d512d9c
49 changed files with 1396 additions and 595 deletions

View File

@ -1,3 +1,66 @@
2006-04-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: added struct GimpArray which can
keep static or allocated data. Added boxed types GIMP_TYPE_ARRAY
and GIMP_TYPE_STRING_ARRAY. Added GParamSpecs for PDB int32,
int16, int8, float and string arrays. Added functions to get, dup,
set and set_static the various arrays from/to GValues.
* app/pdb/gimpprocedure.c
* app/pdb/procedural_db.c
* app/plug-in/plug-in-params.c
* tools/pdbgen/app.pl
* tools/pdbgen/pdb.pl: use the new param pspecs and gimp_value
functions to keep arrays in GimpArguments.
* app/pdb/gimpargument.[ch] (gimp_arguments_destroy): removed
parameter "gboolean full_destroy". It's not needed any longer
because the GValues fully memory-manage all their data now.
* app/batch.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* app/core/gimppdbprogress.c
* app/dialogs/about-dialog.c
* app/dialogs/print-size-dialog.c
* app/dialogs/resize-dialog.c
* app/display/gimpdisplayshell-handlers.c
* app/file/file-open.c
* app/file/file-save.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-run.c
* app/plug-in/plug-ins.c
* app/widgets/gimphelp.c
* app/widgets/gimppdbdialog.c
* tools/pdbgen/pdb/fileops.pdb: changed accordingly.
* app/pdb/brush_cmds.c
* app/pdb/brushes_cmds.c
* app/pdb/buffer_cmds.c
* app/pdb/color_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/fileops_cmds.c
* app/pdb/fonts_cmds.c
* app/pdb/gimpargument.c
* app/pdb/gimpargument.h
* app/pdb/gimpprocedure.c
* app/pdb/gradient_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/image_cmds.c
* app/pdb/paint_tools_cmds.c
* app/pdb/palettes_cmds.c
* app/pdb/parasite_cmds.c
* app/pdb/paths_cmds.c
* app/pdb/pattern_cmds.c
* app/pdb/patterns_cmds.c
* app/pdb/plug_in_cmds.c
* app/pdb/procedural_db.c
* app/pdb/procedural_db_cmds.c
* app/pdb/selection_tools_cmds.c
* app/pdb/vectors_cmds.c: regenerated.
... and ported everything to perl btw...
2006-03-31 Michael Natterer <mitch@gimp.org>
* app/pdb/pdb-types.h

View File

@ -145,7 +145,7 @@ plug_in_run_cmd_callback (GtkAction *action,
}
error:
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
}
void

View File

@ -344,7 +344,7 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action,
procedure, args, 3 /* not procedure->num_args */,
FALSE, TRUE, display ? gimp_display_get_ID (display) : 0);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
}
void

View File

@ -163,8 +163,8 @@ batch_run_cmd (Gimp *gimp,
break;
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
gimp_arguments_destroy (args, procedure->num_args);
return;
}

View File

@ -35,10 +35,10 @@
* GIMP_TYPE_PARAM_STRING
*/
static void gimp_param_string_class_init (GParamSpecClass *class);
static void gimp_param_string_init (GParamSpec *pspec);
static gboolean gimp_param_string_validate (GParamSpec *pspec,
GValue *value);
static void gimp_param_string_class_init (GParamSpecClass *class);
static void gimp_param_string_init (GParamSpec *pspec);
static gboolean gimp_param_string_validate (GParamSpec *pspec,
GValue *value);
GType
gimp_param_string_get_type (void)
@ -143,11 +143,11 @@ gimp_param_spec_string (const gchar *name,
* GIMP_TYPE_PARAM_ENUM
*/
static void gimp_param_enum_class_init (GParamSpecClass *class);
static void gimp_param_enum_init (GParamSpec *pspec);
static void gimp_param_enum_finalize (GParamSpec *pspec);
static gboolean gimp_param_enum_validate (GParamSpec *pspec,
GValue *value);
static void gimp_param_enum_class_init (GParamSpecClass *class);
static void gimp_param_enum_init (GParamSpec *pspec);
static void gimp_param_enum_finalize (GParamSpec *pspec);
static gboolean gimp_param_enum_validate (GParamSpec *pspec,
GValue *value);
GType
gimp_param_enum_get_type (void)
@ -419,12 +419,12 @@ gimp_value_set_image (GValue *value,
static void gimp_param_item_id_class_init (GParamSpecClass *class);
static void gimp_param_item_id_init (GParamSpec *pspec);
static void gimp_param_item_id_set_default (GParamSpec *pspec,
GValue *value);
GValue *value);
static gboolean gimp_param_item_id_validate (GParamSpec *pspec,
GValue *value);
GValue *value);
static gint gimp_param_item_id_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2);
const GValue *value1,
const GValue *value2);
GType
gimp_param_item_id_get_type (void)
@ -773,8 +773,6 @@ gimp_parasite_get_type (void)
static void gimp_param_parasite_class_init (GParamSpecClass *class);
static void gimp_param_parasite_init (GParamSpec *pspec);
static void gimp_param_parasite_set_default (GParamSpec *pspec,
GValue *value);
static gboolean gimp_param_parasite_validate (GParamSpec *pspec,
GValue *value);
static gint gimp_param_parasite_values_cmp (GParamSpec *pspec,
@ -810,10 +808,9 @@ gimp_param_parasite_get_type (void)
static void
gimp_param_parasite_class_init (GParamSpecClass *class)
{
class->value_type = GIMP_TYPE_PARASITE;
class->value_set_default = gimp_param_parasite_set_default;
class->value_validate = gimp_param_parasite_validate;
class->values_cmp = gimp_param_parasite_values_cmp;
class->value_type = GIMP_TYPE_PARASITE;
class->value_validate = gimp_param_parasite_validate;
class->values_cmp = gimp_param_parasite_values_cmp;
}
static void
@ -821,12 +818,6 @@ gimp_param_parasite_init (GParamSpec *pspec)
{
}
static void
gimp_param_parasite_set_default (GParamSpec *pspec,
GValue *value)
{
}
static gboolean
gimp_param_parasite_validate (GParamSpec *pspec,
GValue *value)
@ -880,3 +871,601 @@ gimp_param_spec_parasite (const gchar *name,
return G_PARAM_SPEC (parasite_spec);
}
/*
* GIMP_TYPE_ARRAY
*/
GimpArray *
gimp_array_new (const guint8 *data,
gsize length,
gboolean static_data)
{
GimpArray *array;
g_return_val_if_fail ((data == NULL && length == 0) ||
(data != NULL && length > 0), NULL);
array = g_new0 (GimpArray, 1);
array->data = static_data ? (guint8 *) data : g_memdup (data, length);
array->length = length;
array->static_data = static_data;
return array;
}
GimpArray *
gimp_array_copy (const GimpArray *array)
{
if (array)
return gimp_array_new (array->data, array->length, FALSE);
return NULL;
}
void
gimp_array_free (GimpArray *array)
{
if (array)
{
if (! array->static_data)
g_free (array->data);
g_free (array);
}
}
GType
gimp_array_get_type (void)
{
static GType type = 0;
if (! type)
type = g_boxed_type_register_static ("GimpArray",
(GBoxedCopyFunc) gimp_array_copy,
(GBoxedFreeFunc) gimp_array_free);
return type;
}
/*
* GIMP_TYPE_PARAM_ARRAY
*/
static void gimp_param_array_class_init (GParamSpecClass *class);
static void gimp_param_array_init (GParamSpec *pspec);
static gboolean gimp_param_array_validate (GParamSpec *pspec,
GValue *value);
static gint gimp_param_array_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2);
GType
gimp_param_array_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo type_info =
{
sizeof (GParamSpecClass),
NULL, NULL,
(GClassInitFunc) gimp_param_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecArray),
0,
(GInstanceInitFunc) gimp_param_array_init
};
type = g_type_register_static (G_TYPE_PARAM_BOXED,
"GimpParamArray",
&type_info, 0);
}
return type;
}
static void
gimp_param_array_class_init (GParamSpecClass *class)
{
class->value_type = GIMP_TYPE_ARRAY;
class->value_validate = gimp_param_array_validate;
class->values_cmp = gimp_param_array_values_cmp;
}
static void
gimp_param_array_init (GParamSpec *pspec)
{
}
static gboolean
gimp_param_array_validate (GParamSpec *pspec,
GValue *value)
{
return FALSE;
}
static gint
gimp_param_array_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2)
{
GimpArray *array1 = value1->data[0].v_pointer;
GimpArray *array2 = value2->data[0].v_pointer;
/* try to return at least *something*, it's useless anyway... */
if (! array1)
return array2 != NULL ? -1 : 0;
else if (! array2)
return array1 != NULL;
else
{
}
return 0;
}
GParamSpec *
gimp_param_spec_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecArray *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
}
const guint8 *
gimp_value_get_int8array (const GValue *value)
{
GimpArray *array;
g_return_val_if_fail (GIMP_VALUE_HOLDS_ARRAY (value), NULL);
array = value->data[0].v_pointer;
if (array)
return array->data;
return NULL;
}
guint8 *
gimp_value_dup_int8array (const GValue *value)
{
GimpArray *array;
g_return_val_if_fail (GIMP_VALUE_HOLDS_ARRAY (value), NULL);
array = value->data[0].v_pointer;
if (array)
return g_memdup (array->data, array->length);
return NULL;
}
void
gimp_value_set_int8array (GValue *value,
const guint8 *data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_ARRAY (value));
array = gimp_array_new (data, length, FALSE);
g_value_take_boxed (value, array);
}
void
gimp_value_set_static_int8array (GValue *value,
const guint8 *data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_ARRAY (value));
array = gimp_array_new (data, length, TRUE);
g_value_take_boxed (value, array);
}
void
gimp_value_take_int8array (GValue *value,
guint8 *data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_ARRAY (value));
array = gimp_array_new (data, length, TRUE);
array->static_data = FALSE;
g_value_take_boxed (value, array);
}
const gint16 *
gimp_value_get_int16array (const GValue *value)
{
return (const gint16 *) gimp_value_get_int8array (value);
}
gint16 *
gimp_value_dup_int16array (const GValue *value)
{
return (gint16 *) gimp_value_dup_int8array (value);
}
void
gimp_value_set_int16array (GValue *value,
const gint16 *data,
gsize length)
{
return gimp_value_set_int8array (value, (guint8 *) data,
length * sizeof (gint16));
}
void
gimp_value_set_static_int16array (GValue *value,
const gint16 *data,
gsize length)
{
return gimp_value_set_static_int8array (value, (guint8 *) data,
length * sizeof (gint16));
}
void
gimp_value_take_int16array (GValue *value,
gint16 *data,
gsize length)
{
return gimp_value_take_int8array (value, (guint8 *) data,
length * sizeof (gint16));
}
const gint32 *
gimp_value_get_int32array (const GValue *value)
{
return (const gint32 *) gimp_value_get_int8array (value);
}
gint32 *
gimp_value_dup_int32array (const GValue *value)
{
return (gint32 *) gimp_value_dup_int8array (value);
}
void
gimp_value_set_int32array (GValue *value,
const gint32 *data,
gsize length)
{
return gimp_value_set_int8array (value, (guint8 *) data,
length * sizeof (gint32));
}
void
gimp_value_set_static_int32array (GValue *value,
const gint32 *data,
gsize length)
{
return gimp_value_set_static_int8array (value, (guint8 *) data,
length * sizeof (gint32));
}
void
gimp_value_take_int32array (GValue *value,
gint32 *data,
gsize length)
{
return gimp_value_take_int8array (value, (guint8 *) data,
length * sizeof (gint32));
}
const gdouble *
gimp_value_get_floatarray (const GValue *value)
{
return (const gdouble *) gimp_value_get_int8array (value);
}
gdouble *
gimp_value_dup_floatarray (const GValue *value)
{
return (gdouble *) gimp_value_dup_int8array (value);
}
void
gimp_value_set_floatarray (GValue *value,
const gdouble *data,
gsize length)
{
return gimp_value_set_int8array (value, (guint8 *) data,
length * sizeof (gdouble));
}
void
gimp_value_set_static_floatarray (GValue *value,
const gdouble *data,
gsize length)
{
return gimp_value_set_static_int8array (value, (guint8 *) data,
length * sizeof (gdouble));
}
void
gimp_value_take_floatarray (GValue *value,
gdouble *data,
gsize length)
{
return gimp_value_take_int8array (value, (guint8 *) data,
length * sizeof (gdouble));
}
/*
* GIMP_TYPE_STRING_ARRAY
*/
GimpArray *
gimp_string_array_new (const gchar **data,
gsize length,
gboolean static_data)
{
GimpArray *array;
g_return_val_if_fail ((data == NULL && length == 0) ||
(data != NULL && length > 0), NULL);
array = g_new0 (GimpArray, 1);
if (! static_data)
{
gchar **tmp = g_new (gchar *, length);
gint i;
for (i = 0; i < length; i++)
tmp[i] = g_strdup (data[i]);
array->data = (guint8 *) tmp;
}
else
{
array->data = (guint8 *) data;
}
array->length = length;
array->static_data = static_data;
return array;
}
GimpArray *
gimp_string_array_copy (const GimpArray *array)
{
if (array)
return gimp_string_array_new ((const gchar **) array->data,
array->length, FALSE);
return NULL;
}
void
gimp_string_array_free (GimpArray *array)
{
if (array)
{
if (! array->static_data)
{
gchar **tmp = (gchar **) array->data;
gint i;
for (i = 0; i < array->length; i++)
g_free (tmp[i]);
g_free (array->data);
}
g_free (array);
}
}
GType
gimp_string_array_get_type (void)
{
static GType type = 0;
if (! type)
type = g_boxed_type_register_static ("GimpStringArray",
(GBoxedCopyFunc) gimp_string_array_copy,
(GBoxedFreeFunc) gimp_string_array_free);
return type;
}
/*
* GIMP_TYPE_PARAM_STRING_ARRAY
*/
static void gimp_param_string_array_class_init (GParamSpecClass *class);
static void gimp_param_string_array_init (GParamSpec *pspec);
static gboolean gimp_param_string_array_validate (GParamSpec *pspec,
GValue *value);
static gint gimp_param_string_array_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2);
GType
gimp_param_string_array_get_type (void)
{
static GType type = 0;
if (! type)
{
static const GTypeInfo type_info =
{
sizeof (GParamSpecClass),
NULL, NULL,
(GClassInitFunc) gimp_param_string_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecArray),
0,
(GInstanceInitFunc) gimp_param_string_array_init
};
type = g_type_register_static (G_TYPE_PARAM_BOXED,
"GimpParamStringArray",
&type_info, 0);
}
return type;
}
static void
gimp_param_string_array_class_init (GParamSpecClass *class)
{
class->value_type = GIMP_TYPE_STRING_ARRAY;
class->value_validate = gimp_param_string_array_validate;
class->values_cmp = gimp_param_string_array_values_cmp;
}
static void
gimp_param_string_array_init (GParamSpec *pspec)
{
}
static gboolean
gimp_param_string_array_validate (GParamSpec *pspec,
GValue *value)
{
return FALSE;
}
static gint
gimp_param_string_array_values_cmp (GParamSpec *pspec,
const GValue *value1,
const GValue *value2)
{
GimpArray *array1 = value1->data[0].v_pointer;
GimpArray *array2 = value2->data[0].v_pointer;
/* try to return at least *something*, it's useless anyway... */
if (! array1)
return array2 != NULL ? -1 : 0;
else if (! array2)
return array1 != NULL;
else
{
}
return 0;
}
GParamSpec *
gimp_param_spec_string_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecStringArray *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_STRING_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
}
const gchar **
gimp_value_get_stringarray (const GValue *value)
{
GimpArray *array;
g_return_val_if_fail (GIMP_VALUE_HOLDS_STRING_ARRAY (value), NULL);
array = value->data[0].v_pointer;
if (array)
return (const gchar **) array->data;
return NULL;
}
gchar **
gimp_value_dup_stringarray (const GValue *value)
{
GimpArray *array;
g_return_val_if_fail (GIMP_VALUE_HOLDS_STRING_ARRAY (value), NULL);
array = value->data[0].v_pointer;
if (array)
{
gchar **ret = g_memdup (array->data, array->length * sizeof (gchar *));
gint i;
for (i = 0; i < array->length; i++)
ret[i] = g_strdup (ret[i]);
return ret;
}
return NULL;
}
void
gimp_value_set_stringarray (GValue *value,
const gchar **data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_STRING_ARRAY (value));
array = gimp_string_array_new (data, length, FALSE);
g_value_take_boxed (value, array);
}
void
gimp_value_set_static_stringarray (GValue *value,
const gchar **data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_STRING_ARRAY (value));
array = gimp_string_array_new (data, length, TRUE);
g_value_take_boxed (value, array);
}
void
gimp_value_take_stringarray (GValue *value,
gchar **data,
gsize length)
{
GimpArray *array;
g_return_if_fail (GIMP_VALUE_HOLDS_STRING_ARRAY (value));
array = gimp_string_array_new ((const gchar **) data, length, TRUE);
array->static_data = FALSE;
g_value_take_boxed (value, array);
}

View File

@ -226,4 +226,151 @@ GParamSpec * gimp_param_spec_parasite (const gchar *name,
GParamFlags flags);
/*
* GIMP_TYPE_ARRAY
*/
typedef struct _GimpArray GimpArray;
struct _GimpArray
{
guint8 *data;
gsize length;
gboolean static_data;
};
GimpArray * gimp_array_new (const guint8 *data,
gsize length,
gboolean static_data);
GimpArray * gimp_array_copy (const GimpArray *array);
void gimp_array_free (GimpArray *array);
#define GIMP_TYPE_ARRAY (gimp_array_get_type ())
#define GIMP_VALUE_HOLDS_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_ARRAY))
GType gimp_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_ARRAY
*/
#define GIMP_TYPE_PARAM_ARRAY (gimp_param_array_get_type ())
#define GIMP_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_ARRAY, GimpParamSpecArray))
#define GIMP_IS_PARAM_SPEC_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_ARRAY))
typedef struct _GimpParamSpecArray GimpParamSpecArray;
struct _GimpParamSpecArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const guint8 * gimp_value_get_int8array (const GValue *value);
guint8 * gimp_value_dup_int8array (const GValue *value);
void gimp_value_set_int8array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_set_static_int8array (GValue *value,
const guint8 *array,
gsize length);
void gimp_value_take_int8array (GValue *value,
guint8 *array,
gsize length);
const gint16 * gimp_value_get_int16array (const GValue *value);
gint16 * gimp_value_dup_int16array (const GValue *value);
void gimp_value_set_int16array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_set_static_int16array (GValue *value,
const gint16 *array,
gsize length);
void gimp_value_take_int16array (GValue *value,
gint16 *array,
gsize length);
const gint32 * gimp_value_get_int32array (const GValue *value);
gint32 * gimp_value_dup_int32array (const GValue *value);
void gimp_value_set_int32array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_set_static_int32array (GValue *value,
const gint32 *array,
gsize length);
void gimp_value_take_int32array (GValue *value,
gint32 *array,
gsize length);
const gdouble * gimp_value_get_floatarray (const GValue *value);
gdouble * gimp_value_dup_floatarray (const GValue *value);
void gimp_value_set_floatarray (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_set_static_floatarray (GValue *value,
const gdouble *array,
gsize length);
void gimp_value_take_floatarray (GValue *value,
gdouble *array,
gsize length);
/*
* GIMP_TYPE_STRING_ARRAY
*/
GimpArray * gimp_string_array_new (const gchar **data,
gsize length,
gboolean static_data);
GimpArray * gimp_string_array_copy (const GimpArray *array);
void gimp_string_array_free (GimpArray *array);
#define GIMP_TYPE_STRING_ARRAY (gimp_string_array_get_type ())
#define GIMP_VALUE_HOLDS_STRING_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_STRING_ARRAY))
GType gimp_string_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_STRING_ARRAY
*/
#define GIMP_TYPE_PARAM_STRING_ARRAY (gimp_param_string_array_get_type ())
#define GIMP_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY, GimpParamSpecStringArray))
#define GIMP_IS_PARAM_SPEC_STRING_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_STRING_ARRAY))
typedef struct _GimpParamSpecStringArray GimpParamSpecStringArray;
struct _GimpParamSpecStringArray
{
GParamSpecBoxed parent_instance;
};
GType gimp_param_string_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gchar ** gimp_value_get_stringarray (const GValue *value);
gchar ** gimp_value_dup_stringarray (const GValue *value);
void gimp_value_set_stringarray (GValue *value,
const gchar **array,
gsize length);
void gimp_value_set_static_stringarray (GValue *value,
const gchar **array,
gsize length);
void gimp_value_take_stringarray (GValue *value,
gchar **array,
gsize length);
#endif /* __GIMP_PARAM_SPECS_H__ */

View File

@ -271,7 +271,7 @@ gimp_pdb_progress_run_callback (GimpPdbProgress *progress,
retval = g_value_get_double (&return_vals[1].value);
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
progress->callback_busy = FALSE;
}

View File

@ -224,7 +224,7 @@ about_dialog_load_url (GtkAboutDialog *dialog,
&n_return_vals,
GIMP_PDB_STRING, url,
GIMP_PDB_END);
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
}

View File

@ -176,7 +176,7 @@ file_open_image (Gimp *gimp,
_("Plug-In could not open image"));
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
return image;
}
@ -257,7 +257,7 @@ file_open_thumbnail (Gimp *gimp,
}
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
return image;
}

View File

@ -141,7 +141,7 @@ file_save (GimpImage *image,
status = g_value_get_enum (&return_vals[0].value);
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
if (status == GIMP_PDB_SUCCESS)
{

View File

@ -280,10 +280,10 @@ register_brush_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("mask-bytes",
"mask bytes",
"The brush mask data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("mask-bytes",
"mask bytes",
"The brush mask data",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("color-bpp",
@ -300,10 +300,10 @@ register_brush_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("color-bytes",
"color bytes",
"The brush color data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-bytes",
"color bytes",
"The brush color data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1080,10 +1080,10 @@ brush_get_pixels_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[2].value, height);
g_value_set_int (&return_vals[3].value, mask_bpp);
g_value_set_int (&return_vals[4].value, num_mask_bytes);
g_value_set_pointer (&return_vals[5].value, mask_bytes);
gimp_value_take_int8array (&return_vals[5].value, mask_bytes, num_mask_bytes);
g_value_set_int (&return_vals[6].value, color_bpp);
g_value_set_int (&return_vals[7].value, num_color_bytes);
g_value_set_pointer (&return_vals[8].value, color_bytes);
gimp_value_take_int8array (&return_vals[8].value, color_bytes, num_color_bytes);
}
return return_vals;

View File

@ -77,10 +77,10 @@ register_brushes_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("brush-list",
"brush list",
"The list of brush names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("brush-list",
"brush list",
"The list of brush names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -209,10 +209,10 @@ register_brushes_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("mask-data",
"mask data",
"The brush mask data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("mask-data",
"mask data",
"The brush mask data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -270,7 +270,7 @@ brushes_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_brushes);
g_value_set_pointer (&return_vals[2].value, brush_list);
gimp_value_take_stringarray (&return_vals[2].value, brush_list, num_brushes);
}
return return_vals;
@ -486,7 +486,7 @@ brushes_get_brush_data_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[5].value, width);
g_value_set_int (&return_vals[6].value, height);
g_value_set_int (&return_vals[7].value, length);
g_value_set_pointer (&return_vals[8].value, mask_data);
gimp_value_take_int8array (&return_vals[8].value, mask_data, length);
}
return return_vals;

View File

@ -70,10 +70,10 @@ register_buffer_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("buffer-list",
"buffer list",
"The list of buffer names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("buffer-list",
"buffer list",
"The list of buffer names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -233,7 +233,7 @@ buffers_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_buffers);
g_value_set_pointer (&return_vals[2].value, buffer_list);
gimp_value_take_stringarray (&return_vals[2].value, buffer_list, num_buffers);
}
return return_vals;

View File

@ -306,10 +306,10 @@ register_color_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("control-pts",
"control pts",
"The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("control-pts",
"control pts",
"The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -341,10 +341,10 @@ register_color_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("curve",
"curve",
"The explicit curve",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("curve",
"curve",
"The explicit curve",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1050,7 +1050,7 @@ curves_spline_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
channel = g_value_get_enum (&args[1].value);
num_points = g_value_get_int (&args[2].value);
control_pts = g_value_get_pointer (&args[3].value);
control_pts = (guint8 *) gimp_value_get_int8array (&args[3].value);
if (success)
{
@ -1152,7 +1152,7 @@ curves_explicit_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
channel = g_value_get_enum (&args[1].value);
num_bytes = g_value_get_int (&args[2].value);
curve = g_value_get_pointer (&args[3].value);
curve = (guint8 *) gimp_value_get_int8array (&args[3].value);
if (success)
{

View File

@ -795,10 +795,10 @@ register_drawable_procs (Gimp *gimp)
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("pixel",
"pixel",
"The pixel value",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("pixel",
"pixel",
"The pixel value",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -836,10 +836,10 @@ register_drawable_procs (Gimp *gimp)
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("pixel",
"pixel",
"The pixel value",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("pixel",
"pixel",
"The pixel value",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -963,10 +963,10 @@ register_drawable_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1053,10 +1053,10 @@ register_drawable_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -2355,7 +2355,7 @@ drawable_get_pixel_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_channels);
g_value_set_pointer (&return_vals[2].value, pixel);
gimp_value_take_int8array (&return_vals[2].value, pixel, num_channels);
}
return return_vals;
@ -2395,7 +2395,7 @@ drawable_set_pixel_invoker (GimpProcedure *procedure,
x_coord = g_value_get_int (&args[1].value);
y_coord = g_value_get_int (&args[2].value);
num_channels = g_value_get_int (&args[3].value);
pixel = g_value_get_pointer (&args[4].value);
pixel = (guint8 *) gimp_value_get_int8array (&args[4].value);
if (success)
{
@ -2598,7 +2598,7 @@ drawable_thumbnail_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[2].value, actual_height);
g_value_set_int (&return_vals[3].value, bpp);
g_value_set_int (&return_vals[4].value, thumbnail_data_count);
g_value_set_pointer (&return_vals[5].value, thumbnail_data);
gimp_value_take_int8array (&return_vals[5].value, thumbnail_data, thumbnail_data_count);
}
return return_vals;
@ -2695,7 +2695,7 @@ drawable_sub_thumbnail_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[2].value, height);
g_value_set_int (&return_vals[3].value, bpp);
g_value_set_int (&return_vals[4].value, thumbnail_data_count);
g_value_set_pointer (&return_vals[5].value, thumbnail_data);
gimp_value_take_int8array (&return_vals[5].value, thumbnail_data, thumbnail_data_count);
}
return return_vals;

View File

@ -176,10 +176,10 @@ register_fileops_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("thumb-data",
"thumb data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("thumb-data",
"thumb data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -508,7 +508,7 @@ file_load_invoker (GimpProcedure *procedure,
new_args, proc->num_args,
&n_return_vals);
gimp_arguments_destroy (new_args, proc->num_args, TRUE);
gimp_arguments_destroy (new_args, proc->num_args);
return return_vals;
}
@ -664,7 +664,7 @@ file_load_thumbnail_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[1].value, width);
g_value_set_int (&return_vals[2].value, height);
g_value_set_int (&return_vals[3].value, thumb_data_count);
g_value_set_pointer (&return_vals[4].value, thumb_data);
gimp_value_take_int8array (&return_vals[4].value, thumb_data, thumb_data_count);
}
return return_vals;
@ -731,7 +731,7 @@ file_save_invoker (GimpProcedure *procedure,
new_args, proc->num_args,
&n_return_vals);
gimp_arguments_destroy (new_args, proc->num_args, TRUE);
gimp_arguments_destroy (new_args, proc->num_args);
return return_vals;
}

View File

@ -69,10 +69,10 @@ register_fonts_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("font-list",
"font list",
"The list of font names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("font-list",
"font list",
"The list of font names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -130,7 +130,7 @@ fonts_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_fonts);
g_value_set_pointer (&return_vals[2].value, font_list);
gimp_value_take_stringarray (&return_vals[2].value, font_list, num_fonts);
}
return return_vals;

View File

@ -285,7 +285,7 @@ procedural_db_execute (Gimp *gimp,
* and run the next procedure.
*/
if (g_list_next (list))
gimp_arguments_destroy (return_vals, *n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, *n_return_vals);
}
else
{
@ -343,6 +343,8 @@ procedural_db_run_proc (Gimp *gimp,
{
GimpPDBArgType arg_type = va_arg (va_args, GimpPDBArgType);
GValue *value;
GimpArray *array;
gint count;
if (arg_type == GIMP_PDB_END)
break;
@ -352,7 +354,7 @@ procedural_db_run_proc (Gimp *gimp,
gchar *expected = procedural_db_type_name (procedure->args[i].type);
gchar *got = procedural_db_type_name (arg_type);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
g_message (_("PDB calling error for procedure '%s':\n"
"Argument #%d type mismatch (expected %s, got %s)"),
@ -399,11 +401,38 @@ procedural_db_run_proc (Gimp *gimp,
break;
case GIMP_PDB_INT32ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int32array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT16ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int16array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT8ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int8array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_FLOATARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_floatarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_STRINGARRAY:
g_value_set_pointer (value, va_arg (va_args, gpointer));
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_stringarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_COLOR:
@ -445,7 +474,7 @@ procedural_db_run_proc (Gimp *gimp,
args, procedure->num_args,
n_return_vals);
gimp_arguments_destroy (args, procedure->num_args, FALSE);
gimp_arguments_destroy (args, procedure->num_args);
return return_vals;
}

View File

@ -73,8 +73,11 @@ gimp_argument_init_compat (GimpArgument *arg,
case GIMP_PDB_INT16ARRAY:
case GIMP_PDB_INT8ARRAY:
case GIMP_PDB_FLOATARRAY:
g_value_init (&arg->value, GIMP_TYPE_ARRAY);
break;
case GIMP_PDB_STRINGARRAY:
g_value_init (&arg->value, G_TYPE_POINTER);
g_value_init (&arg->value, GIMP_TYPE_STRING_ARRAY);
break;
case GIMP_PDB_COLOR:
@ -110,8 +113,7 @@ gimp_argument_init_compat (GimpArgument *arg,
void
gimp_arguments_destroy (GimpArgument *args,
gint n_args,
gboolean full_destroy)
gint n_args)
{
gint i;
@ -119,59 +121,7 @@ gimp_arguments_destroy (GimpArgument *args,
return;
for (i = n_args - 1; i >= 0; i--)
{
switch (args[i].type)
{
case GIMP_PDB_INT32:
case GIMP_PDB_INT16:
case GIMP_PDB_INT8:
case GIMP_PDB_FLOAT:
case GIMP_PDB_STRING:
break;
case GIMP_PDB_INT32ARRAY:
case GIMP_PDB_INT16ARRAY:
case GIMP_PDB_INT8ARRAY:
case GIMP_PDB_FLOATARRAY:
if (full_destroy)
g_free (g_value_get_pointer (&args[i].value));
break;
case GIMP_PDB_STRINGARRAY:
if (full_destroy)
{
gchar **array;
gint count;
gint j;
count = g_value_get_int (&args[i - 1].value);
array = g_value_get_pointer (&args[i].value);
for (j = 0; j < count; j++)
g_free (array[j]);
g_free (array);
}
break;
case GIMP_PDB_COLOR:
case GIMP_PDB_REGION:
case GIMP_PDB_DISPLAY:
case GIMP_PDB_IMAGE:
case GIMP_PDB_LAYER:
case GIMP_PDB_CHANNEL:
case GIMP_PDB_DRAWABLE:
case GIMP_PDB_SELECTION:
case GIMP_PDB_BOUNDARY:
case GIMP_PDB_VECTORS:
case GIMP_PDB_PARASITE:
case GIMP_PDB_STATUS:
case GIMP_PDB_END:
break;
}
g_value_unset (&args[i].value);
}
g_value_unset (&args[i].value);
g_free (args);
}

View File

@ -39,8 +39,7 @@ void gimp_argument_init_compat (GimpArgument *arg,
GimpPDBArgType arg_type);
void gimp_arguments_destroy (GimpArgument *args,
gint n_args,
gboolean full_destroy);
gint n_args);
#endif /* __GIMP_ARGUMENT_H__ */

View File

@ -285,7 +285,7 @@ procedural_db_execute (Gimp *gimp,
* and run the next procedure.
*/
if (g_list_next (list))
gimp_arguments_destroy (return_vals, *n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, *n_return_vals);
}
else
{
@ -343,6 +343,8 @@ procedural_db_run_proc (Gimp *gimp,
{
GimpPDBArgType arg_type = va_arg (va_args, GimpPDBArgType);
GValue *value;
GimpArray *array;
gint count;
if (arg_type == GIMP_PDB_END)
break;
@ -352,7 +354,7 @@ procedural_db_run_proc (Gimp *gimp,
gchar *expected = procedural_db_type_name (procedure->args[i].type);
gchar *got = procedural_db_type_name (arg_type);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
g_message (_("PDB calling error for procedure '%s':\n"
"Argument #%d type mismatch (expected %s, got %s)"),
@ -399,11 +401,38 @@ procedural_db_run_proc (Gimp *gimp,
break;
case GIMP_PDB_INT32ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int32array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT16ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int16array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT8ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int8array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_FLOATARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_floatarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_STRINGARRAY:
g_value_set_pointer (value, va_arg (va_args, gpointer));
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_stringarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_COLOR:
@ -445,7 +474,7 @@ procedural_db_run_proc (Gimp *gimp,
args, procedure->num_args,
n_return_vals);
gimp_arguments_destroy (args, procedure->num_args, FALSE);
gimp_arguments_destroy (args, procedure->num_args);
return return_vals;
}

View File

@ -472,9 +472,13 @@ gimp_procedure_compat_pspec (Gimp *gimp,
case GIMP_PDB_INT16ARRAY:
case GIMP_PDB_INT8ARRAY:
case GIMP_PDB_FLOATARRAY:
pspec = gimp_param_spec_array (name, name, desc,
G_PARAM_READWRITE);
break;
case GIMP_PDB_STRINGARRAY:
pspec = g_param_spec_pointer (name, name, desc,
G_PARAM_READWRITE);
pspec = gimp_param_spec_string_array (name, name, desc,
G_PARAM_READWRITE);
break;
case GIMP_PDB_COLOR:

View File

@ -219,10 +219,10 @@ register_gradient_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -246,10 +246,10 @@ register_gradient_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("positions",
"positions",
"The list of positions to sample along the gradient",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("positions",
"positions",
"The list of positions to sample along the gradient",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT32,
g_param_spec_boolean ("reverse",
@ -266,10 +266,10 @@ register_gradient_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1394,7 +1394,7 @@ gradient_get_uniform_samples_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_color_samples);
g_value_set_pointer (&return_vals[2].value, color_samples);
gimp_value_take_floatarray (&return_vals[2].value, color_samples, num_color_samples);
}
return return_vals;
@ -1434,7 +1434,7 @@ gradient_get_custom_samples_invoker (GimpProcedure *procedure,
name = (gchar *) g_value_get_string (&args[0].value);
num_samples = g_value_get_int (&args[1].value);
positions = g_value_get_pointer (&args[2].value);
positions = (gdouble *) gimp_value_get_floatarray (&args[2].value);
reverse = g_value_get_boolean (&args[3].value);
if (success)
@ -1475,7 +1475,7 @@ gradient_get_custom_samples_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_color_samples);
g_value_set_pointer (&return_vals[2].value, color_samples);
gimp_value_take_floatarray (&return_vals[2].value, color_samples, num_color_samples);
}
return return_vals;

View File

@ -75,10 +75,10 @@ register_gradients_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("gradient-list",
"gradient list",
"The list of gradient names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("gradient-list",
"gradient list",
"The list of gradient names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -108,10 +108,10 @@ register_gradients_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -127,10 +127,10 @@ register_gradients_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("positions",
"positions",
"The list of positions to sample along the gradient",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("positions",
"positions",
"The list of positions to sample along the gradient",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT32,
g_param_spec_boolean ("reverse",
@ -147,10 +147,10 @@ register_gradients_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-samples",
"color samples",
"Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -196,10 +196,10 @@ register_gradients_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("grad-data",
"grad data",
"The gradient sample data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("grad-data",
"grad data",
"The gradient sample data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -257,7 +257,7 @@ gradients_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_gradients);
g_value_set_pointer (&return_vals[2].value, gradient_list);
gimp_value_take_stringarray (&return_vals[2].value, gradient_list, num_gradients);
}
return return_vals;
@ -331,7 +331,7 @@ gradients_sample_uniform_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, array_length);
g_value_set_pointer (&return_vals[2].value, color_samples);
gimp_value_take_floatarray (&return_vals[2].value, color_samples, array_length);
}
return return_vals;
@ -369,7 +369,7 @@ gradients_sample_custom_invoker (GimpProcedure *procedure,
gdouble *color_samples = NULL;
num_samples = g_value_get_int (&args[0].value);
positions = g_value_get_pointer (&args[1].value);
positions = (gdouble *) gimp_value_get_floatarray (&args[1].value);
reverse = g_value_get_boolean (&args[2].value);
if (success)
@ -404,7 +404,7 @@ gradients_sample_custom_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, array_length);
g_value_set_pointer (&return_vals[2].value, color_samples);
gimp_value_take_floatarray (&return_vals[2].value, color_samples, array_length);
}
return return_vals;
@ -502,7 +502,7 @@ gradients_get_gradient_data_invoker (GimpProcedure *procedure,
{
g_value_take_string (&return_vals[1].value, actual_name);
g_value_set_int (&return_vals[2].value, width);
g_value_set_pointer (&return_vals[3].value, grad_data);
gimp_value_take_floatarray (&return_vals[3].value, grad_data, width);
}
return return_vals;

View File

@ -147,10 +147,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("image-ids",
"image ids",
"The list of images currently open",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("image-ids",
"image ids",
"The list of images currently open",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -481,10 +481,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("layer-ids",
"layer ids",
"The list of layers contained in the image",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("layer-ids",
"layer ids",
"The list of layers contained in the image",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -507,10 +507,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("channel-ids",
"channel ids",
"The list of channels contained in the image",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("channel-ids",
"channel ids",
"The list of channels contained in the image",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -533,10 +533,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("vector-ids",
"vector ids",
"The list of vectors contained in the image",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("vector-ids",
"vector ids",
"The list of vectors contained in the image",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1239,10 +1239,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("colormap",
"colormap",
"The image's colormap",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("colormap",
"colormap",
"The image's colormap",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1265,10 +1265,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("colormap",
"colormap",
"The new colormap values",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("colormap",
"colormap",
"The new colormap values",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1359,10 +1359,10 @@ register_image_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("thumbnail-data",
"thumbnail data",
"The thumbnail data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1949,7 +1949,7 @@ image_list_invoker (GimpProcedure *procedure,
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
g_value_set_int (&return_vals[1].value, num_images);
g_value_set_pointer (&return_vals[2].value, image_ids);
gimp_value_take_int32array (&return_vals[2].value, image_ids, num_images);
return return_vals;
}
@ -2558,7 +2558,7 @@ image_get_layers_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_layers);
g_value_set_pointer (&return_vals[2].value, layer_ids);
gimp_value_take_int32array (&return_vals[2].value, layer_ids, num_layers);
}
return return_vals;
@ -2617,7 +2617,7 @@ image_get_channels_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_channels);
g_value_set_pointer (&return_vals[2].value, channel_ids);
gimp_value_take_int32array (&return_vals[2].value, channel_ids, num_channels);
}
return return_vals;
@ -2676,7 +2676,7 @@ image_get_vectors_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_vectors);
g_value_set_pointer (&return_vals[2].value, vector_ids);
gimp_value_take_int32array (&return_vals[2].value, vector_ids, num_vectors);
}
return return_vals;
@ -3876,7 +3876,7 @@ image_get_colormap_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_bytes);
g_value_set_pointer (&return_vals[2].value, colormap);
gimp_value_take_int8array (&return_vals[2].value, colormap, num_bytes);
}
return return_vals;
@ -3912,7 +3912,7 @@ image_set_colormap_invoker (GimpProcedure *procedure,
image = gimp_value_get_image (&args[0].value, gimp);
num_bytes = g_value_get_int (&args[1].value);
colormap = g_value_get_pointer (&args[2].value);
colormap = (guint8 *) gimp_value_get_int8array (&args[2].value);
if (success)
{
@ -4087,7 +4087,7 @@ image_thumbnail_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[2].value, actual_height);
g_value_set_int (&return_vals[3].value, bpp);
g_value_set_int (&return_vals[4].value, thumbnail_data_count);
g_value_set_pointer (&return_vals[5].value, thumbnail_data);
gimp_value_take_int8array (&return_vals[5].value, thumbnail_data, thumbnail_data_count);
}
return return_vals;

View File

@ -88,10 +88,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -115,10 +115,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -172,10 +172,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -199,10 +199,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -241,10 +241,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -268,10 +268,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -318,10 +318,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -345,10 +345,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -372,10 +372,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT32,
g_param_spec_enum ("hardness",
@ -415,10 +415,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -449,10 +449,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT32,
g_param_spec_enum ("method",
@ -491,10 +491,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -518,10 +518,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -552,10 +552,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -579,10 +579,10 @@ register_paint_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("strokes",
"strokes",
"Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -656,7 +656,7 @@ airbrush_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
pressure = g_value_get_double (&args[1].value);
num_strokes = g_value_get_int (&args[2].value);
strokes = g_value_get_pointer (&args[3].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[3].value);
if (success)
{
@ -711,7 +711,7 @@ airbrush_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -770,7 +770,7 @@ clone_invoker (GimpProcedure *procedure,
src_x = g_value_get_double (&args[3].value);
src_y = g_value_get_double (&args[4].value);
num_strokes = g_value_get_int (&args[5].value);
strokes = g_value_get_pointer (&args[6].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[6].value);
if (success)
{
@ -829,7 +829,7 @@ clone_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -884,7 +884,7 @@ convolve_invoker (GimpProcedure *procedure,
pressure = g_value_get_double (&args[1].value);
convolve_type = g_value_get_enum (&args[2].value);
num_strokes = g_value_get_int (&args[3].value);
strokes = g_value_get_pointer (&args[4].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[4].value);
if (success)
{
@ -940,7 +940,7 @@ convolve_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -997,7 +997,7 @@ dodgeburn_invoker (GimpProcedure *procedure,
dodgeburn_type = g_value_get_enum (&args[2].value);
dodgeburn_mode = g_value_get_enum (&args[3].value);
num_strokes = g_value_get_int (&args[4].value);
strokes = g_value_get_pointer (&args[5].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[5].value);
if (success)
{
@ -1054,7 +1054,7 @@ dodgeburn_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -1107,7 +1107,7 @@ eraser_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
hardness = g_value_get_enum (&args[3].value);
method = g_value_get_enum (&args[4].value);
@ -1165,7 +1165,7 @@ eraser_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -1220,7 +1220,7 @@ paintbrush_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
fade_out = g_value_get_double (&args[1].value);
num_strokes = g_value_get_int (&args[2].value);
strokes = g_value_get_pointer (&args[3].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[3].value);
method = g_value_get_enum (&args[4].value);
gradient_length = g_value_get_double (&args[5].value);
@ -1281,7 +1281,7 @@ paintbrush_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -1332,7 +1332,7 @@ pencil_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{
@ -1385,7 +1385,7 @@ smudge_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
pressure = g_value_get_double (&args[1].value);
num_strokes = g_value_get_int (&args[2].value);
strokes = g_value_get_pointer (&args[3].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[3].value);
if (success)
{
@ -1440,7 +1440,7 @@ smudge_default_invoker (GimpProcedure *procedure,
drawable = (GimpDrawable *) gimp_value_get_item (&args[0].value, gimp, GIMP_TYPE_DRAWABLE);
num_strokes = g_value_get_int (&args[1].value);
strokes = g_value_get_pointer (&args[2].value);
strokes = (gdouble *) gimp_value_get_floatarray (&args[2].value);
if (success)
{

View File

@ -76,10 +76,10 @@ register_palettes_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("palette-list",
"palette list",
"The list of palette names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("palette-list",
"palette list",
"The list of palette names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -201,7 +201,7 @@ palettes_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_palettes);
g_value_set_pointer (&return_vals[2].value, palette_list);
gimp_value_take_stringarray (&return_vals[2].value, palette_list, num_palettes);
}
return return_vals;

View File

@ -117,10 +117,10 @@ register_parasite_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -210,10 +210,10 @@ register_parasite_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -307,10 +307,10 @@ register_parasite_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -404,10 +404,10 @@ register_parasite_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("parasites",
"parasites",
"The names of currently attached parasites",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -546,7 +546,7 @@ parasite_list_invoker (GimpProcedure *procedure,
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
g_value_set_int (&return_vals[1].value, num_parasites);
g_value_set_pointer (&return_vals[2].value, parasites);
gimp_value_take_stringarray (&return_vals[2].value, parasites, num_parasites);
return return_vals;
}
@ -716,7 +716,7 @@ image_parasite_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_parasites);
g_value_set_pointer (&return_vals[2].value, parasites);
gimp_value_take_stringarray (&return_vals[2].value, parasites, num_parasites);
}
return return_vals;
@ -888,7 +888,7 @@ drawable_parasite_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_parasites);
g_value_set_pointer (&return_vals[2].value, parasites);
gimp_value_take_stringarray (&return_vals[2].value, parasites, num_parasites);
}
return return_vals;
@ -1060,7 +1060,7 @@ vectors_parasite_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_parasites);
g_value_set_pointer (&return_vals[2].value, parasites);
gimp_value_take_stringarray (&return_vals[2].value, parasites, num_parasites);
}
return return_vals;

View File

@ -84,10 +84,10 @@ register_paths_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("path-list",
"path list",
"List of the paths belonging to this image.",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("path-list",
"path list",
"List of the paths belonging to this image.",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -195,10 +195,10 @@ register_paths_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("points-pairs",
"points pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution.",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("points-pairs",
"points pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points are returned in pixel resolution.",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -236,10 +236,10 @@ register_paths_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("points-pairs",
"points pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution.",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("points-pairs",
"points pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR, 2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are returned in pixel resolution.",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -597,7 +597,7 @@ path_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_paths);
g_value_set_pointer (&return_vals[2].value, path_list);
gimp_value_take_stringarray (&return_vals[2].value, path_list, num_paths);
}
return return_vals;
@ -820,7 +820,7 @@ path_get_points_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[1].value, path_type);
g_value_set_int (&return_vals[2].value, path_closed);
g_value_set_int (&return_vals[3].value, num_path_point_details);
g_value_set_pointer (&return_vals[4].value, points_pairs);
gimp_value_take_floatarray (&return_vals[4].value, points_pairs, num_path_point_details);
}
return return_vals;
@ -860,7 +860,7 @@ path_set_points_invoker (GimpProcedure *procedure,
name = (gchar *) g_value_get_string (&args[1].value);
ptype = g_value_get_int (&args[2].value);
num_path_points = g_value_get_int (&args[3].value);
points_pairs = g_value_get_pointer (&args[4].value);
points_pairs = (gdouble *) gimp_value_get_floatarray (&args[4].value);
if (success)
{

View File

@ -122,10 +122,10 @@ register_pattern_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("color-bytes",
"color bytes",
"The pattern data.",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("color-bytes",
"color bytes",
"The pattern data.",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -234,7 +234,7 @@ pattern_get_pixels_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[2].value, height);
g_value_set_int (&return_vals[3].value, bpp);
g_value_set_int (&return_vals[4].value, num_color_bytes);
g_value_set_pointer (&return_vals[5].value, color_bytes);
gimp_value_take_int8array (&return_vals[5].value, color_bytes, num_color_bytes);
}
return return_vals;

View File

@ -75,10 +75,10 @@ register_patterns_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("pattern-list",
"pattern list",
"The list of pattern names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("pattern-list",
"pattern list",
"The list of pattern names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -159,10 +159,10 @@ register_patterns_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("mask-data",
"mask data",
"The pattern mask data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("mask-data",
"mask data",
"The pattern mask data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -220,7 +220,7 @@ patterns_get_list_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_patterns);
g_value_set_pointer (&return_vals[2].value, pattern_list);
gimp_value_take_stringarray (&return_vals[2].value, pattern_list, num_patterns);
}
return return_vals;
@ -351,7 +351,7 @@ patterns_get_pattern_data_invoker (GimpProcedure *procedure,
g_value_set_int (&return_vals[3].value, height);
g_value_set_int (&return_vals[4].value, mask_bpp);
g_value_set_int (&return_vals[5].value, length);
g_value_set_pointer (&return_vals[6].value, mask_data);
gimp_value_take_int8array (&return_vals[6].value, mask_data, length);
}
return return_vals;

View File

@ -75,10 +75,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("menu-path",
"menu path",
"The menu path of the plugin",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("menu-path",
"menu path",
"The menu path of the plugin",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("num-plugins",
@ -88,10 +88,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("plugin-accelerator",
"plugin accelerator",
"String representing keyboard accelerator (could be empty string)",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("plugin-accelerator",
"plugin accelerator",
"String representing keyboard accelerator (could be empty string)",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("num-plugins",
@ -101,10 +101,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("plugin-location",
"plugin location",
"Location of the plugin program",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("plugin-location",
"plugin location",
"Location of the plugin program",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("num-plugins",
@ -114,10 +114,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("plugin-image-type",
"plugin image type",
"Type of image that this plugin will work on",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("plugin-image-type",
"plugin image type",
"Type of image that this plugin will work on",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("num-plugins",
@ -127,10 +127,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("plugin-install-time",
"plugin install time",
"Time that the plugin was installed",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("plugin-install-time",
"plugin install time",
"Time that the plugin was installed",
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32,
g_param_spec_int ("num-plugins",
@ -140,10 +140,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("plugin-real-name",
"plugin real name",
"The internal name of the plugin",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("plugin-real-name",
"plugin real name",
"The internal name of the plugin",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -263,10 +263,10 @@ register_plug_in_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("icon-data",
"icon data",
"The procedure's icon. The format depends on the 'icon_type' parameter",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("icon-data",
"icon data",
"The procedure's icon. The format depends on the 'icon_type' parameter",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -301,17 +301,17 @@ plugins_query_invoker (GimpProcedure *procedure,
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
g_value_set_int (&return_vals[1].value, num_plugins);
g_value_set_pointer (&return_vals[2].value, menu_path);
gimp_value_take_stringarray (&return_vals[2].value, menu_path, num_plugins);
g_value_set_int (&return_vals[3].value, num_plugins);
g_value_set_pointer (&return_vals[4].value, plugin_accelerator);
gimp_value_take_stringarray (&return_vals[4].value, plugin_accelerator, num_plugins);
g_value_set_int (&return_vals[5].value, num_plugins);
g_value_set_pointer (&return_vals[6].value, plugin_location);
gimp_value_take_stringarray (&return_vals[6].value, plugin_location, num_plugins);
g_value_set_int (&return_vals[7].value, num_plugins);
g_value_set_pointer (&return_vals[8].value, plugin_image_type);
gimp_value_take_stringarray (&return_vals[8].value, plugin_image_type, num_plugins);
g_value_set_int (&return_vals[9].value, num_plugins);
g_value_set_pointer (&return_vals[10].value, plugin_install_time);
gimp_value_take_int32array (&return_vals[10].value, plugin_install_time, num_plugins);
g_value_set_int (&return_vals[11].value, num_plugins);
g_value_set_pointer (&return_vals[12].value, plugin_real_name);
gimp_value_take_stringarray (&return_vals[12].value, plugin_real_name, num_plugins);
return return_vals;
}
@ -541,7 +541,7 @@ plugin_icon_register_invoker (GimpProcedure *procedure,
procedure_name = (gchar *) g_value_get_string (&args[0].value);
icon_type = g_value_get_enum (&args[1].value);
icon_data_length = g_value_get_int (&args[2].value);
icon_data = g_value_get_pointer (&args[3].value);
icon_data = (guint8 *) gimp_value_get_int8array (&args[3].value);
if (success)
{

View File

@ -285,7 +285,7 @@ procedural_db_execute (Gimp *gimp,
* and run the next procedure.
*/
if (g_list_next (list))
gimp_arguments_destroy (return_vals, *n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, *n_return_vals);
}
else
{
@ -343,6 +343,8 @@ procedural_db_run_proc (Gimp *gimp,
{
GimpPDBArgType arg_type = va_arg (va_args, GimpPDBArgType);
GValue *value;
GimpArray *array;
gint count;
if (arg_type == GIMP_PDB_END)
break;
@ -352,7 +354,7 @@ procedural_db_run_proc (Gimp *gimp,
gchar *expected = procedural_db_type_name (procedure->args[i].type);
gchar *got = procedural_db_type_name (arg_type);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
g_message (_("PDB calling error for procedure '%s':\n"
"Argument #%d type mismatch (expected %s, got %s)"),
@ -399,11 +401,38 @@ procedural_db_run_proc (Gimp *gimp,
break;
case GIMP_PDB_INT32ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int32array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT16ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int16array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_INT8ARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_int8array (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_FLOATARRAY:
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_floatarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_STRINGARRAY:
g_value_set_pointer (value, va_arg (va_args, gpointer));
count = g_value_get_int (&args[i - 1].value);
gimp_value_set_static_stringarray (value,
va_arg (va_args, gpointer),
count);
break;
case GIMP_PDB_COLOR:
@ -445,7 +474,7 @@ procedural_db_run_proc (Gimp *gimp,
args, procedure->num_args,
n_return_vals);
gimp_arguments_destroy (args, procedure->num_args, FALSE);
gimp_arguments_destroy (args, procedure->num_args);
return return_vals;
}

View File

@ -147,10 +147,10 @@ register_procedural_db_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_STRINGARRAY,
g_param_spec_pointer ("procedure-names",
"procedure names",
"The list of procedure names",
GIMP_PARAM_READWRITE));
gimp_param_spec_string_array ("procedure-names",
"procedure names",
"The list of procedure names",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -344,10 +344,10 @@ register_procedural_db_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("data",
"data",
"A byte array containing data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("data",
"data",
"A byte array containing data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -392,10 +392,10 @@ register_procedural_db_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT8ARRAY,
g_param_spec_pointer ("data",
"data",
"A byte array containing data",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("data",
"data",
"A byte array containing data",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
}
@ -512,7 +512,7 @@ procedural_db_query_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_matches);
g_value_set_pointer (&return_vals[2].value, procedure_names);
gimp_value_take_stringarray (&return_vals[2].value, procedure_names, num_matches);
}
return return_vals;
@ -799,7 +799,7 @@ procedural_db_get_data_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, bytes);
g_value_set_pointer (&return_vals[2].value, data);
gimp_value_take_int8array (&return_vals[2].value, data, bytes);
}
return return_vals;
@ -889,7 +889,7 @@ procedural_db_set_data_invoker (GimpProcedure *procedure,
identifier = (gchar *) g_value_get_string (&args[0].value);
bytes = g_value_get_int (&args[1].value);
data = g_value_get_pointer (&args[2].value);
data = (guint8 *) gimp_value_get_int8array (&args[2].value);
if (success)
{

View File

@ -201,10 +201,10 @@ register_selection_tools_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("segs",
"segs",
"Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("segs",
"segs",
"Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}",
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
GIMP_PDB_INT32,
g_param_spec_enum ("operation",
@ -510,7 +510,7 @@ free_select_invoker (GimpProcedure *procedure,
image = gimp_value_get_image (&args[0].value, gimp);
num_segs = g_value_get_int (&args[1].value);
segs = g_value_get_pointer (&args[2].value);
segs = (gdouble *) gimp_value_get_floatarray (&args[2].value);
operation = g_value_get_enum (&args[3].value);
antialias = g_value_get_boolean (&args[4].value);
feather = g_value_get_boolean (&args[5].value);

View File

@ -308,10 +308,10 @@ register_vectors_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_INT32ARRAY,
g_param_spec_pointer ("stroke-ids",
"stroke ids",
"List of the strokes belonging to the path.",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("stroke-ids",
"stroke ids",
"List of the strokes belonging to the path.",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -566,10 +566,10 @@ register_vectors_procs (Gimp *gimp)
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
GIMP_PDB_FLOATARRAY,
g_param_spec_pointer ("coords",
"coords",
"List of the coords along the path (x0, y0, x1, y1, ...).",
GIMP_PARAM_READWRITE));
gimp_param_spec_array ("coords",
"coords",
"List of the coords along the path (x0, y0, x1, y1, ...).",
GIMP_PARAM_READWRITE));
procedural_db_register (gimp, procedure);
/*
@ -1265,7 +1265,7 @@ vectors_get_strokes_invoker (GimpProcedure *procedure,
if (success)
{
g_value_set_int (&return_vals[1].value, num_strokes);
g_value_set_pointer (&return_vals[2].value, stroke_ids);
gimp_value_take_int32array (&return_vals[2].value, stroke_ids, num_strokes);
}
return return_vals;
@ -1645,7 +1645,7 @@ vectors_stroke_interpolate_invoker (GimpProcedure *procedure,
{
g_value_set_boolean (&return_vals[1].value, closed);
g_value_set_int (&return_vals[2].value, num_coords);
g_value_set_pointer (&return_vals[3].value, coords);
gimp_value_take_floatarray (&return_vals[3].value, coords, num_coords);
}
return return_vals;

View File

@ -462,8 +462,8 @@ plug_in_handle_proc_run (PlugIn *plug_in,
return;
}
gimp_arguments_destroy (args, n_args, FALSE);
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (args, n_args);
gimp_arguments_destroy (return_vals, n_return_vals);
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
}
else

View File

@ -193,7 +193,7 @@ plug_in_run (Gimp *gimp,
done:
if (return_vals && destroy_return_vals)
{
gimp_arguments_destroy (return_vals, procedure->num_values, TRUE);
gimp_arguments_destroy (return_vals, procedure->num_values);
return_vals = NULL;
}
@ -235,7 +235,7 @@ plug_in_repeat (Gimp *gimp,
args, 3 /* not proc_def->procedure->num_args */,
FALSE, TRUE, display_ID);
gimp_arguments_destroy (args, proc_def->procedure->num_args, TRUE);
gimp_arguments_destroy (args, proc_def->procedure->num_args);
}
}

View File

@ -193,7 +193,7 @@ plug_in_run (Gimp *gimp,
done:
if (return_vals && destroy_return_vals)
{
gimp_arguments_destroy (return_vals, procedure->num_values, TRUE);
gimp_arguments_destroy (return_vals, procedure->num_values);
return_vals = NULL;
}
@ -235,7 +235,7 @@ plug_in_repeat (Gimp *gimp,
args, 3 /* not proc_def->procedure->num_args */,
FALSE, TRUE, display_ID);
gimp_arguments_destroy (args, proc_def->procedure->num_args, TRUE);
gimp_arguments_destroy (args, proc_def->procedure->num_args);
}
}

View File

@ -1087,7 +1087,7 @@ plug_ins_add_to_db (Gimp *gimp,
GIMP_PDB_END);
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
}
}
}

View File

@ -462,8 +462,8 @@ plug_in_handle_proc_run (PlugIn *plug_in,
return;
}
gimp_arguments_destroy (args, n_args, FALSE);
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (args, n_args);
gimp_arguments_destroy (return_vals, n_return_vals);
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
}
else

View File

@ -45,7 +45,6 @@ plug_in_params_to_args (GimpArgumentSpec *proc_args,
gboolean full_copy)
{
GimpArgument *args;
gint count;
gint i;
g_return_val_if_fail ((proc_args != NULL && n_proc_args > 0) ||
@ -61,6 +60,7 @@ plug_in_params_to_args (GimpArgumentSpec *proc_args,
for (i = 0; i < n_params; i++)
{
GValue *value = &args[i].value;
gint count;
if (i < n_proc_args && proc_args[i].type == params[i].type)
{
@ -104,79 +104,63 @@ plug_in_params_to_args (GimpArgumentSpec *proc_args,
break;
case GIMP_PDB_INT32ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
g_value_set_pointer (value,
g_memdup (params[i].data.d_int32array,
count * sizeof (gint32)));
}
else
{
g_value_set_pointer (value, params[i].data.d_int32array);
}
count = g_value_get_int (&args[i - 1].value);
if (full_copy)
gimp_value_set_int32array (value,
params[i].data.d_int32array,
count);
else
gimp_value_set_static_int32array (value,
params[i].data.d_int32array,
count);
break;
case GIMP_PDB_INT16ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
g_value_set_pointer (value,
g_memdup (params[i].data.d_int16array,
count * sizeof (gint16)));
}
else
{
g_value_set_pointer (value, params[i].data.d_int16array);
}
count = g_value_get_int (&args[i - 1].value);
if (full_copy)
gimp_value_set_int16array (value,
params[i].data.d_int16array,
count);
else
gimp_value_set_static_int16array (value,
params[i].data.d_int16array,
count);
break;
case GIMP_PDB_INT8ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
g_value_set_pointer (value,
g_memdup (params[i].data.d_int8array,
count));
}
else
{
g_value_set_pointer (value, params[i].data.d_int8array);
}
count = g_value_get_int (&args[i - 1].value);
if (full_copy)
gimp_value_set_int8array (value,
(guint8 *) params[i].data.d_int8array,
count);
else
gimp_value_set_static_int8array (value,
(guint8 *) params[i].data.d_int8array,
count);
break;
case GIMP_PDB_FLOATARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
g_value_set_pointer (value,
g_memdup (params[i].data.d_floatarray,
count * sizeof (gdouble)));
}
else
{
g_value_set_pointer (value, params[i].data.d_floatarray);
}
count = g_value_get_int (&args[i - 1].value);
if (full_copy)
gimp_value_set_floatarray (value,
params[i].data.d_floatarray,
count);
else
gimp_value_set_static_floatarray (value,
params[i].data.d_floatarray,
count);
break;
case GIMP_PDB_STRINGARRAY:
if (full_copy)
{
gchar **array;
gint j;
count = g_value_get_int (&args[i - 1].value);
array = g_new (gchar *, count);
g_value_set_pointer (value, array);
for (j = 0; j < count; j++)
array[j] = g_strdup (params[i].data.d_stringarray[j]);
}
else
{
g_value_set_pointer (value, params[i].data.d_stringarray);
}
count = g_value_get_int (&args[i - 1].value);
if (full_copy)
gimp_value_set_stringarray (value,
(const gchar **) params[i].data.d_stringarray,
count);
else
gimp_value_set_static_stringarray (value,
(const gchar **) params[i].data.d_stringarray,
count);
break;
case GIMP_PDB_COLOR:
@ -244,7 +228,6 @@ plug_in_args_to_params (GimpArgument *args,
gboolean full_copy)
{
GPParam *params;
gint count;
gint i;
g_return_val_if_fail ((args != NULL && n_args > 0) ||
@ -299,77 +282,37 @@ plug_in_args_to_params (GimpArgument *args,
case GIMP_PDB_INT32ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
params[i].data.d_int32array =
g_memdup (g_value_get_pointer (value),
count * sizeof (gint32));
}
else
{
params[i].data.d_int32array = g_value_get_pointer (value);
}
params[i].data.d_int32array = gimp_value_dup_int32array (value);
else
params[i].data.d_int32array = (gint32 *) gimp_value_get_int32array (value);
break;
case GIMP_PDB_INT16ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
params[i].data.d_int16array =
g_memdup (g_value_get_pointer (value),
count * sizeof (gint16));
}
else
{
params[i].data.d_int16array = g_value_get_pointer (value);
}
params[i].data.d_int16array = gimp_value_dup_int16array (value);
else
params[i].data.d_int16array = (gint16 *) gimp_value_get_int16array (value);
break;
case GIMP_PDB_INT8ARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
params[i].data.d_int8array =
g_memdup (g_value_get_pointer (value), count);
}
else
{
params[i].data.d_int8array = g_value_get_pointer (value);
}
params[i].data.d_int8array = (gint8 *) gimp_value_dup_int8array (value);
else
params[i].data.d_int8array = (gint8 *) gimp_value_get_int8array (value);
break;
case GIMP_PDB_FLOATARRAY:
if (full_copy)
{
count = g_value_get_int (&args[i - 1].value);
params[i].data.d_floatarray =
g_memdup (g_value_get_pointer (value),
count * sizeof (gdouble));
}
else
{
params[i].data.d_floatarray = g_value_get_pointer (value);
}
params[i].data.d_floatarray = gimp_value_dup_floatarray (value);
else
params[i].data.d_floatarray = (gdouble *) gimp_value_get_floatarray (value);
break;
case GIMP_PDB_STRINGARRAY:
if (full_copy)
{
gchar **array;
gint j;
count = g_value_get_int (&args[i - 1].value);
array = g_value_get_pointer (value);
params[i].data.d_stringarray = g_new (gchar *, count);
for (j = 0; j < count; j++)
params[i].data.d_stringarray[j] = g_strdup (array[j]);
}
else
{
params[i].data.d_stringarray = g_value_get_pointer (value);
}
params[i].data.d_stringarray = gimp_value_dup_stringarray (value);
else
params[i].data.d_stringarray = (gchar **) gimp_value_get_stringarray (value);
break;
case GIMP_PDB_COLOR:

View File

@ -193,7 +193,7 @@ plug_in_run (Gimp *gimp,
done:
if (return_vals && destroy_return_vals)
{
gimp_arguments_destroy (return_vals, procedure->num_values, TRUE);
gimp_arguments_destroy (return_vals, procedure->num_values);
return_vals = NULL;
}
@ -235,7 +235,7 @@ plug_in_repeat (Gimp *gimp,
args, 3 /* not proc_def->procedure->num_args */,
FALSE, TRUE, display_ID);
gimp_arguments_destroy (args, proc_def->procedure->num_args, TRUE);
gimp_arguments_destroy (args, proc_def->procedure->num_args);
}
}

View File

@ -1087,7 +1087,7 @@ plug_ins_add_to_db (Gimp *gimp,
GIMP_PDB_END);
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
}
}
}

View File

@ -202,7 +202,7 @@ gimp_help_browser (Gimp *gimp)
plug_in_run (gimp, gimp_get_user_context (gimp), NULL,
procedure, args, 1, FALSE, TRUE, -1);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
}
/* Check if the help browser started properly */
@ -290,7 +290,7 @@ gimp_help_call (Gimp *gimp,
plug_in_run (gimp, gimp_get_user_context (gimp), NULL,
procedure, args, 4, FALSE, TRUE, -1);
gimp_arguments_destroy (args, procedure->num_args, TRUE);
gimp_arguments_destroy (args, procedure->num_args);
}
/* Check if the help parser started properly */
@ -321,7 +321,7 @@ gimp_help_call (Gimp *gimp,
GIMP_PDB_STRING, help_id,
GIMP_PDB_END);
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
}
}

View File

@ -322,7 +322,7 @@ gimp_pdb_dialog_run_callback (GimpPdbDialog *dialog,
g_type_name (G_TYPE_FROM_INSTANCE (dialog)));
}
gimp_arguments_destroy (return_vals, n_return_vals, TRUE);
gimp_arguments_destroy (return_vals, n_return_vals);
}
dialog->callback_busy = FALSE;

View File

@ -166,12 +166,24 @@ CODE
my ($pdbtype) = &arg_parse($_->{type});
my $arg = $arg_types{$pdbtype};
my $var = $_->{name};
my $var_len;
my $value;
$argc++;
$value = "&return_vals[$argc].value";
if (exists $_->{array}) {
my $arrayarg = $_->{array};
if (exists $arrayarg->{name}) {
$var_len = $arrayarg->{name};
}
else {
$var_len = 'num_' . $_->{name};
}
}
$outargs .= eval qq/" $arg->{set_value_func};\n"/;
}
@ -451,13 +463,20 @@ CODE
elsif ($pdbtype eq 'int32array' ||
$pdbtype eq 'int16array' ||
$pdbtype eq 'int8array' ||
$pdbtype eq 'floatarray' ||
$pdbtype eq 'stringarray') {
$pdbtype eq 'floatarray') {
$pspec = <<CODE;
g_param_spec_pointer ("$name",
"$nick",
"$blurb",
$flags)
gimp_param_spec_array ("$name",
"$nick",
"$blurb",
$flags)
CODE
}
elsif ($pdbtype eq 'stringarray') {
$pspec = <<CODE;
gimp_param_spec_string_array ("$name",
"$nick",
"$blurb",
$flags)
CODE
}
else {

View File

@ -49,32 +49,32 @@ package Gimp::CodeGen::pdb;
type => 'gint32 *',
array => 1,
init_value => 'NULL',
get_value_func => '$var = g_value_get_pointer ($value)',
set_value_func => 'g_value_set_pointer ($value, $var)' },
get_value_func => '$var = (gint32 *) gimp_value_get_int32array ($value)',
set_value_func => 'gimp_value_take_int32array ($value, $var, $var_len)' },
int16array => { name => 'INT16ARRAY',
type => 'gint16 *',
array => 1,
init_value => 'NULL',
get_value_func => '$var = g_value_get_pointer ($value)',
set_value_func => 'g_value_set_pointer ($value, $var)' },
get_value_func => '$var = (gint16 *) gimp_value_get_int16array ($value)',
set_value_func => 'gimp_value_take_int16array ($value, $var, $var_len)' },
int8array => { name => 'INT8ARRAY',
type => 'guint8 *',
array => 1,
init_value => 'NULL',
get_value_func => '$var = g_value_get_pointer ($value)',
set_value_func => 'g_value_set_pointer ($value, $var)' },
get_value_func => '$var = (guint8 *) gimp_value_get_int8array ($value)',
set_value_func => 'gimp_value_take_int8array ($value, $var, $var_len)' },
floatarray => { name => 'FLOATARRAY',
type => 'gdouble *',
array => 1,
init_value => 'NULL',
get_value_func => '$var = g_value_get_pointer ($value)',
set_value_func => 'g_value_set_pointer ($value, $var)' },
get_value_func => '$var = (gdouble *) gimp_value_get_floatarray ($value)',
set_value_func => 'gimp_value_take_floatarray ($value, $var, $var_len)' },
stringarray => { name => 'STRINGARRAY',
type => 'gchar **',
array => 1,
init_value => 'NULL',
get_value_func => '$var = g_value_get_pointer ($value)',
set_value_func => 'g_value_set_pointer ($value, $var)' },
get_value_func => '$var = (gchar **) gimp_value_get_stringarray ($value)',
set_value_func => 'gimp_value_take_stringarray ($value, $var, $var_len)' },
color => { name => 'COLOR' ,
type => 'GimpRGB ',

View File

@ -89,7 +89,7 @@ HELP
new_args, proc->num_args,
&n_return_vals);
gimp_arguments_destroy (new_args, proc->num_args, TRUE);
gimp_arguments_destroy (new_args, proc->num_args);
return return_vals;
}
@ -216,7 +216,7 @@ HELP
new_args, proc->num_args,
&n_return_vals);
gimp_arguments_destroy (new_args, proc->num_args, TRUE);
gimp_arguments_destroy (new_args, proc->num_args);
return return_vals;
}