common-win.el 21 KB

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