Commit dffab0e9 authored by Niels De Graef's avatar Niels De Graef Committed by Jehan

Remove GimpInt16Array

It isn't being used by any plug-in or any code in GIMP at all even.
Let's get rid of it while we can still break API, so we can cut down on
all the complexity of the gimp-param stuff a bit.
parent 97db69c3
Pipeline #258510 passed with stages
in 61 minutes and 11 seconds
......@@ -221,7 +221,6 @@ gimp_g_value_get_memsize (GValue *value)
}
else if (GIMP_VALUE_HOLDS_ARRAY (value) ||
GIMP_VALUE_HOLDS_UINT8_ARRAY (value) ||
GIMP_VALUE_HOLDS_INT16_ARRAY (value) ||
GIMP_VALUE_HOLDS_INT32_ARRAY (value) ||
GIMP_VALUE_HOLDS_FLOAT_ARRAY (value))
{
......
......@@ -447,7 +447,6 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
}
if (GIMP_VALUE_HOLDS_INT32_ARRAY (value) ||
GIMP_VALUE_HOLDS_INT16_ARRAY (value) ||
GIMP_VALUE_HOLDS_UINT8_ARRAY (value) ||
GIMP_VALUE_HOLDS_FLOAT_ARRAY (value) ||
GIMP_VALUE_HOLDS_RGB_ARRAY (value) ||
......@@ -465,10 +464,6 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
gimp_value_set_int32_array (value,
(const gint32 *) va_arg (va_args, gpointer),
prev_int_value);
else if (GIMP_VALUE_HOLDS_INT16_ARRAY (value))
gimp_value_set_int16_array (value,
(const gint16 *) va_arg (va_args, gpointer),
prev_int_value);
else if (GIMP_VALUE_HOLDS_UINT8_ARRAY (value))
gimp_value_set_uint8_array (value,
(const guint8 *) va_arg (va_args, gpointer),
......
......@@ -730,7 +730,6 @@ gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
GPParamDef *prev_param_def = &proc_install->params[i - 1];
if ((! strcmp (param_def->type_name, "GimpParamInt32Array") ||
! strcmp (param_def->type_name, "GimpParamInt16Array") ||
! strcmp (param_def->type_name, "GimpParamUInt8Array") ||
! strcmp (param_def->type_name, "GimpParamIntFloatArray") ||
! strcmp (param_def->type_name, "GimpParamIntStringArray") ||
......
......@@ -3535,20 +3535,6 @@ gimp_value_dup_int8array
gimp_value_set_int8array
gimp_value_set_static_int8array
gimp_value_take_int8array
GIMP_TYPE_INT16_ARRAY
GIMP_VALUE_HOLDS_INT16_ARRAY
gimp_int16_array_get_type
GIMP_TYPE_PARAM_INT16_ARRAY
GIMP_PARAM_SPEC_INT16_ARRAY
GIMP_IS_PARAM_SPEC_INT16_ARRAY
GimpParamSpecInt16Array
gimp_param_int16_array_get_type
gimp_param_spec_int16_array
gimp_value_get_int16array
gimp_value_dup_int16array
gimp_value_set_int16array
gimp_value_set_static_int16array
gimp_value_take_int16array
GIMP_TYPE_INT32_ARRAY
GIMP_VALUE_HOLDS_INT32_ARRAY
gimp_int32_array_get_type
......
......@@ -1089,13 +1089,6 @@ GIMP_VALUES_GET_UINT8_ARRAY
GIMP_VALUES_DUP_UINT8_ARRAY
GIMP_VALUES_SET_UINT8_ARRAY
GIMP_VALUES_TAKE_UINT8_ARRAY
GIMP_PROC_ARG_INT16_ARRAY
GIMP_PROC_AUX_ARG_INT16_ARRAY
GIMP_PROC_VAL_INT16_ARRAY
GIMP_VALUES_GET_INT16_ARRAY
GIMP_VALUES_DUP_INT16_ARRAY
GIMP_VALUES_SET_INT16_ARRAY
GIMP_VALUES_TAKE_INT16_ARRAY
GIMP_PROC_ARG_INT32_ARRAY
GIMP_PROC_AUX_ARG_INT32_ARRAY
GIMP_PROC_VAL_INT32_ARRAY
......
......@@ -299,12 +299,6 @@ gimp_value_dup_uint8_array
gimp_value_set_uint8_array
gimp_value_set_static_uint8_array
gimp_value_take_uint8_array
gimp_param_spec_int16_array
gimp_value_get_int16_array
gimp_value_dup_int16_array
gimp_value_set_int16_array
gimp_value_set_static_int16_array
gimp_value_take_int16_array
gimp_param_spec_int32_array
gimp_value_get_int32_array
gimp_value_dup_int32_array
......@@ -346,7 +340,6 @@ gimp_value_take_object_array
<SUBSECTION Standard>
GIMP_IS_PARAM_SPEC_ARRAY
GIMP_IS_PARAM_SPEC_FLOAT_ARRAY
GIMP_IS_PARAM_SPEC_INT16_ARRAY
GIMP_IS_PARAM_SPEC_INT32_ARRAY
GIMP_IS_PARAM_SPEC_OBJECT_ARRAY
GIMP_IS_PARAM_SPEC_UINT8_ARRAY
......@@ -355,7 +348,6 @@ GIMP_IS_PARAM_SPEC_STRING
GIMP_IS_PARAM_SPEC_STRING_ARRAY
GIMP_PARAM_SPEC_ARRAY
GIMP_PARAM_SPEC_FLOAT_ARRAY
GIMP_PARAM_SPEC_INT16_ARRAY
GIMP_PARAM_SPEC_INT32_ARRAY
GIMP_PARAM_SPEC_OBJECT_ARRAY
GIMP_PARAM_SPEC_UINT8_ARRAY
......@@ -364,13 +356,11 @@ GIMP_PARAM_SPEC_STRING
GIMP_PARAM_SPEC_STRING_ARRAY
GIMP_TYPE_ARRAY
GIMP_TYPE_FLOAT_ARRAY
GIMP_TYPE_INT16_ARRAY
GIMP_TYPE_INT32_ARRAY
GIMP_TYPE_OBJECT_ARRAY
GIMP_TYPE_UINT8_ARRAY
GIMP_TYPE_PARAM_ARRAY
GIMP_TYPE_PARAM_FLOAT_ARRAY
GIMP_TYPE_PARAM_INT16_ARRAY
GIMP_TYPE_PARAM_INT32_ARRAY
GIMP_TYPE_PARAM_OBJECT_ARRAY
GIMP_TYPE_PARAM_UINT8_ARRAY
......@@ -381,7 +371,6 @@ GIMP_TYPE_RGB_ARRAY
GIMP_TYPE_STRING_ARRAY
GIMP_VALUE_HOLDS_ARRAY
GIMP_VALUE_HOLDS_FLOAT_ARRAY
GIMP_VALUE_HOLDS_INT16_ARRAY
GIMP_VALUE_HOLDS_INT32_ARRAY
GIMP_VALUE_HOLDS_OBJECT_ARRAY
GIMP_VALUE_HOLDS_UINT8_ARRAY
......@@ -389,7 +378,6 @@ GIMP_VALUE_HOLDS_RGB_ARRAY
GIMP_VALUE_HOLDS_STRING_ARRAY
GimpParamSpecArray
GimpParamSpecFloatArray
GimpParamSpecInt16Array
GimpParamSpecInt32Array
GimpParamSpecObjectArray
GimpParamSpecUInt8Array
......@@ -397,13 +385,11 @@ GimpParamSpecRGBArray
GimpParamSpecStringArray
gimp_array_get_type
gimp_float_array_get_type
gimp_int16_array_get_type
gimp_int32_array_get_type
gimp_object_array_get_type
gimp_uint8_array_get_type
gimp_param_array_get_type
gimp_param_float_array_get_type
gimp_param_int16_array_get_type
gimp_param_int32_array_get_type
gimp_param_object_array_get_type
gimp_param_uint8_array_get_type
......
gimp_array_get_type
gimp_float_array_get_type
gimp_int16_array_get_type
gimp_int32_array_get_type
gimp_uint8_array_get_type
gimp_memsize_get_type
gimp_metadata_get_type
gimp_param_array_get_type
gimp_param_float_array_get_type
gimp_param_int16_array_get_type
gimp_param_int32_array_get_type
gimp_param_uint8_array_get_type
gimp_param_rgb_array_get_type
......
......@@ -438,7 +438,6 @@ gimp_main (GType plug_in_type,
GIMP_TYPE_ARRAY, GIMP_TYPE_PARAM_ARRAY,
GIMP_TYPE_UINT8_ARRAY, GIMP_TYPE_PARAM_UINT8_ARRAY,
GIMP_TYPE_INT16_ARRAY, GIMP_TYPE_PARAM_INT16_ARRAY,
GIMP_TYPE_INT32_ARRAY, GIMP_TYPE_PARAM_INT32_ARRAY,
GIMP_TYPE_FLOAT_ARRAY, GIMP_TYPE_PARAM_FLOAT_ARRAY,
GIMP_TYPE_STRING_ARRAY, GIMP_TYPE_PARAM_STRING_ARRAY,
......
......@@ -41,9 +41,6 @@ _gimp_gp_param_def_to_param_spec (const GPParamDef *param_def)
if (! strcmp (param_def->type_name, "GimpParamInt32Array"))
return gimp_param_spec_int32_array (name, nick, blurb, flags);
if (! strcmp (param_def->type_name, "GimpParamInt16Array"))
return gimp_param_spec_int16_array (name, nick, blurb, flags);
if (! strcmp (param_def->type_name, "GimpParamUInt8Array"))
return gimp_param_spec_uint8_array (name, nick, blurb, flags);
......@@ -492,13 +489,6 @@ gimp_gp_param_to_value (gpointer gimp,
param->data.d_array.size /
sizeof (gint32));
}
else if (GIMP_VALUE_HOLDS_INT16_ARRAY (value))
{
gimp_value_set_int16_array (value,
(gint16 *) param->data.d_array.data,
param->data.d_array.size /
sizeof (gint16));
}
else if (GIMP_VALUE_HOLDS_UINT8_ARRAY (value))
{
gimp_value_set_uint8_array (value,
......@@ -778,7 +768,6 @@ gimp_value_to_gp_param (const GValue *value,
}
}
else if (GIMP_VALUE_HOLDS_INT32_ARRAY (value) ||
GIMP_VALUE_HOLDS_INT16_ARRAY (value) ||
GIMP_VALUE_HOLDS_UINT8_ARRAY (value) ||
GIMP_VALUE_HOLDS_FLOAT_ARRAY (value) ||
GIMP_VALUE_HOLDS_RGB_ARRAY (value))
......
......@@ -374,36 +374,6 @@ G_BEGIN_DECLS
gimp_value_take_uint8_array (gimp_value_array_index (args, n), value, length)
/* int16 array */
#define GIMP_PROC_ARG_INT16_ARRAY(procedure, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
gimp_param_spec_int16_array (name, nick, blurb,\
flags))
#define GIMP_PROC_AUX_ARG_INT16_ARRAY(procedure, name, nick, blurb, flags) \
gimp_procedure_add_aux_argument (procedure,\
gimp_param_spec_int16_array (name, nick, blurb,\
flags))
#define GIMP_PROC_VAL_INT16_ARRAY(procedure, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
gimp_param_spec_int16_array (name, nick, blurb,\
flags))
#define GIMP_VALUES_GET_INT16_ARRAY(args, n) \
gimp_value_get_int16_array (gimp_value_array_index (args, n))
#define GIMP_VALUES_DUP_INT16_ARRAY(args, n) \
gimp_value_dup_int16_array (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_INT16_ARRAY(args, n, value, length) \
gimp_value_set_int16_array (gimp_value_array_index (args, n), value, length)
#define GIMP_VALUES_TAKE_INT16_ARRAY(args, n, value, length) \
gimp_value_take_int16_array (gimp_value_array_index (args, n), value, length)
/* int32 array */
#define GIMP_PROC_ARG_INT32_ARRAY(procedure, name, nick, blurb, flags) \
......
......@@ -64,7 +64,6 @@ EXPORTS
gimp_ink_blob_type_get_type
gimp_installation_directory
gimp_installation_directory_file
gimp_int16_array_get_type
gimp_int32_array_get_type
gimp_interpolation_type_get_type
gimp_is_canonical_identifier
......@@ -108,7 +107,6 @@ EXPORTS
gimp_paint_application_mode_get_type
gimp_param_array_get_type
gimp_param_float_array_get_type
gimp_param_int16_array_get_type
gimp_param_int32_array_get_type
gimp_param_memsize_get_type
gimp_param_object_array_get_type
......@@ -116,7 +114,6 @@ EXPORTS
gimp_param_rgb_array_get_type
gimp_param_spec_array
gimp_param_spec_float_array
gimp_param_spec_int16_array
gimp_param_spec_int32_array
gimp_param_spec_memsize
gimp_param_spec_object_array
......@@ -226,26 +223,22 @@ EXPORTS
gimp_value_array_truncate
gimp_value_array_unref
gimp_value_dup_float_array
gimp_value_dup_int16_array
gimp_value_dup_int32_array
gimp_value_dup_object_array
gimp_value_dup_rgb_array
gimp_value_dup_string_array
gimp_value_dup_uint8_array
gimp_value_get_float_array
gimp_value_get_int16_array
gimp_value_get_int32_array
gimp_value_get_object_array
gimp_value_get_rgb_array
gimp_value_get_string_array
gimp_value_get_uint8_array
gimp_value_set_float_array
gimp_value_set_int16_array
gimp_value_set_int32_array
gimp_value_set_object_array
gimp_value_set_rgb_array
gimp_value_set_static_float_array
gimp_value_set_static_int16_array
gimp_value_set_static_int32_array
gimp_value_set_static_object_array
gimp_value_set_static_rgb_array
......@@ -254,7 +247,6 @@ EXPORTS
gimp_value_set_string_array
gimp_value_set_uint8_array
gimp_value_take_float_array
gimp_value_take_int16_array
gimp_value_take_int32_array
gimp_value_take_object_array
gimp_value_take_rgb_array
......
......@@ -421,177 +421,6 @@ gimp_value_take_uint8_array (GValue *value,
}
/*
* GIMP_TYPE_INT16_ARRAY
*/
typedef GimpArray GimpInt16Array;
G_DEFINE_BOXED_TYPE (GimpInt16Array, gimp_int16_array, gimp_array_copy, gimp_array_free)
/*
* GIMP_TYPE_PARAM_INT16_ARRAY
*/
static void gimp_param_int16_array_class_init (GParamSpecClass *klass);
static void gimp_param_int16_array_init (GParamSpec *pspec);
GType
gimp_param_int16_array_get_type (void)
{
static GType type = 0;
if (! type)
{
const GTypeInfo info =
{
sizeof (GParamSpecClass),
NULL, NULL,
(GClassInitFunc) gimp_param_int16_array_class_init,
NULL, NULL,
sizeof (GimpParamSpecInt16Array),
0,
(GInstanceInitFunc) gimp_param_int16_array_init
};
type = g_type_register_static (GIMP_TYPE_PARAM_ARRAY,
"GimpParamInt16Array", &info, 0);
}
return type;
}
static void
gimp_param_int16_array_class_init (GParamSpecClass *klass)
{
klass->value_type = GIMP_TYPE_INT16_ARRAY;
}
static void
gimp_param_int16_array_init (GParamSpec *pspec)
{
}
/**
* gimp_param_spec_int16_array:
* @name: Canonical name of the property specified.
* @nick: Nick name of the property specified.
* @blurb: Description of the property specified.
* @flags: Flags for the property specified.
*
* Creates a new #GimpParamSpecInt16Array specifying a
* #GIMP_TYPE_INT16_ARRAY property.
*
* See g_param_spec_internal() for details on property names.
*
* Returns: (transfer full): The newly created #GimpParamSpecInt16Array.
*
* Since: 3.0
**/
GParamSpec *
gimp_param_spec_int16_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags)
{
GimpParamSpecArray *array_spec;
array_spec = g_param_spec_internal (GIMP_TYPE_PARAM_INT16_ARRAY,
name, nick, blurb, flags);
return G_PARAM_SPEC (array_spec);
}
/**
* gimp_value_get_int16_array:
* @value: A valid value of type %GIMP_TYPE_INT16_ARRAY
*
* Gets the contents of a %GIMP_TYPE_INT16_ARRAY #GValue
*
* Returns: (transfer none) (array): The contents of @value
*/
const gint16 *
gimp_value_get_int16_array (const GValue *value)
{
g_return_val_if_fail (GIMP_VALUE_HOLDS_INT16_ARRAY (value), NULL);
return (const gint16 *) gimp_value_get_array (value);
}
/**
* gimp_value_dup_int16_array:
* @value: A valid value of type %GIMP_TYPE_INT16_ARRAY
*
* Gets the contents of a %GIMP_TYPE_INT16_ARRAY #GValue
*
* Returns: (transfer full) (array): The contents of @value
*/
gint16 *
gimp_value_dup_int16_array (const GValue *value)
{
g_return_val_if_fail (GIMP_VALUE_HOLDS_INT16_ARRAY (value), NULL);
return (gint16 *) gimp_value_dup_array (value);
}
/**
* gimp_value_set_int16_array:
* @value: A valid value of type %GIMP_TYPE_INT16_ARRAY
* @data: (array length=length): A #gint16 array
* @length: The number of elements in @data
*
* Sets the contents of @value to @data.
*/
void
gimp_value_set_int16_array (GValue *value,
const gint16 *data,
gsize length)
{
g_return_if_fail (GIMP_VALUE_HOLDS_INT16_ARRAY (value));
gimp_value_set_array (value, (const guint8 *) data,
length * sizeof (gint16));
}
/**
* gimp_value_set_static_int16_array:
* @value: A valid value of type %GIMP_TYPE_INT16_ARRAY
* @data: (array length=length): A #gint16 array
* @length: The number of elements in @data
*
* Sets the contents of @value to @data, without copying the data.
*/
void
gimp_value_set_static_int16_array (GValue *value,
const gint16 *data,
gsize length)
{
g_return_if_fail (GIMP_VALUE_HOLDS_INT16_ARRAY (value));
gimp_value_set_static_array (value, (const guint8 *) data,
length * sizeof (gint16));
}
/**
* gimp_value_take_int16_array:
* @value: A valid value of type %GIMP_TYPE_INT16_ARRAY
* @data: (transfer full) (array length=length): A #gint16 array
* @length: The number of elements in @data
*
* Sets the contents of @value to @data, and takes ownership of @data.
*/
void
gimp_value_take_int16_array (GValue *value,
gint16 *data,
gsize length)
{
g_return_if_fail (GIMP_VALUE_HOLDS_INT16_ARRAY (value));
gimp_value_take_array (value, (guint8 *) data,
length * sizeof (gint16));
}
/*
* GIMP_TYPE_INT32_ARRAY
*/
......
......@@ -173,51 +173,6 @@ void gimp_value_take_uint8_array (GValue *value,
gsize length);
/*
* GIMP_TYPE_INT16_ARRAY
*/
#define GIMP_TYPE_INT16_ARRAY (gimp_int16_array_get_type ())
#define GIMP_VALUE_HOLDS_INT16_ARRAY(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_INT16_ARRAY))
GType gimp_int16_array_get_type (void) G_GNUC_CONST;
/*
* GIMP_TYPE_PARAM_INT16_ARRAY
*/
#define GIMP_TYPE_PARAM_INT16_ARRAY (gimp_param_int16_array_get_type ())
#define GIMP_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY, GimpParamSpecInt16Array))
#define GIMP_IS_PARAM_SPEC_INT16_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_INT16_ARRAY))
typedef struct _GimpParamSpecInt16Array GimpParamSpecInt16Array;
struct _GimpParamSpecInt16Array
{
GimpParamSpecArray parent_instance;
};
GType gimp_param_int16_array_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_int16_array (const gchar *name,
const gchar *nick,
const gchar *blurb,
GParamFlags flags);
const gint16 * gimp_value_get_int16_array (const GValue *value);
gint16 * gimp_value_dup_int16_array (const GValue *value);
void gimp_value_set_int16_array (GValue *value,
const gint16 *data,
gsize length);
void gimp_value_set_static_int16_array (GValue *value,
const gint16 *data,
gsize length);
void gimp_value_take_int16_array (GValue *value,
gint16 *data,
gsize length);
/*
* GIMP_TYPE_INT32_ARRAY
*/
......
......@@ -295,11 +295,6 @@ gimp_config_param_spec_duplicate (GParamSpec *pspec)
copy = gimp_param_spec_uint8_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_INT16_ARRAY (pspec))
{
copy = gimp_param_spec_int16_array (name, nick, blurb,
flags);
}
else if (GIMP_IS_PARAM_SPEC_INT32_ARRAY (pspec))
{
copy = gimp_param_spec_int32_array (name, nick, blurb,
......
......@@ -544,14 +544,6 @@ gimp_param_spec_int32_array ("$name",
"$nick",
"$blurb",
$flags)
CODE
}
elsif ($pdbtype eq 'int16array') {
$pspec = <<CODE;
gimp_param_spec_int16_array ("$name",
"$nick",
"$blurb",
$flags)
CODE
}
elsif ($pdbtype eq 'int8array') {
......
......@@ -71,19 +71,6 @@ package Gimp::CodeGen::pdb;
set_value_func => 'gimp_value_set_int32_array ($value, $var, $var_len)',
take_value_func => 'gimp_value_take_int32_array ($value, $var, $var_len)' },
int16array => { name => 'INT16ARRAY',
gtype => 'GIMP_TYPE_INT16_ARRAY',
type => 'gint16 *',
const_type => 'const gint16 *',
array => 1,
init_value => 'NULL',
in_annotate => '(element-type gint16)',
out_annotate => '(element-type gint16) (transfer full)',
get_value_func => '$var = gimp_value_get_int16_array ($value)',
dup_value_func => '$var = GIMP_VALUES_DUP_INT16_ARRAY ($value)',
set_value_func => 'gimp_value_set_int16_array ($value, $var, $var_len)',
take_value_func => 'gimp_value_take_int16_array ($value, $var, $var_len)' },
int8array => { name => 'INT8ARRAY',
gtype => 'GIMP_TYPE_UINT8_ARRAY',
type => 'guint8 *',
......
......@@ -918,64 +918,6 @@ script_fu_marshal_procedure_call (scheme *sc,
g_printerr ("\n");
}
}
#endif
}
}
else if (GIMP_VALUE_HOLDS_INT16_ARRAY (&value))
{
vector = sc->vptr->pair_car (a);
if (! sc->vptr->is_vector (vector))
success = FALSE;
if (success)
{
gint16 *array;
n_elements = GIMP_VALUES_GET_INT (args, i - 1);
if (n_elements < 0 ||
n_elements > sc->vptr->vector_length (vector))
{
g_snprintf (error_str, sizeof (error_str),
"INT16 vector (argument %d) for function %s has "
"size of %ld but expected size of %d",
i+1, proc_name, sc->vptr->vector_length (vector), n_elements);
return foreign_error (sc, error_str, 0);
}
array = g_new0 (gint16, n_elements);
for (j = 0; j < n_elements; j++)
{
pointer v_element = sc->vptr->vector_elem (vector, j);
if (! sc->vptr->is_number (v_element))
{
g_snprintf (error_str, sizeof (error_str),
"Item %d in vector is not a number (argument %d for function %s)",
j+1, i+1, proc_name);
g_free (array);
return foreign_error (sc, error_str, vector);
}
array[j] = (gint16) sc->vptr->ivalue (v_element);
}
gimp_value_take_int16_array (&value, array, n_elements);
#if DEBUG_MARSHALL
{