Function: gs-set-ghostview-window-prop
gs-set-ghostview-window-prop is a byte-compiled function defined in
gs.el.gz.
Signature
(gs-set-ghostview-window-prop FRAME SPEC IMG-WIDTH IMG-HEIGHT)
Documentation
Set the GHOSTVIEW window property of FRAME.
SPEC is a GS image specification. IMG-WIDTH is the width of the requested image, and IMG-HEIGHT is the height of the requested image in pixels.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/gs.el.gz
(defun gs-set-ghostview-window-prop (frame spec img-width img-height)
"Set the `GHOSTVIEW' window property of FRAME.
SPEC is a GS image specification. IMG-WIDTH is the width of the
requested image, and IMG-HEIGHT is the height of the requested
image in pixels."
(let* ((box (plist-get (cdr spec) :bounding-box))
(llx (elt box 0))
(lly (elt box 1))
(urx (elt box 2))
(ury (elt box 3))
(rotation (or (plist-get (cdr spec) :rotate) 0))
;; The pixel width IMG-WIDTH of the pixmap gives the
;; dots, URX - LLX give the inch.
(in-width (/ (- urx llx) 72.0))
(in-height (/ (- ury lly) 72.0))
(xdpi (/ img-width in-width))
(ydpi (/ img-height in-height)))
(x-change-window-property "GHOSTVIEW"
(format "0 %d %d %d %d %d %g %g"
rotation llx lly urx ury xdpi ydpi)
frame)))