Sets our main struct and passes it to the parent class
Creates a new GArray with a reference count of 1.
Adds len elements onto the end of the array.
Atomically increments the reference count of array by one. This function is MT-safe and may be called from any thread. Since 2.22
Frees the memory allocated for the GArray. If free_segment is TRUE it frees the memory block holding the elements as well and also each element if array has a element_free_func set. Pass FALSE if you want to free the GArray wrapper but preserve the underlying array for use elsewhere. If the reference count of array is greater than one, the GArray wrapper is preserved but the size of array will be set to zero. Note If array elements contain dynamically-allocated memory, they should be freed separately.
Get the main Gtk struct
Gets the size of the elements in array. Since 2.22
the main Gtk struct as a void*
Inserts len elements into a GArray at the given index.
Adds len elements onto the start of the array. This operation is slower than g_array_append_vals() since the existing elements in the array have to be moved to make space for the new elements.
Removes the element at the given index from a GArray. The following elements are moved down one place.
Removes the element at the given index from a GArray. The last element in the array is used to fill in the space, so this function does not preserve the order of the GArray. But it is faster than g_array_remove_index().
Removes the given number of elements starting at the given index from a GArray. The following elements are moved to close the gap. Since 2.4
Sets a function to clear an element of array. The clear_func will be called when an element in the array data segment is removed and when the array is freed and data segment is deallocated as well. Note that in contrast with other uses of GDestroyNotify functions, clear_func is expected to clear the contents of the array element it is given, but not free the element itself. Since 2.32
Sets the size of the array, expanding it if necessary. If the array was created with clear_ set to TRUE, the new elements are set to 0.
Sorts a GArray using compare_func which should be a qsort()-style comparison function (returns less than zero for first arg is less than second arg, zero for equal, greater zero if first arg is greater than second arg). This is guaranteed to be a stable sort since version 2.32.
Like g_array_sort(), but the comparison function receives an extra user data argument. This is guaranteed to be a stable sort since version 2.32. There used to be a comment here about making the sort stable by using the addresses of the elements in the comparison function. This did not actually work, so any such code should be removed.
Atomically decrements the reference count of array by one. If the reference count drops to 0, all memory allocated by the array is released. This function is MT-safe and may be called from any thread. Since 2.22
Creates a new GArray with reserved_size elements preallocated and a reference count of 1. This avoids frequent reallocation, if you are going to add many elements to the array. Note however that the size of the array is still 0.
the main Gtk struct
Arrays are similar to standard C arrays, except that they grow automatically as elements are added.
Array elements can be of any size (though all elements of one array are the same size), and the array can be automatically cleared to '0's and zero-terminated.
To create a new array use g_array_new().
To add elements to an array, use g_array_append_val(), g_array_append_vals(), g_array_prepend_val(), and g_array_prepend_vals().
To access an element of an array, use g_array_index().
To set the size of an array, use g_array_set_size().
To free an array, use g_array_free().