1 ;; Common Lisp bindings for librsvg
2 ;; Copyright 2005 Espen S. Johnsen <espen@users.sf.net>
4 ;; Permission is hereby granted, free of charge, to any person obtaining
5 ;; a copy of this software and associated documentation files (the
6 ;; "Software"), to deal in the Software without restriction, including
7 ;; without limitation the rights to use, copy, modify, merge, publish,
8 ;; distribute, sublicense, and/or sell copies of the Software, and to
9 ;; permit persons to whom the Software is furnished to do so, subject to
10 ;; the following conditions:
12 ;; The above copyright notice and this permission notice shall be
13 ;; included in all copies or substantial portions of the Software.
15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 ;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 ;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 ;; $Id: rsvg.lisp,v 1.2 2006/02/08 22:21:26 espen Exp $
28 (eval-when (:compile-toplevel :load-toplevel :execute)
30 (defclass dimension-data (struct)
34 :accessor dimension-data-width
39 :accessor dimension-data-height
44 :accessor dimension-data-em
49 :accessor dimension-data-ex
51 (:metaclass struct-class))
54 (defclass handle (proxy)
57 :getter "rsvg_handle_get_base_uri"
58 :setter "rsvg_handle_set_base_uri"
59 :accessor handle-base-uri
63 :getter handle-get-dimensions
64 :reader handle-dimensions
68 :getter "rsvg_handle_get_title"
73 :getter "rsvg_handle_get_desc"
74 :reader handle-description
78 :getter "rsvg_handle_get_metadata"
79 :reader handle-metadata
81 (:metaclass proxy-class))
85 (defbinding init () nil)
86 (defbinding term () nil)
88 (defbinding set-default-dpi () nil
92 (defbinding handle-set-dpi () nil
98 (defbinding handle-get-dimensions (handle &optional (dimensions (make-instance 'dimension-data))) nil
100 (dimensions dimension-data :return))
104 (defbinding handle-close () boolean
108 (defbinding %handle-new () pointer)
110 (defbinding %handle-new-from-file () pointer
114 (defmethod initialize-instance ((handle handle) &key filename)
115 (multiple-value-bind (location gerror)
117 (filename (%handle-new-from-file filename))
120 (signal-gerror gerror)
121 (setf (foreign-location handle) location)))
125 (defbinding %handle-free () nil
128 (defmethod unreference-foreign ((class (eql (find-class 'handle))) location)
129 (%handle-free location))
136 (defbinding cairo-render () nil