((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/cairo" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg") (toc)) (section 2 "cairo" (p "Chicken bindings for Cairo, a vector graphics library.") (section 3 "Usage" (highlight scheme "(require-extension cairo)")) (section 3 "Documentation" (p "To build this extension, you will need a current version of " (link "http://cairo.freedesktop.org/" "cairo") ". To build/run the test-program, the " (int-link "sdl") " egg is required.") (p "Currently there is no documentation, see the source-files for more information.")) (section 3 "Examples" (p "By " (int-link "/users/christian-kellermann" "Christian Kellermann") ":") (highlight scheme "(import scheme (chicken base) cairo miscmacros (chicken random))\n\n(define *rotation* 0)\n(define *delta* 2.7)\n(define *width* 18)\n(define *height* 26)\n(define *box-size* 15)\n\n(define s (cairo-pdf-surface-create \"schotter.pdf\" 842 1190)) ; A3\n(define c (cairo-create s))\n\n;; use millimeters as units from here on\n(cairo-scale c (/ 72 25.4) (/ 72 25.4))\n(cairo-set-source-rgba c 1 0 0 1)\n\n(dotimes (y *height*)\n  (dotimes (x *width*)\n    (cairo-save c)\n    (cairo-set-line-width c .3)\n    (cairo-translate c (+ 12 (* x *box-size*)) (+ 16 (* y *box-size*)))\n    (cairo-rotate c (* (if (> 1 (pseudo-random-integer 2)) -1 1)\n                       (/ cairo-pi 180)\n                       (* *rotation*  (pseudo-random-real))))\n    (cairo-rectangle c 0 0 *box-size* *box-size*)\n    (cairo-set-source-rgba c 0 0 0 1)\n    (cairo-stroke c)\n    (cairo-restore c))\n  (set! *rotation* (+ *rotation* *delta*)))\n\n(cairo-surface-show-page s)\n(cairo-destroy c)\n(cairo-surface-finish s)\n(cairo-surface-destroy s)") (p "Output:") (p (image-link "//www.call-cc.org/img/cairo/georg-nees.png"))) (section 3 "Author" (p "Michael Bridgen and Tony Garnock-Jones")) (section 3 "Version History" (dl (dt "0.1.15") (dd "Support for blend mode operators thanks to Matt Gushee") (dt "0.1.14") (dd "Support for rectangle-from-surface and mask-surface procedure") (dt "0.1.13") (dd "Support for pdf/svg/ps surfaces, thanks to Markus Klotzbücher, get-width, get-height for surfaces added, FFI bugfixes.") (dt "0.1.12") (dd "Bugfix for #762, fixes record-printers, thanks to Markus Klotzbücher, Peter and Felix") (dt "0.1.11") (dd "Fix wrong pointer type in FFI") (dt "0.1.10") (dd "also mark linker options returned by pkg-config, so -pthread gets recognised as linker option ") (dt "0.1.9") (dd "parses options returned by pkg-config (thanks to bpowers)") (dt "0.1.8") (dd "fixed use of removed foreign type " (tt "pointer")) (dt "0.1.7") (dd (tt "cairo.setup") " bug fix regarding to eggdoc obsolete code") (dt "0.1.6") (dd "Fixed incorrect SDL-header include in test-cairo.scm (thanks to Markus Klotzbuecher)") (dt "0.1.4 (alpha)") (dd "PNG and additional surface functions by Michael McDermott") (dt "0.1.3 (alpha)") (dd "Initial release"))) (section 3 "License" (pre "Copyright (C) 2004, 2005 Michael Bridgen and Tony Garnock-Jones\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA"))))