Made %TREE-PATH-TO-VECTOR handle null pointers
[clg] / cairo / cairo.lisp
index 63b1f70..f249eca 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.11 2007/02/19 14:37:52 espen Exp $
+;; $Id: cairo.lisp,v 1.14 2007/08/23 21:12:43 espen Exp $
 
 (in-package "CAIRO")
 
@@ -40,7 +40,7 @@
   (define-enum-type fill-rule :winding :even-odd)
   (define-enum-type line-cap :butt :round :square)
   (define-enum-type line-join :miter :round :bevel)    
-  (define-enum-type font-slant :normal :itaic :oblique)
+  (define-enum-type font-slant :normal :italic :oblique)
   (define-enum-type font-weight :normal :bold)
 
   (define-enum-type operator
@@ -58,7 +58,7 @@
   (define-enum-type surface-type 
     image-surface pdf-surface ps-surface xlib-surface xcb-surface 
     glitz-surface quartz-surface win32-surface beos-surface 
-    directfb-surface)
+    directfb-surface svg-surface os2-surface)
 
   (defclass surface-class (proxy-class)
     ())
 
 (defmacro defpath (name args &optional relative-p)
   (flet ((def (name type)
-          `(progn
-             ,(when (eq type 'optimized-double-float)
-                `(declaim (ftype (function (context ,@(loop repeat (length args) collect 'double-float))) ,(first name))))
+          `(progn
+             ,(when (eq type 'optimized-double-float)
+                `(declaim (inline ,(first name))))
              (defbinding ,name () nil
                (cr context)
                ,@(mapcar #'(lambda (arg) (list arg type)) args)))))
 (defpath move-to (x y) t)
 (defpath rectangle (x y width height))
 
-(defun circle (cr x y radius)
-  (arc cr x y radius 0.0 (* pi 2)))
+(defun circle (cr x y radius &optional negative-p)
+  (move-to cr radius 0.0d0)
+  (if negative-p
+      (arc-negative cr x y radius (* pi 2) 0.0d0)
+    (arc cr x y radius 0.0d0 (* pi 2)))
+  (close-path cr))
+
 
 (defbinding glyph-path (cr glyphs) nil
   (cr context)