1 ;; Common Lisp bindings for Cairo
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: cairo.lisp,v 1.18 2007/10/31 11:52:53 espen Exp $
27 (eval-when (:compile-toplevel :load-toplevel :execute)
28 (define-enum-type surface-format :argb32 :rgb24 :a8 :a1)
29 (define-enum-type content :color :alpha :color-alpha)
30 (define-enum-type svg-version :svg-1.1 :svg-1.2)
32 (define-enum-type status
33 :success :no-memory :invalid-restore :invalid-pop-group
34 :no-current-point :invalid-matrix :invalid-status :null-pointer
35 :invalid-string :invalid-path-data :read-error :write-error
36 :surface-finished :surface-type-mismatch :pattern-type-mismatch
37 :invalid-content :invalid-format :invalid-visual :file-not-found
40 (define-enum-type fill-rule :winding :even-odd)
41 (define-enum-type line-cap :butt :round :square)
42 (define-enum-type line-join :miter :round :bevel)
43 (define-enum-type font-slant :normal :italic :oblique)
44 (define-enum-type font-weight :normal :bold)
46 (define-enum-type operator
47 :clear :source :over :in :out :atop :dest :dest-over
48 :dest-in :dest-out :dest-atop :xor :add :saturate)
50 (define-enum-type antialias :default :none :gray :subpixel)
51 (define-enum-type extend :none :repeat :reflect)
52 (define-enum-type filter :fast :good :best :nearest :bilinear :gaussian)
53 (define-enum-type subpixel-order :default :rgb :bgr :vrgb :vbgr)
54 (define-enum-type hint-style :default :none :slight :medium :full)
55 (define-enum-type hint-metrics :default :off :on)
58 (define-enum-type surface-type
59 image-surface pdf-surface ps-surface xlib-surface xcb-surface
60 glitz-surface quartz-surface win32-surface beos-surface
61 directfb-surface svg-surface os2-surface)
63 (defclass surface-class (proxy-class)
66 (defmethod validate-superclass ((class surface-class) (super standard-class))
67 (subtypep (class-name super) 'surface))
69 (defclass glyph (struct)
85 (:metaclass struct-class))
87 (defclass font-face (ref-counted-object)
89 (:metaclass proxy-class)
90 (:ref %font-face-reference)
91 (:unref %font-face-destroy))
93 (defclass font-options (ref-counted-object)
96 :getter "font_options_get_antialias"
97 :setter "font_options_set_antialias"
98 :accessor font-options-antialias
102 :getter "font_options_get_subpixel_order"
103 :setter "font_options_set_subpixel_order"
104 :accessor font-options-subpixel-order
105 :type subpixel-order)
108 :getter "font_options_get_hint_style"
109 :setter "font_options_set_hint_style"
110 :accessor font-options-hint-style
114 :getter "font_options_get_hint_metrics"
115 :setter "font_options_set_hint_metrics"
116 :accessor font-options-hint-metrics
118 (:metaclass proxy-class)
119 (:ref %font-options-reference)
120 (:unref %font-options-destroy))
122 (defclass scaled-font (ref-counted-object)
124 (:metaclass proxy-class)
125 (:ref %scaled-font-reference)
126 (:unref %scaled-font-destroy))
128 (defclass matrix (struct)
129 ((xx :allocation :alien :initarg :xx :initform 1.0
130 :accessor matrix-xx :type double-float)
131 (yx :allocation :alien :initarg :yx :initform 0.0
132 :accessor matrix-yx :type double-float)
133 (xy :allocation :alien :initarg :xy :initform 1.0
134 :accessor matrix-xy :type double-float)
135 (yy :allocation :alien :initarg :yy :initform 0.0
136 :accessor matrix-yy :type double-float)
137 (x0 :allocation :alien :initarg :x0 :initform 0.0
138 :accessor matrix-x0 :type double-float)
139 (y0 :allocation :alien :initarg :y0 :initform 0.0
140 :accessor matrix-y0 :type double-float))
141 (:metaclass struct-class))
143 (defclass font-extents (struct)
144 ((ascent :allocation :alien :reader font-extents-ascent :type double-float)
145 (descent :allocation :alien :reader font-extents-descent :type double-float)
146 (height :allocation :alien :reader font-extents-height :type double-float)
147 (max-x-advance :allocation :alien :reader font-extents-max-x-advance :type double-float)
148 (max-y-advance :allocation :alien :reader font-extents-max-y-advance :type double-float))
149 (:metaclass struct-class))
151 (defclass text-extents (struct)
152 ((x-bearing :allocation :alien :reader text-extents-x-bearing :type double-float)
153 (y-bearing :allocation :alien :reader text-extents-y-bearing :type double-float)
154 (width :allocation :alien :reader text-extents-width :type double-float)
155 (height :allocation :alien :reader text-extents-height :type double-float)
156 (x-advance :allocation :alien :reader text-extents-x-advance :type double-float)
157 (y-advance :allocation :alien :reader text-extents-y-advance :type double-float))
158 (:metaclass struct-class))
160 (defclass pattern (ref-counted-object)
163 :getter "cairo_pattern_get_extend"
164 :setter "cairo_pattern_set_extend"
165 :accessor pattern-extend
169 :getter "cairo_pattern_get_filter"
170 :setter "cairo_pattern_set_filter"
171 :accessor pattern-filter
175 :getter "cairo_pattern_get_matrix"
176 :setter "cairo_pattern_set_matrix"
177 :accessor pattern-matrix
179 (:metaclass proxy-class)
180 (:ref %pattern-reference)
181 (:unref %pattern-destroy))
184 (defclass surface (ref-counted-object)
187 :getter "cairo_surface_get_content"
188 :reader surface-content
190 (:metaclass surface-class))
192 (defclass image-surface (surface)
195 :getter "cairo_image_surface_get_data"
200 :getter "cairo_image_surface_get_format"
201 :reader surface-format
202 :type surface-format)
205 :getter "cairo_image_surface_get_width"
206 :reader surface-width
210 :getter "cairo_image_surface_get_height"
211 :reader surface-height
215 :getter "cairo_image_surface_get_stride"
216 :reader surface-stride
218 (:metaclass surface-class))
220 (defclass xlib-surface (surface)
223 :getter "cairo_xlib_surface_get_width"
224 :reader surface-width
228 :getter "cairo_xlib_surface_get_height"
229 :reader surface-height
231 (:metaclass surface-class))
233 (defclass pdf-surface (surface)
235 (:metaclass surface-class))
237 (defclass ps-surface (surface)
239 (:metaclass surface-class))
241 (defclass svg-surface (surface)
243 (:metaclass surface-class))
246 (defclass context (ref-counted-object)
249 :getter "cairo_get_target"
254 :getter "cairo_get_source"
255 :setter "cairo_set_source"
260 :getter "cairo_get_antialias"
261 :setter "cairo_set_antialias"
266 :getter "cairo_get_tolerance"
267 :setter "cairo_set_tolerance"
272 :getter "cairo_get_fill_rule"
273 :setter "cairo_set_fill_rule"
278 :getter "cairo_get_line_width"
279 :setter "cairo_set_line_width"
284 :getter "cairo_get_line_cap"
285 :setter "cairo_set_line_cap"
290 :getter "cairo_get_line_join"
291 :setter "cairo_set_line_join"
296 :getter "cairo_get_miter_limit"
297 :setter "cairo_set_miter_limit"
298 :accessor miter-limit
302 :getter "cairo_get_font_matrix"
303 :setter "cairo_set_font_matrix"
304 :accessor font-matrix
308 :getter "cairo_get_font_options"
309 :setter "cairo_set_font_options"
310 :accessor font-options
314 :getter "cairo_get_font_face"
315 :setter "cairo_set_font_face"
320 :getter "cairo_get_operator"
321 :setter "cairo_set_operator"
327 :setter "cairo_set_matrix"
328 :writer (setf matrix)
331 (:metaclass proxy-class)
336 (defclass path (struct)
337 ((status :allocation :alien :type status)
338 (data :allocation :alien :type pointer)
339 (length :allocation :alien :type int))
340 (:metaclass proxy-class)
341 (:unref %path-destroy)))
346 (defmethod allocate-foreign ((context context) &key target)
347 (%create-context target))
349 (defbinding (%create-context "cairo_create") () pointer
352 (defbinding %reference () pointer
355 (defbinding %destroy () nil
358 (defbinding (save-context "cairo_save") () nil
361 (defbinding (restore-context "cairo_restore") () nil
364 (defmacro with-context ((cr &optional var) &body body)
365 (let ((context (or var (make-symbol "CONTEXT"))))
366 `(let ((,context ,cr))
367 (save-context ,context)
370 (restore-context ,context)))))
372 (defbinding status () status
375 (defun ensure-color-component (component)
378 (integer (/ component 256.0))))
380 (defbinding (set-source-color "cairo_set_source_rgba") (cr red green blue &optional (alpha 1.0)) nil
382 ((ensure-color-component red) double-float)
383 ((ensure-color-component green) double-float)
384 ((ensure-color-component blue) double-float)
385 ((ensure-color-component alpha) double-float))
387 (defbinding set-source-surface (cr surface &optional (x 0.0) (y 0.0)) nil
393 (defun set-source (cr source)
395 (pattern (setf (source cr) source))
396 (surface (set-source-surface cr source))
397 (null (set-source-color cr 0.0 0.0 0.0))
398 (list (apply #'set-source-color cr source))
399 (vector (apply #'set-source-color cr (coerce source 'list)))))
401 (defbinding set-dash (cr dashes &optional (offset 0.0)) nil
403 (dashes (vector double-float))
404 ((length dashes) int)
405 (offset double-float))
407 (defbinding (paint "cairo_paint_with_alpha") (cr &optional (alpha 1.0)) nil
409 (alpha double-float))
411 (defbinding mask () nil
415 (defbinding mask-surface () nil
418 (surface-x double-float)
419 (surface-y double-float))
421 (defmacro defoperator (name &optional clip-p)
422 (let ((iname (intern (format nil "%~A" name)))
423 (pname (intern (format nil "%~A-PRESERVE" name))))
425 (defbinding ,iname () nil
427 (defbinding ,pname () nil
429 (defun ,name (cr &optional preserve)
434 (let ((tname (intern (format nil "IN-~A-P" name)))
435 (ename (intern (format nil "~A-EXTENTS" name))))
437 (defbinding ,tname () boolean
441 (defbinding ,ename () nil
443 (x1 double-float :out)
444 (y1 double-float :out)
445 (x2 double-float :out)
446 (y2 double-float :out))))))))
452 (defbinding reset-clip () nil
455 (defbinding copy-page () nil
458 (defbinding show-page () nil
464 (defbinding %path-destroy () nil
467 (defbinding copy-path () path
470 (defbinding copy-path-flat () path
473 (defbinding append-path () nil
477 (defbinding get-current-point () nil
479 (x double-float :out)
480 (y double-float :out))
482 (defbinding new-path () nil
485 #?(pkg-exists-p "cairo" :atleast-version "1.2")
486 (defbinding new-sub-path () nil
489 (defbinding close-path () nil
492 (defmacro defpath (name args &optional relative-p)
493 (flet ((def (name type)
495 ,(when (eq type 'optimized-double-float)
496 `(declaim (inline ,(first name))))
497 (defbinding ,name () nil
499 ,@(mapcar #'(lambda (arg) (list arg type)) args)))))
502 ,(def name 'double-float)
503 ,(let ((name (intern (format nil "FAST-~A" name)))
504 (cname (gffi::default-alien-fname name)))
505 (def (list name cname) 'optimized-double-float))
507 (let* ((rel-name (intern (format nil "REL-~A" name)))
508 (fast-rel-name (intern (format nil "FAST-REL-~A" name)))
509 (cname (gffi::default-alien-fname rel-name)))
511 (def rel-name 'double-float)
512 (def (list fast-rel-name cname) 'optimized-double-float)))))))
515 (defpath arc (xc yc radius angle1 angle2))
516 (defpath arc-negative (xc yc radius angle1 angle2))
517 (defpath curve-to (x1 y1 x2 y2 x3 y3) t)
518 (defpath line-to (x y) t)
519 (defpath move-to (x y) t)
520 (defpath rectangle (x y width height))
522 (defun circle (cr x y radius &optional negative-p)
523 (move-to cr radius 0.0d0)
525 (arc-negative cr x y radius (* pi 2) 0.0d0)
526 (arc cr x y radius 0.0d0 (* pi 2)))
530 (defbinding glyph-path (cr glyphs) nil
532 (glyphs (vector glyph))
533 ((length glyphs) int))
535 (defbinding text-path () nil
543 (defbinding (pattern-add-color-stop "cairo_pattern_add_color_stop_rgba")
544 (pattern offset red green blue &optional (alpha 1.0)) nil
546 (offset double-float)
547 ((ensure-color-component red) double-float)
548 ((ensure-color-component green) double-float)
549 ((ensure-color-component blue) double-float)
550 ((ensure-color-component alpha) double-float))
552 (defbinding (pattern-create "cairo_pattern_create_rgba")
553 (red green blue &optional (alpha 1.0)) pattern
554 ((ensure-color-component red) double-float)
555 ((ensure-color-component green) double-float)
556 ((ensure-color-component blue) double-float)
557 ((ensure-color-component alpha) double-float))
559 (defbinding pattern-create-for-surface () pattern
562 (defbinding pattern-create-linear () pattern
568 (defbinding pattern-create-radial () pattern
571 (radius0 double-float)
574 (radius1 double-float))
576 (defbinding %pattern-reference () pointer
579 (defbinding %pattern-destroy () nil
582 (defbinding pattern-status () status
589 (defbinding translate () nil
594 (defbinding scale (cr sx &optional (sy sx)) nil
599 (defun scale-to-device (cr &optional keep-rotation-p)
601 (multiple-value-bind (dx dy) (device-to-user-distance cr 1.0 0.0)
602 (scale cr (sqrt (+ (* dx dx) (* dy dy)))))
603 (multiple-value-bind (x y)
606 (multiple-value-call #'user-to-device cr (get-current-point cr)))
608 (translate cr x y))))
610 (defbinding rotate () nil
612 (angle double-float))
614 (defbinding transform () nil
618 (defbinding (matrix "cairo_get_matrix") () nil
620 ((make-instance 'matrix) matrix :in/return))
622 (defbinding identity-matrix () nil
625 (defbinding user-to-device () nil
627 (x double-float :in/out)
628 (y double-float :in/out))
630 (defbinding user-to-device-distance (cr dx &optional (dy dx)) nil
632 (dx double-float :in/out)
633 (dy double-float :in/out))
635 (defbinding device-to-user () nil
637 (x double-float :in/out)
638 (y double-float :in/out))
640 (defbinding device-to-user-distance (cr dx &optional (dy dx)) nil
642 (dx double-float :in/out)
643 (dy double-float :in/out))
648 (defbinding select-font-face () nil
652 (weight font-weight))
654 (defbinding set-font-size () nil
658 (defbinding show-text () nil
662 (defbinding show-glyphs () nil
664 (glyphs (vector glyph))
665 ((length glyphs) int))
667 (defbinding font-extents (cr &optional (extents (make-instance 'font-extents))) nil
669 (extents font-extents :in/return))
671 (defbinding text-extents (cr text &optional (extents (make-instance 'text-extents))) nil
674 (extents text-extents :in/return))
676 (defbinding glyph-extents (cr glyphs &optional (extents (make-instance 'text-extents))) nil
678 (glyphs (vector glyph))
679 ((length glyphs) int)
680 (extents text-extents :in/return))
685 (defbinding %font-face-reference () pointer
688 (defbinding %font-face-destroy () nil
691 (defbinding font-face-status () status
692 (font-face font-face))
698 (defbinding %scaled-font-reference () pointer
701 (defbinding %scaled-font-destroy () nil
704 (defbinding scaled-font-status () status
705 (scaled-font scaled-font))
707 (defbinding scaled-font-extents (scaled-font &optional (extents (make-instance 'text-extents))) nil
708 (scaled-font scaled-font)
709 (extents text-extents :in/return))
711 (defbinding scaled-font-glyph-extents (scaled-font glyphs &optional (extents (make-instance 'text-extents))) nil
712 (scaled-font scaled-font)
713 (glyphs (vector glyph))
714 ((length glyphs) int)
715 (extents text-extents :in/return))
717 (defbinding %scaled-font-create () pointer
718 (font-face font-face)
721 (options font-options))
723 (defmethod allocate-foreign ((scaled-font scaled-font) &key font-face font-matrix cmt options)
724 (%scaled-font-create font-face font-matrix cmt options))
731 (defbinding %font-options-copy () nil
734 (defbinding %font-options-destroy () nil
737 (defbinding font-options-status () status
738 (font-options font-options))
740 (defbinding %font-options-create () pointer)
742 (defmethod allocate-foreign ((font-options font-options) &rest initargs)
743 (declare (ignore initargs))
744 (%font-options-create))
746 (defbinding font-options-merge () nil
747 (options1 font-options :in/return)
748 (options2 font-options))
750 (defbinding font-options-hash () unsigned-int
751 (options font-options))
753 (defbinding font-options-equal-p () boolean
754 (options1 font-options)
755 (options2 font-options))
761 (defmethod make-proxy-instance :around ((class surface-class) location
763 (let ((class (find-class (%surface-get-type location))))
764 (apply #'call-next-method class location initargs)))
766 (defbinding %surface-get-type () surface-type
769 (defbinding %surface-reference () pointer
772 (defbinding %surface-destroy () nil
775 (defmethod reference-function ((class surface-class))
776 (declare (ignore class))
777 #'%surface-reference)
779 (defmethod unreference-function ((class surface-class))
780 (declare (ignore class))
783 (defbinding %surface-set-user-data (surface key data-id) status
785 ((quark-intern key) pointer-data)
786 (data-id pointer-data)
787 (user-data-destroy-callback callback))
789 (defmethod (setf user-data) (data (surface surface) key)
790 (%surface-set-user-data (foreign-location surface) key (register-user-data data))
793 (defbinding %surface-get-user-data () pointer-data
797 (defmethod user-data ((surface surface) key)
798 (find-user-data (%surface-get-user-data surface (quark-intern key))))
800 (defbinding surface-create-similar () surface
802 (format surface-format )
806 (defbinding surface-finish () nil
809 (defbinding surface-flush () nil
812 (defbinding surface-get-font-options () nil
814 ((make-instance 'font-options) font-options :in/return))
816 (defbinding surface-set-device-offset () nil
818 (x-offset double-float)
819 (y-offset double-float))
821 (defbinding surface-status () status
824 (defbinding %surface-mark-dirty () nil
827 (defbinding %surface-mark-dirty-rectangle () nil
834 (defun surface-mark-dirty (surface &optional x y width height)
836 (%surface-mark-dirty-rectangle surface x y width height)
837 (%surface-mark-dirty surface)))
839 (defbinding surface-set-fallback-resolution () nil
841 (x-pixels-per-inch double-float)
842 (y-pixels-per-inch double-float))
844 (define-callback stream-write-func status
845 ((stream-id pointer-data) (data pointer) (length unsigned-int))
846 (let ((stream (find-user-data stream-id)))
849 (map-c-vector 'nil #'(lambda (octet) (write-byte octet stream))
850 data '(unsigned-byte 8) length))
851 ((or symbol function)
853 (map-c-vector 'vector #'identity data '(unsigned-byte 8) length)))))
857 (defmacro with-surface ((surface cr) &body body)
858 `(let ((,cr (make-instance 'context :target ,surface)))
864 ;; Should data be automatically freed when the surface is GCed?
865 (defmethod allocate-foreign ((surface image-surface)
866 &key filename width height stride format data)
868 (filename (%image-surface-create-from-png filename))
869 ((not data) (%image-surface-create format width height))
871 (%image-surface-create-for-data data format width height
874 (let ((element-size (cdr (assoc format '((:argb32 . 4) (:rgb24 . 4) (:a8 . 1) (:a1 1/8))))))
875 (ceiling (* width element-size))))))))
878 (defbinding %image-surface-create () pointer
879 (format surface-format)
883 (defbinding %image-surface-create-for-data () pointer
885 (format surface-format)
890 (defbinding %image-surface-create-from-png () pointer
893 (defbinding surface-write-to-png () status
900 (defmethod allocate-foreign ((surface pdf-surface)
901 &key filename stream width height)
903 ((and filename stream)
904 (error "Only one of the arguments :filename and :stream may be specified"))
905 (filename (%pdf-surface-create filename width height))
907 (let* ((stream-id (register-user-data stream))
908 (location (%pdf-surface-create-for-stream stream-id width height)))
909 (%surface-set-user-data location 'stream stream-id)
913 (defbinding %pdf-surface-create () pointer
916 (height double-float))
918 (defbinding %pdf-surface-create-for-stream (stream width height) pointer
919 (stream-write-func callback)
920 (stream pointer-data)
922 (height double-float))
924 (defbinding pdf-surface-set-size () nil
925 (surface pdf-surface)
927 (height double-float))
932 (defmethod allocate-foreign ((surface ps-surface)
933 &key filename stream width height)
935 ((and filename stream)
936 (error "Only one of the arguments :filename and :stream may be specified"))
937 (filename (%ps-surface-create filename width height))
939 (let* ((stream-id (register-user-data stream))
940 (location (%ps-surface-create-for-stream stream-id width height)))
941 (%surface-set-user-data location 'stream stream-id)
944 (defbinding %ps-surface-create () pointer
947 (height double-float))
949 (defbinding %ps-surface-create-for-stream (stream width height) pointer
950 (stream-write-func callback)
951 (stream pointer-data)
953 (height double-float))
955 (defbinding ps-surface-set-size () nil
958 (height double-float))
960 (defbinding ps-surface-dsc-begin-setup () nil
961 (surface ps-surface))
963 (defbinding ps-surface-dsc-begin-page-setup () nil
964 (surface ps-surface))
966 (defbinding ps-surface-dsc-comment () nil
973 (defmethod allocate-foreign ((surface svg-surface)
974 &key filename stream width height)
976 ((and filename stream)
977 (error "Only one of the arguments :filename and :stream may be specified"))
978 (filename (%svg-surface-create filename width height))
980 (let* ((stream-id (register-user-data stream))
981 (location (%svg-surface-create-for-stream stream-id width height)))
982 (%surface-set-user-data location 'stream stream-id)
985 (defbinding %svg-surface-create () pointer
988 (height double-float))
990 (defbinding %svg-surface-create-for-stream (stream width height) pointer
991 (stream-write-func callback)
992 (stream pointer-data)
994 (height double-float))
996 (defbinding svg-surface-restrict-to-version () nil
997 (surface svg-surface)
998 (version svg-version))
1004 (defbinding matrix-init () nil
1005 (matrix matrix :in/return)
1006 (xx double-float) (yx double-float)
1007 (xy double-float) (yy double-float)
1008 (x0 double-float) (y0 double-float))
1010 (defbinding matrix-init-identity (&optional (matrix (make-instance 'matrix))) nil
1011 (matrix matrix :in/return))
1013 (defun identity-matrix-p (matrix)
1014 (with-slots (xx yx xy yy x0 y0) matrix
1016 (= xx 1.0d0) (= yx 0.0d0) (= xy 0.0d0)
1017 (= yy 1.0d0) (= x0 0.0d0) (= y0 0.0d0))))
1019 (defbinding matrix-init-translate () nil
1020 (matrix matrix :in/return)
1024 (defbinding matrix-init-scale (matrix sx &optional (sy sx)) nil
1025 (matrix matrix :in/return)
1029 (defbinding matrix-init-rotate () nil
1030 (matrix matrix :in/return)
1031 (radians double-float))
1033 (defbinding matrix-translate () nil
1034 (matrix matrix :in/return)
1038 (defbinding matrix-scale (matrix sx &optional (sy sx)) nil
1039 (matrix matrix :in/return)
1043 (defbinding matrix-rotate () nil
1044 (matrix matrix :in/return)
1045 (radians double-float))
1047 (defbinding matrix-invert () nil
1048 (matrix matrix :in/return))
1050 (defbinding matrix-multiply () nil
1051 (result matrix :out)
1055 (defbinding matrix-transform-distance (matrix dx &optional (dy dx)) nil
1057 (dx double-float :in/out)
1058 (dy double-float :in/out))
1060 (defbinding matrix-transform-point () nil
1062 (x double-float :in/out)
1063 (y double-float :in/out))