X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=dev%2Fgraphviz%2Fgraphviz-support.lisp;h=1ea586a6f170b13fe09249605a91adeb232395af;hb=7090c13854c379b6eb139bea25d873fe2a5eb668;hp=df13254fb2ac956497ed3068099b8885f0a57cc3;hpb=45c12d2ef967f4fda3c37a9e9594b243f6c879a9;p=cl-graph.git diff --git a/dev/graphviz/graphviz-support.lisp b/dev/graphviz/graphviz-support.lisp index df13254..1ea586a 100644 --- a/dev/graphviz/graphviz-support.lisp +++ b/dev/graphviz/graphviz-support.lisp @@ -341,24 +341,26 @@ B--D [] (:export-p t)) -(defmethod (setf dot-attribute-value) :before (value (attr symbol) (thing dot-attributes-mixin)) +(defmethod (setf dot-attribute-value) + :before (value (attr symbol) (thing dot-attributes-mixin)) (declare (ignore value)) (ensure-valid-dot-attribute attr thing)) -(defmethod (setf dot-attribute-value) (value (attr symbol) (thing dot-attributes-mixin)) +(defmethod (setf dot-attribute-value) + (value (attr symbol) (thing dot-attributes-mixin)) (setf (getf (dot-attributes thing) attr) value)) (defmethod dot-attribute-value ((attr symbol) (thing dot-attributes-mixin)) (getf (dot-attributes thing) attr)) (defmacro defpixel-inch-accessors (name attr type) - (bind ((actual-name (form-symbol name "-IN-PIXELS"))) + (let ((actual-name (form-symbol name (symbol-name '-in-pixels)))) `(progn - (export ',actual-name) + (eval-always (export ',actual-name)) (defmethod ,actual-name ((thing ,type)) "Return the attribute in pixels assuming 72 dpi" - (awhen (dot-attribute-value ,attr thing) - (* 72 it))) + (when (dot-attribute-value ,attr thing) + (* 72 (dot-attribute-value ,attr thing)))) (defmethod (setf ,actual-name) (value (thing ,type)) "Set the attribute in pixels assuming 72 dpi" (setf (dot-attribute-value ,attr thing) @@ -515,10 +517,10 @@ the program in *dot-path*." #-(or sbcl lispworks) (error "Don't know how to execute a program on this platform"))) -;;; --------------------------------------------------------------------------- -; +;;; ; Test dot external -; + +#+test (defun test-dot-external () (let* ((g (make-graph 'dot-graph)) (v1 (add-vertex g 'a :dot-attributes '(:shape :box