Closed pwaller closed 10 years ago
+1 for me, could you at least elaborate a bit what would be needed to have this working. I can give it a try too if you put me on the right path...
I see that there is some support for GList objects, as seen in returnvalues.py and glib/init.py
I had a go but didn't get very far. I really need this but don't have time to implement it currently, nor can I see exactly how to do it.
Have you got any answer from pgi's maintainer since then ?
@vincele, nope.
Sorry, I'm busy with other projects atm.
It's basically:
OK, but this is a little bit terse for me. Could you elaborate a bit ?
For example, explain what is the GList code already present in pgi for ?
And what the points you cited mean in terms of code, f.e. :
not something in depth, but sufficient to let someone with very little knowledge of cffi or ctypes start hacking, and come back with better questions next time ;-)
Thanks
For passing GLists to functions:
The ctypes_backend GList type needs to use other types for packing/unpacking/validation the list values like in CArray. You can borrow high level tests from the pygobject test suite (might be that they are already there but skipped, don't know)
It's a bit of a mess right now for those non basic types... needs refactoring I guess. Any feedback welcome.
Where do you want to use pgi btw?
Thanks a lot. I try to run meld (meld.sf.net) with pypy, to see if the speed will get better. This is mostly for my own curiosity, but could eventually become interesting for upstreaming...
I want to use it for the Poppler API, e.g. http://people.freedesktop.org/~ajohnson/docs/poppler-glib/PopplerPage.html
GList * poppler_page_get_text_attributes (PopplerPage *page);
Wow, this looks like it works, awesome!
It's not currently possible to call functions returning a
GList
type. I'm tempted to have a go at implementing this, but if you don't hear from me in the very near future assume I haven't.