213
|
1 /* mswindows-specific Lisp objects.
|
|
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
|
|
4 Copyright (C) 1995 Tinker Systems.
|
|
5 Copyright (C) 1995, 1996 Ben Wing.
|
|
6 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
7 Copyright (C) 1997 Jonathan Harris.
|
|
8
|
|
9 This file is part of XEmacs.
|
|
10
|
|
11 XEmacs is free software; you can redistribute it and/or modify it
|
|
12 under the terms of the GNU General Public License as published by the
|
|
13 Free Software Foundation; either version 2, or (at your option) any
|
|
14 later version.
|
|
15
|
|
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
19 for more details.
|
|
20
|
|
21 You should have received a copy of the GNU General Public License
|
|
22 along with XEmacs; see the file COPYING. If not, write to
|
|
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
24 Boston, MA 02111-1307, USA. */
|
|
25
|
|
26 /* Synched up with: Not in FSF. */
|
|
27
|
|
28 /* Authorship:
|
|
29
|
|
30 Jamie Zawinski, Chuck Thompson, Ben Wing
|
272
|
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
|
213
|
32 */
|
|
33
|
|
34
|
|
35 /* TODO: palette handling */
|
|
36
|
|
37 #include <config.h>
|
|
38 #include "lisp.h"
|
272
|
39 #include "hash.h"
|
213
|
40
|
|
41 #include "console-msw.h"
|
|
42 #include "objects-msw.h"
|
|
43
|
|
44 #ifdef MULE
|
|
45 #include "mule-charset.h"
|
|
46 #endif
|
|
47
|
|
48 #include "buffer.h"
|
|
49 #include "device.h"
|
|
50 #include "insdel.h"
|
|
51
|
231
|
52 #ifdef __CYGWIN32__
|
|
53 #define stricmp strcasecmp
|
|
54 #endif
|
213
|
55
|
|
56 typedef struct colormap_t
|
|
57 {
|
|
58 char *name;
|
|
59 COLORREF colorref;
|
|
60 } colormap_t;
|
|
61
|
251
|
62 /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */
|
213
|
63 static CONST colormap_t mswindows_X_color_map[] =
|
|
64 {
|
251
|
65 {"snow" , PALETTERGB (255, 250, 250) },
|
|
66 {"GhostWhite" , PALETTERGB (248, 248, 255) },
|
|
67 {"WhiteSmoke" , PALETTERGB (245, 245, 245) },
|
|
68 {"gainsboro" , PALETTERGB (220, 220, 220) },
|
|
69 {"FloralWhite" , PALETTERGB (255, 250, 240) },
|
|
70 {"OldLace" , PALETTERGB (253, 245, 230) },
|
|
71 {"linen" , PALETTERGB (250, 240, 230) },
|
|
72 {"AntiqueWhite" , PALETTERGB (250, 235, 215) },
|
|
73 {"PapayaWhip" , PALETTERGB (255, 239, 213) },
|
|
74 {"BlanchedAlmond" , PALETTERGB (255, 235, 205) },
|
|
75 {"bisque" , PALETTERGB (255, 228, 196) },
|
|
76 {"PeachPuff" , PALETTERGB (255, 218, 185) },
|
|
77 {"NavajoWhite" , PALETTERGB (255, 222, 173) },
|
|
78 {"moccasin" , PALETTERGB (255, 228, 181) },
|
|
79 {"cornsilk" , PALETTERGB (255, 248, 220) },
|
|
80 {"ivory" , PALETTERGB (255, 255, 240) },
|
|
81 {"LemonChiffon" , PALETTERGB (255, 250, 205) },
|
|
82 {"seashell" , PALETTERGB (255, 245, 238) },
|
|
83 {"honeydew" , PALETTERGB (240, 255, 240) },
|
|
84 {"MintCream" , PALETTERGB (245, 255, 250) },
|
|
85 {"azure" , PALETTERGB (240, 255, 255) },
|
|
86 {"AliceBlue" , PALETTERGB (240, 248, 255) },
|
|
87 {"lavender" , PALETTERGB (230, 230, 250) },
|
|
88 {"LavenderBlush" , PALETTERGB (255, 240, 245) },
|
|
89 {"MistyRose" , PALETTERGB (255, 228, 225) },
|
|
90 {"white" , PALETTERGB (255, 255, 255) },
|
|
91 {"black" , PALETTERGB (0, 0, 0) },
|
|
92 {"DarkSlateGray" , PALETTERGB (47, 79, 79) },
|
|
93 {"DarkSlateGrey" , PALETTERGB (47, 79, 79) },
|
|
94 {"DimGray" , PALETTERGB (105, 105, 105) },
|
|
95 {"DimGrey" , PALETTERGB (105, 105, 105) },
|
|
96 {"SlateGray" , PALETTERGB (112, 128, 144) },
|
|
97 {"SlateGrey" , PALETTERGB (112, 128, 144) },
|
|
98 {"LightSlateGray" , PALETTERGB (119, 136, 153) },
|
|
99 {"LightSlateGrey" , PALETTERGB (119, 136, 153) },
|
|
100 {"gray" , PALETTERGB (190, 190, 190) },
|
|
101 {"grey" , PALETTERGB (190, 190, 190) },
|
|
102 {"LightGrey" , PALETTERGB (211, 211, 211) },
|
|
103 {"LightGray" , PALETTERGB (211, 211, 211) },
|
|
104 {"MidnightBlue" , PALETTERGB (25, 25, 112) },
|
|
105 {"navy" , PALETTERGB (0, 0, 128) },
|
|
106 {"NavyBlue" , PALETTERGB (0, 0, 128) },
|
|
107 {"CornflowerBlue" , PALETTERGB (100, 149, 237) },
|
|
108 {"DarkSlateBlue" , PALETTERGB (72, 61, 139) },
|
|
109 {"SlateBlue" , PALETTERGB (106, 90, 205) },
|
|
110 {"MediumSlateBlue" , PALETTERGB (123, 104, 238) },
|
|
111 {"LightSlateBlue" , PALETTERGB (132, 112, 255) },
|
|
112 {"MediumBlue" , PALETTERGB (0, 0, 205) },
|
|
113 {"RoyalBlue" , PALETTERGB (65, 105, 225) },
|
|
114 {"blue" , PALETTERGB (0, 0, 255) },
|
|
115 {"DodgerBlue" , PALETTERGB (30, 144, 255) },
|
|
116 {"DeepSkyBlue" , PALETTERGB (0, 191, 255) },
|
|
117 {"SkyBlue" , PALETTERGB (135, 206, 235) },
|
|
118 {"LightSkyBlue" , PALETTERGB (135, 206, 250) },
|
|
119 {"SteelBlue" , PALETTERGB (70, 130, 180) },
|
|
120 {"LightSteelBlue" , PALETTERGB (176, 196, 222) },
|
|
121 {"LightBlue" , PALETTERGB (173, 216, 230) },
|
|
122 {"PowderBlue" , PALETTERGB (176, 224, 230) },
|
|
123 {"PaleTurquoise" , PALETTERGB (175, 238, 238) },
|
|
124 {"DarkTurquoise" , PALETTERGB (0, 206, 209) },
|
|
125 {"MediumTurquoise" , PALETTERGB (72, 209, 204) },
|
|
126 {"turquoise" , PALETTERGB (64, 224, 208) },
|
|
127 {"cyan" , PALETTERGB (0, 255, 255) },
|
|
128 {"LightCyan" , PALETTERGB (224, 255, 255) },
|
|
129 {"CadetBlue" , PALETTERGB (95, 158, 160) },
|
|
130 {"MediumAquamarine" , PALETTERGB (102, 205, 170) },
|
|
131 {"aquamarine" , PALETTERGB (127, 255, 212) },
|
|
132 {"DarkGreen" , PALETTERGB (0, 100, 0) },
|
|
133 {"DarkOliveGreen" , PALETTERGB (85, 107, 47) },
|
|
134 {"DarkSeaGreen" , PALETTERGB (143, 188, 143) },
|
|
135 {"SeaGreen" , PALETTERGB (46, 139, 87) },
|
|
136 {"MediumSeaGreen" , PALETTERGB (60, 179, 113) },
|
|
137 {"LightSeaGreen" , PALETTERGB (32, 178, 170) },
|
|
138 {"PaleGreen" , PALETTERGB (152, 251, 152) },
|
|
139 {"SpringGreen" , PALETTERGB (0, 255, 127) },
|
|
140 {"LawnGreen" , PALETTERGB (124, 252, 0) },
|
|
141 {"green" , PALETTERGB (0, 255, 0) },
|
|
142 {"chartreuse" , PALETTERGB (127, 255, 0) },
|
|
143 {"MediumSpringGreen" , PALETTERGB (0, 250, 154) },
|
|
144 {"GreenYellow" , PALETTERGB (173, 255, 47) },
|
|
145 {"LimeGreen" , PALETTERGB (50, 205, 50) },
|
|
146 {"YellowGreen" , PALETTERGB (154, 205, 50) },
|
|
147 {"ForestGreen" , PALETTERGB (34, 139, 34) },
|
|
148 {"OliveDrab" , PALETTERGB (107, 142, 35) },
|
|
149 {"DarkKhaki" , PALETTERGB (189, 183, 107) },
|
|
150 {"khaki" , PALETTERGB (240, 230, 140) },
|
|
151 {"PaleGoldenrod" , PALETTERGB (238, 232, 170) },
|
|
152 {"LightGoldenrodYellow" , PALETTERGB (250, 250, 210) },
|
|
153 {"LightYellow" , PALETTERGB (255, 255, 224) },
|
|
154 {"yellow" , PALETTERGB (255, 255, 0) },
|
|
155 {"gold" , PALETTERGB (255, 215, 0) },
|
|
156 {"LightGoldenrod" , PALETTERGB (238, 221, 130) },
|
|
157 {"goldenrod" , PALETTERGB (218, 165, 32) },
|
|
158 {"DarkGoldenrod" , PALETTERGB (184, 134, 11) },
|
|
159 {"RosyBrown" , PALETTERGB (188, 143, 143) },
|
|
160 {"IndianRed" , PALETTERGB (205, 92, 92) },
|
|
161 {"SaddleBrown" , PALETTERGB (139, 69, 19) },
|
|
162 {"sienna" , PALETTERGB (160, 82, 45) },
|
|
163 {"peru" , PALETTERGB (205, 133, 63) },
|
|
164 {"burlywood" , PALETTERGB (222, 184, 135) },
|
|
165 {"beige" , PALETTERGB (245, 245, 220) },
|
|
166 {"wheat" , PALETTERGB (245, 222, 179) },
|
|
167 {"SandyBrown" , PALETTERGB (244, 164, 96) },
|
|
168 {"tan" , PALETTERGB (210, 180, 140) },
|
|
169 {"chocolate" , PALETTERGB (210, 105, 30) },
|
|
170 {"firebrick" , PALETTERGB (178, 34, 34) },
|
|
171 {"brown" , PALETTERGB (165, 42, 42) },
|
|
172 {"DarkSalmon" , PALETTERGB (233, 150, 122) },
|
|
173 {"salmon" , PALETTERGB (250, 128, 114) },
|
|
174 {"LightSalmon" , PALETTERGB (255, 160, 122) },
|
|
175 {"orange" , PALETTERGB (255, 165, 0) },
|
|
176 {"DarkOrange" , PALETTERGB (255, 140, 0) },
|
|
177 {"coral" , PALETTERGB (255, 127, 80) },
|
|
178 {"LightCoral" , PALETTERGB (240, 128, 128) },
|
|
179 {"tomato" , PALETTERGB (255, 99, 71) },
|
|
180 {"OrangeRed" , PALETTERGB (255, 69, 0) },
|
|
181 {"red" , PALETTERGB (255, 0, 0) },
|
|
182 {"HotPink" , PALETTERGB (255, 105, 180) },
|
|
183 {"DeepPink" , PALETTERGB (255, 20, 147) },
|
|
184 {"pink" , PALETTERGB (255, 192, 203) },
|
|
185 {"LightPink" , PALETTERGB (255, 182, 193) },
|
|
186 {"PaleVioletRed" , PALETTERGB (219, 112, 147) },
|
|
187 {"maroon" , PALETTERGB (176, 48, 96) },
|
|
188 {"MediumVioletRed" , PALETTERGB (199, 21, 133) },
|
|
189 {"VioletRed" , PALETTERGB (208, 32, 144) },
|
|
190 {"magenta" , PALETTERGB (255, 0, 255) },
|
|
191 {"violet" , PALETTERGB (238, 130, 238) },
|
|
192 {"plum" , PALETTERGB (221, 160, 221) },
|
|
193 {"orchid" , PALETTERGB (218, 112, 214) },
|
|
194 {"MediumOrchid" , PALETTERGB (186, 85, 211) },
|
|
195 {"DarkOrchid" , PALETTERGB (153, 50, 204) },
|
|
196 {"DarkViolet" , PALETTERGB (148, 0, 211) },
|
|
197 {"BlueViolet" , PALETTERGB (138, 43, 226) },
|
|
198 {"purple" , PALETTERGB (160, 32, 240) },
|
|
199 {"MediumPurple" , PALETTERGB (147, 112, 219) },
|
|
200 {"thistle" , PALETTERGB (216, 191, 216) },
|
|
201 {"snow1" , PALETTERGB (255, 250, 250) },
|
|
202 {"snow2" , PALETTERGB (238, 233, 233) },
|
|
203 {"snow3" , PALETTERGB (205, 201, 201) },
|
|
204 {"snow4" , PALETTERGB (139, 137, 137) },
|
|
205 {"seashell1" , PALETTERGB (255, 245, 238) },
|
|
206 {"seashell2" , PALETTERGB (238, 229, 222) },
|
|
207 {"seashell3" , PALETTERGB (205, 197, 191) },
|
|
208 {"seashell4" , PALETTERGB (139, 134, 130) },
|
|
209 {"AntiqueWhite1" , PALETTERGB (255, 239, 219) },
|
|
210 {"AntiqueWhite2" , PALETTERGB (238, 223, 204) },
|
|
211 {"AntiqueWhite3" , PALETTERGB (205, 192, 176) },
|
|
212 {"AntiqueWhite4" , PALETTERGB (139, 131, 120) },
|
|
213 {"bisque1" , PALETTERGB (255, 228, 196) },
|
|
214 {"bisque2" , PALETTERGB (238, 213, 183) },
|
|
215 {"bisque3" , PALETTERGB (205, 183, 158) },
|
|
216 {"bisque4" , PALETTERGB (139, 125, 107) },
|
|
217 {"PeachPuff1" , PALETTERGB (255, 218, 185) },
|
|
218 {"PeachPuff2" , PALETTERGB (238, 203, 173) },
|
|
219 {"PeachPuff3" , PALETTERGB (205, 175, 149) },
|
|
220 {"PeachPuff4" , PALETTERGB (139, 119, 101) },
|
|
221 {"NavajoWhite1" , PALETTERGB (255, 222, 173) },
|
|
222 {"NavajoWhite2" , PALETTERGB (238, 207, 161) },
|
|
223 {"NavajoWhite3" , PALETTERGB (205, 179, 139) },
|
|
224 {"NavajoWhite4" , PALETTERGB (139, 121, 94) },
|
|
225 {"LemonChiffon1" , PALETTERGB (255, 250, 205) },
|
|
226 {"LemonChiffon2" , PALETTERGB (238, 233, 191) },
|
|
227 {"LemonChiffon3" , PALETTERGB (205, 201, 165) },
|
|
228 {"LemonChiffon4" , PALETTERGB (139, 137, 112) },
|
|
229 {"cornsilk1" , PALETTERGB (255, 248, 220) },
|
|
230 {"cornsilk2" , PALETTERGB (238, 232, 205) },
|
|
231 {"cornsilk3" , PALETTERGB (205, 200, 177) },
|
|
232 {"cornsilk4" , PALETTERGB (139, 136, 120) },
|
|
233 {"ivory1" , PALETTERGB (255, 255, 240) },
|
|
234 {"ivory2" , PALETTERGB (238, 238, 224) },
|
|
235 {"ivory3" , PALETTERGB (205, 205, 193) },
|
|
236 {"ivory4" , PALETTERGB (139, 139, 131) },
|
|
237 {"honeydew1" , PALETTERGB (240, 255, 240) },
|
|
238 {"honeydew2" , PALETTERGB (224, 238, 224) },
|
|
239 {"honeydew3" , PALETTERGB (193, 205, 193) },
|
|
240 {"honeydew4" , PALETTERGB (131, 139, 131) },
|
|
241 {"LavenderBlush1" , PALETTERGB (255, 240, 245) },
|
|
242 {"LavenderBlush2" , PALETTERGB (238, 224, 229) },
|
|
243 {"LavenderBlush3" , PALETTERGB (205, 193, 197) },
|
|
244 {"LavenderBlush4" , PALETTERGB (139, 131, 134) },
|
|
245 {"MistyRose1" , PALETTERGB (255, 228, 225) },
|
|
246 {"MistyRose2" , PALETTERGB (238, 213, 210) },
|
|
247 {"MistyRose3" , PALETTERGB (205, 183, 181) },
|
|
248 {"MistyRose4" , PALETTERGB (139, 125, 123) },
|
|
249 {"azure1" , PALETTERGB (240, 255, 255) },
|
|
250 {"azure2" , PALETTERGB (224, 238, 238) },
|
|
251 {"azure3" , PALETTERGB (193, 205, 205) },
|
|
252 {"azure4" , PALETTERGB (131, 139, 139) },
|
|
253 {"SlateBlue1" , PALETTERGB (131, 111, 255) },
|
|
254 {"SlateBlue2" , PALETTERGB (122, 103, 238) },
|
|
255 {"SlateBlue3" , PALETTERGB (105, 89, 205) },
|
|
256 {"SlateBlue4" , PALETTERGB (71, 60, 139) },
|
|
257 {"RoyalBlue1" , PALETTERGB (72, 118, 255) },
|
|
258 {"RoyalBlue2" , PALETTERGB (67, 110, 238) },
|
|
259 {"RoyalBlue3" , PALETTERGB (58, 95, 205) },
|
|
260 {"RoyalBlue4" , PALETTERGB (39, 64, 139) },
|
|
261 {"blue1" , PALETTERGB (0, 0, 255) },
|
|
262 {"blue2" , PALETTERGB (0, 0, 238) },
|
|
263 {"blue3" , PALETTERGB (0, 0, 205) },
|
|
264 {"blue4" , PALETTERGB (0, 0, 139) },
|
|
265 {"DodgerBlue1" , PALETTERGB (30, 144, 255) },
|
|
266 {"DodgerBlue2" , PALETTERGB (28, 134, 238) },
|
|
267 {"DodgerBlue3" , PALETTERGB (24, 116, 205) },
|
|
268 {"DodgerBlue4" , PALETTERGB (16, 78, 139) },
|
|
269 {"SteelBlue1" , PALETTERGB (99, 184, 255) },
|
|
270 {"SteelBlue2" , PALETTERGB (92, 172, 238) },
|
|
271 {"SteelBlue3" , PALETTERGB (79, 148, 205) },
|
|
272 {"SteelBlue4" , PALETTERGB (54, 100, 139) },
|
|
273 {"DeepSkyBlue1" , PALETTERGB (0, 191, 255) },
|
|
274 {"DeepSkyBlue2" , PALETTERGB (0, 178, 238) },
|
|
275 {"DeepSkyBlue3" , PALETTERGB (0, 154, 205) },
|
|
276 {"DeepSkyBlue4" , PALETTERGB (0, 104, 139) },
|
|
277 {"SkyBlue1" , PALETTERGB (135, 206, 255) },
|
|
278 {"SkyBlue2" , PALETTERGB (126, 192, 238) },
|
|
279 {"SkyBlue3" , PALETTERGB (108, 166, 205) },
|
|
280 {"SkyBlue4" , PALETTERGB (74, 112, 139) },
|
|
281 {"LightSkyBlue1" , PALETTERGB (176, 226, 255) },
|
|
282 {"LightSkyBlue2" , PALETTERGB (164, 211, 238) },
|
|
283 {"LightSkyBlue3" , PALETTERGB (141, 182, 205) },
|
|
284 {"LightSkyBlue4" , PALETTERGB (96, 123, 139) },
|
|
285 {"SlateGray1" , PALETTERGB (198, 226, 255) },
|
|
286 {"SlateGray2" , PALETTERGB (185, 211, 238) },
|
|
287 {"SlateGray3" , PALETTERGB (159, 182, 205) },
|
|
288 {"SlateGray4" , PALETTERGB (108, 123, 139) },
|
|
289 {"LightSteelBlue1" , PALETTERGB (202, 225, 255) },
|
|
290 {"LightSteelBlue2" , PALETTERGB (188, 210, 238) },
|
|
291 {"LightSteelBlue3" , PALETTERGB (162, 181, 205) },
|
|
292 {"LightSteelBlue4" , PALETTERGB (110, 123, 139) },
|
|
293 {"LightBlue1" , PALETTERGB (191, 239, 255) },
|
|
294 {"LightBlue2" , PALETTERGB (178, 223, 238) },
|
|
295 {"LightBlue3" , PALETTERGB (154, 192, 205) },
|
|
296 {"LightBlue4" , PALETTERGB (104, 131, 139) },
|
|
297 {"LightCyan1" , PALETTERGB (224, 255, 255) },
|
|
298 {"LightCyan2" , PALETTERGB (209, 238, 238) },
|
|
299 {"LightCyan3" , PALETTERGB (180, 205, 205) },
|
|
300 {"LightCyan4" , PALETTERGB (122, 139, 139) },
|
|
301 {"PaleTurquoise1" , PALETTERGB (187, 255, 255) },
|
|
302 {"PaleTurquoise2" , PALETTERGB (174, 238, 238) },
|
|
303 {"PaleTurquoise3" , PALETTERGB (150, 205, 205) },
|
|
304 {"PaleTurquoise4" , PALETTERGB (102, 139, 139) },
|
|
305 {"CadetBlue1" , PALETTERGB (152, 245, 255) },
|
|
306 {"CadetBlue2" , PALETTERGB (142, 229, 238) },
|
|
307 {"CadetBlue3" , PALETTERGB (122, 197, 205) },
|
|
308 {"CadetBlue4" , PALETTERGB (83, 134, 139) },
|
|
309 {"turquoise1" , PALETTERGB (0, 245, 255) },
|
|
310 {"turquoise2" , PALETTERGB (0, 229, 238) },
|
|
311 {"turquoise3" , PALETTERGB (0, 197, 205) },
|
|
312 {"turquoise4" , PALETTERGB (0, 134, 139) },
|
|
313 {"cyan1" , PALETTERGB (0, 255, 255) },
|
|
314 {"cyan2" , PALETTERGB (0, 238, 238) },
|
|
315 {"cyan3" , PALETTERGB (0, 205, 205) },
|
|
316 {"cyan4" , PALETTERGB (0, 139, 139) },
|
|
317 {"DarkSlateGray1" , PALETTERGB (151, 255, 255) },
|
|
318 {"DarkSlateGray2" , PALETTERGB (141, 238, 238) },
|
|
319 {"DarkSlateGray3" , PALETTERGB (121, 205, 205) },
|
|
320 {"DarkSlateGray4" , PALETTERGB (82, 139, 139) },
|
|
321 {"aquamarine1" , PALETTERGB (127, 255, 212) },
|
|
322 {"aquamarine2" , PALETTERGB (118, 238, 198) },
|
|
323 {"aquamarine3" , PALETTERGB (102, 205, 170) },
|
|
324 {"aquamarine4" , PALETTERGB (69, 139, 116) },
|
|
325 {"DarkSeaGreen1" , PALETTERGB (193, 255, 193) },
|
|
326 {"DarkSeaGreen2" , PALETTERGB (180, 238, 180) },
|
|
327 {"DarkSeaGreen3" , PALETTERGB (155, 205, 155) },
|
|
328 {"DarkSeaGreen4" , PALETTERGB (105, 139, 105) },
|
|
329 {"SeaGreen1" , PALETTERGB (84, 255, 159) },
|
|
330 {"SeaGreen2" , PALETTERGB (78, 238, 148) },
|
|
331 {"SeaGreen3" , PALETTERGB (67, 205, 128) },
|
|
332 {"SeaGreen4" , PALETTERGB (46, 139, 87) },
|
|
333 {"PaleGreen1" , PALETTERGB (154, 255, 154) },
|
|
334 {"PaleGreen2" , PALETTERGB (144, 238, 144) },
|
|
335 {"PaleGreen3" , PALETTERGB (124, 205, 124) },
|
|
336 {"PaleGreen4" , PALETTERGB (84, 139, 84) },
|
|
337 {"SpringGreen1" , PALETTERGB (0, 255, 127) },
|
|
338 {"SpringGreen2" , PALETTERGB (0, 238, 118) },
|
|
339 {"SpringGreen3" , PALETTERGB (0, 205, 102) },
|
|
340 {"SpringGreen4" , PALETTERGB (0, 139, 69) },
|
|
341 {"green1" , PALETTERGB (0, 255, 0) },
|
|
342 {"green2" , PALETTERGB (0, 238, 0) },
|
|
343 {"green3" , PALETTERGB (0, 205, 0) },
|
|
344 {"green4" , PALETTERGB (0, 139, 0) },
|
|
345 {"chartreuse1" , PALETTERGB (127, 255, 0) },
|
|
346 {"chartreuse2" , PALETTERGB (118, 238, 0) },
|
|
347 {"chartreuse3" , PALETTERGB (102, 205, 0) },
|
|
348 {"chartreuse4" , PALETTERGB (69, 139, 0) },
|
|
349 {"OliveDrab1" , PALETTERGB (192, 255, 62) },
|
|
350 {"OliveDrab2" , PALETTERGB (179, 238, 58) },
|
|
351 {"OliveDrab3" , PALETTERGB (154, 205, 50) },
|
|
352 {"OliveDrab4" , PALETTERGB (105, 139, 34) },
|
|
353 {"DarkOliveGreen1" , PALETTERGB (202, 255, 112) },
|
|
354 {"DarkOliveGreen2" , PALETTERGB (188, 238, 104) },
|
|
355 {"DarkOliveGreen3" , PALETTERGB (162, 205, 90) },
|
|
356 {"DarkOliveGreen4" , PALETTERGB (110, 139, 61) },
|
|
357 {"khaki1" , PALETTERGB (255, 246, 143) },
|
|
358 {"khaki2" , PALETTERGB (238, 230, 133) },
|
|
359 {"khaki3" , PALETTERGB (205, 198, 115) },
|
|
360 {"khaki4" , PALETTERGB (139, 134, 78) },
|
|
361 {"LightGoldenrod1" , PALETTERGB (255, 236, 139) },
|
|
362 {"LightGoldenrod2" , PALETTERGB (238, 220, 130) },
|
|
363 {"LightGoldenrod3" , PALETTERGB (205, 190, 112) },
|
|
364 {"LightGoldenrod4" , PALETTERGB (139, 129, 76) },
|
|
365 {"LightYellow1" , PALETTERGB (255, 255, 224) },
|
|
366 {"LightYellow2" , PALETTERGB (238, 238, 209) },
|
|
367 {"LightYellow3" , PALETTERGB (205, 205, 180) },
|
|
368 {"LightYellow4" , PALETTERGB (139, 139, 122) },
|
|
369 {"yellow1" , PALETTERGB (255, 255, 0) },
|
|
370 {"yellow2" , PALETTERGB (238, 238, 0) },
|
|
371 {"yellow3" , PALETTERGB (205, 205, 0) },
|
|
372 {"yellow4" , PALETTERGB (139, 139, 0) },
|
|
373 {"gold1" , PALETTERGB (255, 215, 0) },
|
|
374 {"gold2" , PALETTERGB (238, 201, 0) },
|
|
375 {"gold3" , PALETTERGB (205, 173, 0) },
|
|
376 {"gold4" , PALETTERGB (139, 117, 0) },
|
|
377 {"goldenrod1" , PALETTERGB (255, 193, 37) },
|
|
378 {"goldenrod2" , PALETTERGB (238, 180, 34) },
|
|
379 {"goldenrod3" , PALETTERGB (205, 155, 29) },
|
|
380 {"goldenrod4" , PALETTERGB (139, 105, 20) },
|
|
381 {"DarkGoldenrod1" , PALETTERGB (255, 185, 15) },
|
|
382 {"DarkGoldenrod2" , PALETTERGB (238, 173, 14) },
|
|
383 {"DarkGoldenrod3" , PALETTERGB (205, 149, 12) },
|
|
384 {"DarkGoldenrod4" , PALETTERGB (139, 101, 8) },
|
|
385 {"RosyBrown1" , PALETTERGB (255, 193, 193) },
|
|
386 {"RosyBrown2" , PALETTERGB (238, 180, 180) },
|
|
387 {"RosyBrown3" , PALETTERGB (205, 155, 155) },
|
|
388 {"RosyBrown4" , PALETTERGB (139, 105, 105) },
|
|
389 {"IndianRed1" , PALETTERGB (255, 106, 106) },
|
|
390 {"IndianRed2" , PALETTERGB (238, 99, 99) },
|
|
391 {"IndianRed3" , PALETTERGB (205, 85, 85) },
|
|
392 {"IndianRed4" , PALETTERGB (139, 58, 58) },
|
|
393 {"sienna1" , PALETTERGB (255, 130, 71) },
|
|
394 {"sienna2" , PALETTERGB (238, 121, 66) },
|
|
395 {"sienna3" , PALETTERGB (205, 104, 57) },
|
|
396 {"sienna4" , PALETTERGB (139, 71, 38) },
|
|
397 {"burlywood1" , PALETTERGB (255, 211, 155) },
|
|
398 {"burlywood2" , PALETTERGB (238, 197, 145) },
|
|
399 {"burlywood3" , PALETTERGB (205, 170, 125) },
|
|
400 {"burlywood4" , PALETTERGB (139, 115, 85) },
|
|
401 {"wheat1" , PALETTERGB (255, 231, 186) },
|
|
402 {"wheat2" , PALETTERGB (238, 216, 174) },
|
|
403 {"wheat3" , PALETTERGB (205, 186, 150) },
|
|
404 {"wheat4" , PALETTERGB (139, 126, 102) },
|
|
405 {"tan1" , PALETTERGB (255, 165, 79) },
|
|
406 {"tan2" , PALETTERGB (238, 154, 73) },
|
|
407 {"tan3" , PALETTERGB (205, 133, 63) },
|
|
408 {"tan4" , PALETTERGB (139, 90, 43) },
|
|
409 {"chocolate1" , PALETTERGB (255, 127, 36) },
|
|
410 {"chocolate2" , PALETTERGB (238, 118, 33) },
|
|
411 {"chocolate3" , PALETTERGB (205, 102, 29) },
|
|
412 {"chocolate4" , PALETTERGB (139, 69, 19) },
|
|
413 {"firebrick1" , PALETTERGB (255, 48, 48) },
|
|
414 {"firebrick2" , PALETTERGB (238, 44, 44) },
|
|
415 {"firebrick3" , PALETTERGB (205, 38, 38) },
|
|
416 {"firebrick4" , PALETTERGB (139, 26, 26) },
|
|
417 {"brown1" , PALETTERGB (255, 64, 64) },
|
|
418 {"brown2" , PALETTERGB (238, 59, 59) },
|
|
419 {"brown3" , PALETTERGB (205, 51, 51) },
|
|
420 {"brown4" , PALETTERGB (139, 35, 35) },
|
|
421 {"salmon1" , PALETTERGB (255, 140, 105) },
|
|
422 {"salmon2" , PALETTERGB (238, 130, 98) },
|
|
423 {"salmon3" , PALETTERGB (205, 112, 84) },
|
|
424 {"salmon4" , PALETTERGB (139, 76, 57) },
|
|
425 {"LightSalmon1" , PALETTERGB (255, 160, 122) },
|
|
426 {"LightSalmon2" , PALETTERGB (238, 149, 114) },
|
|
427 {"LightSalmon3" , PALETTERGB (205, 129, 98) },
|
|
428 {"LightSalmon4" , PALETTERGB (139, 87, 66) },
|
|
429 {"orange1" , PALETTERGB (255, 165, 0) },
|
|
430 {"orange2" , PALETTERGB (238, 154, 0) },
|
|
431 {"orange3" , PALETTERGB (205, 133, 0) },
|
|
432 {"orange4" , PALETTERGB (139, 90, 0) },
|
|
433 {"DarkOrange1" , PALETTERGB (255, 127, 0) },
|
|
434 {"DarkOrange2" , PALETTERGB (238, 118, 0) },
|
|
435 {"DarkOrange3" , PALETTERGB (205, 102, 0) },
|
|
436 {"DarkOrange4" , PALETTERGB (139, 69, 0) },
|
|
437 {"coral1" , PALETTERGB (255, 114, 86) },
|
|
438 {"coral2" , PALETTERGB (238, 106, 80) },
|
|
439 {"coral3" , PALETTERGB (205, 91, 69) },
|
|
440 {"coral4" , PALETTERGB (139, 62, 47) },
|
|
441 {"tomato1" , PALETTERGB (255, 99, 71) },
|
|
442 {"tomato2" , PALETTERGB (238, 92, 66) },
|
|
443 {"tomato3" , PALETTERGB (205, 79, 57) },
|
|
444 {"tomato4" , PALETTERGB (139, 54, 38) },
|
|
445 {"OrangeRed1" , PALETTERGB (255, 69, 0) },
|
|
446 {"OrangeRed2" , PALETTERGB (238, 64, 0) },
|
|
447 {"OrangeRed3" , PALETTERGB (205, 55, 0) },
|
|
448 {"OrangeRed4" , PALETTERGB (139, 37, 0) },
|
|
449 {"red1" , PALETTERGB (255, 0, 0) },
|
|
450 {"red2" , PALETTERGB (238, 0, 0) },
|
|
451 {"red3" , PALETTERGB (205, 0, 0) },
|
|
452 {"red4" , PALETTERGB (139, 0, 0) },
|
|
453 {"DeepPink1" , PALETTERGB (255, 20, 147) },
|
|
454 {"DeepPink2" , PALETTERGB (238, 18, 137) },
|
|
455 {"DeepPink3" , PALETTERGB (205, 16, 118) },
|
|
456 {"DeepPink4" , PALETTERGB (139, 10, 80) },
|
|
457 {"HotPink1" , PALETTERGB (255, 110, 180) },
|
|
458 {"HotPink2" , PALETTERGB (238, 106, 167) },
|
|
459 {"HotPink3" , PALETTERGB (205, 96, 144) },
|
|
460 {"HotPink4" , PALETTERGB (139, 58, 98) },
|
|
461 {"pink1" , PALETTERGB (255, 181, 197) },
|
|
462 {"pink2" , PALETTERGB (238, 169, 184) },
|
|
463 {"pink3" , PALETTERGB (205, 145, 158) },
|
|
464 {"pink4" , PALETTERGB (139, 99, 108) },
|
|
465 {"LightPink1" , PALETTERGB (255, 174, 185) },
|
|
466 {"LightPink2" , PALETTERGB (238, 162, 173) },
|
|
467 {"LightPink3" , PALETTERGB (205, 140, 149) },
|
|
468 {"LightPink4" , PALETTERGB (139, 95, 101) },
|
|
469 {"PaleVioletRed1" , PALETTERGB (255, 130, 171) },
|
|
470 {"PaleVioletRed2" , PALETTERGB (238, 121, 159) },
|
|
471 {"PaleVioletRed3" , PALETTERGB (205, 104, 137) },
|
|
472 {"PaleVioletRed4" , PALETTERGB (139, 71, 93) },
|
|
473 {"maroon1" , PALETTERGB (255, 52, 179) },
|
|
474 {"maroon2" , PALETTERGB (238, 48, 167) },
|
|
475 {"maroon3" , PALETTERGB (205, 41, 144) },
|
|
476 {"maroon4" , PALETTERGB (139, 28, 98) },
|
|
477 {"VioletRed1" , PALETTERGB (255, 62, 150) },
|
|
478 {"VioletRed2" , PALETTERGB (238, 58, 140) },
|
|
479 {"VioletRed3" , PALETTERGB (205, 50, 120) },
|
|
480 {"VioletRed4" , PALETTERGB (139, 34, 82) },
|
|
481 {"magenta1" , PALETTERGB (255, 0, 255) },
|
|
482 {"magenta2" , PALETTERGB (238, 0, 238) },
|
|
483 {"magenta3" , PALETTERGB (205, 0, 205) },
|
|
484 {"magenta4" , PALETTERGB (139, 0, 139) },
|
|
485 {"orchid1" , PALETTERGB (255, 131, 250) },
|
|
486 {"orchid2" , PALETTERGB (238, 122, 233) },
|
|
487 {"orchid3" , PALETTERGB (205, 105, 201) },
|
|
488 {"orchid4" , PALETTERGB (139, 71, 137) },
|
|
489 {"plum1" , PALETTERGB (255, 187, 255) },
|
|
490 {"plum2" , PALETTERGB (238, 174, 238) },
|
|
491 {"plum3" , PALETTERGB (205, 150, 205) },
|
|
492 {"plum4" , PALETTERGB (139, 102, 139) },
|
|
493 {"MediumOrchid1" , PALETTERGB (224, 102, 255) },
|
|
494 {"MediumOrchid2" , PALETTERGB (209, 95, 238) },
|
|
495 {"MediumOrchid3" , PALETTERGB (180, 82, 205) },
|
|
496 {"MediumOrchid4" , PALETTERGB (122, 55, 139) },
|
|
497 {"DarkOrchid1" , PALETTERGB (191, 62, 255) },
|
|
498 {"DarkOrchid2" , PALETTERGB (178, 58, 238) },
|
|
499 {"DarkOrchid3" , PALETTERGB (154, 50, 205) },
|
|
500 {"DarkOrchid4" , PALETTERGB (104, 34, 139) },
|
|
501 {"purple1" , PALETTERGB (155, 48, 255) },
|
|
502 {"purple2" , PALETTERGB (145, 44, 238) },
|
|
503 {"purple3" , PALETTERGB (125, 38, 205) },
|
|
504 {"purple4" , PALETTERGB (85, 26, 139) },
|
|
505 {"MediumPurple1" , PALETTERGB (171, 130, 255) },
|
|
506 {"MediumPurple2" , PALETTERGB (159, 121, 238) },
|
|
507 {"MediumPurple3" , PALETTERGB (137, 104, 205) },
|
|
508 {"MediumPurple4" , PALETTERGB (93, 71, 139) },
|
|
509 {"thistle1" , PALETTERGB (255, 225, 255) },
|
|
510 {"thistle2" , PALETTERGB (238, 210, 238) },
|
|
511 {"thistle3" , PALETTERGB (205, 181, 205) },
|
|
512 {"thistle4" , PALETTERGB (139, 123, 139) },
|
|
513 {"gray0" , PALETTERGB (0, 0, 0) },
|
|
514 {"grey0" , PALETTERGB (0, 0, 0) },
|
|
515 {"gray1" , PALETTERGB (3, 3, 3) },
|
|
516 {"grey1" , PALETTERGB (3, 3, 3) },
|
|
517 {"gray2" , PALETTERGB (5, 5, 5) },
|
|
518 {"grey2" , PALETTERGB (5, 5, 5) },
|
|
519 {"gray3" , PALETTERGB (8, 8, 8) },
|
|
520 {"grey3" , PALETTERGB (8, 8, 8) },
|
|
521 {"gray4" , PALETTERGB (10, 10, 10) },
|
|
522 {"grey4" , PALETTERGB (10, 10, 10) },
|
|
523 {"gray5" , PALETTERGB (13, 13, 13) },
|
|
524 {"grey5" , PALETTERGB (13, 13, 13) },
|
|
525 {"gray6" , PALETTERGB (15, 15, 15) },
|
|
526 {"grey6" , PALETTERGB (15, 15, 15) },
|
|
527 {"gray7" , PALETTERGB (18, 18, 18) },
|
|
528 {"grey7" , PALETTERGB (18, 18, 18) },
|
|
529 {"gray8" , PALETTERGB (20, 20, 20) },
|
|
530 {"grey8" , PALETTERGB (20, 20, 20) },
|
|
531 {"gray9" , PALETTERGB (23, 23, 23) },
|
|
532 {"grey9" , PALETTERGB (23, 23, 23) },
|
|
533 {"gray10" , PALETTERGB (26, 26, 26) },
|
|
534 {"grey10" , PALETTERGB (26, 26, 26) },
|
|
535 {"gray11" , PALETTERGB (28, 28, 28) },
|
|
536 {"grey11" , PALETTERGB (28, 28, 28) },
|
|
537 {"gray12" , PALETTERGB (31, 31, 31) },
|
|
538 {"grey12" , PALETTERGB (31, 31, 31) },
|
|
539 {"gray13" , PALETTERGB (33, 33, 33) },
|
|
540 {"grey13" , PALETTERGB (33, 33, 33) },
|
|
541 {"gray14" , PALETTERGB (36, 36, 36) },
|
|
542 {"grey14" , PALETTERGB (36, 36, 36) },
|
|
543 {"gray15" , PALETTERGB (38, 38, 38) },
|
|
544 {"grey15" , PALETTERGB (38, 38, 38) },
|
|
545 {"gray16" , PALETTERGB (41, 41, 41) },
|
|
546 {"grey16" , PALETTERGB (41, 41, 41) },
|
|
547 {"gray17" , PALETTERGB (43, 43, 43) },
|
|
548 {"grey17" , PALETTERGB (43, 43, 43) },
|
|
549 {"gray18" , PALETTERGB (46, 46, 46) },
|
|
550 {"grey18" , PALETTERGB (46, 46, 46) },
|
|
551 {"gray19" , PALETTERGB (48, 48, 48) },
|
|
552 {"grey19" , PALETTERGB (48, 48, 48) },
|
|
553 {"gray20" , PALETTERGB (51, 51, 51) },
|
|
554 {"grey20" , PALETTERGB (51, 51, 51) },
|
|
555 {"gray21" , PALETTERGB (54, 54, 54) },
|
|
556 {"grey21" , PALETTERGB (54, 54, 54) },
|
|
557 {"gray22" , PALETTERGB (56, 56, 56) },
|
|
558 {"grey22" , PALETTERGB (56, 56, 56) },
|
|
559 {"gray23" , PALETTERGB (59, 59, 59) },
|
|
560 {"grey23" , PALETTERGB (59, 59, 59) },
|
|
561 {"gray24" , PALETTERGB (61, 61, 61) },
|
|
562 {"grey24" , PALETTERGB (61, 61, 61) },
|
|
563 {"gray25" , PALETTERGB (64, 64, 64) },
|
|
564 {"grey25" , PALETTERGB (64, 64, 64) },
|
|
565 {"gray26" , PALETTERGB (66, 66, 66) },
|
|
566 {"grey26" , PALETTERGB (66, 66, 66) },
|
|
567 {"gray27" , PALETTERGB (69, 69, 69) },
|
|
568 {"grey27" , PALETTERGB (69, 69, 69) },
|
|
569 {"gray28" , PALETTERGB (71, 71, 71) },
|
|
570 {"grey28" , PALETTERGB (71, 71, 71) },
|
|
571 {"gray29" , PALETTERGB (74, 74, 74) },
|
|
572 {"grey29" , PALETTERGB (74, 74, 74) },
|
|
573 {"gray30" , PALETTERGB (77, 77, 77) },
|
|
574 {"grey30" , PALETTERGB (77, 77, 77) },
|
|
575 {"gray31" , PALETTERGB (79, 79, 79) },
|
|
576 {"grey31" , PALETTERGB (79, 79, 79) },
|
|
577 {"gray32" , PALETTERGB (82, 82, 82) },
|
|
578 {"grey32" , PALETTERGB (82, 82, 82) },
|
|
579 {"gray33" , PALETTERGB (84, 84, 84) },
|
|
580 {"grey33" , PALETTERGB (84, 84, 84) },
|
|
581 {"gray34" , PALETTERGB (87, 87, 87) },
|
|
582 {"grey34" , PALETTERGB (87, 87, 87) },
|
|
583 {"gray35" , PALETTERGB (89, 89, 89) },
|
|
584 {"grey35" , PALETTERGB (89, 89, 89) },
|
|
585 {"gray36" , PALETTERGB (92, 92, 92) },
|
|
586 {"grey36" , PALETTERGB (92, 92, 92) },
|
|
587 {"gray37" , PALETTERGB (94, 94, 94) },
|
|
588 {"grey37" , PALETTERGB (94, 94, 94) },
|
|
589 {"gray38" , PALETTERGB (97, 97, 97) },
|
|
590 {"grey38" , PALETTERGB (97, 97, 97) },
|
|
591 {"gray39" , PALETTERGB (99, 99, 99) },
|
|
592 {"grey39" , PALETTERGB (99, 99, 99) },
|
|
593 {"gray40" , PALETTERGB (102, 102, 102) },
|
|
594 {"grey40" , PALETTERGB (102, 102, 102) },
|
|
595 {"gray41" , PALETTERGB (105, 105, 105) },
|
|
596 {"grey41" , PALETTERGB (105, 105, 105) },
|
|
597 {"gray42" , PALETTERGB (107, 107, 107) },
|
|
598 {"grey42" , PALETTERGB (107, 107, 107) },
|
|
599 {"gray43" , PALETTERGB (110, 110, 110) },
|
|
600 {"grey43" , PALETTERGB (110, 110, 110) },
|
|
601 {"gray44" , PALETTERGB (112, 112, 112) },
|
|
602 {"grey44" , PALETTERGB (112, 112, 112) },
|
|
603 {"gray45" , PALETTERGB (115, 115, 115) },
|
|
604 {"grey45" , PALETTERGB (115, 115, 115) },
|
|
605 {"gray46" , PALETTERGB (117, 117, 117) },
|
|
606 {"grey46" , PALETTERGB (117, 117, 117) },
|
|
607 {"gray47" , PALETTERGB (120, 120, 120) },
|
|
608 {"grey47" , PALETTERGB (120, 120, 120) },
|
|
609 {"gray48" , PALETTERGB (122, 122, 122) },
|
|
610 {"grey48" , PALETTERGB (122, 122, 122) },
|
|
611 {"gray49" , PALETTERGB (125, 125, 125) },
|
|
612 {"grey49" , PALETTERGB (125, 125, 125) },
|
|
613 {"gray50" , PALETTERGB (127, 127, 127) },
|
|
614 {"grey50" , PALETTERGB (127, 127, 127) },
|
|
615 {"gray51" , PALETTERGB (130, 130, 130) },
|
|
616 {"grey51" , PALETTERGB (130, 130, 130) },
|
|
617 {"gray52" , PALETTERGB (133, 133, 133) },
|
|
618 {"grey52" , PALETTERGB (133, 133, 133) },
|
|
619 {"gray53" , PALETTERGB (135, 135, 135) },
|
|
620 {"grey53" , PALETTERGB (135, 135, 135) },
|
|
621 {"gray54" , PALETTERGB (138, 138, 138) },
|
|
622 {"grey54" , PALETTERGB (138, 138, 138) },
|
|
623 {"gray55" , PALETTERGB (140, 140, 140) },
|
|
624 {"grey55" , PALETTERGB (140, 140, 140) },
|
|
625 {"gray56" , PALETTERGB (143, 143, 143) },
|
|
626 {"grey56" , PALETTERGB (143, 143, 143) },
|
|
627 {"gray57" , PALETTERGB (145, 145, 145) },
|
|
628 {"grey57" , PALETTERGB (145, 145, 145) },
|
|
629 {"gray58" , PALETTERGB (148, 148, 148) },
|
|
630 {"grey58" , PALETTERGB (148, 148, 148) },
|
|
631 {"gray59" , PALETTERGB (150, 150, 150) },
|
|
632 {"grey59" , PALETTERGB (150, 150, 150) },
|
|
633 {"gray60" , PALETTERGB (153, 153, 153) },
|
|
634 {"grey60" , PALETTERGB (153, 153, 153) },
|
|
635 {"gray61" , PALETTERGB (156, 156, 156) },
|
|
636 {"grey61" , PALETTERGB (156, 156, 156) },
|
|
637 {"gray62" , PALETTERGB (158, 158, 158) },
|
|
638 {"grey62" , PALETTERGB (158, 158, 158) },
|
|
639 {"gray63" , PALETTERGB (161, 161, 161) },
|
|
640 {"grey63" , PALETTERGB (161, 161, 161) },
|
|
641 {"gray64" , PALETTERGB (163, 163, 163) },
|
|
642 {"grey64" , PALETTERGB (163, 163, 163) },
|
|
643 {"gray65" , PALETTERGB (166, 166, 166) },
|
|
644 {"grey65" , PALETTERGB (166, 166, 166) },
|
|
645 {"gray66" , PALETTERGB (168, 168, 168) },
|
|
646 {"grey66" , PALETTERGB (168, 168, 168) },
|
|
647 {"gray67" , PALETTERGB (171, 171, 171) },
|
|
648 {"grey67" , PALETTERGB (171, 171, 171) },
|
|
649 {"gray68" , PALETTERGB (173, 173, 173) },
|
|
650 {"grey68" , PALETTERGB (173, 173, 173) },
|
|
651 {"gray69" , PALETTERGB (176, 176, 176) },
|
|
652 {"grey69" , PALETTERGB (176, 176, 176) },
|
|
653 {"gray70" , PALETTERGB (179, 179, 179) },
|
|
654 {"grey70" , PALETTERGB (179, 179, 179) },
|
|
655 {"gray71" , PALETTERGB (181, 181, 181) },
|
|
656 {"grey71" , PALETTERGB (181, 181, 181) },
|
|
657 {"gray72" , PALETTERGB (184, 184, 184) },
|
|
658 {"grey72" , PALETTERGB (184, 184, 184) },
|
|
659 {"gray73" , PALETTERGB (186, 186, 186) },
|
|
660 {"grey73" , PALETTERGB (186, 186, 186) },
|
|
661 {"gray74" , PALETTERGB (189, 189, 189) },
|
|
662 {"grey74" , PALETTERGB (189, 189, 189) },
|
|
663 {"gray75" , PALETTERGB (191, 191, 191) },
|
|
664 {"grey75" , PALETTERGB (191, 191, 191) },
|
|
665 {"gray76" , PALETTERGB (194, 194, 194) },
|
|
666 {"grey76" , PALETTERGB (194, 194, 194) },
|
|
667 {"gray77" , PALETTERGB (196, 196, 196) },
|
|
668 {"grey77" , PALETTERGB (196, 196, 196) },
|
|
669 {"gray78" , PALETTERGB (199, 199, 199) },
|
|
670 {"grey78" , PALETTERGB (199, 199, 199) },
|
|
671 {"gray79" , PALETTERGB (201, 201, 201) },
|
|
672 {"grey79" , PALETTERGB (201, 201, 201) },
|
|
673 {"gray80" , PALETTERGB (204, 204, 204) },
|
|
674 {"grey80" , PALETTERGB (204, 204, 204) },
|
|
675 {"gray81" , PALETTERGB (207, 207, 207) },
|
|
676 {"grey81" , PALETTERGB (207, 207, 207) },
|
|
677 {"gray82" , PALETTERGB (209, 209, 209) },
|
|
678 {"grey82" , PALETTERGB (209, 209, 209) },
|
|
679 {"gray83" , PALETTERGB (212, 212, 212) },
|
|
680 {"grey83" , PALETTERGB (212, 212, 212) },
|
|
681 {"gray84" , PALETTERGB (214, 214, 214) },
|
|
682 {"grey84" , PALETTERGB (214, 214, 214) },
|
|
683 {"gray85" , PALETTERGB (217, 217, 217) },
|
|
684 {"grey85" , PALETTERGB (217, 217, 217) },
|
|
685 {"gray86" , PALETTERGB (219, 219, 219) },
|
|
686 {"grey86" , PALETTERGB (219, 219, 219) },
|
|
687 {"gray87" , PALETTERGB (222, 222, 222) },
|
|
688 {"grey87" , PALETTERGB (222, 222, 222) },
|
|
689 {"gray88" , PALETTERGB (224, 224, 224) },
|
|
690 {"grey88" , PALETTERGB (224, 224, 224) },
|
|
691 {"gray89" , PALETTERGB (227, 227, 227) },
|
|
692 {"grey89" , PALETTERGB (227, 227, 227) },
|
|
693 {"gray90" , PALETTERGB (229, 229, 229) },
|
|
694 {"grey90" , PALETTERGB (229, 229, 229) },
|
|
695 {"gray91" , PALETTERGB (232, 232, 232) },
|
|
696 {"grey91" , PALETTERGB (232, 232, 232) },
|
|
697 {"gray92" , PALETTERGB (235, 235, 235) },
|
|
698 {"grey92" , PALETTERGB (235, 235, 235) },
|
|
699 {"gray93" , PALETTERGB (237, 237, 237) },
|
|
700 {"grey93" , PALETTERGB (237, 237, 237) },
|
|
701 {"gray94" , PALETTERGB (240, 240, 240) },
|
|
702 {"grey94" , PALETTERGB (240, 240, 240) },
|
|
703 {"gray95" , PALETTERGB (242, 242, 242) },
|
|
704 {"grey95" , PALETTERGB (242, 242, 242) },
|
|
705 {"gray96" , PALETTERGB (245, 245, 245) },
|
|
706 {"grey96" , PALETTERGB (245, 245, 245) },
|
|
707 {"gray97" , PALETTERGB (247, 247, 247) },
|
|
708 {"grey97" , PALETTERGB (247, 247, 247) },
|
|
709 {"gray98" , PALETTERGB (250, 250, 250) },
|
|
710 {"grey98" , PALETTERGB (250, 250, 250) },
|
|
711 {"gray99" , PALETTERGB (252, 252, 252) },
|
|
712 {"grey99" , PALETTERGB (252, 252, 252) },
|
|
713 {"gray100" , PALETTERGB (255, 255, 255) },
|
|
714 {"grey100" , PALETTERGB (255, 255, 255) },
|
|
715 {"DarkGrey" , PALETTERGB (169, 169, 169) },
|
|
716 {"DarkGray" , PALETTERGB (169, 169, 169) },
|
|
717 {"DarkBlue" , PALETTERGB (0, 0, 139) },
|
|
718 {"DarkCyan" , PALETTERGB (0, 139, 139) },
|
|
719 {"DarkMagenta" , PALETTERGB (139, 0, 139) },
|
|
720 {"DarkRed" , PALETTERGB (139, 0, 0) },
|
|
721 {"LightGreen" , PALETTERGB (144, 238, 144) }
|
213
|
722 };
|
|
723
|
294
|
724
|
|
725 /************************************************************************/
|
|
726 /* helpers */
|
|
727 /************************************************************************/
|
|
728
|
227
|
729 static int
|
|
730 hexval (char c)
|
|
731 {
|
251
|
732 /* assumes ASCII and isxdigit(c) */
|
|
733 if (c >= 'a')
|
227
|
734 return c-'a' + 10;
|
251
|
735 else if (c >= 'A')
|
239
|
736 return c-'A' + 10;
|
|
737 else
|
|
738 return c-'0';
|
227
|
739 }
|
|
740
|
267
|
741 COLORREF
|
213
|
742 mswindows_string_to_color(CONST char *name)
|
|
743 {
|
227
|
744 int i;
|
251
|
745
|
213
|
746 if (*name == '#')
|
251
|
747 {
|
282
|
748 /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB"
|
|
749 or "rgb:rrrr/gggg/bbbb" */
|
251
|
750 unsigned int r, g, b;
|
|
751
|
|
752 for (i=1; i<strlen(name); i++)
|
|
753 {
|
272
|
754 if (!isxdigit ((int)name[i]))
|
294
|
755 return (COLORREF) -1;
|
251
|
756 }
|
|
757 if (strlen(name)==7)
|
|
758 {
|
|
759 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
760 g = hexval (name[3]) * 16 + hexval (name[4]);
|
|
761 b = hexval (name[5]) * 16 + hexval (name[6]);
|
|
762 return (PALETTERGB (r, g, b));
|
|
763 }
|
|
764 else if (strlen(name)==10)
|
|
765 {
|
|
766 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
767 g = hexval (name[4]) * 16 + hexval (name[5]);
|
|
768 b = hexval (name[7]) * 16 + hexval (name[8]);
|
|
769 return (PALETTERGB (r, g, b));
|
|
770 }
|
|
771 else if (strlen(name)==13)
|
|
772 {
|
|
773 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
774 g = hexval (name[5]) * 16 + hexval (name[6]);
|
|
775 b = hexval (name[9]) * 16 + hexval (name[10]);
|
|
776 return (PALETTERGB (r, g, b));
|
|
777 }
|
|
778 }
|
282
|
779 else if (!strncmp(name, "rgb:", 4))
|
|
780 {
|
|
781 unsigned int r,g,b;
|
|
782
|
288
|
783 if (sscanf(name, "rgb:%04x/%04x/%04x", &r, &g, &b) == 3)
|
|
784 {
|
|
785 int len = strlen (name);
|
|
786 if (len == 18)
|
|
787 {
|
|
788 r /= 257;
|
|
789 g /= 257;
|
|
790 b /= 257;
|
|
791 }
|
|
792 else if (len == 15)
|
|
793 {
|
|
794 r /= 17;
|
|
795 g /= 17;
|
|
796 b /= 17;
|
|
797 }
|
|
798 return (PALETTERGB (r, g, b));
|
|
799 }
|
|
800 else
|
294
|
801 return (COLORREF) -1;
|
282
|
802 }
|
251
|
803 else if (*name) /* Can't be an empty string */
|
|
804 {
|
|
805 char *nospaces = alloca (strlen (name)+1);
|
|
806 char *c=nospaces;
|
|
807 while (*name)
|
|
808 if (*name != ' ')
|
|
809 *(c++) = *(name++);
|
|
810 else
|
|
811 name++;
|
|
812 *c = '\0';
|
|
813
|
272
|
814 for (i=0; i< countof (mswindows_X_color_map); i++)
|
251
|
815 if (!stricmp (nospaces, mswindows_X_color_map[i].name))
|
|
816 return (mswindows_X_color_map[i].colorref);
|
|
817 }
|
294
|
818 return (COLORREF) -1;
|
213
|
819 }
|
|
820
|
294
|
821 /*
|
|
822 * Returns non-zero if the two supplied font patterns match.
|
|
823 * If they match and fontname is not NULL, copies the logical OR of the
|
|
824 * patterns to fontname (which is assumed to be at least MSW_FONTSIZE in size).
|
|
825 *
|
|
826 * The patterns 'match' iff for each field that is not blank in either pattern,
|
|
827 * the corresponding field in the other pattern is either identical or blank.
|
|
828 */
|
|
829 static int
|
|
830 match_font (char *pattern1, char *pattern2, char *fontname)
|
|
831 {
|
296
|
832 char *c1=pattern1, *c2=pattern2, *e1=0, *e2=0;
|
294
|
833 int i;
|
|
834
|
|
835 if (fontname)
|
|
836 fontname[0] = '\0';
|
|
837
|
|
838 for (i=0; i<5; i++)
|
|
839 {
|
|
840 if (c1 && (e1 = strchr (c1, ':')))
|
|
841 *(e1) = '\0';
|
|
842 if (c2 && (e2 = strchr (c2, ':')))
|
|
843 *(e2) = '\0';
|
|
844
|
|
845 if (c1 && c1[0]!='\0')
|
|
846 {
|
|
847 if (c2 && c2[0]!='\0' && stricmp(c1, c2))
|
|
848 {
|
|
849 if (e1) *e1 = ':';
|
|
850 if (e2) *e2 = ':';
|
|
851 return 0;
|
|
852 }
|
|
853 else if (fontname)
|
|
854 strcat (strcat (fontname, c1), ":");
|
|
855 }
|
|
856 else if (fontname)
|
|
857 {
|
|
858 if (c2 && c2[0]!='\0')
|
|
859 strcat (strcat (fontname, c2), ":");
|
|
860 else
|
|
861 strcat (fontname, ":");
|
|
862 }
|
|
863
|
|
864 if (e1) *(e1++) = ':';
|
|
865 if (e2) *(e2++) = ':';
|
|
866 c1=e1;
|
|
867 c2=e2;
|
|
868 }
|
|
869
|
|
870 if (fontname)
|
|
871 fontname[strlen (fontname) - 1] = '\0'; /* Trim trailing ':' */
|
|
872 return 1;
|
|
873 }
|
|
874
|
|
875
|
|
876 /************************************************************************/
|
|
877 /* methods */
|
|
878 /************************************************************************/
|
|
879
|
213
|
880 static int
|
|
881 mswindows_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name,
|
|
882 Lisp_Object device, Error_behavior errb)
|
|
883 {
|
|
884 CONST char *extname;
|
|
885 COLORREF color;
|
|
886
|
|
887 GET_C_STRING_CTEXT_DATA_ALLOCA (name, extname);
|
|
888 color = mswindows_string_to_color(extname);
|
|
889 if (color != -1)
|
|
890 {
|
|
891 c->data = xnew (struct mswindows_color_instance_data);
|
|
892 COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color;
|
|
893 return 1;
|
|
894 }
|
|
895 maybe_signal_simple_error ("unrecognized color", name, Qcolor, errb);
|
|
896 return(0);
|
|
897 }
|
|
898
|
245
|
899 #if 0
|
213
|
900 static void
|
|
901 mswindows_mark_color_instance (struct Lisp_Color_Instance *c,
|
|
902 void (*markobj) (Lisp_Object))
|
|
903 {
|
|
904 }
|
245
|
905 #endif
|
213
|
906
|
|
907 static void
|
|
908 mswindows_print_color_instance (struct Lisp_Color_Instance *c,
|
|
909 Lisp_Object printcharfun,
|
|
910 int escapeflag)
|
|
911 {
|
|
912 char buf[32];
|
|
913 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
|
227
|
914 sprintf (buf, " %06ld=(%04X,%04X,%04X)", color & 0xffffff,
|
251
|
915 GetRValue(color)*257, GetGValue(color)*257, GetBValue(color)*257);
|
213
|
916 write_c_string (buf, printcharfun);
|
|
917 }
|
|
918
|
|
919 static void
|
|
920 mswindows_finalize_color_instance (struct Lisp_Color_Instance *c)
|
|
921 {
|
|
922 if (c->data)
|
|
923 {
|
|
924 xfree (c->data);
|
|
925 c->data = 0;
|
|
926 }
|
|
927 }
|
|
928
|
|
929 static int
|
|
930 mswindows_color_instance_equal (struct Lisp_Color_Instance *c1,
|
|
931 struct Lisp_Color_Instance *c2,
|
|
932 int depth)
|
|
933 {
|
|
934 return (COLOR_INSTANCE_MSWINDOWS_COLOR(c1) == COLOR_INSTANCE_MSWINDOWS_COLOR(c2));
|
|
935 }
|
|
936
|
|
937 static unsigned long
|
|
938 mswindows_color_instance_hash (struct Lisp_Color_Instance *c, int depth)
|
|
939 {
|
280
|
940 return (unsigned long)(COLOR_INSTANCE_MSWINDOWS_COLOR(c));
|
213
|
941 }
|
|
942
|
|
943 static Lisp_Object
|
|
944 mswindows_color_instance_rgb_components (struct Lisp_Color_Instance *c)
|
|
945 {
|
|
946 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
|
243
|
947 return list3 (make_int (GetRValue (color) * 257),
|
|
948 make_int (GetGValue (color) * 257),
|
|
949 make_int (GetBValue (color) * 257));
|
213
|
950 }
|
|
951
|
|
952 static int
|
|
953 mswindows_valid_color_name_p (struct device *d, Lisp_Object color)
|
|
954 {
|
|
955 CONST char *extname;
|
|
956
|
|
957 GET_C_STRING_CTEXT_DATA_ALLOCA (color, extname);
|
|
958 return (mswindows_string_to_color(extname)!=-1);
|
|
959 }
|
|
960
|
|
961
|
|
962
|
|
963 static void
|
|
964 mswindows_finalize_font_instance (struct Lisp_Font_Instance *f)
|
|
965 {
|
|
966 if (f->data)
|
|
967 {
|
|
968 DeleteObject(f->data);
|
|
969 f->data=0;
|
|
970 }
|
|
971 }
|
|
972
|
|
973 static int
|
|
974 mswindows_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name,
|
294
|
975 Lisp_Object device, Error_behavior errb)
|
213
|
976 {
|
|
977 CONST char *extname;
|
|
978 LOGFONT logfont;
|
|
979 int fields;
|
|
980 int pt;
|
294
|
981 char fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8];
|
|
982 char effects[LF_FACESIZE], charset[LF_FACESIZE];
|
|
983 char *c;
|
|
984
|
213
|
985 GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, extname);
|
|
986
|
|
987 /*
|
|
988 * mswindows fonts look like:
|
294
|
989 * fontname[:[weight ][style][:pointsize[:effects]]][:charset]
|
213
|
990 * The font name field shouldn't be empty.
|
|
991 *
|
|
992 * ie:
|
|
993 * Lucida Console:Regular:10
|
|
994 * minimal:
|
|
995 * Courier New
|
|
996 * maximal:
|
294
|
997 * Courier New:Bold Italic:10:underline strikeout:western
|
213
|
998 */
|
294
|
999
|
213
|
1000 fields = sscanf (extname, "%31[^:]:%31[^:]:%7[^:]:%31[^:]:%31s",
|
|
1001 fontname, weight, points, effects, charset);
|
|
1002
|
294
|
1003 /* This function is implemented in a fairly ad-hoc manner.
|
|
1004 * The general idea is to validate and canonicalize each of the above fields
|
|
1005 * at the same time as we build up the win32 LOGFONT structure. This enables
|
|
1006 * us to use math_font() on a canonicalized font string to check the
|
|
1007 * availability of the requested font */
|
|
1008
|
213
|
1009 if (fields<0)
|
|
1010 {
|
|
1011 maybe_signal_simple_error ("Invalid font", f->name, Qfont, errb);
|
|
1012 return (0);
|
|
1013 }
|
|
1014
|
|
1015 if (fields>0 && strlen(fontname))
|
|
1016 {
|
|
1017 strncpy (logfont.lfFaceName, fontname, LF_FACESIZE);
|
|
1018 logfont.lfFaceName[LF_FACESIZE-1] = 0;
|
|
1019 }
|
|
1020 else
|
|
1021 {
|
|
1022 maybe_signal_simple_error ("Must specify a font name", f->name, Qfont, errb);
|
|
1023 return (0);
|
|
1024 }
|
|
1025
|
294
|
1026 /* weight */
|
|
1027 if (fields < 2)
|
|
1028 strcpy (weight, "Regular");
|
|
1029
|
|
1030 /* Maybe split weight into weight and style */
|
|
1031 if ((c=strchr(weight, ' ')))
|
213
|
1032 {
|
294
|
1033 *c = '\0';
|
|
1034 style = c+1;
|
|
1035 }
|
|
1036 else
|
|
1037 style = NULL;
|
|
1038
|
|
1039 #define FROB(wgt) \
|
|
1040 if (stricmp (weight, #wgt) == 0) \
|
|
1041 logfont.lfWeight = FW_##wgt
|
213
|
1042
|
294
|
1043 FROB (REGULAR);
|
|
1044 else FROB (THIN);
|
|
1045 else FROB (EXTRALIGHT);
|
|
1046 else FROB (ULTRALIGHT);
|
|
1047 else FROB (LIGHT);
|
|
1048 else FROB (NORMAL);
|
|
1049 else FROB (MEDIUM);
|
|
1050 else FROB (SEMIBOLD);
|
|
1051 else FROB (DEMIBOLD);
|
|
1052 else FROB (BOLD);
|
|
1053 else FROB (EXTRABOLD);
|
|
1054 else FROB (ULTRABOLD);
|
|
1055 else FROB (HEAVY);
|
|
1056 else FROB (BLACK);
|
|
1057 else if (!style)
|
|
1058 {
|
213
|
1059 logfont.lfWeight = FW_REGULAR;
|
294
|
1060 style = weight; /* May have specified style without weight */
|
213
|
1061 }
|
294
|
1062 else
|
213
|
1063 {
|
294
|
1064 maybe_signal_simple_error ("Invalid font weight", f->name, Qfont, errb);
|
|
1065 return (0);
|
213
|
1066 }
|
|
1067
|
294
|
1068 #undef FROB
|
|
1069
|
|
1070 if (style)
|
213
|
1071 {
|
286
|
1072 /* #### what about oblique? */
|
213
|
1073 if (stricmp (style,"italic") == 0)
|
|
1074 logfont.lfItalic = TRUE;
|
|
1075 else
|
|
1076 {
|
|
1077 maybe_signal_simple_error ("Invalid font weight or style", f->name, Qfont, errb);
|
294
|
1078 return (0);
|
213
|
1079 }
|
|
1080
|
294
|
1081 /* Glue weight and style together again */
|
|
1082 if (weight != style)
|
|
1083 *c = ' ';
|
|
1084 }
|
213
|
1085 else
|
|
1086 logfont.lfItalic = FALSE;
|
|
1087
|
294
|
1088 if (fields < 3)
|
|
1089 pt = 10; /* #### Should we reject strings that don't specify a size? */
|
|
1090 else if ((pt=atoi(points)) == 0)
|
|
1091 {
|
|
1092 maybe_signal_simple_error ("Invalid font pointsize", f->name, Qfont, errb);
|
|
1093 return (0);
|
|
1094 }
|
213
|
1095
|
|
1096 /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */
|
|
1097 logfont.lfHeight = -MulDiv(pt, DEVICE_MSWINDOWS_LOGPIXELSY(XDEVICE (device)), 72);
|
|
1098 logfont.lfWidth = 0;
|
|
1099
|
294
|
1100 /* Effects */
|
213
|
1101 logfont.lfUnderline = FALSE;
|
|
1102 logfont.lfStrikeOut = FALSE;
|
294
|
1103 if (fields >= 4 && effects[0] != '\0')
|
|
1104 {
|
|
1105 char *effects2;
|
213
|
1106
|
294
|
1107 /* Maybe split effects into effects and effects2 */
|
|
1108 if ((c=strchr (effects, ' ')))
|
|
1109 {
|
|
1110 *c = '\0';
|
|
1111 effects2 = c+1;
|
|
1112 }
|
|
1113 else
|
|
1114 effects2 = NULL;
|
|
1115
|
|
1116 if (stricmp (effects, "underline") == 0)
|
|
1117 logfont.lfUnderline = TRUE;
|
|
1118 else if (stricmp (effects, "strikeout") == 0)
|
|
1119 logfont.lfStrikeOut = TRUE;
|
|
1120 else
|
|
1121 {
|
|
1122 maybe_signal_simple_error ("Invalid font effect", f->name,
|
|
1123 Qfont, errb);
|
|
1124 return (0);
|
|
1125 }
|
|
1126
|
|
1127 if (effects2 && effects2[0] != '\0')
|
|
1128 {
|
|
1129 if (stricmp (effects2, "underline") == 0)
|
|
1130 logfont.lfUnderline = TRUE;
|
|
1131 else if (stricmp (effects2, "strikeout") == 0)
|
|
1132 logfont.lfStrikeOut = TRUE;
|
|
1133 else
|
|
1134 {
|
|
1135 maybe_signal_simple_error ("Invalid font effect", f->name,
|
|
1136 Qfont, errb);
|
|
1137 return (0);
|
|
1138 }
|
|
1139 }
|
|
1140
|
|
1141 /* Regenerate sanitised effects string */
|
|
1142 if (logfont.lfUnderline)
|
|
1143 {
|
|
1144 if (logfont.lfStrikeOut)
|
|
1145 strcpy (effects, "underline strikeout");
|
|
1146 else
|
|
1147 strcpy (effects, "underline");
|
|
1148 }
|
|
1149 else if (logfont.lfStrikeOut)
|
|
1150 strcpy (effects, "strikeout");
|
|
1151 }
|
|
1152 else
|
|
1153 effects[0] = '\0';
|
286
|
1154
|
|
1155 #define FROB(cs) \
|
|
1156 else if (stricmp (charset, #cs) == 0) \
|
|
1157 logfont.lfCharSet = cs##_CHARSET
|
|
1158
|
|
1159 /* Charset aliases. Hangeul = Hangul is defined in windows.h.
|
|
1160 We do not use the name "russian", only "cyrillic", as it is
|
|
1161 the common name of this charset, used in other languages
|
|
1162 than Russian. */
|
|
1163 #define CYRILLIC_CHARSET RUSSIAN_CHARSET
|
|
1164 #define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET
|
294
|
1165 #define CENTRALEUROPEAN_CHARSET EASTEUROPE_CHARSET
|
213
|
1166
|
294
|
1167 /* charset can be specified even if earlier fields havn't been */
|
|
1168 if ((fields < 5) && (c=strchr (extname, ':')) && (c=strchr (c+1, ':')) &&
|
|
1169 (c=strchr (c+1, ':')) && (c=strchr (c+1, ':')))
|
286
|
1170 {
|
294
|
1171 strncpy (charset, c+1, LF_FACESIZE);
|
|
1172 charset[LF_FACESIZE-1] = '\0';
|
286
|
1173 }
|
|
1174 else
|
294
|
1175 charset[0] = '\0';
|
|
1176
|
|
1177 if (charset[0] == '\0' || (stricmp (charset, "ansi") == 0) ||
|
|
1178 (stricmp (charset, "western") == 0))
|
|
1179 {
|
|
1180 logfont.lfCharSet = ANSI_CHARSET;
|
|
1181 strcpy (charset, "western");
|
|
1182 }
|
|
1183 FROB (SYMBOL);
|
|
1184 FROB (SHIFTJIS);
|
|
1185 FROB (GB2312);
|
|
1186 FROB (HANGEUL);
|
|
1187 FROB (CHINESEBIG5);
|
|
1188 FROB (JOHAB);
|
|
1189 FROB (HEBREW);
|
|
1190 FROB (ARABIC);
|
|
1191 FROB (GREEK);
|
|
1192 FROB (TURKISH);
|
|
1193 FROB (THAI);
|
|
1194 FROB (EASTEUROPE);
|
|
1195 FROB (CENTRALEUROPEAN);
|
|
1196 FROB (CYRILLIC);
|
|
1197 FROB (MAC);
|
|
1198 FROB (BALTIC);
|
|
1199 else if (stricmp (charset, "oem/dos") == 0)
|
|
1200 logfont.lfCharSet = OEM_CHARSET;
|
|
1201 else
|
|
1202 {
|
|
1203 maybe_signal_simple_error ("Invalid charset", f->name, Qfont, errb);
|
|
1204 return 0;
|
|
1205 }
|
286
|
1206
|
|
1207 #undef FROB
|
294
|
1208
|
|
1209 /* Windows will silently substitute a default font if the fontname
|
|
1210 * specifies a non-existent font. So we check the font against the device's
|
|
1211 * list of font patterns to make sure that at least one of them matches */
|
|
1212 {
|
|
1213 struct mswindows_font_enum *fontlist;
|
|
1214 char truename[MSW_FONTSIZE];
|
|
1215 int done = 0;
|
|
1216
|
|
1217 sprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, charset);
|
|
1218 fontlist = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device));
|
|
1219 while (fontlist && !done)
|
|
1220 {
|
|
1221 done = match_font (fontlist->fontname, truename, NULL);
|
|
1222 fontlist = fontlist->next;
|
|
1223 }
|
|
1224 if (!done)
|
|
1225 {
|
|
1226 maybe_signal_simple_error ("No matching font", f->name, Qfont, errb);
|
|
1227 return 0;
|
|
1228 }
|
|
1229 }
|
|
1230
|
213
|
1231 /* Misc crud */
|
|
1232 logfont.lfEscapement = logfont.lfOrientation = 0;
|
|
1233 #if 1
|
|
1234 logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
|
|
1235 logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
1236 logfont.lfQuality = DEFAULT_QUALITY;
|
|
1237 #else
|
|
1238 logfont.lfOutPrecision = OUT_STROKE_PRECIS;
|
|
1239 logfont.lfClipPrecision = CLIP_STROKE_PRECIS;
|
|
1240 logfont.lfQuality = PROOF_QUALITY;
|
|
1241 #endif
|
294
|
1242 /* Default to monospaced if the specified fontname doesn't exist.
|
|
1243 * The match_font calls above should mean that this can't happen. */
|
|
1244 logfont.lfPitchAndFamily = FF_MODERN;
|
213
|
1245
|
|
1246 if ((f->data = CreateFontIndirect(&logfont)) == NULL)
|
|
1247 {
|
|
1248 maybe_signal_simple_error ("Couldn't create font", f->name, Qfont, errb);
|
|
1249 return 0;
|
|
1250 }
|
|
1251
|
|
1252 {
|
|
1253 HDC hdc;
|
|
1254 HFONT holdfont;
|
|
1255 TEXTMETRIC metrics;
|
|
1256
|
276
|
1257 hdc = CreateCompatibleDC (NULL);
|
|
1258 if (hdc)
|
|
1259 {
|
|
1260 holdfont = SelectObject(hdc, f->data);
|
|
1261 if (holdfont)
|
|
1262 {
|
|
1263 GetTextMetrics (hdc, &metrics);
|
|
1264 SelectObject(hdc, holdfont);
|
|
1265 DeleteDC (hdc);
|
|
1266 f->width = (unsigned short) metrics.tmAveCharWidth;
|
|
1267 f->height = (unsigned short) metrics.tmHeight;
|
|
1268 f->ascent = (unsigned short) metrics.tmAscent;
|
|
1269 f->descent = (unsigned short) metrics.tmDescent;
|
|
1270 f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
|
|
1271 return 1;
|
|
1272 }
|
|
1273 DeleteDC (hdc);
|
|
1274 }
|
|
1275 mswindows_finalize_font_instance (f);
|
|
1276 maybe_signal_simple_error ("Couldn't map font", f->name, Qfont, errb);
|
213
|
1277 }
|
276
|
1278 return 0;
|
213
|
1279 }
|
|
1280
|
245
|
1281 #if 0
|
213
|
1282 static void
|
|
1283 mswindows_mark_font_instance (struct Lisp_Font_Instance *f,
|
|
1284 void (*markobj) (Lisp_Object))
|
|
1285 {
|
|
1286 }
|
245
|
1287 #endif
|
213
|
1288
|
|
1289 static void
|
|
1290 mswindows_print_font_instance (struct Lisp_Font_Instance *f,
|
|
1291 Lisp_Object printcharfun,
|
|
1292 int escapeflag)
|
|
1293 {
|
|
1294 }
|
|
1295
|
|
1296 static Lisp_Object
|
|
1297 mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device)
|
|
1298 {
|
294
|
1299 Lisp_Object result = Qnil;
|
|
1300 struct mswindows_font_enum *fontlist;
|
|
1301 char fontname[MSW_FONTSIZE], *extpattern;
|
|
1302
|
|
1303 GET_C_STRING_CTEXT_DATA_ALLOCA (pattern, extpattern);
|
|
1304 fontlist = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device));
|
|
1305 while (fontlist)
|
|
1306 {
|
|
1307 if (match_font (fontlist->fontname, extpattern, fontname))
|
|
1308 result = Fcons (build_string (fontname), result);
|
|
1309 fontlist = fontlist->next;
|
|
1310 }
|
|
1311
|
|
1312 return Fnreverse (result);
|
213
|
1313 }
|
|
1314
|
251
|
1315 #ifdef MULE
|
|
1316
|
|
1317 static int
|
|
1318 mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset,
|
|
1319 CONST Bufbyte *nonreloc, Lisp_Object reloc,
|
|
1320 Bytecount offset, Bytecount length)
|
|
1321 {
|
286
|
1322 /* #### Implement me */
|
251
|
1323 if (UNBOUNDP (charset))
|
|
1324 return 1;
|
|
1325
|
|
1326 return 1;
|
|
1327 }
|
|
1328
|
|
1329 /* find a font spec that matches font spec FONT and also matches
|
|
1330 (the registry of) CHARSET. */
|
|
1331 static Lisp_Object
|
|
1332 mswindows_find_charset_font (Lisp_Object device, Lisp_Object font,
|
|
1333 Lisp_Object charset)
|
|
1334 {
|
286
|
1335 /* #### Implement me */
|
251
|
1336 return build_string ("Courier New:Regular:10");
|
|
1337 }
|
|
1338
|
|
1339 #endif /* MULE */
|
213
|
1340
|
|
1341
|
|
1342 /************************************************************************/
|
294
|
1343 /* non-methods */
|
|
1344 /************************************************************************/
|
|
1345
|
|
1346 DEFUN ("mswindows-color-list", Fmswindows_color_list, 0, 0, 0, /*
|
|
1347 Return a list of the colors available on mswindows devices.
|
|
1348 */
|
|
1349 ())
|
|
1350 {
|
|
1351 Lisp_Object result = Qnil;
|
|
1352 int i;
|
|
1353
|
|
1354 for (i=0; i<countof (mswindows_X_color_map); i++)
|
|
1355 result = Fcons (build_string (mswindows_X_color_map[i].name), result);
|
|
1356
|
|
1357 return Fnreverse (result);
|
|
1358 }
|
|
1359
|
|
1360
|
|
1361
|
|
1362 /************************************************************************/
|
213
|
1363 /* initialization */
|
|
1364 /************************************************************************/
|
|
1365
|
|
1366 void
|
|
1367 syms_of_objects_mswindows (void)
|
|
1368 {
|
294
|
1369 DEFSUBR (Fmswindows_color_list);
|
213
|
1370 }
|
|
1371
|
|
1372 void
|
|
1373 console_type_create_objects_mswindows (void)
|
|
1374 {
|
|
1375 /* object methods */
|
|
1376 CONSOLE_HAS_METHOD (mswindows, initialize_color_instance);
|
|
1377 /* CONSOLE_HAS_METHOD (mswindows, mark_color_instance); */
|
|
1378 CONSOLE_HAS_METHOD (mswindows, print_color_instance);
|
|
1379 CONSOLE_HAS_METHOD (mswindows, finalize_color_instance);
|
|
1380 CONSOLE_HAS_METHOD (mswindows, color_instance_equal);
|
|
1381 CONSOLE_HAS_METHOD (mswindows, color_instance_hash);
|
|
1382 CONSOLE_HAS_METHOD (mswindows, color_instance_rgb_components);
|
|
1383 CONSOLE_HAS_METHOD (mswindows, valid_color_name_p);
|
|
1384
|
|
1385 CONSOLE_HAS_METHOD (mswindows, initialize_font_instance);
|
|
1386 /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */
|
|
1387 CONSOLE_HAS_METHOD (mswindows, print_font_instance);
|
|
1388 CONSOLE_HAS_METHOD (mswindows, finalize_font_instance);
|
|
1389 /* CONSOLE_HAS_METHOD (mswindows, font_instance_truename); */
|
|
1390 CONSOLE_HAS_METHOD (mswindows, list_fonts);
|
|
1391 #ifdef MULE
|
|
1392 CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset);
|
|
1393 CONSOLE_HAS_METHOD (mswindows, find_charset_font);
|
|
1394 #endif
|
|
1395 }
|
|
1396
|
|
1397 void
|
|
1398 vars_of_objects_mswindows (void)
|
|
1399 {
|
|
1400 }
|