Re: Announcing: Perl bindings for LibSoup



On 25.05.2011 23:18, Emmanuel Rodriguez wrote:
But since WebKit also supports gobject-introspection, why not use it that
way as well?  It's still a little rough around the edges, but here's your
browser.pl example ported to use the introspection stuff.

The introspection framework really looks nice. Your examples show that
it's very easy to write the bindings for arbitrary C C libraries quite
easily. What's the catch?  ;) Are there bugs or unimplemented parts?
This is too nice to be true.

Well, all this has been cooking for a while: about six years. But there are some rough edges remaining, some in gobject-introspection itself, many in the Perl bindings. Nothing insurmountable though.

This is the future of language bindings (in a GNOME context at least).

Is there a way to provide custom made XS methods to an introspection
perl package? For instance, SoupMessageBody is defined as:

typedef struct {
        const char *data;
        goffset     length;
} SoupMessageBody;

And provides no accessor for data or length. Is there a way to
complete the introspection binding with extra XS methods?
If so do you know of an existing cpan package that does this?

Adding custom XS methods is no problem: just write them as you normally would. But in the case you mention, that's not necessary. gobject-introspection provides the means to get and set public fields of boxed types. I don't remember right now how good the support for that is in the Perl bindings, however.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]