diff options
author | Kim F. Storm <storm@cua.dk> | 2006-09-06 11:51:57 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2006-09-06 11:51:57 +0000 |
commit | 51e39dfcf136d2e048e740b213232c631d3c7a10 (patch) | |
tree | 987ff8672474a6b2f777251bc6589e39a5b634f9 /lisp/frame.el | |
parent | 2ca43ca550c493a926de17ae9f69668e8b9fad87 (diff) | |
download | emacs-51e39dfcf136d2e048e740b213232c631d3c7a10.tar.gz emacs-51e39dfcf136d2e048e740b213232c631d3c7a10.tar.bz2 emacs-51e39dfcf136d2e048e740b213232c631d3c7a10.zip |
(display-mm-dimensions-alist): New defcustom.
(display-mm-height, display-mm-width): Use it.
Diffstat (limited to 'lisp/frame.el')
-rw-r--r-- | lisp/frame.el | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index 368cab3aed7..8f7fdf1fd5c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1083,17 +1083,43 @@ For character terminals, each character counts as a single pixel." (t (frame-width (if (framep display) display (selected-frame))))))) +(defcustom display-mm-dimensions-alist nil + "Alist for specifying screen dimensions in millimeters. +The dimensions will be used for `display-mm-height' and +`display-mm-width' if defined for the respective display. + +Each element of the alist has the form (display . (width . height)), +e.g. (\":0.0\" . (287 . 215)). + +If `display' equals t, it specifies dimensions for all graphical +displays not explicitely specified." + :version "22.1" + :type '(alist :key-type (choice (string :tag "Display name") + (const :tag "Default" t)) + :value-type (cons :tag "Dimensions" + (integer :tag "Width") + (integer :tag "Height"))) + :group 'frames) + (defun display-mm-height (&optional display) "Return the height of DISPLAY's screen in millimeters. +System values can be overriden by `display-mm-dimensions-alist'. If the information is unavailable, value is nil." (and (memq (framep-on-display display) '(x w32 mac)) - (x-display-mm-height display))) + (or (cddr (assoc (or display (frame-parameter nil 'display)) + display-mm-dimensions-alist)) + (cddr (assoc t display-mm-dimensions-alist)) + (x-display-mm-height display)))) (defun display-mm-width (&optional display) "Return the width of DISPLAY's screen in millimeters. +System values can be overriden by `display-mm-dimensions-alist'. If the information is unavailable, value is nil." (and (memq (framep-on-display display) '(x w32 mac)) - (x-display-mm-width display))) + (or (cadr (assoc (or display (frame-parameter nil 'display)) + display-mm-dimensions-alist)) + (cadr (assoc t display-mm-dimensions-alist)) + (x-display-mm-width display)))) (defun display-backing-store (&optional display) "Return the backing store capability of DISPLAY's screen. |