+(defmacro defpixel-inch-accessors (name attr type)
+ (bind ((actual-name (form-symbol name "-IN-PIXELS")))
+ `(progn
+ (export ',actual-name)
+ (defmethod ,actual-name ((thing ,type))
+ "Return the attribute in pixels assuming 72 dpi"
+ (awhen (dot-attribute-value ,attr thing)
+ (* 72 it)))
+ (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)
+
+