1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A polymorphic type that can hold values of any other type.
7 <!-- ##### SECTION Long_Description ##### -->
9 The #GValue structure is basically a variable container that consists
10 of a type identifier and a specific value of that type.
11 The type identifier within a #GValue structure always determines the
12 type of the associated value.
13 To create a undefined #GValue structure, simply create a zero-filled
14 #GValue structure. To initialize the #GValue, use the g_value_init()
15 function. A #GValue cannot be used until it is initialized.
16 The basic type operations (such as freeing and copying) are determined
17 by the #GTypeValueTable associated with the type ID stored in the #GValue.
18 Other #GValue operations (such as converting values between types) are
19 provided by this interface.
22 <!-- ##### SECTION See_Also ##### -->
24 The fundamental types which all support #GValue operations and thus
25 can be used as a type initializer for g_value_init() are defined by
26 a separate interface. See the Standard Values API for details.
29 <!-- ##### MACRO G_VALUE_HOLDS ##### -->
31 Returns #TRUE if @value holds (or contains) a value of @type.
32 This macro will also check for @value != #NULL and issue a
33 warning if the check fails.
40 <!-- ##### MACRO G_VALUE_TYPE ##### -->
42 Returns the type identifier of @value.
45 @value: A #GValue structure.
48 <!-- ##### MACRO G_VALUE_TYPE_NAME ##### -->
50 Returns the type name of @value.
53 @value: A #GValue structure.
56 <!-- ##### MACRO G_TYPE_IS_VALUE ##### -->
58 Return whether the passed in type ID can be used for g_value_init().
59 That is, this macro checks whether this type provides an implementation
60 of the #GTypeValueTable functions required for a type to create a #GValue of.
63 @type: A #GType value.
64 @Returns: Whether @type is suitable as a #GValue type.
67 <!-- ##### MACRO G_TYPE_IS_VALUE_ABSTRACT ##### -->
75 <!-- ##### MACRO G_IS_VALUE ##### -->
77 Returns #TRUE if @value is a valid and initialized #GValue structure.
80 @value: A #GValue structure.
83 <!-- ##### USER_FUNCTION GValueExchange ##### -->
92 <!-- ##### STRUCT GValue ##### -->
94 A mostly opaque structure used to hold a #GValue object. Mostly because
95 the data within the structure has protected scope: it is accessible only
96 to functions within a #GTypeValueTable structure, or implementations of
101 <!-- ##### MACRO G_TYPE_VALUE ##### -->
108 <!-- ##### MACRO G_TYPE_VALUE_ARRAY ##### -->
115 <!-- ##### FUNCTION g_value_init ##### -->
117 Initializes @value with the default value of @type.
120 @value: A zero-filled (uninitialized) #GValue structure.
121 @g_type: Type the #GValue should hold values of.
125 <!-- ##### FUNCTION g_value_copy ##### -->
127 Copies the value of @src_value into @dest_value.
130 @src_value: An initialized #GValue structure.
131 @dest_value: An initialized #GValue structure of the same type as @src_value.
134 <!-- ##### FUNCTION g_value_reset ##### -->
136 Clears the current value in @value and resets it to the default value
137 (as if the value had just been initialized).
140 @value: An initialized #GValue structure.
144 <!-- ##### FUNCTION g_value_unset ##### -->
146 Clears the current value in @value and "unsets" the type,
147 this releases all resources associated with this GValue.
148 An unset value is the same as an uninitialized (zero-filled)
152 @value: An initialized #GValue structure.
155 <!-- ##### FUNCTION g_value_fits_pointer ##### -->
157 Determines if @value will fit inside the size of a pointer value.
158 This is an internal function introduced mainly for C marshallers.
161 @value: An initialized #GValue structure.
162 @Returns: #TRUE if @value will fit inside a pointer value.
165 <!-- ##### FUNCTION g_value_peek_pointer ##### -->
167 Return the value contents as pointer. This function asserts that
168 g_value_fits_pointer() returned #TRUE for the passed in value.
169 This is an internal function introduced mainly for C marshallers.
172 @value: An initialized #GValue structure.
173 @Returns: #TRUE if @value will fit inside a pointer value.
176 <!-- ##### FUNCTION g_value_type_compatible ##### -->
186 <!-- ##### FUNCTION g_value_type_transformable ##### -->
196 <!-- ##### FUNCTION g_value_transform ##### -->
206 <!-- ##### USER_FUNCTION GValueTransform ##### -->
215 <!-- ##### FUNCTION g_value_register_transform_func ##### -->
225 <!-- ##### FUNCTION g_strdup_value_contents ##### -->