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