Re: Perl bindings for libaosd: v0.01



Torsten Schoenfeld wrote:

It doesn't use GObject to implement its own objects, so it won't be
completely fool-proof to write bindings.  It's still not really hard,
and you don't need that much C experience.  So just give it a try.  Look
at other bindings.  Read some things about Perl's extension language XS.
Ask questions on this list.

Ok, so I did and so I'll do ;)

I wrote a first version binding the elementary stuff, so at least the 
test suite produces a black OSD rectangle (wow, I'm a hero :). For now 
you can download this well undocumented version here:

  http://www.exit1.org/packages/X11-Aosd/X11-Aosd-0.01.tar.gz

  (any comments are welcome how to do things better)

But in this state it's quite unusable and I'd appreciate some help. Next
thing is to add the Cairo stuff, which is realized using a callback in 
libaosd:

The callback:

  typedef void (*AosdRenderer)(cairo_t* cr, void* user_data);

Passing it to the Aosd object:

  void aosd_set_renderer(Aosd* aosd, AosdRenderer renderer, void* user_data);

My questions are: how do I create such a callback function? How do I 
reference to the Cairo Perl objects? Is it just adding a T_PTROBJ entry
for cairo_t in the typemap and passing a Cairo Perl object?

Thanks,

Jörn

-- 
Think before you code. And while you're doing it probably won't hurt. ;)

Attachment: pgpC3HVDpf9dY.pgp
Description: PGP signature



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