Top | ![]() |
![]() |
![]() |
![]() |
The prime purpose of a GimpValueArray is for it to be used as an
object property that holds an array of values. A GimpValueArray wraps
an array of GValue elements in order for it to be used as a boxed
type through GIMP_TYPE_VALUE_ARRAY
.
GimpValueArray *
gimp_value_array_new (gint n_prealloced
);
Allocate and initialize a new GimpValueArray, optionally preserve space
for n_prealloced
elements. New arrays always contain 0 elements,
regardless of the value of n_prealloced
.
Since: 2.10
GimpValueArray * gimp_value_array_new_from_types (gchar **error_msg
,GType first_type
,...
);
Allocate and initialize a new GimpValueArray, and fill it with values that are given as a list of (GType, value) pairs, terminated by G_TYPE_NONE.
[skip]
error_msg |
return location for an error message. |
|
first_type |
first type in the array, or G_TYPE_NONE. |
|
... |
the remaining types in the array, terminated by G_TYPE_NONE |
Since: 3.0
GimpValueArray * gimp_value_array_new_from_types_valist (gchar **error_msg
,GType first_type
,va_list va_args
);
Allocate and initialize a new GimpValueArray, and fill it with
va_args
given in the order as passed to
gimp_value_array_new_from_types()
.
[skip]
error_msg |
return location for an error message. |
|
first_type |
first type in the array, or G_TYPE_NONE. |
|
va_args |
a va_list of GTypes and values, terminated by G_TYPE_NONE |
Since: 3.0
GimpValueArray * gimp_value_array_new_from_values (const GValue *values
,gint n_values
);
Allocate and initialize a new GimpValueArray, and fill it with the given GValues. When no GValues are given, returns empty GimpValueArray.
values |
The GValue elements. |
[array length=n_values] |
n_values |
the number of value elements |
Since: 3.0
GimpValueArray *
gimp_value_array_ref (GimpValueArray *value_array
);
Adds a reference to a GimpValueArray.
Since: 2.10
void
gimp_value_array_unref (GimpValueArray *value_array
);
Unref a GimpValueArray. If the reference count drops to zero, the array including its contents are freed.
Since: 2.10
GValue * gimp_value_array_index (const GimpValueArray *value_array
,gint index
);
Return a pointer to the value at index
contained in value_array
.
Since: 2.10
GimpValueArray * gimp_value_array_prepend (GimpValueArray *value_array
,const GValue *value
);
Insert a copy of value
as first element of value_array
. If value
is
NULL
, an uninitialized value is prepended.
value_array |
GimpValueArray to add an element to |
|
value |
GValue to copy into GimpValueArray, or |
[allow-none] |
Since: 2.10
GimpValueArray * gimp_value_array_append (GimpValueArray *value_array
,const GValue *value
);
Insert a copy of value
as last element of value_array
. If value
is
NULL
, an uninitialized value is appended.
value_array |
GimpValueArray to add an element to |
|
value |
GValue to copy into GimpValueArray, or |
[allow-none] |
Since: 2.10
GimpValueArray * gimp_value_array_insert (GimpValueArray *value_array
,gint index
,const GValue *value
);
Insert a copy of value
at specified position into value_array
. If value
is NULL
, an uninitialized value is inserted.
value_array |
GimpValueArray to add an element to |
|
index |
insertion position, must be <= |
|
value |
GValue to copy into GimpValueArray, or |
[allow-none] |
Since: 2.10
GimpValueArray * gimp_value_array_remove (GimpValueArray *value_array
,gint index
);
Remove the value at position index
from value_array
.
value_array |
GimpValueArray to remove an element from |
|
index |
position of value to remove, which must be less than
|
Since: 2.10
void gimp_value_array_truncate (GimpValueArray *value_array
,gint n_values
);
GParamSpec * gimp_param_spec_value_array (const gchar *name
,const gchar *nick
,const gchar *blurb
,GParamSpec *element_spec
,GParamFlags flags
);
Creates a new GimpParamSpecValueArray specifying a G_TYPE_VALUE_ARRAY property.
See g_param_spec_internal()
for details on property names.
name |
Canonical name of the property specified. |
|
nick |
Nick name of the property specified. |
|
blurb |
Description of the property specified. |
|
element_spec |
GParamSpec the contained array's elements
have comply to, or |
[nullable] |
flags |
Flags for the property specified. |
Since: 3.0
typedef struct _GimpValueArray GimpValueArray;
A GimpValueArray contains an array of GValue elements.
Since: 2.10
struct GimpParamSpecValueArray { GParamSpec parent_instance; GParamSpec *element_spec; gint fixed_n_elements; };
A GParamSpec derived structure that contains the meta data for value array properties.
GParamSpec * |
the GParamSpec of the array elements |
|
gint |
default length of the array |