After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623631 - g-i needs to mark GBoxed types as such in GIR files
g-i needs to mark GBoxed types as such in GIR files
Status: RESOLVED NOTABUG
Product: gobject-introspection
Classification: Platform
Component: general
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 623254
 
 
Reported: 2010-07-05 20:53 UTC by Travis Reitter
Modified: 2015-02-07 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Travis Reitter 2010-07-05 20:53:23 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.
Comment 1 Johan (not receiving bugmail) Dahlin 2010-07-05 21:07:30 UTC
This is a bug in telepathy, change the type so it's registered as TpIntset and not TpIntSet.
Comment 2 Travis Reitter 2010-07-05 22:40:12 UTC
(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?
Comment 3 Johan (not receiving bugmail) Dahlin 2010-07-05 23:04:30 UTC
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()
Comment 4 André Klapper 2015-02-07 16:52:59 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]