+(defmacro defpixel-inch-accessors (name attr type)
+ (bind ((actual-name (form-symbol name "-IN-PIXELS")))
+ `(progn
+ (eval-always (export ',actual-name))
+ (defmethod ,actual-name ((thing ,type))
+ "Return the attribute in pixels assuming 72 dpi"
+ (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)
+ (coerce (/ value 72) 'double-float))))))
+
+(defpixel-inch-accessors width :width dot-vertex-mixin)
+(defpixel-inch-accessors height :height dot-vertex-mixin)
+
+