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 560281 - Object/classes/interface field offsets
Object/classes/interface field offsets
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-11-11 05:44 UTC by Owen Taylor
Modified: 2015-02-07 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add g_ir_ffi_convert_arguments (4.94 KB, patch)
2009-10-21 12:56 UTC, Tomeu Vizoso
none Details | Review
Add methods to Everything.TestInterface (11.48 KB, patch)
2009-10-21 13:05 UTC, Tomeu Vizoso
none Details | Review
Remove offset from vfuncs and add it to callbacks (8.86 KB, patch)
2009-10-21 13:06 UTC, Tomeu Vizoso
none Details | Review

Description Owen Taylor 2008-11-11 05:44:26 UTC
We need to compute offsets and write them for:

 Object member fields
 Object class virtual functions
 Interface virtual functions

There's some mess to clean up here - the compiler expects interfaces to
have <vfunc/> children, and it expects <vfunc/> members of the <object/>
elements to apply to the class structure. But the scanner always generates
<callback/> not <vfunc/> and the class structure is treated separately.

(Note that without knowning all class members, including non-function members
you can't compute the vfunc offsets - see GtkWidgetClass for example -
so the gir probably needs to keep the full class structure definition,
but it could be handled differently in the typelib if we are willing
to let the two diverge.)
Comment 1 Tomeu Vizoso 2009-10-15 18:40:26 UTC
This may help to whoever decides to tackle it:

(08:55:03 PM) owen_: there's nothing remotely technically hard about this in g-i .. I did all the stuff that was (remotely) technically hard when we added struct field offsets
(08:56:00 PM) owen_: There may still be a remaining mess to sort out with where virtual functions are defined and the relationship between class structures and instance structures. Not sure if walters got that sorted or not.
(08:56:31 PM) owen_: Then the rest is simply going through and hooking up the existing struct-field-offset code to virtual functions as well.
Comment 2 Tomeu Vizoso 2009-10-21 12:56:36 UTC
Created attachment 145947 [details] [review]
Add g_ir_ffi_convert_arguments
Comment 3 Tomeu Vizoso 2009-10-21 13:05:36 UTC
Created attachment 145948 [details] [review]
Add methods to Everything.TestInterface
Comment 4 Tomeu Vizoso 2009-10-21 13:06:27 UTC
Created attachment 145949 [details] [review]
Remove offset from vfuncs and add it to callbacks
Comment 5 Tomeu Vizoso 2009-10-21 13:07:23 UTC
This work depends on Didier's patches from https://bugzilla.gnome.org/show_bug.cgi?id=557383 landing first.
Comment 6 Tomeu Vizoso 2009-11-06 18:00:12 UTC
Callbacks are being written as part of regular fields, maybe this one can be closed as being obsoleted by https://bugzilla.gnome.org/show_bug.cgi?id=557383 ?
Comment 7 André Klapper 2015-02-07 16:55:11 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]