GNOME Bugzilla – Bug 623631
g-i needs to mark GBoxed types as such in GIR files
Last modified: 2015-02-07 16:52:59 UTC
I'm trying to bind an opaque GBoxed type for Vala, through gobject-introspection. The type is TpIntSet (seen here: http://git.collabora.co.uk/?p=telepathy-glib.git;a=blob;f=telepathy-glib/intset.h;h=f4abdd0801234935e7ac5ad008afd17314c26224;hb=HEAD and here: http://git.collabora.co.uk/?p=telepathy-glib.git;a=blob;f=telepathy-glib/intset.c;h=baa995e86a9ed6da6528ff0928e5c3b8f6aaa6cb;hb=HEAD). It's basically the same situation as GtkTreePath, but that's bound in Vala from its own GIDL file instead of a GIR file, so it doesn't hit this problem. It seems that g-ir-compiler should be able to determine that TpIntSet is a GBoxed by its GType. Maybe they could just be marked as <glib:boxed> instead of <record> (but with the inner content the same). Then languages that support g-i could use g_boxed_copy/free. Alternatively, we could add attributes to <record> to specify the copy/free functions.
This is a bug in telepathy, change the type so it's registered as TpIntset and not TpIntSet.
(In reply to comment #1) > This is a bug in telepathy, change the type so it's registered as TpIntset and > not TpIntSet. When I do so, the record gets stripped down to <record name="IntSet" c:type="TpIntSet" doc="Opaque type representing a set of unsigned integers."> </record> Ie, all the functions are direct children of <namespace> and there doesn't seem to be a clear indicator that the IntSet record is a boxed type. Isn't there a conflict in the way that TpIntSet has a capital S and registering the type as TpIntset?
I guess you need to rename the type as well, or the functions; 1) TpIntSet -> tp_int_set_get_type()/tp_int_set_foo_method() 2) TpIntset -> tp_intset_get_type()/tp_intset_foo_method()
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]