GNOME Bugzilla – Bug 754263
GdaBinary.data is wrongly introspected
Last modified: 2016-04-21 15:29:46 UTC
GdaBinary.data should be marked as a guint8 array
I'm not very fluent on the annotations, could you provide a patch? Thanks!
in libgda/gda-value.h, line 136 change this: /** * GdaBinary: * @data: * @binary_length: */ into this: /** * GdaBinary: * @data: (array): * @binary_length: */
Thanks, This is now committed: https://git.gnome.org/browse/libgda/commit/?id=6a22ca5e476f8dccd315aec2455574a7ded6810a
I can't see the array length set on VAPI nor on GIR. I've added a (array length=binary_length), but VAPI doesn't set correct value for array length, it should hide binary_length on biding, as for: [CCode (cheader_filename = "libgda/libgda.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gda_binary_get_type ()")] [Compact] public class Binary { [CCode (array_length_name = binary_length)] public weak uint8[] data; public static void* copy (void* boxed); public static void free (owned void* boxed); public string to_string (uint maxlen); } from: https://wiki.gnome.org/Projects/Vala/LegacyBindings#Array_Lengths and https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations#GObject-Introspection_annotations Then in order to get correctly set array length, may custome code to Gda-6.0.metadata should be added or try to fix (witch is better) on GI annotations. I'm checking it.
For better GdaBinary introspection, we should: a) Hide GdaBinary members to users b) Add API to modify, create and release structure resources c) consider to use glib API like GBytes Comments?
I’d go with GBytes, as it works pretty well already in GLib. Why re-invent the wheel?
I've prepared a huge commit to seal GdaBinary and GdaBlob, making them introspectable friendly. It is already in master. Closing this bug. Feel free to reopen if you found it is not fixed.