Commit | Line | Data |
---|---|---|
d5e4dda5 DN |
1 | ;;; common-win.el --- common part of handling window systems |
2 | ||
ba318903 | 3 | ;; Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc. |
d5e4dda5 | 4 | |
34dc21db | 5 | ;; Maintainer: emacs-devel@gnu.org |
d5e4dda5 DN |
6 | ;; Keywords: terminals |
7 | ||
8 | ;; This file is part of GNU Emacs. | |
9 | ||
10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | |
11 | ;; it under the terms of the GNU General Public License as published by | |
12 | ;; the Free Software Foundation, either version 3 of the License, or | |
13 | ;; (at your option) any later version. | |
14 | ||
15 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;; GNU General Public License for more details. | |
19 | ||
20 | ;; You should have received a copy of the GNU General Public License | |
21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | ;;; Commentary: | |
24 | ||
25 | ;;; Code: | |
26 | ||
8aa0f263 GM |
27 | (defcustom x-select-enable-clipboard t |
28 | "Non-nil means cutting and pasting uses the clipboard. | |
29 | This is in addition to, but in preference to, the primary selection. | |
30 | ||
31 | Note that MS-Windows does not support selection types other than the | |
725513b7 GM |
32 | clipboard. (The primary selection that is set by Emacs is not |
33 | accessible to other programs on MS-Windows.) | |
34 | ||
35 | This variable is not used by the Nextstep port." | |
8aa0f263 GM |
36 | :type 'boolean |
37 | :group 'killing | |
38 | ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. | |
39 | :version "24.1") | |
d5e4dda5 | 40 | |
a44d921f GM |
41 | (defvar x-last-selected-text) ; w32-fns.el |
42 | (declare-function w32-set-clipboard-data "w32select.c" | |
43 | (string &optional ignored)) | |
725513b7 GM |
44 | (defvar ns-last-selected-text) ; ns-win.el |
45 | (declare-function ns-set-pasteboard "ns-win" (string)) | |
a44d921f | 46 | |
047a1a4c GM |
47 | (defvar x-select-enable-primary) ; x-win.el |
48 | (defvar x-last-selected-text-primary) | |
49 | (defvar x-last-selected-text-clipboard) | |
5aa78c2d | 50 | (defvar saved-region-selection) ; simple.el |
047a1a4c | 51 | |
a44d921f GM |
52 | (defun x-select-text (text) |
53 | "Select TEXT, a string, according to the window system. | |
54 | ||
55 | On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the | |
56 | clipboard. If `x-select-enable-primary' is non-nil, put TEXT in | |
57 | the primary selection. | |
58 | ||
59 | On MS-Windows, make TEXT the current selection. If | |
60 | `x-select-enable-clipboard' is non-nil, copy the text to the | |
61 | clipboard as well. | |
62 | ||
725513b7 GM |
63 | On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard' |
64 | is not used)." | |
0fda9b75 | 65 | (cond ((eq (framep (selected-frame)) 'w32) |
725513b7 GM |
66 | (if x-select-enable-clipboard |
67 | (w32-set-clipboard-data text)) | |
68 | (setq x-last-selected-text text)) | |
69 | ((featurep 'ns) | |
70 | ;; Don't send the pasteboard too much text. | |
71 | ;; It becomes slow, and if really big it causes errors. | |
72 | (ns-set-pasteboard text) | |
73 | (setq ns-last-selected-text text)) | |
74 | (t | |
75 | ;; With multi-tty, this function may be called from a tty frame. | |
76 | (when (eq (framep (selected-frame)) 'x) | |
77 | (when x-select-enable-primary | |
78 | (x-set-selection 'PRIMARY text) | |
79 | (setq x-last-selected-text-primary text)) | |
80 | (when x-select-enable-clipboard | |
5aa78c2d JD |
81 | ;; When cutting, the selection is cleared and PRIMARY set to |
82 | ;; the empty string. Prevent that, PRIMARY should not be reset | |
83 | ;; by cut (Bug#16382). | |
84 | (setq saved-region-selection text) | |
725513b7 GM |
85 | (x-set-selection 'CLIPBOARD text) |
86 | (setq x-last-selected-text-clipboard text)))))) | |
a44d921f GM |
87 | |
88 | ;;;; Function keys | |
89 | ||
90 | (defvar x-alternatives-map | |
91 | (let ((map (make-sparse-keymap))) | |
92 | ;; Map certain keypad keys into ASCII characters that people usually expect. | |
93 | (define-key map [M-backspace] [?\M-\d]) | |
94 | (define-key map [M-delete] [?\M-\d]) | |
95 | (define-key map [M-tab] [?\M-\t]) | |
96 | (define-key map [M-linefeed] [?\M-\n]) | |
97 | (define-key map [M-clear] [?\M-\C-l]) | |
98 | (define-key map [M-return] [?\M-\C-m]) | |
99 | (define-key map [M-escape] [?\M-\e]) | |
725513b7 GM |
100 | (unless (featurep 'ns) |
101 | (define-key map [iso-lefttab] [backtab]) | |
102 | (define-key map [S-iso-lefttab] [backtab])) | |
103 | (and (or (eq system-type 'windows-nt) | |
104 | (featurep 'ns)) | |
a44d921f GM |
105 | (define-key map [S-tab] [backtab])) |
106 | map) | |
107 | "Keymap of possible alternative meanings for some keys.") | |
108 | ||
109 | (defun x-setup-function-keys (frame) | |
110 | "Set up `function-key-map' on the graphical frame FRAME." | |
111 | ;; Don't do this twice on the same display, or it would break | |
112 | ;; normal-erase-is-backspace-mode. | |
113 | (unless (terminal-parameter frame 'x-setup-function-keys) | |
114 | ;; Map certain keypad keys into ASCII characters that people usually expect. | |
115 | (with-selected-frame frame | |
116 | (let ((map (copy-keymap x-alternatives-map))) | |
117 | (set-keymap-parent map (keymap-parent local-function-key-map)) | |
725513b7 GM |
118 | (set-keymap-parent local-function-key-map map)) |
119 | (when (featurep 'ns) | |
120 | (setq interprogram-cut-function 'x-select-text | |
121 | interprogram-paste-function 'x-selection-value | |
122 | system-key-alist | |
123 | (list | |
fc3eda04 | 124 | ;; These are special "keys" used to pass events from C to lisp. |
725513b7 GM |
125 | (cons (logior (lsh 0 16) 1) 'ns-power-off) |
126 | (cons (logior (lsh 0 16) 2) 'ns-open-file) | |
127 | (cons (logior (lsh 0 16) 3) 'ns-open-temp-file) | |
128 | (cons (logior (lsh 0 16) 4) 'ns-drag-file) | |
129 | (cons (logior (lsh 0 16) 5) 'ns-drag-color) | |
130 | (cons (logior (lsh 0 16) 6) 'ns-drag-text) | |
131 | (cons (logior (lsh 0 16) 7) 'ns-change-font) | |
132 | (cons (logior (lsh 0 16) 8) 'ns-open-file-line) | |
133 | ;;; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text) | |
134 | ;;; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text) | |
135 | (cons (logior (lsh 0 16) 11) 'ns-spi-service-call) | |
3e972d98 | 136 | (cons (logior (lsh 0 16) 12) 'ns-new-frame) |
725513b7 | 137 | (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar) |
3e972d98 | 138 | (cons (logior (lsh 0 16) 14) 'ns-show-prefs) |
fc3eda04 | 139 | )))) |
a44d921f GM |
140 | (set-terminal-parameter frame 'x-setup-function-keys t))) |
141 | ||
d5e4dda5 DN |
142 | (defvar x-invocation-args) |
143 | ||
144 | (defvar x-command-line-resources nil) | |
145 | ||
146 | ;; Handler for switches of the form "-switch value" or "-switch". | |
59ba9d59 | 147 | (defun x-handle-switch (switch &optional numeric) |
d5e4dda5 DN |
148 | (let ((aelt (assoc switch command-line-x-option-alist))) |
149 | (if aelt | |
59ba9d59 GM |
150 | (setq default-frame-alist |
151 | (cons (cons (nth 3 aelt) | |
152 | (if numeric | |
153 | (string-to-number (pop x-invocation-args)) | |
154 | (or (nth 4 aelt) (pop x-invocation-args)))) | |
155 | default-frame-alist))))) | |
d5e4dda5 DN |
156 | |
157 | ;; Handler for switches of the form "-switch n" | |
158 | (defun x-handle-numeric-switch (switch) | |
59ba9d59 | 159 | (x-handle-switch switch t)) |
d5e4dda5 DN |
160 | |
161 | ;; Handle options that apply to initial frame only | |
162 | (defun x-handle-initial-switch (switch) | |
163 | (let ((aelt (assoc switch command-line-x-option-alist))) | |
164 | (if aelt | |
59ba9d59 GM |
165 | (setq initial-frame-alist |
166 | (cons (cons (nth 3 aelt) | |
167 | (or (nth 4 aelt) (pop x-invocation-args))) | |
168 | initial-frame-alist))))) | |
d5e4dda5 DN |
169 | |
170 | ;; Make -iconic apply only to the initial frame! | |
9d3aa82c | 171 | (defun x-handle-iconic (_switch) |
d5e4dda5 DN |
172 | (setq initial-frame-alist |
173 | (cons '(visibility . icon) initial-frame-alist))) | |
174 | ||
175 | ;; Handle the -xrm option. | |
176 | (defun x-handle-xrm-switch (switch) | |
177 | (unless (consp x-invocation-args) | |
178 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
179 | (setq x-command-line-resources | |
180 | (if (null x-command-line-resources) | |
59ba9d59 GM |
181 | (pop x-invocation-args) |
182 | (concat x-command-line-resources "\n" (pop x-invocation-args))))) | |
d5e4dda5 DN |
183 | |
184 | (declare-function x-parse-geometry "frame.c" (string)) | |
185 | ||
186 | ;; Handle the geometry option | |
9d3aa82c | 187 | (defun x-handle-geometry (_switch) |
59ba9d59 | 188 | (let* ((geo (x-parse-geometry (pop x-invocation-args))) |
d5e4dda5 DN |
189 | (left (assq 'left geo)) |
190 | (top (assq 'top geo)) | |
191 | (height (assq 'height geo)) | |
192 | (width (assq 'width geo))) | |
193 | (if (or height width) | |
194 | (setq default-frame-alist | |
195 | (append default-frame-alist | |
196 | '((user-size . t)) | |
197 | (if height (list height)) | |
198 | (if width (list width))) | |
199 | initial-frame-alist | |
200 | (append initial-frame-alist | |
201 | '((user-size . t)) | |
202 | (if height (list height)) | |
203 | (if width (list width))))) | |
204 | (if (or left top) | |
205 | (setq initial-frame-alist | |
206 | (append initial-frame-alist | |
207 | '((user-position . t)) | |
208 | (if left (list left)) | |
59ba9d59 | 209 | (if top (list top))))))) |
d5e4dda5 DN |
210 | |
211 | (defvar x-resource-name) | |
212 | ||
213 | ;; Handle the -name option. Set the variable x-resource-name | |
214 | ;; to the option's operand; set the name of | |
215 | ;; the initial frame, too. | |
216 | (defun x-handle-name-switch (switch) | |
217 | (or (consp x-invocation-args) | |
218 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | |
59ba9d59 GM |
219 | (setq x-resource-name (pop x-invocation-args) |
220 | initial-frame-alist (cons (cons 'name x-resource-name) | |
d5e4dda5 DN |
221 | initial-frame-alist))) |
222 | ||
223 | (defvar x-display-name nil | |
3077d1f6 EZ |
224 | "The name of the window display on which Emacs was started. |
225 | On X, the display name of individual X frames is recorded in the | |
226 | `display' frame parameter.") | |
d5e4dda5 | 227 | |
9d3aa82c | 228 | (defun x-handle-display (_switch) |
d5e4dda5 | 229 | "Handle -display DISPLAY option." |
59ba9d59 | 230 | (setq x-display-name (pop x-invocation-args)) |
d5e4dda5 DN |
231 | ;; Make subshell programs see the same DISPLAY value Emacs really uses. |
232 | ;; Note that this isn't completely correct, since Emacs can use | |
233 | ;; multiple displays. However, there is no way to tell an already | |
234 | ;; running subshell which display the user is currently typing on. | |
235 | (setenv "DISPLAY" x-display-name)) | |
236 | ||
237 | (defun x-handle-args (args) | |
d7d8c62a GM |
238 | "Process the X (or Nextstep) related command line options in ARGS. |
239 | This is done before the user's startup file is loaded. | |
240 | Copies the options in ARGS to `x-invocation-args'. It then extracts | |
241 | the X (or Nextstep) options according to the handlers defined in | |
242 | `command-line-x-option-alist' (or `command-line-ns-option-alist'). | |
243 | For example, `x-handle-switch' handles a switch like \"-fg\" and its | |
244 | value \"black\". This function returns ARGS minus the arguments that | |
245 | have been processed." | |
d5e4dda5 | 246 | ;; We use ARGS to accumulate the args that we don't handle here, to return. |
725513b7 | 247 | (setq x-invocation-args args ; FIXME let-bind? |
d5e4dda5 DN |
248 | args nil) |
249 | (while (and x-invocation-args | |
250 | (not (equal (car x-invocation-args) "--"))) | |
59ba9d59 | 251 | (let* ((this-switch (pop x-invocation-args)) |
d5e4dda5 | 252 | (orig-this-switch this-switch) |
d7d8c62a GM |
253 | (option-alist (if (featurep 'ns) |
254 | command-line-ns-option-alist | |
255 | command-line-x-option-alist)) | |
d5e4dda5 | 256 | completion argval aelt handler) |
d5e4dda5 DN |
257 | ;; Check for long options with attached arguments |
258 | ;; and separate out the attached option argument into argval. | |
259 | (if (string-match "^--[^=]*=" this-switch) | |
260 | (setq argval (substring this-switch (match-end 0)) | |
261 | this-switch (substring this-switch 0 (1- (match-end 0))))) | |
262 | ;; Complete names of long options. | |
263 | (if (string-match "^--" this-switch) | |
264 | (progn | |
d7d8c62a | 265 | (setq completion (try-completion this-switch option-alist)) |
d5e4dda5 DN |
266 | (if (eq completion t) |
267 | ;; Exact match for long option. | |
268 | nil | |
269 | (if (stringp completion) | |
d7d8c62a | 270 | (let ((elt (assoc completion option-alist))) |
d5e4dda5 DN |
271 | ;; Check for abbreviated long option. |
272 | (or elt | |
273 | (error "Option `%s' is ambiguous" this-switch)) | |
274 | (setq this-switch completion)))))) | |
d7d8c62a | 275 | (setq aelt (assoc this-switch option-alist)) |
d5e4dda5 DN |
276 | (if aelt (setq handler (nth 2 aelt))) |
277 | (if handler | |
278 | (if argval | |
279 | (let ((x-invocation-args | |
280 | (cons argval x-invocation-args))) | |
281 | (funcall handler this-switch)) | |
282 | (funcall handler this-switch)) | |
283 | (setq args (cons orig-this-switch args))))) | |
284 | (nconc (nreverse args) x-invocation-args)) | |
285 | ||
286 | \f | |
287 | ;; | |
288 | ;; Available colors | |
289 | ;; | |
290 | ;; The ordering of the colors is chosen for the user's convenience in | |
291 | ;; `list-colors-display', which displays the reverse of this list. | |
292 | ;; Roughly speaking, `list-colors-display' orders by (i) named shades | |
e4769531 | 293 | ;; of gray with hue 0.0, sorted by value (ii) named colors with |
d5e4dda5 DN |
294 | ;; saturation 1.0, sorted by hue, (iii) named non-white colors with |
295 | ;; saturation less than 1.0, sorted by hue, (iv) other named shades of | |
296 | ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades | |
e4769531 | 297 | ;; of gray. |
d5e4dda5 | 298 | |
725513b7 GM |
299 | (declare-function ns-list-colors "nsfns.m" (&optional frame)) |
300 | ||
d5e4dda5 | 301 | (defvar x-colors |
725513b7 GM |
302 | (if (featurep 'ns) (ns-list-colors) |
303 | (purecopy | |
304 | '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97" | |
305 | "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94" | |
306 | "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90" | |
307 | "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87" | |
308 | "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83" | |
309 | "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80" | |
310 | "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76" | |
311 | "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73" | |
312 | "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69" | |
313 | "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66" | |
314 | "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62" | |
315 | "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59" | |
316 | "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55" | |
317 | "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52" | |
318 | "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48" | |
319 | "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45" | |
320 | "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41" | |
321 | "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38" | |
322 | "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34" | |
323 | "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31" | |
324 | "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27" | |
325 | "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24" | |
326 | "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20" | |
327 | "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17" | |
328 | "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13" | |
329 | "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10" | |
330 | "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6" | |
331 | "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2" | |
332 | "gray1" "grey1" "gray0" "grey0" | |
333 | "LightPink1" "LightPink2" "LightPink3" "LightPink4" | |
334 | "pink1" "pink2" "pink3" "pink4" | |
335 | "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4" | |
336 | "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" | |
337 | "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4" | |
338 | "HotPink1" "HotPink2" "HotPink3" "HotPink4" | |
339 | "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" | |
340 | "maroon1" "maroon2" "maroon3" "maroon4" | |
341 | "orchid1" "orchid2" "orchid3" "orchid4" | |
342 | "plum1" "plum2" "plum3" "plum4" | |
343 | "thistle1" "thistle2" "thistle3" "thistle4" | |
344 | "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4" | |
345 | "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4" | |
346 | "purple1" "purple2" "purple3" "purple4" | |
347 | "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4" | |
348 | "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4" | |
349 | "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4" | |
350 | "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" | |
351 | "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4" | |
352 | "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4" | |
353 | "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" | |
354 | "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4" | |
355 | "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4" | |
356 | "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" | |
357 | "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4" | |
358 | "azure1" "azure2" "azure3" "azure4" | |
359 | "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" | |
360 | "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" | |
361 | "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4" | |
362 | "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4" | |
363 | "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" | |
364 | "honeydew1" "honeydew2" "honeydew3" "honeydew4" | |
365 | "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4" | |
366 | "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4" | |
367 | "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" | |
368 | "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4" | |
369 | "ivory1" "ivory2" "ivory3" "ivory4" | |
370 | "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" | |
371 | "khaki1" "khaki2" "khaki3" "khaki4" | |
372 | "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4" | |
373 | "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" | |
374 | "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4" | |
375 | "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4" | |
376 | "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4" | |
377 | "wheat1" "wheat2" "wheat3" "wheat4" | |
378 | "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4" | |
379 | "burlywood1" "burlywood2" "burlywood3" "burlywood4" | |
380 | "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" | |
381 | "bisque1" "bisque2" "bisque3" "bisque4" | |
382 | "tan1" "tan2" "tan3" "tan4" | |
383 | "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4" | |
384 | "seashell1" "seashell2" "seashell3" "seashell4" | |
385 | "chocolate1" "chocolate2" "chocolate3" "chocolate4" | |
386 | "sienna1" "sienna2" "sienna3" "sienna4" | |
387 | "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" | |
388 | "salmon1" "salmon2" "salmon3" "salmon4" | |
389 | "coral1" "coral2" "coral3" "coral4" | |
390 | "tomato1" "tomato2" "tomato3" "tomato4" | |
391 | "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" | |
392 | "snow1" "snow2" "snow3" "snow4" | |
393 | "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4" | |
394 | "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" | |
395 | "firebrick1" "firebrick2" "firebrick3" "firebrick4" | |
396 | "brown1" "brown2" "brown3" "brown4" | |
397 | "magenta1" "magenta2" "magenta3" "magenta4" | |
398 | "blue1" "blue2" "blue3" "blue4" | |
399 | "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4" | |
400 | "turquoise1" "turquoise2" "turquoise3" "turquoise4" | |
401 | "cyan1" "cyan2" "cyan3" "cyan4" | |
402 | "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4" | |
403 | "green1" "green2" "green3" "green4" | |
404 | "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4" | |
405 | "yellow1" "yellow2" "yellow3" "yellow4" | |
406 | "gold1" "gold2" "gold3" "gold4" | |
407 | "orange1" "orange2" "orange3" "orange4" | |
408 | "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4" | |
409 | "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4" | |
410 | "red1" "red2" "red3" "red4" | |
411 | "lavender blush" "LavenderBlush" "ghost white" "GhostWhite" | |
412 | "lavender" "alice blue" "AliceBlue" "azure" "light cyan" | |
413 | "LightCyan" "mint cream" "MintCream" "honeydew" "ivory" | |
414 | "light goldenrod yellow" "LightGoldenrodYellow" "light yellow" | |
415 | "LightYellow" "beige" "floral white" "FloralWhite" "old lace" | |
416 | "OldLace" "blanched almond" "BlanchedAlmond" "moccasin" | |
417 | "papaya whip" "PapayaWhip" "bisque" "antique white" | |
418 | "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell" | |
419 | "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink" | |
420 | "hot pink" "HotPink" "deep pink" "DeepPink" "maroon" | |
421 | "pale violet red" "PaleVioletRed" "violet red" "VioletRed" | |
422 | "medium violet red" "MediumVioletRed" "violet" "plum" "thistle" | |
423 | "orchid" "medium orchid" "MediumOrchid" "dark orchid" | |
424 | "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple" | |
425 | "MediumPurple" "light slate blue" "LightSlateBlue" | |
426 | "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue" | |
427 | "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue" | |
428 | "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue" | |
429 | "light steel blue" "LightSteelBlue" "cornflower blue" | |
430 | "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue" | |
431 | "RoyalBlue" "light slate gray" "light slate grey" | |
432 | "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey" | |
433 | "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey" | |
434 | "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue" | |
435 | "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue" | |
436 | "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue" | |
437 | "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise" | |
438 | "medium turquoise" "MediumTurquoise" "dark turquoise" | |
439 | "DarkTurquoise" "dark cyan" "DarkCyan" "aquamarine" | |
440 | "medium aquamarine" "MediumAquamarine" "light sea green" | |
441 | "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green" | |
442 | "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green" | |
443 | "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen" | |
444 | "forest green" "ForestGreen" "light green" "LightGreen" | |
445 | "green yellow" "GreenYellow" "yellow green" "YellowGreen" | |
446 | "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen" | |
447 | "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki" | |
448 | "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod" | |
449 | "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod" | |
450 | "wheat" "navajo white" "NavajoWhite" "tan" "burlywood" | |
451 | "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown" | |
452 | "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon" | |
453 | "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon" | |
454 | "salmon" "light coral" "LightCoral" "indian red" "IndianRed" | |
455 | "firebrick" "brown" "dark red" "DarkRed" "magenta" | |
456 | "dark magenta" "DarkMagenta" "dark violet" "DarkViolet" | |
457 | "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue" | |
458 | "cyan" "medium spring green" "MediumSpringGreen" "spring green" | |
459 | "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse" | |
460 | "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red" | |
461 | "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro" | |
462 | "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey" | |
463 | "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray" | |
464 | "dim grey" "DimGray" "DimGrey" "black"))) | |
3077d1f6 EZ |
465 | "List of basic colors available on color displays. |
466 | For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20. | |
467 | For Nextstep, this is a list of non-PANTONE colors returned by | |
468 | the operating system.") | |
d5e4dda5 | 469 | |
a44d921f GM |
470 | (defvar w32-color-map) |
471 | ||
472 | (defun xw-defined-colors (&optional frame) | |
473 | "Internal function called by `defined-colors', which see." | |
b94a5a43 GM |
474 | (if (featurep 'ns) |
475 | x-colors | |
476 | (or frame (setq frame (selected-frame))) | |
477 | (let (defined-colors) | |
478 | (dolist (this-color (if (eq system-type 'windows-nt) | |
479 | (or (mapcar 'car w32-color-map) x-colors) | |
480 | x-colors)) | |
481 | (and (color-supported-p this-color frame t) | |
482 | (setq defined-colors (cons this-color defined-colors)))) | |
483 | defined-colors))) | |
a44d921f | 484 | |
d5e4dda5 | 485 | ;;; common-win.el ends here |