GNOME Bugzilla – Bug 572434
Have glib:is-iface-struct-for attribute on *Iface structs
Last modified: 2015-02-07 16:55:12 UTC
There is no information to relate *Iface structs to their interface.
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 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.
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.
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 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.
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.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]