diff options
| author | Kim F. Storm | 2006-09-06 11:51:57 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-09-06 11:51:57 +0000 |
| commit | 51e39dfcf136d2e048e740b213232c631d3c7a10 (patch) | |
| tree | 987ff8672474a6b2f777251bc6589e39a5b634f9 | |
| parent | 2ca43ca550c493a926de17ae9f69668e8b9fad87 (diff) | |
| download | emacs-51e39dfcf136d2e048e740b213232c631d3c7a10.tar.gz emacs-51e39dfcf136d2e048e740b213232c631d3c7a10.zip | |
(display-mm-dimensions-alist): New defcustom.
(display-mm-height, display-mm-width): Use it.
| -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." | |||
| 1083 | (t | 1083 | (t |
| 1084 | (frame-width (if (framep display) display (selected-frame))))))) | 1084 | (frame-width (if (framep display) display (selected-frame))))))) |
| 1085 | 1085 | ||
| 1086 | (defcustom display-mm-dimensions-alist nil | ||
| 1087 | "Alist for specifying screen dimensions in millimeters. | ||
| 1088 | The dimensions will be used for `display-mm-height' and | ||
| 1089 | `display-mm-width' if defined for the respective display. | ||
| 1090 | |||
| 1091 | Each element of the alist has the form (display . (width . height)), | ||
| 1092 | e.g. (\":0.0\" . (287 . 215)). | ||
| 1093 | |||
| 1094 | If `display' equals t, it specifies dimensions for all graphical | ||
| 1095 | displays not explicitely specified." | ||
| 1096 | :version "22.1" | ||
| 1097 | :type '(alist :key-type (choice (string :tag "Display name") | ||
| 1098 | (const :tag "Default" t)) | ||
| 1099 | :value-type (cons :tag "Dimensions" | ||
| 1100 | (integer :tag "Width") | ||
| 1101 | (integer :tag "Height"))) | ||
| 1102 | :group 'frames) | ||
| 1103 | |||
| 1086 | (defun display-mm-height (&optional display) | 1104 | (defun display-mm-height (&optional display) |
| 1087 | "Return the height of DISPLAY's screen in millimeters. | 1105 | "Return the height of DISPLAY's screen in millimeters. |
| 1106 | System values can be overriden by `display-mm-dimensions-alist'. | ||
| 1088 | If the information is unavailable, value is nil." | 1107 | If the information is unavailable, value is nil." |
| 1089 | (and (memq (framep-on-display display) '(x w32 mac)) | 1108 | (and (memq (framep-on-display display) '(x w32 mac)) |
| 1090 | (x-display-mm-height display))) | 1109 | (or (cddr (assoc (or display (frame-parameter nil 'display)) |
| 1110 | display-mm-dimensions-alist)) | ||
| 1111 | (cddr (assoc t display-mm-dimensions-alist)) | ||
| 1112 | (x-display-mm-height display)))) | ||
| 1091 | 1113 | ||
| 1092 | (defun display-mm-width (&optional display) | 1114 | (defun display-mm-width (&optional display) |
| 1093 | "Return the width of DISPLAY's screen in millimeters. | 1115 | "Return the width of DISPLAY's screen in millimeters. |
| 1116 | System values can be overriden by `display-mm-dimensions-alist'. | ||
| 1094 | If the information is unavailable, value is nil." | 1117 | If the information is unavailable, value is nil." |
| 1095 | (and (memq (framep-on-display display) '(x w32 mac)) | 1118 | (and (memq (framep-on-display display) '(x w32 mac)) |
| 1096 | (x-display-mm-width display))) | 1119 | (or (cadr (assoc (or display (frame-parameter nil 'display)) |
| 1120 | display-mm-dimensions-alist)) | ||
| 1121 | (cadr (assoc t display-mm-dimensions-alist)) | ||
| 1122 | (x-display-mm-width display)))) | ||
| 1097 | 1123 | ||
| 1098 | (defun display-backing-store (&optional display) | 1124 | (defun display-backing-store (&optional display) |
| 1099 | "Return the backing store capability of DISPLAY's screen. | 1125 | "Return the backing store capability of DISPLAY's screen. |