]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - mac/macpgen.r
Merge out from trunk, to keep this branch viable. We are now up to
[PuTTY.git] / mac / macpgen.r
1 /* $Id$ */
2 /*
3  * Copyright (c) 1999, 2002, 2003 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 /* PuTTYgen resources */
29
30 /*
31  * The space after the # for system includes is to stop mkfiles.pl
32  * trying to chase them (Rez doesn't support the angle-bracket
33  * syntax).
34  */
35
36 # include "Types.r"
37 # include "Dialogs.r"
38 # include "Palettes.r"
39 # include "Script.r"
40
41
42 /* Get resource IDs we share with C code */
43 #include "macpgrid.h"
44
45 #include "version.r"
46
47 /*
48  * Finder-related resources
49  */
50
51 /* 'pGen' is now registered with Apple as PuTTYgen's signature */
52
53 type 'pGen' as 'STR ';
54
55 resource 'pGen' (0, purgeable) {
56     "PuTTYgen experimental Mac port"
57 };
58
59 resource 'SIZE' (-1) {
60     reserved,
61     acceptSuspendResumeEvents,
62     reserved,
63     canBackground,
64     doesActivateOnFGSwitch,
65     backgroundAndForeground,
66     dontGetFrontClicks,
67     ignoreAppDiedEvents,
68     is32BitCompatible,
69     isHighLevelEventAware,
70     localandRemoteHLEvents,
71     isStationeryAware,
72     dontUseTextEditServices,
73     reserved,
74     reserved,
75     reserved,
76     1024 * 1024,        /* Minimum size */
77     1024 * 1024,        /* Preferred size */
78 };
79
80 #define FREF_APPL 128
81 #define FREF_Seed 132
82
83 resource 'FREF' (FREF_APPL, purgeable) {
84     /* The application itself */
85     'APPL', FREF_APPL, ""
86 };
87
88 resource 'FREF' (FREF_Seed, purgeable) {
89     /* Random seed */
90     'Seed', FREF_Seed, ""
91 };
92
93 /* "Internal" file types, which can't be opened */
94 resource 'BNDL' (129, purgeable) {
95     'pTTI', 0,
96     {
97         'ICN#', {
98             FREF_Seed, FREF_Seed,
99         },
100         'FREF', {
101             FREF_Seed, FREF_Seed,
102         };
103     };
104 };
105
106 resource 'kind' (129) {
107     'pTTI',
108     verBritain,
109     {
110         'Seed', "PuTTY random number seed",
111     }
112 };
113
114 #if TARGET_API_MAC_CARBON
115 /*
116  * Mac OS X Info.plist.
117  * See Tech Note TN2013 for details.
118  * We don't bother with things that Mac OS X seems to be able to get from
119  * other resources.
120  */
121 type 'plst' as 'TEXT';
122
123 resource 'plst' (0) {
124     "<?xml version='1.0' encoding='UTF-8'?>\n"
125     "<!DOCTYPE plist PUBLIC '-//Apple Computer//DTD PLIST 1.0//EN'\n"
126     " 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>\n"
127     "<plist version='1.0'>\n"
128     "  <dict>\n"
129     "    <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>\n"
130     "    <key>CFBundleIdentifier</key>\n"
131     "      <string>org.tartarus.projects.putty.puttygen</string>\n"
132     "    <key>CFBundleName</key>                  <string>PuTTYgen</string>\n"
133     "    <key>CFBundlePackageType</key>           <string>APPL</string>\n"
134     "    <key>CFBundleSignature</key>             <string>pGen</string>\n"
135     "  </dict>\n"
136     "</plist>\n"
137 };
138
139 /* Mac OS X doesn't use this, but Mac OS 9 does. */
140 type 'carb' as 'TEXT';
141 resource 'carb' (0) { "" };
142 #endif
143
144 /* Icons, courtesy of DeRez */
145
146 /* Random seed icon */
147
148 resource 'ICN#' (FREF_Seed, purgeable) {
149         {       /* array: 2 elements */
150                 /* [1] */
151                 $"1FFFFC00 18F36600 161EF500 1CC92C80"
152                 $"1CF2EC40 10662C20 108E07F0 151F0490"
153                 $"1E00C4F0 1803BBD0 1FC5BE10 108B5A90"
154                 $"1B3C4F50 1267AC90 14B60470 1BB791B0"
155                 $"17F4D2B0 1DC1F830 1B029450 1B753DD0"
156                 $"145A8170 11390DD0 1E15A8B0 1CC4CD90"
157                 $"154ECED0 15C9CF30 172CDB50 12617970"
158                 $"15E45C90 1D4B9890 15CE4430 1FFFFFF0",
159                 /* [2] */
160                 $"1FFFFC00 1FFFFE00 1FFFFF00 1FFFFF80"
161                 $"1FFFFFC0 1FFFFFE0 1FFFFFF0 1FFFFFF0"
162                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
163                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
164                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
165                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
166                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
167                 $"1FFFFFF0 1FFFFFF0 1FFFFFF0 1FFFFFF0"
168         }
169 };
170 resource 'icl4' (FREF_Seed) {
171         $"000FFFFFFFFFFFFFFFFFFF0000000000"
172         $"000FFC0CFFFF0CFF1FFC0FF000000000"
173         $"000F0FF0C0CFFFF1FFFFCFCF00000000"
174         $"000FFF0CFF0CF11F0CFCFFCCF0000000"
175         $"000FFFC0FFFF11F0FFF0FFCCCF000000"
176         $"000F0C0C0FF11FFC0CFCFFCCCCF00000"
177         $"000FC0C0F111FFF0C0C0CFFFFFFF0000"
178         $"000F0F0F111FFFFF0C0C0F0CFC0F0000"
179         $"000FFFF111111111FFC0CFC0FFFF0000"
180         $"000FF111111111FFFCFFF0FFFF0F0000"
181         $"000FFFFFFF111FCFF0FFFFF0C0CF0000"
182         $"000F0C0CF111FCFF0F0FFCFCFC0F0000"
183         $"000FF0FF11FFFFC0CFC0FFFFCFCF0000"
184         $"000F0CF11FFC0FFFFCFCFF0CFC0F0000"
185         $"000FCF11F0FFCFF0C0C0CFC0CFFF0000"
186         $"000FF1FFFCFF0FFFFC0F0C0FFCFF0000"
187         $"000F1FFFFFFFCFC0FFCFC0F0F0FF0000"
188         $"000FFF0FFF0C0C0FFFFFFC0C0CFF0000"
189         $"000FF0FFC0C0C0F0F0CF0FC0CFCF0000"
190         $"000FFCFF0FFF0F0F0CFFFF0FFF0F0000"
191         $"000FCFC0CF0FF0F0F0C0C0CFCFFF0000"
192         $"000F0C0F0CFFFC0F0C0CFF0FFF0F0000"
193         $"000FFFF0C0CFCFCFF0F0F0C0F0FF0000"
194         $"000FFF0CFF0C0F0CFF0CFF0FFC0F0000"
195         $"000FCFCF0FC0FFF0FFC0FFF0FFCF0000"
196         $"000F0F0FFF0CFC0FFF0CFFFF0CFF0000"
197         $"000FCFFFC0F0FFC0FFCFF0FFCFCF0000"
198         $"000F0CFC0FFC0C0F0FFFFC0F0FFF0000"
199         $"000FCFCFFFF0CFC0CFCFFFC0F0CF0000"
200         $"000FFF0F0F0CF0FFFC0FFC0CFC0F0000"
201         $"000FCFCFFFC0FFF0CFC0CFC0C0FF0000"
202         $"000FFFFFFFFFFFFFFFFFFFFFFFFF"
203 };
204 resource 'icl8' (FREF_Seed) {
205         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000"
206         $"000000FFFFF5F5F5FFFFFFFFF5F5FFFF05FFFFF5F5FFFF000000000000000000"
207         $"000000FFF5FFFFF5F5F5F5FFFFFFFF05FFFFFFFFF5FF2BFF0000000000000000"
208         $"000000FFFFFFF5F5FFFFF5F5FF0505FF0000FFF5FFFF2B2BFF00000000000000"
209         $"000000FFFFFFF5F5FFFFFFFF0505FFF5FFFFFFF5FFFF2B2B2BFF000000000000"
210         $"000000FFF5F5F5F5F5FFFF0505FFFFF5F5F5FFF5FFFF2B2B2B2BFF0000000000"
211         $"000000FFF5F5F5F5FF050505FFFFFFF5F5F5F5F5F5FFFFFFFFFFFFFF00000000"
212         $"000000FFF5FFF5FF050505FFFFFFFFFFF5F5F5F5F5FFF5F5FFF5F5FF00000000"
213         $"000000FFFFFFFF050505050505050505FFFFF5F5F5FFF5F5FFFFFFFF00000000"
214         $"000000FFFF050505050505050505FFFFFFF5FFFFFFF5FFFFFFFFF5FF00000000"
215         $"000000FFFFFFFFFFFFFF050505FFF5FFFFF5FFFFFFFFFFF5F5F5F5FF00000000"
216         $"000000FFF5F5F5F5FF050505FFF5FFFFF5FFF5FFFFF5FFF5FFF5F5FF00000000"
217         $"000000FFFFF5FFFF0505FFFFFFFFF5F5F5FFF5F5FFFFFFFFF5FFF5FF00000000"
218         $"000000FFF5F5FF0505FFFFF5F5FFFFFFFFF5FFF5FFFFF5F5FFF5F5FF00000000"
219         $"000000FFF5FF0505FFF5FFFFF5FFFFF5F5F5F5F5F5FFF5F5F5FFFFFF00000000"
220         $"000000FFFF05FFFFFFF5FFFFF5FFFFFFFFF5F5FFF5F5F5FFFFF5FFFF00000000"
221         $"000000FF05FFFFFFFFFFFFFFF5FFF5F5FFFFF5FFF5F5FFF5FFF5FFFF00000000"
222         $"000000FFFFFFF5FFFFFFF5F5F5F5F5FFFFFFFFFFFFF5F5F5F5F5FFFF00000000"
223         $"000000FFFFF5FFFFF5F5F5F5F5F5FF00FFF5F5FFF5FFF5F5F5FFF5FF00000000"
224         $"000000FFFFF5FFFFF5FFFFFFF5FF00FFF5F5FFFFFFFFF5FFFFFFF5FF00000000"
225         $"000000FFF5FFF5F5F5FFF5FFFF00FF00FFF5F5F5F5F5F5FFF5FFFFFF00000000"
226         $"000000FFF5F5F5FFF5F5FFFFFF0000FFF5F5F5F5FFFFF5FFFFFF00FF00000000"
227         $"000000FFFFFFFFF5F5F5F5FFF5FF00FFFFF5FFF5FFF5F5F5FF00FFFF00000000"
228         $"000000FFFFFFF5F5FFFFF5F5F5FF0000FFFFF5F5FFFFF5FFFF0000FF00000000"
229         $"000000FFF5FFF5FFF5FFF5F5FFFFFF00FFFFF5F5FFFFFFF5FFFF00FF00000000"
230         $"000000FFF5FFF5FFFFFFF5F5FFF5F5FFFFFFF5F5FFFFFFFFF5F5FFFF00000000"
231         $"000000FFF5FFFFFFF5F5FFF5FFFFF5F5FFFFF5FFFFF5FFFFF5FFF5FF00000000"
232         $"000000FFF5F5FFF5F5FFFFF5F5F5F5FFF5FFFFFFFFF5F5FFF5FFFFFF00000000"
233         $"000000FFF5FFF5FFFFFFFFF5F5FFF5F5F5FFF5FFFFFFF5F5FFF5F5FF00000000"
234         $"000000FFFFFFF5FFF5FFF5F5FFF5FFFFFFF5F5FFFFF5F5F5FFF5F5FF00000000"
235         $"000000FFF5FFF5FFFFFFF5F5FFFFFFF5F5FFF5F5F5FFF5F5F5F5FFFF00000000"
236         $"000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
237 };
238 resource 'ics#' (FREF_Seed) {
239         {       /* array: 2 elements */
240                 /* [1] */
241                 $"7FE0 56B0 59A8 637C 51DC 6794 59AC 76EC"
242                 $"7224 7C6C 743C 71AC 505C 459C 4424 7FFC",
243                 /* [2] */
244                 $"7FE0 7FF0 7FF8 7FFC 7FFC 7FFC 7FFC 7FFC"
245                 $"7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC"
246         }
247 };
248 resource 'ics4' (FREF_Seed) {
249         $"0FFFFFFFFFF00000"
250         $"0F0F0FF1FCFF0000"
251         $"0FCFF11FF0FCF000"
252         $"0FF111FF0FFFFF00"
253         $"0FCF111FFFCFFF00"
254         $"0FF11FFFFC0F0F00"
255         $"0F1FF0CFF0F0FF00"
256         $"0FFF0FFCFFFCFF00"
257         $"0FFFC0F0C0F0CF00"
258         $"0FFFFF0C0FFCFF00"
259         $"0FFFCFC0C0FFFF00"
260         $"0FFF0C0FFCFCFF00"
261         $"0FCFC0C0CFCFFF00"
262         $"0F0C0F0FFC0FFF00"
263         $"0FC0CFC0C0F0CF00"
264         $"0FFFFFFFFFFFFF"
265 };
266 resource 'ics8' (FREF_Seed) {
267         $"00FFFFFFFFFFFFFFFFFFFF0000000000"
268         $"00FFF5FFF5FFFF05FFF5FFFF00000000"
269         $"00FFF5FFFF0505FFFFF5FF2BFF000000"
270         $"00FFFF050505FFFFF5FFFFFFFFFF0000"
271         $"00FFF5FF050505FFFFFFF5FFFFFF0000"
272         $"00FFFF0505FFFFFFFFF5F5FFF5FF0000"
273         $"00FF05FFFFF5F5FFFFF5FFF5FFFF0000"
274         $"00FFFFFFF5FFFFF5FFFFFFF5FFFF0000"
275         $"00FFFFFFF5F5FFF5F5F5FFF5F5FF0000"
276         $"00FFFFFFFFFFF5F5F5FFFFF5FFFF0000"
277         $"00FFFFFFF5FFF5F5F5F5FFFFFFFF0000"
278         $"00FFFFFFF5F5F5FFFFF5FFF5FFFF0000"
279         $"00FFF5FFF5F5F5F5F5FFF5FFFFFF0000"
280         $"00FFF5F5F5FFF5FFFFF5F5FFFFFF0000"
281         $"00FFF5F5F5FFF5F5F5F5FFF5F5FF0000"
282         $"00FFFFFFFFFFFFFFFFFFFFFFFFFF"
283 };
284
285 /*
286  * Application-missing message string, for random seed and host key database
287  * files.
288  */
289 resource 'STR ' (-16397, purgeable) {
290     "This file is used internally by PuTTY.  It cannot be opened."
291 };
292
293 /* Missing-application name string, for private keys. */
294 /* XXX Private keys should eventually be owned by Pageant */
295 resource 'STR ' (-16396, purgeable) {
296     "PuTTYgen"
297 };
298
299 /*
300  * Internal resources
301  */
302
303 /* Menu bar */
304
305 resource 'MBAR' (MBAR_Main, preload) {
306     { mApple, mFile, mEdit, mWindow }
307 };
308
309 resource 'MENU' (mApple, preload) {
310     mApple,
311     textMenuProc,
312     0b11111111111111111111111111111101,
313     enabled,
314     apple,
315     {
316         "About PuTTYgen\0xc9",  noicon, nokey, nomark, plain,
317         "-",                    noicon, nokey, nomark, plain,
318     }
319 };
320
321 resource 'MENU' (mFile, preload) {
322     mFile,
323     textMenuProc,
324     0b11111111111111111111111101111011,
325     enabled,
326     "File",
327     {
328         "New",                  noicon, "N",   nomark, plain,
329         "Open\0xc9",            noicon, "O",   nomark, plain,
330         "-",                    noicon, nokey, nomark, plain,
331         "Close",                noicon, "W",   nomark, plain,
332         "Save",                 noicon, "S",   nomark, plain,
333         "Save As\0xc9",         noicon, nokey, nomark, plain,
334         "-",                    noicon, nokey, nomark, plain,
335         "Quit",                 noicon, "Q",   nomark, plain,
336     }
337 };
338
339 resource 'MENU' (mEdit, preload) {
340     mEdit,
341     textMenuProc,
342     0b11111111111111111111111111111101,
343     enabled,
344     "Edit",
345     {
346         "Undo",                 noicon, "Z",   nomark, plain,
347         "-",                    noicon, nokey, nomark, plain,
348         "Cut",                  noicon, "X",   nomark, plain,
349         "Copy",                 noicon, "C",   nomark, plain,
350         "Paste",                noicon, "V",   nomark, plain,
351         "Clear",                noicon, nokey, nomark, plain,
352         "Select All",           noicon, "A",   nomark, plain,
353     }
354 };
355
356 resource 'MENU' (mWindow, preload) {
357     mWindow,
358     textMenuProc,
359     0b11111111111111111111111111111111,
360     enabled,
361     "Window",
362     {
363     }
364 };
365
366 /* Fatal error box.  Stolen from the Finder. */
367
368 resource 'ALRT' (wFatal, "fatalbox", purgeable) {
369         {54, 67, 152, 435},
370         wFatal,
371         beepStages,
372         alertPositionMainScreen
373 };
374
375 resource 'DITL' (wFatal, "fatalbox", purgeable) {
376         {       /* array DITLarray: 3 elements */
377                 /* [1] */
378                 {68, 299, 88, 358},
379                 Button {
380                         enabled,
381                         "OK"
382                 },
383                 /* [2] */
384                 {68, 227, 88, 286},
385                 StaticText {
386                         disabled,
387                         ""
388                 },
389                 /* [3] */
390                 {7, 74, 55, 358},
391                 StaticText {
392                         disabled,
393                         "^0"
394                 }
395         }
396 };
397
398 /* "About" box */
399
400 resource 'DLOG' (wAbout, "about", purgeable) {
401     { 0, 0, 120, 240 },
402     noGrowDocProc,
403     invisible,
404     goAway,
405     wAbout,             /* RefCon -- identifies the window to PuTTY */
406     wAbout,             /* DITL ID */
407     "About PuTTYgen",
408     alertPositionMainScreen
409 };
410
411 resource 'dlgx' (wAbout, "about", purgeable) {
412     versionZero {
413         kDialogFlagsUseThemeBackground | kDialogFlagsUseThemeControls
414     }
415 };
416
417 resource 'DITL' (wAbout, "about", purgeable) {
418     {
419         { 87, 13, 107, 227 },
420         Button { enabled, "View Licence" },
421         { 13, 13, 29, 227 },
422         StaticText { disabled, "PuTTYgen"},
423         { 42, 13, 74, 227 },
424         StaticText { disabled, "Some version or other\n"
425                                "Copyright © 1997-2008 Simon Tatham"},
426     }
427 };
428
429 /* Licence box */
430
431 resource 'WIND' (wLicence, "licence", purgeable) {
432     { 0, 0, 250, 400 },
433     noGrowDocProc,
434     visible,
435     goAway,
436     wLicence,
437     "PuTTYgen Licence",
438     alertPositionParentWindowScreen
439 };
440
441 type 'TEXT' {
442     string;
443 };
444
445 resource 'TEXT' (wLicence, "licence", purgeable) {
446     "Copyright 1997-2008 Simon Tatham.\n"
447     "\n"
448     "Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
449     "Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, "
450     "Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus "
451     "Kuhn, Colin Watson, and CORE SDI S.A.\n"
452     "\n"    
453     "Permission is hereby granted, free of charge, to any person "
454     "obtaining a copy of this software and associated documentation "
455     "files (the \"Software\"), to deal in the Software without "
456     "restriction, including without limitation the rights to use, "
457     "copy, modify, merge, publish, distribute, sublicense, and/or "
458     "sell copies of the Software, and to permit persons to whom the "
459     "Software is furnished to do so, subject to the following "
460     "conditions:\n\n"
461     
462     "The above copyright notice and this permission notice shall be "
463     "included in all copies or substantial portions of the Software.\n\n"
464     
465     "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, "
466     "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
467     "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND "
468     "NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR "
469     "ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF "
470     "CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
471     "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE "
472     "SOFTWARE."
473 };
474
475 /* Key box */
476
477 resource 'DLOG' (wKey, "key", purgeable) {
478     { 0, 0, 120, 240 },
479     noGrowDocProc,
480     invisible,
481     goAway,
482     wKey,               /* RefCon -- identifies the window to PuTTY */
483     wKey,               /* DITL ID */
484     "untitled",
485     staggerParentWindowScreen
486 };
487
488 resource 'dlgx' (wKey, "key", purgeable) {
489     versionZero {
490         kDialogFlagsUseThemeBackground | kDialogFlagsUseThemeControls
491     }
492 };
493
494 #define cProgress 129
495
496 resource 'DITL' (wKey, "key", purgeable) {
497     {
498         { 13, 13, 33, 227 },
499         Button { enabled, "Generate" },
500         { 46, 13, 12, 227 },
501         Control { enabled, cProgress },
502     }
503 };
504
505 resource 'CNTL' (cProgress) {
506     { 46, 13, 12, 227 },
507     0, visible, 0, 0,
508     kControlProgressBarProc, 0, ""
509 };