[cairo] Gauche-cairo 0.1.0 released

TOKUNAGA Hiroyuki tkng at xem.jp
Tue Dec 14 11:36:06 PST 2004


Hi, 

I made a new cairo binding. It's for Gauche, a scheme interpreter.

You can download Gauche-cairo-0.1.0 from:
  http://xem.jp/~tkng/Gauche-cairo-0.1.0.tar.gz
  sha1sum: cfbaecd0297c04a68623ea4a8fecba86ce2a4ef5  Gauche-cairo-0.1.0.tar.gz

Unfortunatelly there's no document for Gauche-cairo yet, but function
name mapping from C to Scheme is straightforward. So you can use it with
Cairo's API document.

 - Replace underbar with hyphen.
 - Replace cairo_t with <cairo>, cairo_surface_t with <cairo-surface>

It's still in experimental development stage, so there are some
restrictions. Currently, usable backend is only two, png backend and ps
backend.

Sample in C:

  cairo_t *cr = cairo_create();
  FILE *fp = fopen(fp, "w");
  cairo_surface_t *surface = cairo_png_surface_create(fp, CAIRO_FORMAT_ARGB32, 256 256);
  cairo_set_target_surface(cr, surface);

  /* draw something */

  cairo_show_page(cr);
  fclose(fp);

Sample in Scheme.

  (define cr (cairo-create))
  (define port (open-output-file "test.png" :buffering :none))
  (define surface (cairo-png-surface-create port CAIRO_FORMAT_ARGB32 512 512))
  (cairo-set-target-surface cr surface)

  ;; draw something

  (cairo-show-page cr)
  (cairo-close-port p)

For more details, see sample.scm.


Regards,

-- 
TOKUNAGA Hiroyuki
tkng at xem.jp
http://kodou.net/



More information about the cairo mailing list