]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - mac_res.r
Fixes so it runs (with bugs) without Color QuickDraw.
[PuTTY.git] / mac_res.r
1 /* $Id: mac_res.r,v 1.1.2.17 1999/04/02 12:58:02 ben Exp $ */
2 /*
3  * Copyright (c) 1999 Ben Harris
4  * All rights reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person
7  * obtaining a copy of this software and associated documentation
8  * files (the "Software"), to deal in the Software without
9  * restriction, including without limitation the rights to use,
10  * copy, modify, merge, publish, distribute, sublicense, and/or
11  * sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following
13  * conditions:
14  * 
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  * 
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
22  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27
28 /* PuTTY resources */
29
30 #include "Types.r"
31 #include "Dialogs.r"
32 #include "Palettes.r"
33
34 /* Get resource IDs we share with C code */
35 #include "macresid.h"
36
37 /*
38  * Finder-related resources
39  */
40
41 /* 'pTTY' is now registered with Apple as PuTTY's signature */
42
43 type 'pTTY' as 'STR ';
44
45 resource 'pTTY' (0, purgeable) {
46     "PuTTY experimental Mac port"
47 };
48
49 resource 'SIZE' (-1) {
50     reserved,
51     ignoreSuspendResumeEvents,
52     reserved,
53     cannotBackground,
54     needsActivateOnFGSwitch,
55     backgroundAndForeground,
56     dontGetFrontClicks,
57     ignoreAppDiedEvents,
58     is32BitCompatible,
59     notHighLevelEventAware,
60     onlyLocalHLEvents,
61     notStationeryAware,
62     useTextEditServices,
63     reserved,
64     reserved,
65     reserved,
66     1024 * 1024,        /* Minimum size */
67     1024 * 1024,        /* Preferred size */
68 };
69
70 resource 'FREF' (128, purgeable) {
71     /* The application itself */
72     'APPL', 128, ""
73 };
74
75 resource 'FREF' (129, purgeable) {
76     /* Saved session */
77     'Sess', 129, ""
78     };
79
80 resource 'FREF' (130, purgeable) {
81     /* SSH host keys database */
82     'HKey', 130, ""
83 };
84
85 resource 'BNDL' (128, purgeable) {
86     'pTTY', 0,
87     {
88         'ICN#', {
89             128, 128,
90             129, 129,
91             130, 130
92         },
93         'FREF', {
94             128, 128,
95             129, 129,
96             130, 130
97         };
98     };
99 };
100
101 /* Icons, courtesy of DeRez */
102
103 /* Application icon */
104 resource 'ICN#' (128, purgeable) {
105         {       /* array: 2 elements */
106                 /* [1] */
107                 $"00003FFE 00004001 00004FF9 00005005"
108                 $"00005355 00004505 00005A05 00002405"
109                 $"00004A85 00019005 000223F9 00047C01"
110                 $"00180201 7FA00C7D 801F1001 9FE22001"
111                 $"A00CDFFE AA892002 A0123FFE A82C0000"
112                 $"A0520000 AA6A0000 A00A0000 9FF20000"
113                 $"80020000 80020000 90FA0000 80020000"
114                 $"80020000 7FFC0000 40040000 7FFC",
115                 /* [2] */
116                 $"00003FFE 00007FFF 00007FFF 00007FFF"
117                 $"00007FFF 00007FFF 00007FFF 00007FFF"
118                 $"00007FFF 0001FFFF 0003FFFF 0007FFFF"
119                 $"001FFFFF 7FFFFFFF FFFFFFFF FFFFFFFF"
120                 $"FFFFFFFE FFFF3FFE FFFE3FFE FFFE0000"
121                 $"FFFE0000 FFFE0000 FFFE0000 FFFE0000"
122                 $"FFFE0000 FFFE0000 FFFE0000 FFFE0000"
123                 $"FFFE0000 7FFC0000 7FFC0000 7FFC"
124         }
125 };
126
127 resource 'icl4' (128, purgeable) {
128         $"000000000000000000FFFFFFFFFFFFF0"
129         $"00000000000000000FCCCCCCCCCCCCCF"
130         $"00000000000000000FCEEEEEEEEEEECF"
131         $"00000000000000000FCE0D0D0D0D0CCF"
132         $"00000000000000000FCED0FFD0D0D0CF"
133         $"00000000000000000FCE0F1F0D0D0CCF"
134         $"00000000000000000FCFF1F0D0D0D0CF"
135         $"00000000000000000FF11F0D0D0D0CCF"
136         $"00000000000000000F11F0D0D0D0D0CF"
137         $"000000000000000FF11F0D0D0D0D0CCF"
138         $"00000000000000F111FEC0C0C0C0C0CF"
139         $"0000000000000F111FFFFFCCCCCCCCCF"
140         $"00000000000FF111111111FCCCCCCCCF"
141         $"0FFFFFFFFFF111111111FFCCCFFFFFCF"
142         $"FCCCCCCCCCCFFFFF111F3CCCCCCCCCCF"
143         $"FCEEEEEEEEEEECF111FCCCCCCCCCCCCF"
144         $"FCE0D0D0D0D0FF11FFFFFFFFFFFFFFF0"
145         $"FCED0D0D0D0DF11F00FCCCDDDEEEEAF0"
146         $"FCE0D0D0D0DF11F000FFFFFFFFFFFFF0"
147         $"FCED0D0D0DF1FFF00000000000000000"
148         $"FCE0D0D0DF1FCCF00000000000000000"
149         $"FCED0D0D0FFD0CF00000000000000000"
150         $"FCE0D0D0D0D0CCF00000000000000000"
151         $"FCEC0C0C0C0C0CF00000000000000000"
152         $"FCCCCCCCCCCCCCF00000000000000000"
153         $"FCCCCCCCCCCCCCF00000000000000000"
154         $"FC88CCCCFFFFFCF00000000000000000"
155         $"FC33CCCCCCCCCCF00000000000000000"
156         $"FCCCCCCCCCCCCCF00000000000000000"
157         $"0FFFFFFFFFFFFF000000000000000000"
158         $"0FCCCDDDEEEEAF000000000000000000"
159         $"0FFFFFFFFFFFFF"
160 };
161
162 resource 'icl8' (128, purgeable) {
163         $"000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFF00"
164         $"0000000000000000000000000000000000FF2B2B2B2B2B2B2B2B2B2B2B2B2BFF"
165         $"0000000000000000000000000000000000FF2BFCFCFCFCFCFCFCFCFCFCFC2BFF"
166         $"0000000000000000000000000000000000FF2BFC2A2A2A2A2A2A2A2A2A002BFF"
167         $"0000000000000000000000000000000000FF2BFC2A2AFFFF2A2A2A2A2A002BFF"
168         $"0000000000000000000000000000000000FF2BFC2AFF05FF2A2A2A2A2A002BFF"
169         $"0000000000000000000000000000000000FF2BFFFF05FF2A2A2A2A2A2A002BFF"
170         $"0000000000000000000000000000000000FFFF0505FF2A2A2A2A2A2A2A002BFF"
171         $"0000000000000000000000000000000000FF0505FF2A2A2A2A2A2A2A2A002BFF"
172         $"000000000000000000000000000000FFFF0505FF2A2A2A2A2A2A2A2A2A002BFF"
173         $"0000000000000000000000000000FF050505FFFC000000000000000000002BFF"
174         $"00000000000000000000000000FF050505FFFFFFFFFF2B2B2B2B2B2B2B2B2BFF"
175         $"0000000000000000000000FFFF050505050505050505FF2B2B2B2B2B2B2B2BFF"
176         $"00FFFFFFFFFFFFFFFFFFFF050505050505050505FFFF2B2B2BFFFFFFFFFF2BFF"
177         $"FF2B2B2B2B2B2B2B2B2B2BFFFFFFFFFF050505FFD82B2B2B2B2B2B2B2B2B2BFF"
178         $"FF2BFCFCFCFCFCFCFCFCFCFCFC2BFF050505FF2B2B2B2B2B2B2B2B2B2B2B2BFF"
179         $"FF2BFC2A2A2A2A2A2A2A2A2AFFFF0505FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00"
180         $"FF2BFC2A2A2A2A2A2A2A2A2AFF0505FF0000FF2BF7F8F9FAFAFBFBFCFCFDFF00"
181         $"FF2BFC2A2A2A2A2A2A2A2AFF0505FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF00"
182         $"FF2BFC2A2A2A2A2A2A2AFF05FFFFFF0000000000000000000000000000000000"
183         $"FF2BFC2A2A2A2A2A2AFF05FF002BFF0000000000000000000000000000000000"
184         $"FF2BFC2A2A2A2A2A2AFFFF2A002BFF0000000000000000000000000000000000"
185         $"FF2BFC2A2A2A2A2A2A2A2A2A002BFF0000000000000000000000000000000000"
186         $"FF2BFC000000000000000000002BFF0000000000000000000000000000000000"
187         $"FF2B2B2B2B2B2B2B2B2B2B2B2B2BFF0000000000000000000000000000000000"
188         $"FF2B2B2B2B2B2B2B2B2B2B2B2B2BFF0000000000000000000000000000000000"
189         $"FF2BE3E32B2B2B2BFFFFFFFFFF2BFF0000000000000000000000000000000000"
190         $"FF2BD8D82B2B2B2B2B2B2B2B2B2BFF0000000000000000000000000000000000"
191         $"FF2B2B2B2B2B2B2B2B2B2B2B2B2BFF0000000000000000000000000000000000"
192         $"00FFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000"
193         $"00FF2BF7F8F9FAFAFBFBFCFCFDFF000000000000000000000000000000000000"
194         $"00FFFFFFFFFFFFFFFFFFFFFFFFFF"
195 };
196 resource 'ics#' (128, purgeable) {
197         {       /* array: 2 elements */
198                 /* [1] */
199                 $"00FF 0081 00BD 00A5 00A5 00BD FF81 818D"
200                 $"BD81 A57E A500 BD00 8100 8D00 8100 7E",
201                 /* [2] */
202                 $"00FF 00FF 00FF 00FF 00FF 00FF FFFF FFFF"
203                 $"FFFF FF7E FF00 FF00 FF00 FF00 FF00 7E"
204         }
205 };
206
207 /* Known hosts icon */
208 resource 'ICN#' (130, purgeable) {
209         {       /* array: 2 elements */
210                 /* [1] */
211                 $"1FFFFC00 10000600 10000500 1FFFFC80"
212                 $"10000440 10000420 1FFFFFF0 10000010"
213                 $"13FC0F90 1C03F0F0 15FA8090 150A8090"
214                 $"1D0B80F0 150A8050 15FA8050 1C038070"
215                 $"143A8050 14028050 1FFFABF0 12048110"
216                 $"13FCFF10 1AAAAAB0 10000010 17FFFFD0"
217                 $"14000050 15252250 15555550 15252250"
218                 $"14000050 17FFFFD0 10000010 1FFFFFF0",
219                 /* [2] */
220                 $"1FFFFC00 1FFFFE00 1FFFFF00 1FFFFF80"
221                 $"1FFFFFC0 1FFFFFE0 1FFFFFF0 1FFFFFF0"
222                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
223                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
224                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
225                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
226                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
227                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
228         }
229 };
230
231 resource 'icl4' (130, purgeable) {
232         $"000FFFFFFFFFFFFFFFFFFF0000000000"
233         $"000F00000000000000000FF000000000"
234         $"000F00000000000000000FCF00000000"
235         $"000FFFFFFFFFFFFFFFFFFFCCF0000000"
236         $"000F00000000000000000FCCCF000000"
237         $"000F00000000000000000FCCCCF00000"
238         $"000FFFFFFFFFFFFFFFFFFFFFFFFF0000"
239         $"000F00000000000000000000000F0000"
240         $"000F00FFFFFFFF000000FFFFF00F0000"
241         $"000FFFCCCCCCCCFFFFFFCCCCFFFF0000"
242         $"000F0FCEEEEECCF0FCCCCCCCF00F0000"
243         $"000F0FCE0D0D0CF0FCCCCCCCF00F0000"
244         $"000FFFCED0D0CCFFFCCCCCCCFFFF0000"
245         $"000F0FCE0D0D0CF0FCCCCCCCCF0F0000"
246         $"000F0FCCC0C0CCF0FCCCCCCCCF0F0000"
247         $"000FFFCCCCCCCCFFFCCCCCCCCFFF0000"
248         $"000F0FCCCCFFFCF0FCCCCCCCCF0F0000"
249         $"000F0FCCCCCCCCF0FCCCCCCCCF0F0000"
250         $"000FFFFFFFFFFFFFFDDDDDDFFFFF0000"
251         $"000F00FCCDDEEF00FDDDDDDF000F0000"
252         $"000F00FFFFFFFF00FFFFFFFF000F0000"
253         $"000F0C0C0C0C0C0C0C0C0C0C0C0F0000"
254         $"000FC0C0C0C0C0C0C0C0C0C0C0CF0000"
255         $"000F0FFFFFFFFFFFFFFFFFFFFF0F0000"
256         $"000FCF0000000000000000000FCF0000"
257         $"000F0F0F00F00F0F00F000F00F0F0000"
258         $"000FCF0F0F0F0F0F0F0F0F0F0FCF0000"
259         $"000F0F0F00F00F0F00F000F00F0F0000"
260         $"000FCF0000000000000000000FCF0000"
261         $"000F0FFFFFFFFFFFFFFFFFFFFF0F0000"
262         $"000FC0C0C0C0C0C0C0C0C0C0C0CF0000"
263         $"000FFFFFFFFFFFFFFFFFFFFFFFFF"
264 };
265 resource 'icl8' (130, purgeable) {
266         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000"
267         $"000000FF0000000000000000000000000000000000FFFF000000000000000000"
268         $"000000FF0000000000000000000000000000000000FFF6FF0000000000000000"
269         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F6FF00000000000000"
270         $"000000FF0000000000000000000000000000000000FFF6F6F6FF000000000000"
271         $"000000FF0000000000000000000000000000000000FFF6F6F6F6FF0000000000"
272         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000"
273         $"000000FF0000000000000000000000000000000000000000000000FF00000000"
274         $"000000FF0000FFFFFFFFFFFFFFFF000000000000FFFFFFFFFF0000FF00000000"
275         $"000000FFFFFF2B2B2B2B2B2B2B2BFFFFFFFFFFFF2B2B2B2BFFFFFFFF00000000"
276         $"000000FF00FF2BFCFCFCFCFCF82BFF00FF2B2B2B2B2B2B2BFF0000FF00000000"
277         $"000000FF00FF2BFC2A2A2A2A002BFF00FF2B2B2B2B2B2B2BFF0000FF00000000"
278         $"000000FFFFFF2BFC2A2A2A2A002BFFFFFF2B2B2B2B2B2B2BFFFFFFFF00000000"
279         $"000000FF00FF2BFC2A2A2A2A002BFF00FF2B2B2B2B2B2B2B2BFF00FF00000000"
280         $"000000FF00FF2BF800000000002BFF00FF2B2B2B2B2B2B2B2BFF00FF00000000"
281         $"000000FFFFFF2B2B2B2B2B2B2B2BFFFFFF2B2B2B2B2B2B2B2BFFFFFF00000000"
282         $"000000FF00FF2B2B2B2BFFFFFF2BFF00FF2B2B2B2B2B2B2B2BFF00FF00000000"
283         $"000000FF00FF2B2B2B2B2B2B2B2BFF00FF2B2B2B2B2B2B2B2BFF00FF00000000"
284         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF9F9F9F9F9F9FFFFFFFFFF00000000"
285         $"000000FF0000FFF7F8F9FAFBFCFF0000FFF9F9F9F9F9F9FF000000FF00000000"
286         $"000000FF0000FFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFF000000FF00000000"
287         $"000000FFF5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FF00000000"
288         $"000000FFF5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FF00000000"
289         $"000000FFF5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5FF00000000"
290         $"000000FFF5FF00000000000000000000000000000000000000FFF5FF00000000"
291         $"000000FFF5FF00FF0000FF0000FF00FF0000FF000000FF0000FFF5FF00000000"
292         $"000000FFF5FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FFF5FF00000000"
293         $"000000FFF5FF00FF0000FF0000FF00FF0000FF000000FF0000FFF5FF00000000"
294         $"000000FFF5FF00000000000000000000000000000000000000FFF5FF00000000"
295         $"000000FFF5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5FF00000000"
296         $"000000FFF5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FF00000000"
297         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
298 };
299
300
301 /*
302  * Internal resources
303  */
304
305 /* Menu bar */
306
307 resource 'MBAR' (MBAR_Main, preload) {
308     { mApple, mFile, mEdit }
309 };
310
311 resource 'MENU' (mApple, preload) {
312     mApple,
313     textMenuProc,
314     0b11111111111111111111111111111101,
315     enabled,
316     apple,
317     {
318         "About PuTTYÉ",         noicon, nokey, nomark, plain,
319         "-",                    noicon, nokey, nomark, plain,
320     }
321 };
322
323 resource 'MENU' (mFile, preload) {
324     mFile,
325     textMenuProc,
326     0b11111111111111111111111111111011,
327     enabled,
328     "File",
329     {
330         "New Session",          noicon, "N",   nomark, plain,
331         "Close",                noicon, "W",   nomark, plain,
332         "-",                    noicon, nokey, nomark, plain,
333         "Quit",                 noicon, "Q",   nomark, plain,
334     }
335 };
336
337 resource 'MENU' (mEdit, preload) {
338     mEdit,
339     textMenuProc,
340     0b11111111111111111111111111111101,
341     enabled,
342     "Edit",
343     {
344         "Undo",                 noicon, "Z",   nomark, plain,
345         "-",                    noicon, nokey, nomark, plain,
346         "Cut",                  noicon, "X",   nomark, plain,
347         "Copy",                 noicon, "C",   nomark, plain,
348         "Paste",                noicon, "V",   nomark, plain,
349         "Clear",                noicon, nokey, nomark, plain,
350         "Select All",           noicon, "A",   nomark, plain,
351     }
352 };
353
354 /* Fatal error box.  Stolen from the Finder. */
355
356 resource 'ALRT' (wFatal, "fatalbox", purgeable) {
357         {54, 67, 152, 435},
358         wFatal,
359         beepStages,
360         alertPositionMainScreen
361 };
362
363 resource 'DITL' (wFatal, "fatalbox", purgeable) {
364         {       /* array DITLarray: 3 elements */
365                 /* [1] */
366                 {68, 299, 88, 358},
367                 Button {
368                         enabled,
369                         "OK"
370                 },
371                 /* [2] */
372                 {68, 227, 88, 286},
373                 StaticText {
374                         disabled,
375                         ""
376                 },
377                 /* [3] */
378                 {7, 74, 55, 358},
379                 StaticText {
380                         disabled,
381                         "^0"
382                 }
383         }
384 };
385
386 /* Terminal window */
387
388 resource 'WIND' (wTerminal, "terminal", purgeable) {
389     { 0, 0, 200, 200 },
390     zoomDocProc,
391     invisible,
392     goAway,
393     0x0,
394     "untitled",
395     staggerParentWindowScreen
396 };
397
398 resource 'CNTL' (cVScroll, "vscroll", purgeable) {
399     { 0, 0, 48, 16 },
400     0, invisible, 0, 0,
401     scrollBarProc, 0, ""
402 };
403
404 /* "About" box */
405
406 resource 'DLOG' (wAbout, "about", purgeable) {
407     { 0, 0, 120, 240 },
408     noGrowDocProc,
409     invisible,
410     goAway,
411     wAbout,             /* RefCon -- identifies the window to PuTTY */
412     wAbout,             /* DITL ID */
413     "About PuTTY",
414     alertPositionMainScreen
415 };
416
417 resource 'dlgx' (wAbout, "about", purgeable) {
418     versionZero {
419         kDialogFlagsUseThemeBackground | kDialogFlagsUseThemeControls
420     }
421 };
422
423 resource 'DITL' (wAbout, "about", purgeable) {
424     {
425         { 87, 13, 107, 227 },
426         Button { enabled, "View Licence" },
427         { 13, 13, 29, 227 },
428         StaticText { disabled, "PuTTY"},
429         { 42, 13, 74, 227 },
430         StaticText { disabled, "Some version or other\n"
431                                "Copyright Â© 1997-9 Simon Tatham"},
432     }
433 };
434
435 /* Licence box */
436
437 resource 'WIND' (wLicence, "licence", purgeable) {
438     { 0, 0, 300, 300 },
439     noGrowDocProc,
440     visible,
441     goAway,
442     wLicence,
443     "PuTTY Licence",
444     alertPositionParentWindowScreen
445 };
446
447 type 'TEXT' {
448     string;
449 };
450
451 resource 'TEXT' (wLicence, "licence", purgeable) {
452     "Copyright Â© 1997-9 Simon Tatham\n"
453     "Portions copyright Â© 1999 Ben Harris\n"
454     "Portions copyright Â© 1993 Eric Young\n"
455     "Portions copyright Â© 1986 Gary S. Brown\n"
456     "\n"    
457     "Permission is hereby granted, free of charge, to any person "
458     "obtaining a copy of this software and associated documentation "
459     "files (the \"Software\"), to deal in the Software without "
460     "restriction, including without limitation the rights to use, "
461     "copy, modify, merge, publish, distribute, sublicense, and/or "
462     "sell copies of the Software, and to permit persons to whom the "
463     "Software is furnished to do so, subject to the following "
464     "conditions:\n\n"
465     
466     "The above copyright notice and this permission notice shall be "
467     "included in all copies or substantial portions of the Software.\n\n"
468     
469     "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, "
470     "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
471     "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND "
472     "NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR "
473     "ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF "
474     "CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
475     "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE "
476     "SOFTWARE."
477 };
478
479 /* Default Preferences */
480
481 type PREF_wordness_type {
482     wide array [256] {
483         integer;
484     };
485 };
486
487 /*
488  * This resource collects together the various short settings we need.
489  * Each area of the system gets its own longword for flags, and then
490  * we have the other settings.  Strings are stored as two shorts --
491  * the id of a STR# or STR resource, and the index if it's a STR# (0
492  * for STR).
493  */
494
495 type 'pSET' {
496     /* Basic boolean options */
497     boolean dont_close_on_exit, close_on_exit;
498     align long;
499     /* SSH options */
500     boolean use_pty, no_pty;
501     align long;
502     /* Telnet options */
503     boolean bsd_environ, rfc_environ;
504     align long;
505     /* Keyboard options */
506     boolean backspace, delete;
507     boolean std_home_end, rxvt_home_end;
508     boolean std_funkeys, linux_funkeys;
509     boolean normal_cursor, app_cursor;
510     boolean normal_keypad, app_keypad;
511     align long;
512     /* Terminal options */
513     boolean no_dec_om, dec_om;
514     boolean no_auto_wrap, auto_wrap;
515     boolean no_auto_cr, auto_cr;
516     boolean use_icon_name, win_name_always;
517     align long;
518     /* Colour options */
519     boolean bold_font, bold_colour;
520     align long;
521     /* Selection options */
522     boolean no_implicit_copy, implicit_copy;
523     align long;
524     /* Non-boolean options */
525     integer; integer;           /* host */
526     longint;                    /* port */
527     longint prot_telnet = 0, prot_ssh = 1; /* protocol */
528     integer; integer;           /* termtype */
529     integer; integer;           /* termspeed */
530     integer; integer;           /* environmt */
531     integer; integer;           /* username */
532     longint;                    /* width */
533     longint;                    /* height */
534     longint;                    /* save_lines */
535     integer; unsigned integer;  /* font */
536     longint;                    /* font_height */
537     integer;                    /* 'pltt' for colours */
538     integer;                    /* 'wORD' for wordness */
539     integer;                    /* meta modifiers */
540 };
541
542 resource 'pSET' (PREF_settings, "settings", purgeable) {
543     close_on_exit,
544     use_pty,
545     rfc_environ,
546     delete,
547     std_home_end,
548     std_funkeys,
549     normal_cursor,
550     normal_keypad,
551     no_dec_om,
552     auto_wrap,
553     no_auto_cr,
554     use_icon_name,
555     bold_font,
556     no_implicit_copy,
557 #define PREF_strings 1024
558     PREF_strings, 1,            /* host 'STR#' */
559     23, prot_telnet,            /* port, protocol */
560     PREF_strings, 2,            /* termtype 'STR#' */
561     PREF_strings, 3,            /* termspeed 'STR#' */
562     PREF_strings, 4,            /* environmt 'STR#' */
563     PREF_strings, 5,            /* username */
564     80, 24, 200,                /* width, height, save_lines */
565     PREF_strings, 6,            /* font 'STR#' */
566     9,                          /* font_height */
567 #define PREF_pltt 1024
568     PREF_pltt,                  /* colours 'pltt' */
569 #define PREF_wordness 1024
570     PREF_wordness,              /* wordness 'wORD */
571     0x900,                      /* meta modifiers (cmd+option) */
572 };
573
574 resource 'STR#' (PREF_strings, "strings", purgeable) {
575     {
576         "nowhere.loopback.edu",
577         "xterm",
578         "38400,38400",
579         "\000",
580         "",
581         "Monaco",
582     }
583 };
584
585 resource PREF_wordness_type (PREF_wordness, "wordness", purgeable) {
586     {
587         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
588         0,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
589         1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,
590         1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,
591         1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
592         1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
593         2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,
594         2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2
595     }
596 };
597
598 /*
599  * and _why_ isn't this provided for us?
600  */
601 type 'TMPL' {
602     array {
603         pstring;                /* Item name */
604         literal longint;        /* Item type */
605     };
606 };
607
608 resource 'TMPL' (128, "pSET") {
609     {
610         "Close on exit", 'BBIT',
611         "", 'BBIT', /* Must pad to a multiple of 8 */
612         "", 'BBIT',
613         "", 'BBIT',
614         "", 'BBIT',
615         "", 'BBIT',
616         "", 'BBIT',
617         "", 'BBIT',
618         "", 'ALNG',
619         "No PTY", 'BBIT',
620         "", 'BBIT',
621         "", 'BBIT',
622         "", 'BBIT',
623         "", 'BBIT',
624         "", 'BBIT',
625         "", 'BBIT',
626         "", 'BBIT',
627         "", 'ALNG',
628         "RFC OLD-ENVIRON", 'BBIT',
629         "", 'BBIT',
630         "", 'BBIT',
631         "", 'BBIT',
632         "", 'BBIT',
633         "", 'BBIT',
634         "", 'BBIT',
635         "", 'BBIT',
636         "", 'ALNG',
637         "Delete key sends delete", 'BBIT',
638         "rxvt home/end", 'BBIT',
639         "Linux function keys", 'BBIT',
640         "Application cursor keys", 'BBIT',
641         "Application keypad", 'BBIT',
642         "", 'BBIT',
643         "", 'BBIT',
644         "", 'BBIT',
645         "", 'ALNG',
646         "Use colour for bold", 'BBIT',
647         "", 'BBIT',
648         "", 'BBIT',
649         "", 'BBIT',
650         "", 'BBIT',
651         "", 'BBIT',
652         "", 'BBIT',
653         "", 'BBIT',
654         "", 'ALNG',
655         "Implicit copy", 'BBIT',
656         "", 'BBIT',
657         "", 'BBIT',
658         "", 'BBIT',
659         "", 'BBIT',
660         "", 'BBIT',
661         "", 'BBIT',
662         "", 'BBIT',
663         "", 'ALNG',
664         "Host STR# ID", 'DWRD',
665         "Host STR# index", 'DWRD',
666         "Port", 'DLNG',
667         "Protocol", 'DLNG',
668         "Termtype STR# ID", 'DWRD',
669         "Termtype STR# index", 'DWRD',
670         "Termspeed STR# ID", 'DWRD',
671         "Termspeed STR# index", 'DWRD',
672         "Environ STR# ID", 'DWRD',
673         "Environ STR# index", 'DWRD',
674         "Username STR# ID", 'DWRD',
675         "Username STR# index", 'DWRD',
676         "Terminal width", 'DLNG',
677         "Terminal height", 'DLNG',
678         "Save lines", 'DLNG',
679         "Font STR# ID", 'DWRD',
680         "Font STR# index", 'DWRD',
681         "Font size", 'DLNG',
682         "pltt ID", 'DWRD',
683         "wORD ID", 'DWRD',
684         "meta modifiers", 'HWRD',
685     };
686 };
687
688
689 /*
690  * *mutter*  It might be nice if Apple could actually put all the flags in
691  * Palettes.r.
692  */
693
694 #define pmCourteous     0x0000
695 #define pmDithered      0x0001
696 #define pmTolerant      0x0002
697 #define pmAnimated      0x0004
698 #define pmExplicit      0x0008
699 #define pmWhite         0x0010
700 #define pmBlack         0x0020
701 #define pmInhibitG2     0x0100
702 #define pmInhibitC2     0x0200
703 #define pmInhibitG4     0x0400
704 #define pmInhibitC4     0x0800
705 #define pmInhibitG8     0x1000
706 #define pmInhibitC8     0x2000
707
708 #define PM_BASIC (pmTolerant | pmInhibitG4 | pmInhibitG8)
709 #define PM_NORMAL (PM_BASIC | pmInhibitG2 | pmInhibitC2)
710
711 resource 'pltt' (PREF_pltt, purgeable) {
712     {
713         0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000,      /* black */
714         0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000,      /* bright black */
715         0xbbbb, 0x0000, 0x0000, PM_NORMAL, 0x2000,      /* red */
716         0xffff, 0x5555, 0x5555, PM_NORMAL, 0x2000,      /* bright red */
717         0x0000, 0xbbbb, 0x0000, PM_NORMAL, 0x2000,      /* green */
718         0x5555, 0xffff, 0x5555, PM_NORMAL, 0x2000,      /* bright green */
719         0xbbbb, 0xbbbb, 0x0000, PM_NORMAL, 0x2000,      /* yellow */
720         0xffff, 0xffff, 0x0000, PM_NORMAL, 0x2000,      /* bright yellow */
721         0x0000, 0x0000, 0xbbbb, PM_NORMAL, 0x2000,      /* blue */
722         0x5555, 0x5555, 0xffff, PM_NORMAL, 0x2000,      /* bright blue */
723         0xbbbb, 0x0000, 0xbbbb, PM_NORMAL, 0x2000,      /* magenta */
724         0xffff, 0x5555, 0xffff, PM_NORMAL, 0x2000,      /* bright magenta */
725         0x0000, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000,      /* cyan */
726         0x5555, 0xffff, 0xffff, PM_NORMAL, 0x2000,      /* bright cyan */
727         0xbbbb, 0xbbbb, 0xbbbb, PM_NORMAL, 0x2000,      /* white */
728         0xffff, 0xffff, 0xffff, PM_NORMAL, 0x2000,      /* bright white */
729         0xbbbb, 0xbbbb, 0xbbbb, PM_BASIC,  0x2000,      /* default fg */
730         0xffff, 0xffff, 0xffff, PM_BASIC,  0x2000,      /* default bold fg */
731         0x0000, 0x0000, 0x0000, PM_BASIC,  0x2000,      /* default bg */
732         0x5555, 0x5555, 0x5555, PM_NORMAL, 0x2000,      /* default bold bg */
733         0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000,      /* cursor bg */
734         0x0000, 0x0000, 0x0000, PM_NORMAL, 0x2000,      /* bold cursor bg */
735         0x0000, 0xffff, 0x0000, PM_BASIC,  0x2000,      /* cursor fg */
736         0x0000, 0xffff, 0x0000, PM_NORMAL, 0x2000,      /* bold cursor fg */
737     }
738 };
739
740 read 'pTST' (128, "test data", purgeable) "fragment";
741
742 type 'pMAP' {
743     hex string;
744 };
745
746 resource 'pMAP' (128, "Latin-1 G1 -> Mac OS Roman") {
747     $"20 c1 a2 a3 db b4 00 a4 ac a9 bb c7 c2 00 a8 f8"
748     $"a1 b1 00 00 ab b5 a6 e1 fc 00 bc c8 00 00 00 c0"
749     $"cb e7 e5 cc 80 81 ae 82 e9 83 e6 e8 ed ea eb ec"
750     $"00 84 f1 ee ef cd 85 00 af f4 f2 f3 86 00 00 a7"
751     $"88 87 89 8b 8a 8c be 8d 8f 8e 90 91 93 92 94 95"
752     $"00 96 98 97 99 9b 9a d6 bf 9d 9c 9e 9f 00 00 D8"
753 };
754
755 resource 'pMAP' (129, "DEC line drawing -> Mac OS VT100") {
756     $"d7 bd 09 0c 0d 0a a1 b1 00 0b d2 d3 d4 d5 da e2"
757     $"e3 e4 f5 f6 f7 f8 f9 fa fb b2 b3 b9 ad a3 e1"
758 };