mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
docs: Move the GValueArray SECTION
Move the contents to the struct docs. Helps: #3037
This commit is contained in:
parent
95717eacea
commit
36d65922e2
@ -30,35 +30,35 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:value_arrays
|
* GValueArray:
|
||||||
* @short_description: A container structure to maintain an array of
|
* @n_values: number of values contained in the array
|
||||||
* generic values
|
* @values: array of values
|
||||||
* @see_also: #GValue, #GParamSpecValueArray, g_param_spec_value_array()
|
|
||||||
* @title: Value arrays
|
|
||||||
*
|
*
|
||||||
* The prime purpose of a #GValueArray is for it to be used as an
|
* A `GValueArray` is a container structure to hold an array of generic values.
|
||||||
* object property that holds an array of values. A #GValueArray wraps
|
|
||||||
* an array of #GValue elements in order for it to be used as a boxed
|
|
||||||
* type through %G_TYPE_VALUE_ARRAY.
|
|
||||||
*
|
*
|
||||||
* #GValueArray is deprecated in favour of #GArray since GLib 2.32. It
|
* The prime purpose of a `GValueArray` is for it to be used as an
|
||||||
* is possible to create a #GArray that behaves like a #GValueArray by
|
* object property that holds an array of values. A `GValueArray` wraps
|
||||||
* using the size of #GValue as the element size, and by setting
|
* an array of `GValue` elements in order for it to be used as a boxed
|
||||||
* g_value_unset() as the clear function using g_array_set_clear_func(),
|
* type through `G_TYPE_VALUE_ARRAY`.
|
||||||
* for instance, the following code:
|
|
||||||
*
|
*
|
||||||
* |[<!-- language="C" -->
|
* `GValueArray` is deprecated in favour of `GArray` since GLib 2.32.
|
||||||
|
* It is possible to create a `GArray` that behaves like a `GValueArray`
|
||||||
|
* by using the size of `GValue` as the element size, and by setting
|
||||||
|
* [func@GObject.value_unset] as the clear function using
|
||||||
|
* [method@GLib.Array.set_clear_func], for instance, the following code:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
* GValueArray *array = g_value_array_new (10);
|
* GValueArray *array = g_value_array_new (10);
|
||||||
* ]|
|
* ```
|
||||||
*
|
*
|
||||||
* can be replaced by:
|
* can be replaced by:
|
||||||
*
|
*
|
||||||
* |[<!-- language="C" -->
|
* ```c
|
||||||
* GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
|
* GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10);
|
||||||
* g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
|
* g_array_set_clear_func (array, (GDestroyNotify) g_value_unset);
|
||||||
* ]|
|
* ```
|
||||||
*
|
*
|
||||||
* Deprecated: 2.32: Use #GArray instead, if possible for the given use case,
|
* Deprecated: 2.32: Use `GArray` instead, if possible for the given use case,
|
||||||
* as described above.
|
* as described above.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -41,13 +41,6 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
/* --- typedefs & structs --- */
|
/* --- typedefs & structs --- */
|
||||||
typedef struct _GValueArray GValueArray;
|
typedef struct _GValueArray GValueArray;
|
||||||
/**
|
|
||||||
* GValueArray:
|
|
||||||
* @n_values: number of values contained in the array
|
|
||||||
* @values: array of values
|
|
||||||
*
|
|
||||||
* A #GValueArray contains an array of #GValue elements.
|
|
||||||
*/
|
|
||||||
struct _GValueArray
|
struct _GValueArray
|
||||||
{
|
{
|
||||||
guint n_values;
|
guint n_values;
|
||||||
|
Loading…
Reference in New Issue
Block a user