GNOME Bugzilla – Bug 559705
Missing association between static methods and classes
Last modified: 2015-02-07 16:54:05 UTC
Functions that are part of a class but do not take an instance parameter are currently added as namespace functions to the .gir. They should be moved to the appropriate class element to make the association easily accessible by all bindings. Examples for such functions are g_cancellable_get_current() and g_vfs_get_default().
This is a good idea; would need transformer, .gir and .typelib changes. One highlevel question here is do we just take any function whose name matches a class prefix but doesn't take an intstance parameter as a static method, or do we need an annotation? In other words do there exist functions that would be misidentified by this?
Created attachment 122832 [details] [review] resolve static methods
(In reply to comment #1) > One highlevel question here is do we just take any function whose name matches > a class prefix but doesn't take an intstance parameter as a static method, or > do we need an annotation? gtk-sharp does the former, and it does the right thing 99% of the time; we might need an annotation to say "this ISN'T a static method" in the handful of cases it gets wrong.
Do you know if those cases would be candidates for IntrospectionSkip: (bug 556628) i.e. we don't need to bind them at all, or do we need a NotStatic: type annotation?
I can't remember any examples. We could just not have such an annotation until we find a case where it's necessary.
(In reply to comment #2) > Created an attachment (id=122832) [edit] > resolve static methods > Looks good, I'll do some basic checks and commit if it works.
2008-11-25 Colin Walters <walters@verbum.org> Bug 559705 – Missing association between static methods and classes * docs/typelib-format.txt: * girepository/ginfo.c (g_function_info_get_flags): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (g_ir_node_get_size), (g_ir_node_build_typelib): * girepository/girparser.c (start_function): * girepository/gtypelib.c (g_typelib_check_sanity), (validate_header), (validate_function_blob): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibtransformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: Fixed in r972.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]