pygobject / pgi

[Unmaintained: Use PyGObject instead] GTK+ / GObject Introspection Bindings for PyPy.
GNU Lesser General Public License v2.1
74 stars 16 forks source link

Add Poppler override for Page.get_text_layout #7

Closed pwaller closed 10 years ago

pwaller commented 10 years ago

This is a workaround for #4.

The return type is a ctypes array pointing at the underlying memory which is correctly freed when there are no remaining references to that array.

pwaller commented 10 years ago

Sorry, I forced a few fixes since I sent the PR.

lazka commented 10 years ago

If it works for you, sure.

Wouldn't it be better to fix poppler, or special case by function name during code generation?

pwaller commented 10 years ago

Would it? I think it might be more obscure if it is hidden in the code generation.

I would love to fix the code generation, but I still can't tell where the bug is exactly or what the correct thing to do is. Really, returning an array is the best performing thing one can do and I can't see is doing code generation to produce a Rectangle struct, can we?