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

[libcaca] Term::Caca - a perl wrapper around libcaca



To Sam and users of libcaca,

I've written a perl wrapper around libcaca that is about 90% complete. When I put the finishing touches on it, I'm going to put it on CPAN (http://search.cpan.org/). However, before I do that, I wanted to let the people on this list have a sneak preview of my work in progress.

So far, I've wrapped every documented function in libcaca except caca_set_bitmap_palette and caca_draw_bitmap. I haven't done these, because I would like to implement a way for C arrays to be shared between the Perl side and the C side in a way that feels natural for both languages.

In the Term::Caca distribution, I'm also going to include Term::Caca::Sprite and Term::Caca::Bitmap which will be classes for dealing with the caca_sprite and caca_bitmap structs. These have not been implemented, yet.

To build the Term::Caca extension, do the following:

tar zxvf Term-Caca-0.9_1.tar.gz
cd Term-Caca-0.9_1
perl Build.PL
./Build

In the top-level directory, I've included a script called 'x.pl' that then does a few things with Term::Caca. Try to run it and see if it works.

Those of you familiar with perl may know that the ./Build script can be used to install modules into the system directories by saying `./Build install`, but I don't recommend doing this at the moment, because the module still needs work.

Let me know what you think.

PS: Sam, I noticed this in the README of libcaca:

"As the API is not stable yet, everyone should statically link libcaca with their programs or libraries. DO NOT DISTRIBUTE SHARED VERSIONS
OF LIBCACA."

The C portions of Term::Caca statically link to libcaca, but the end result is something that is dynamically loaded. This allows perl scripts to say "use Term::Caca" and get the appropriate functionality imported into their script.

What is your opinion of this?  Is this a 'shared' version of libcaca?

--
This is the libcaca mailing-list, see http://sam.zoy.org/projects/libcaca/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://sam.zoy.org/projects/libcaca/threads.html