llancet has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks!
I'm going to write some kind of drawing library using Cairo, and I want to create a Perl wrapper for my lib. It would have some method functions like this:
class MyPage { MyPage(cairo_t* context); }
In which, functions of my code have arguments of Cairo's type. I know there's already a Cairo wrapper for perl in CPAN, so I want to have my wrapped code can work like this:
use Cairo; use MyLib; ...... my $context = Cairo::Context->create(...); my $page = MyLib::MyPage->new($context);
However, to achieve this, the XS code of mine must have the knowledge of how Cairo's XS code do the wrap. As I'm not experienced on XS, I need some suggests on it. Thanks for a lot!!
In addition, I noticed that SWIG is another choice for wrapper creation. However Cairo is wrapped using XS, so maybe I have to use XS too?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to let my XS module interact with existing XS module?
by llancet (Friar) on Aug 16, 2013 at 02:07 UTC | |
|
Re: How to let my XS module interact with existing XS module?
by llancet (Friar) on Aug 16, 2013 at 07:18 UTC | |
by Anonymous Monk on Aug 16, 2013 at 07:44 UTC |