From 2859caad86eeda767107d58307a7e6a803b1378a Mon Sep 17 00:00:00 2001 Message-Id: <2859caad86eeda767107d58307a7e6a803b1378a.1717161888.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 24 Dec 2006 14:28:20 +0000 Subject: [PATCH] Added then function NEW-SUB-PATH and some ,inor API changes Organization: Straylight/Edgeware From: espen --- cairo/cairo.lisp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cairo/cairo.lisp b/cairo/cairo.lisp index 9d6aaed..276d603 100644 --- a/cairo/cairo.lisp +++ b/cairo/cairo.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: cairo.lisp,v 1.6 2006/04/26 12:37:48 espen Exp $ +;; $Id: cairo.lisp,v 1.7 2006/12/24 14:28:20 espen Exp $ (in-package "CAIRO") @@ -303,12 +303,17 @@ (defmacro with-context ((cr) &body body) (defbinding status () status (cr context)) +(defun ensure-color-component (component) + (etypecase component + (float component) + (integer (/ component 256.0)))) + (defbinding (set-source-color "cairo_set_source_rgba") (cr red green blue &optional (alpha 1.0)) nil (cr context) - (red double-float) - (green double-float) - (blue double-float) - (alpha double-float)) + ((ensure-color-component red) double-float) + ((ensure-color-component green) double-float) + ((ensure-color-component blue) double-float) + ((ensure-color-component alpha) double-float)) (defbinding set-source-surface () nil (cr context) @@ -387,6 +392,10 @@ (defbinding get-current-point () nil (defbinding new-path () nil (cr context)) +#?(pkg-exists-p "cairo" :atleast-version "1.2") +(defbinding new-sub-path () nil + (cr context)) + (defbinding close-path () nil (cr context)) @@ -531,7 +540,7 @@ (defbinding user-to-device () nil (x double-float :in/out) (y double-float :in/out)) -(defbinding user-to-device-distance () nil +(defbinding user-to-device-distance (cr dx &optional (dy 0.0)) nil (cr context) (dx double-float :in/out) (dy double-float :in/out)) @@ -541,7 +550,7 @@ (defbinding device-to-user () nil (x double-float :in/out) (y double-float :in/out)) -(defbinding device-to-user-distance () nil +(defbinding device-to-user-distance (cr dx &optional (dy 0.0)) nil (cr context) (dx double-float :in/out) (dy double-float :in/out)) -- [mdw]