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 572434 - Have glib:is-iface-struct-for attribute on *Iface structs
Have glib:is-iface-struct-for attribute on *Iface structs
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.18.x
Other All
: Normal enhancement
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 559704
 
 
Reported: 2009-02-19 15:43 UTC by Didier "Ptitjes"
Modified: 2015-02-07 16:55 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Bug 572434 - Associate interfaces with their C structures (16.23 KB, patch)
2009-02-20 22:35 UTC, Colin Walters
accepted-commit_now Details | Review
Bug 572434 - Associate interfaces with their C structures (38.11 KB, patch)
2009-02-23 17:19 UTC, Colin Walters
none Details | Review

Description Didier "Ptitjes" 2009-02-19 15:43:00 UTC
There is no information to relate *Iface structs to their interface.
Comment 1 Colin Walters 2009-02-20 22:35:02 UTC
Created attachment 129191 [details] [review]
Bug 572434 - Associate interfaces with their C structures

Similar to GObject class structs, we pair up GInterfaces with
their C structures.
Comment 2 Johan (not receiving bugmail) Dahlin 2009-02-21 02:04:52 UTC
Comment on attachment 129191 [details] [review]
Bug 572434 - Associate interfaces with their C structures

The attribute name 
'class-struct' is a bit weird as it's an interface and not a class.
Could we call it glib:type-class-struct instead maybe? dunno.
Comment 3 Didier "Ptitjes" 2009-02-21 11:08:17 UTC
Shouldn't we name those attributes glib:iface-struct and glib:is-iface-struct-for ? I think this would be more logical and consistent as class structures are usually named FooClass and iterace structures FooIface.

Thus for Classes:

Class name : Foo
Attribute : glib:class-struct="FooClass"
Class struct name : FooClass
Attribute : glib:is-class-struct-for="Foo"

And for Interfaces:

Interface name : Bar
Attribute : glib:iface-struct="BarClass"
Interface struct name : BarClass
Attribute : glib:is-iface-struct-for="Bar"

I would also be ok for glib:interface-struct and glib:is-interface-struct-for, but these are more verbose.
Comment 4 Colin Walters 2009-02-23 17:19:36 UTC
Created attachment 129347 [details] [review]
Bug 572434 - Associate interfaces with their C structures

Similar to GObject class structs, we pair up GInterfaces with
their C structures.
Comment 5 Johan (not receiving bugmail) Dahlin 2009-02-25 20:41:38 UTC
Comment on attachment 129347 [details] [review]
Bug 572434 - Associate interfaces with their C structures

>diff --git a/giscanner/ast.py b/giscanner/ast.py

>@@ -369,8 +370,8 @@ class Record(Node):

>+        # for some Foo GObject (or similar for GInterface)
>+        self.is_gtype_struct_for = False

>@@ -410,7 +411,7 @@ class Class(Node):

>+        self.glib_type_struct = None

>@@ -432,6 +433,7 @@ class Interface(Node):

>+        self.glib_type_struct = None

Ideally, put these inside glibast.py somehow.
Not sure how much extra work that'll be though.

>     <interface name="Interface"
>                c:type="FooInterface"
>                glib:type-name="FooInterface"
>-               glib:get-type="foo_interface_get_type">
>-      <callback name="do_foo" c:type="do_foo">
>-        <return-value transfer-ownership="none">
>-          <type name="none" c:type="void"/>
>-        </return-value>
>-        <parameters>
>-          <parameter name="self" transfer-ownership="none">
>-            <type name="Interface" c:type="FooInterface*"/>
>-          </parameter>
>-        </parameters>
>-      </callback>

Why is the <callback> gone, looks like a bug?
Albeit, it should probably be called virtual-method, not callback.

>-      <callback name="do_bar" c:type="do_bar">
>-        <return-value transfer-ownership="none">
>-          <type name="none" c:type="void"/>
>-        </return-value>
>-        <parameters>
>-          <parameter name="self" transfer-ownership="none">
>-            <type name="SubInterface" c:type="FooSubInterface*"/>
>-          </parameter>
>-        </parameters>
>-      </callback>

Ditto.
Comment 6 Colin Walters 2009-02-25 22:35:51 UTC
Yeah, the vmethods are bug 557383. We shouldn't remove the callbacks in this commit though, fixed.

I also created a GLibRecord and moved the attribute there.
Comment 7 André Klapper 2015-02-07 16:55:12 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]