Added then function NEW-SUB-PATH and some ,inor API changes
authorespen <espen>
Sun, 24 Dec 2006 14:28:20 +0000 (14:28 +0000)
committerespen <espen>
Sun, 24 Dec 2006 14:28:20 +0000 (14:28 +0000)
cairo/cairo.lisp

index 0a56c13..e37b4a2 100644 (file)
@@ -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")
 
 (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)
 (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))
 
   (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))
   (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))