GNOME Bugzilla – Bug 628753
[girepository] Make it the typelib usable
Last modified: 2015-02-07 17:00:16 UTC
GIRepository API is based on BaseInfo and Typelib structures, which are not boxed, therefore not exported into typelibs.
Created attachment 169470 [details] [review] Patch which makes BaseInfo boxed. This is simple patch which registers BaseInfo as boxed. It makes it correctly exported into GIRepository.typelib
Created attachment 169471 [details] [review] Converts Typelib from C structure to GObject Larger patch, converts Typelib to GObject. This feels natural, because typelib semantics calls for refcounting, GObject brings this and also exports Typelib interface into GIRepository.typelib. The drawback (GObject overhead compared to plain C structure) is minor in this case, since only a few tens at max of these objects are usually created. Most of the patch is just mechanical conversion of 'typelib->' to 'typelib->priv->'.
Created attachment 169472 [details] [review] Typelib keeps reference to its dependencies typelibs. Every typelib now keeps the list of references to dependent typelibs. This means that no typelib which is dependency of another loaded typelib can be incorrectly unloaded (freed) by calling application.
Created attachment 169473 [details] [review] Some missing annotations and documentation for GIRepository Some missing annotations, so that GIRepository.typelib is correct. Also contains a try at documenting missing struct and union methods. but these definitely need review, because my english is poor.
(In reply to comment #1) > Created an attachment (id=169470) [details] [review] > Patch which makes BaseInfo boxed. > > This is simple patch which registers BaseInfo as boxed. It makes it correctly > exported into GIRepository.typelib This patch may be not needed at all if some other resolution of bug 572415 is found.
Created attachment 169581 [details] [review] Adds more missing annotations Annotates 'repository' parameter in most Repository methods as optional.
Created attachment 169949 [details] [review] Update and fix some GIRepository annotations. Merges previous annotations fixes and corrects some. The most important correction is that Repository.require is actually (transfer none) and not (transfer full); existing code (both on gobject-introspection and in pygi and gjs) actually assumed (transfer none), only the annotation was incorrect. This means that there is no need to make Typelib either GObject or boxed, the code can be left as-is, therefore this change obsoletes also previous Typelib->GObject conversion patches.
Review of attachment 169949 [details] [review]: Looks good to me
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]