* ANN: guile-cairo 1.3.90 released
@ 2007-05-18 17:58 Andy Wingo
0 siblings, 0 replies; only message in thread
From: Andy Wingo @ 2007-05-18 17:58 UTC (permalink / raw)
To: guile-user; +Cc: cairo
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
Hey all,
I've just cut the first release of guile-cairo, wrapping the Cairo
graphics library for Guile Scheme.
Download: http://download.gna.org/guile-cairo/guile-cairo-1.3.90.tar.gz
Web page: http://home.gna.org/guile-cairo
Sign up for commit mails:
https://code.launchpad.net/~andywingo/guile-cairo/trunk/+subscribe
More about cairo: http://cairographics.org/
More about guile: http://www.gnu.org/software/guile/
Please follow up to only one of the two lists :)
I'm attaching the readme. Have fun!
Andy.
--
http://wingolog.org/
[-- Attachment #2: README --]
[-- Type: text/x-readme, Size: 4097 bytes --]
Guile-Cairo README
Last updated 18 May 2007.
About Guile-Cairo
=================
Guile-Cairo wraps the Cairo graphics library for Guile Scheme.
A pasteable introduction to using Guile-Cairo
=============================================
;; Paste this into your guile interpreter!
;; This wrapset defines a module `(cairo)'
(use-modules (cairo))
;; Cairo procedures all start with `cairo-'
(cairo-version-string)
;; => "1.4.2"
;; For most useful things, you have to make a surface first
(define surf (cairo-image-surface-create 'argb32 140 100))
;; Given a surface, you can create a cairo context, and start drawing
(define cr (cairo-create surf))
;; You then need to make a source
(cairo-select-font-face cr "Bitstream Vera Sans" 'normal 'normal)
(cairo-scale cr 100 100)
(define pat (cairo-pattern-create-linear 0 0 1 1))
(cairo-pattern-add-color-stop-rgba pat 1 1 0 0 1)
(cairo-pattern-add-color-stop-rgba pat 0 0 0 1 1)
(cairo-set-source cr pat)
;; Then you make your mask
(cairo-set-font-size cr 0.4)
(cairo-move-to cr 0.0 0.6)
(cairo-show-text cr "(cairo)")
;; Finally you can write the surface out to a file if you want
(cairo-surface-write-to-png surf "/tmp/guile-cairo.png")
;; Enumerated types are represented as symbols. The available set of
;; symbols for any given type can be retrieved at runtime
(cairo-format-get-values)
;; => (argb32 rgb24 a8 a1)
;; That's it!
Notes
=====
Guile-Cairo wraps almost all of Cairo's procedures. Notable exceptions
include functions that read or write from streams instead of files and
raw access to image data.
Guile-Cairo wraps all of Cairo's types. As mentioned above, enumerated
values are represented by symbols, but functions accept integers as
well. Struct types like cairo_rectangle_t are represented as vectors.
Constructors of the form cairo-make-rectangle are provided, as well as
accessors like cairo-rectangle:x.
Using Guile-Cairo's C interface
===============================
These days Cairo forms a part of many software stacks; its types are
seen in the APIs of a number of other libraries. Guile-Cairo provides an
interface to represent all cairo C types as scheme values.
To build against this library in your C program, first you will need to
get the CFLAGS and LDFLAGS to link against libguile-cairo. Autoconf
users should use:
PKG_CHECK_MODULES(GUILE_CAIRO, guile-cairo >= 1.3.0)
AC_SUBST(GUILE_CAIRO_CFLAGS)
AC_SUBST(GUILE_CAIRO_LDFLAGS)
In your C files you should then:
#include <guile-cairo.h>
The type wrapping functions are all in the form scm_to_TYPE and
scm_from_TYPE, where TYPE could be cairo_surface, for example. For
vector types there is also scm_fill_TYPE, which expects you to have an
already-allocated structure to fill. Additionally there are
scm_take_TYPE functions that will take ownership of the pointer in
question, for example for constructors and for non-refcounted opaque
objects like cairo_font_options_t.
Copying Guile-Cairo
===================
Distribution of Guile-Cairo is under the LGPL. See the COPYING file for
more information.
Contact info
============
Mailing List: guile-user@gnu.org
Homepage: http://home.gna.org/guile-cairo/
Download: http://home.gna.org/guile-cairo/download/
Build dependencies
==================
* Guile 1.8.0 or newer
http://www.gnu.org/software/guile/
* Cairo 1.4.0 or newer
http://cairographics.org/
Installation quickstart
=======================
Install using the standard autotools incantation:
./configure --prefix=/opt/guile-cairo && make && make install.
Build from CVS or Arch using ./autogen.sh --prefix=/opt/guile-cairo && make.
You can run without installing, just run './env guile'.
Copying this file
=================
Copyright (C) 2007 Andy Wingo <wingo pobox.com>
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved.
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-18 17:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-18 17:58 ANN: guile-cairo 1.3.90 released Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).