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 628753 - [girepository] Make it the typelib usable
[girepository] Make it the typelib usable
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-09-04 07:23 UTC by Pavel Holejsovsky
Modified: 2015-02-07 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which makes BaseInfo boxed. (1.67 KB, patch)
2010-09-04 07:26 UTC, Pavel Holejsovsky
none Details | Review
Converts Typelib from C structure to GObject (96.83 KB, patch)
2010-09-04 07:29 UTC, Pavel Holejsovsky
none Details | Review
Typelib keeps reference to its dependencies typelibs. (2.37 KB, patch)
2010-09-04 07:31 UTC, Pavel Holejsovsky
none Details | Review
Some missing annotations and documentation for GIRepository (13.57 KB, patch)
2010-09-04 07:33 UTC, Pavel Holejsovsky
committed Details | Review
Adds more missing annotations (4.38 KB, patch)
2010-09-06 15:03 UTC, Pavel Holejsovsky
none Details | Review
Update and fix some GIRepository annotations. (6.16 KB, patch)
2010-09-10 13:49 UTC, Pavel Holejsovsky
accepted-commit_now Details | Review

Description Pavel Holejsovsky 2010-09-04 07:23:08 UTC
GIRepository API is based on BaseInfo and Typelib structures, which are not boxed, therefore not exported into typelibs.
Comment 1 Pavel Holejsovsky 2010-09-04 07:26:35 UTC
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
Comment 2 Pavel Holejsovsky 2010-09-04 07:29:22 UTC
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->'.
Comment 3 Pavel Holejsovsky 2010-09-04 07:31:54 UTC
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.
Comment 4 Pavel Holejsovsky 2010-09-04 07:33:53 UTC
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.
Comment 5 Pavel Holejsovsky 2010-09-04 19:41:48 UTC
(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.
Comment 6 Pavel Holejsovsky 2010-09-06 15:03:08 UTC
Created attachment 169581 [details] [review]
Adds more missing annotations

Annotates 'repository' parameter in most Repository methods as optional.
Comment 7 Pavel Holejsovsky 2010-09-10 13:49:10 UTC
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.
Comment 8 Johan (not receiving bugmail) Dahlin 2010-09-13 14:04:07 UTC
Review of attachment 169949 [details] [review]:

Looks good to me
Comment 9 André Klapper 2015-02-07 17:00:16 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]