Add replacement API for GValueArray
@ebassi
Submitted by Emmanuele Bassi Link to original bug (#753522)
Description
GValueArray has been deprecated by bug 667228 because it's a terrible, terrible API that we cannot fix in any sensible way. Sadly, GValueArray did some things in an easy way, and dealing with GValues inside a GArray is not entirely fun and games.
Instead of creating a new type, we should have additional methods, provided by GObject, to initialize and populate a GArray with GValues, thus closing the hole.
We could have something like:
GArray * g_value_init_array (GType value_type);
GArray * g_value_init_array_sized (GType value_type, gsize n_values);
to initialize a GArray-of-GValues and pre-initialize it; it would also add a clear function automatically; then you could simply get the pointer GValue at the wanted index, and populate it with the wanted value.