[cairo] ruby binding

Øyvind Kolås islewind at gmail.com
Wed Dec 1 14:12:28 PST 2004


On Sat, 27 Nov 2004 18:31:52 -0500, MenTaLguY <mental at rydia.net> wrote:
> Mine is in Inkscape CVS, browseable at:
> 
> It's a very thin wrapper, so I'm not sure how much there is to reuse,
> per se.  But have a look.

Looks good, the most important thing is to bind the core cairo API,
and your binding seems (like Evan has mentioned), more complete. I
think the fact that it
is a thin wrapper is good, since keeping the drawing model between
different languages consistent is good.

I haven't had much time to work on the ruby cairo binding, except
initial work to
make it easier to install. But the code is still in need of some restructuring.

The canvas I have been experimenting should work without changes, the
gtkcairo binding will probably only need minor modificaitons before
recompiling.

The portions I think need some thought is how various backends are integrated,
having subclasses for the png|ps|x11|buffer backends might be an idea.

I see two primary uses for cairo from ruby, one is generating PNG
images, the other is user interfaces, for user interfaces input
handling is the problem that the handling for is least obvious, I have
been using gtkcairo and thus the gtk+ bindings for ruby to handle
input (this is what I do in my canvas). A better option might be using
SDL since it is probably more platform independent and a lighter
dependency, but hardware acceleration will be lost.

I might find some time to look at this in the coming weekend, no
guarantees though, and it would be a very pleasant surprise to have
more code to play with at the time ;)

/pippin

-- 
Software patents hinder progress | http://swpat.ffii.org/ 
Web :  http://pippin.gimp.org/



More information about the cairo mailing list