Value
An opaque structure used to hold different types of values.
The data within the structure has protected scope: it is accessible only to functions within a #GTypeValueTable structure, or implementations of the g_value_*() API. That is, code portions which implement new fundamental types.
#GValue users cannot make any assumptions about how data is stored within the 2 element @data union, and the @g_type member should only be accessed through the G_VALUE_TYPE() macro.
Skipped during bindings generation
parameter
transform_func
: ValueTransformfield
data
: _Value__data__union
Constructors
Functions
Get the contents of a variant #GValue, increasing its refcount. The returned #GVariant is never floating.
Determines if @value will fit inside the size of a pointer value. This is an internal function introduced mainly for C marshallers.
Get the contents of a %G_TYPE_BOOLEAN #GValue.
Get the contents of a pointer #GValue.
Get the contents of a variant #GValue.
Initializes and sets @value from an instantiatable type via the value_table's collect_value() function.
Returns the value contents as pointer. This function asserts that g_value_fits_pointer() returned true for the passed in value. This is an internal function introduced mainly for C marshallers.
Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean.
This is an internal function introduced mainly for C marshallers.
Sets @value from an instantiatable type via the value_table's collect_value() function.
Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is assumed to be static and interned (canonical, for example from g_intern_string()), and is thus not duplicated when setting the #GValue.
This is an internal function introduced mainly for C marshallers.
This is an internal function introduced mainly for C marshallers.
Set the contents of a pointer #GValue to @v_pointer.
Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed.
Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is assumed to be static, and is thus not duplicated when setting the #GValue.
Set the contents of a variant #GValue to @variant. If the variant is floating, it is consumed.
Steal ownership on contents of a %G_TYPE_STRING #GValue. As a result of this operation the value's contents will be reset to null.
Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object and takes over the ownership of the caller’s reference to @v_object; the caller doesn’t have to unref it any more (i.e. the reference count of the object is not increased).
Set the contents of a variant #GValue to @variant, and takes over the ownership of the caller's reference to @variant; the caller doesn't have to unref it any more (i.e. the reference count of the variant is not increased).
Tries to cast the contents of @src_value into a type appropriate to store in @dest_value, e.g. to transform a %G_TYPE_INT value into a %G_TYPE_FLOAT value. Performing transformations between value types might incur precision lossage. Especially transformations into strings might reveal seemingly arbitrary results and shouldn't be relied upon for production code (such as rcfile value or object property serialization).