-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgraft.lisp
26 lines (23 loc) · 1.1 KB
/
graft.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(in-package :clim-graphic-forms)
(defclass graphic-forms-graft (standard-graft)
())
(defmethod graft-width ((graft graphic-forms-graft) &key (units :device))
(let ((window (graphic-forms-port-screen (port graft))))
(let ((size (<+ `(gfw:size ,window))))
(with-server-graphics-context (gc window)
(ecase units
(:device (<+ `(gfs:size-width ,size)))
(:millimeters (<+ `(gfs::get-device-caps (gfs:handle ,gc) gfs::+horzsize+)))
(:inches (floor (<+ `(gfs:size-width ,size))
(<+ `(gfs::get-device-caps (gfs:handle ,gc) gfs::+logpixelsx+))))
(:screen-sized 1))))))
(defmethod graft-height ((graft graphic-forms-graft) &key (units :device))
(let ((window (graphic-forms-port-screen (port graft))))
(let ((size (<+ `(gfw:size ,window))))
(with-server-graphics-context (gc window)
(ecase units
(:device (<+ `(gfs:size-height ,size)))
(:millimeters (<+ `(gfs::get-device-caps (gfs:handle ,gc) gfs::+vertsize+)))
(:inches (floor (<+ `(gfs:size-height ,size))
(<+ `(gfs::get-device-caps (gfs:handle ,gc) gfs::+logpixelsy+))))
(:screen-sized 1))))))