Gimp.ValueArray¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gimp.ValueArray¶
The prime purpose of a
Gimp.ValueArray
is for it to be used as an object property that holds an array of values. AGimp.ValueArray
wraps an array ofGObject.Value
elements in order for it to be used as a boxed type through %GIMP_TYPE_VALUE_ARRAY.New in version 2.10.
- classmethod new(n_prealloced)¶
- Parameters:
n_prealloced (
int
) – number of values to preallocate space for- Returns:
a newly allocated
Gimp.ValueArray
with 0 values- Return type:
Allocate and initialize a new
Gimp.ValueArray
, optionally preserve space for n_prealloced elements. New arrays always contain 0 elements, regardless of the value of n_prealloced.New in version 2.10.
- classmethod new_from_values(values)¶
- Parameters:
values ([
GObject.Value
]) – TheGObject.Value
elements- Returns:
a newly allocated
Gimp.ValueArray
.- Return type:
Allocate and initialize a new
Gimp.ValueArray
, and fill it with the givenGObject.Values
. When noGObject.Values
are given, returns emptyGimp.ValueArray
.New in version 3.0.
- append(value)¶
- Parameters:
value (
GObject.Value
orNone
) –GObject.Value
to copy intoGimp.ValueArray
, orNone
- Returns:
the
Gimp.ValueArray
passed in as self- Return type:
Insert a copy of value as last element of self. If value is
None
, an uninitialized value is appended.New in version 2.10.
- copy()¶
- Returns:
a newly allocated
Gimp.ValueArray
.- Return type:
Return an exact copy of a
Gimp.ValueArray
by duplicating all its values.New in version 3.0.
- get_color_array(index)¶
- Parameters:
index (
int
) – index of the value of interest- Returns:
the [type`ColorArray`] stored at index in self.
- Return type:
Return a pointer to the value at index contained in self. This value is supposed to be a [type`ColorArray`].
*Note*: most of the time, you should use the generic [method`Gimp`.ValueArray.index] to retrieve a value, then the relevant
g_value_get_*()
function. This alternative function is mostly there for bindings becauseGObject.Object
-Introspection is not able yet to process correctly known boxed array types.There are no reasons to use this function in C code.
New in version 3.0.
- get_core_object_array(index)¶
- Parameters:
index (
int
) – index of the value of interest- Returns:
the [type`CoreObjectArray`] stored at index in self.
- Return type:
Return a pointer to the value at index contained in self. This value is supposed to be a [type`CoreObjectArray`].
*Note*: most of the time, you should use the generic [method`Gimp`.ValueArray.index] to retrieve a value, then the relevant
g_value_get_*()
function. This alternative function is mostly there for bindings becauseGObject.Object
-Introspection is not able yet to process correctly known boxed array types.There are no reasons to use this function in C code.
New in version 3.0.
- index(index)¶
- Parameters:
index (
int
) – index of the value of interest- Returns:
pointer to a value at index in self
- Return type:
Return a pointer to the value at index contained in self.
*Note*: in binding languages, some custom types fail to be correctly passed through. For these types, you should use specific functions. For instance, in the Python binding, a [type`ColorArray`]
GValue
won’t be usable with this function. You should use instead [method`ValueArray`.get_color_array].New in version 2.10.
- insert(index, value)¶
- Parameters:
index (
int
) – insertion position, must be <=Gimp.ValueArray.length
()value (
GObject.Value
orNone
) –GObject.Value
to copy intoGimp.ValueArray
, orNone
- Returns:
the
Gimp.ValueArray
passed in as self- Return type:
Insert a copy of value at specified position into self. If value is
None
, an uninitialized value is inserted.New in version 2.10.
- prepend(value)¶
- Parameters:
value (
GObject.Value
orNone
) –GObject.Value
to copy intoGimp.ValueArray
, orNone
- Returns:
the
Gimp.ValueArray
passed in as self- Return type:
Insert a copy of value as first element of self. If value is
None
, an uninitialized value is prepended.New in version 2.10.
- ref()¶
- Returns:
the same self
- Return type:
Adds a reference to a
Gimp.ValueArray
.New in version 2.10.
- remove(index)¶
- Parameters:
index (
int
) – position of value to remove, which must be less thanGimp.ValueArray.length
()- Returns:
the
Gimp.ValueArray
passed in as self- Return type:
Remove the value at position index from self.
New in version 2.10.
- unref()¶
Unref a
Gimp.ValueArray
. If the reference count drops to zero, the array including its contents are freed.New in version 2.10.