GNOME Bugzilla – Bug 669686
Add better introspectable API
Last modified: 2012-08-12 07:39:58 UTC
Currently libgee (and more generally any library using Vala generics) cannot be used from GI based bindings. See the following threads http://mail.gnome.org/archives/libgee-list/2012-January/msg00006.html http://mail.gnome.org/archives/python-hackers-list/2012-February/msg00006.html This is a proof of concept for better introspectable API: I've added a new method Iterator.get_value that returns a GValue instead of a pointer. The same can be done for other such methods.
Created attachment 207120 [details] [review] add Iterator.get_value This is a proof of concept for better introspectable API for Iterator.get
I am not entirely convinced - why stop at get? Why not find_value/remove_value/.... At the end we would have to have two identical APIs - one in terms of G and one in terms of Value. The better solutions would be: 1. Add generics to GIR 2. Make Vala generate those methods automatically 3. Default to GTypeable in GIR bindings
(In reply to comment #2) > I am not entirely convinced - why stop at get? Why not > find_value/remove_value/.... It's just a proof of concept, I just wanted to know whether this is acceptable for libgee or not. > At the end we would have to have two identical > APIs - one in terms of G and one in terms of Value. Yes, I don't really like this solution either, but that's what I can do for now. > The better solutions would be: > > 1. Add generics to GIR > 2. Make Vala generate those methods automatically > 3. Default to GTypeable in GIR bindings I don't quite follow what you're saying here, are these three possible solutions or only one? Anyway, adding generics support to GI seems really hard to me.
I've just seen bug 639908, and it doesn't look promising :(
(In reply to comment #3) > (In reply to comment #2) > > I am not entirely convinced - why stop at get? Why not > > find_value/remove_value/.... > > It's just a proof of concept, I just wanted to know whether this is acceptable > for libgee or not. > As a concept - yes. As actual implementation - no as it would required duplication of API. > > The better solutions would be: > > > > 1. Add generics to GIR > > 2. Make Vala generate those methods automatically > > 3. Default to GTypeable in GIR bindings > > I don't quite follow what you're saying here, are these three possible > solutions or only one? Anyway, adding generics support to GI seems really hard > to me. 3 separate solutions.
Marking as duplicate as it should be solved on different layer. *** This bug has been marked as a duplicate of bug 639908 ***