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 669686 - Add better introspectable API
Add better introspectable API
Status: RESOLVED DUPLICATE of bug 639908
Product: libgee
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: libgee-maint
libgee-maint
Depends on: 639908
Blocks:
 
 
Reported: 2012-02-08 15:50 UTC by Abderrahim Kitouni
Modified: 2012-08-12 07:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add Iterator.get_value (8.61 KB, patch)
2012-02-08 15:51 UTC, Abderrahim Kitouni
none Details | Review

Description Abderrahim Kitouni 2012-02-08 15:50:53 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.
Comment 1 Abderrahim Kitouni 2012-02-08 15:51:35 UTC
Created attachment 207120 [details] [review]
add Iterator.get_value

This is a proof of concept for better introspectable API for Iterator.get
Comment 2 Maciej (Matthew) Piechotka 2012-02-10 09:23:50 UTC
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
Comment 3 Abderrahim Kitouni 2012-02-15 19:46:05 UTC
(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.
Comment 4 Abderrahim Kitouni 2012-02-15 20:12:32 UTC
I've just seen bug 639908, and it doesn't look promising :(
Comment 5 Maciej (Matthew) Piechotka 2012-02-15 23:27:30 UTC
(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.
Comment 6 Maciej (Matthew) Piechotka 2012-08-12 07:39:58 UTC
Marking as duplicate as it should be solved on different layer.

*** This bug has been marked as a duplicate of bug 639908 ***