home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-2.iso / Files II / Prog / T / ThinkHelper 1.0b1.sit / ThinkHelper 1.0b1 / Source (!) / Source / ThinkHelperPatch.c < prev    next >
MacBinary  |  1993-08-18  |  8.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: ThinkHelperPatch.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Aug 18 22:06:24 1993, modified Wed Aug 18 22:06:24 1993, creator Think C, type ASCII, 7629 bytes "ThinkHelperPatch.c" , at 0x1e4d 484 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 54 68 69 6e 6b 48 | 65 6c 70 65 72 50 61 74 |..ThinkH|elperPat|
|00000010| 63 68 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |ch.c....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 1d cd 00 | 00 01 e4 a8 98 90 a0 a8 |........|........|
|00000060| 98 90 a0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 50 9e 00 00 |........|....P...|
|00000080| 2f 2a 0d 09 54 68 69 6e | 6b 48 65 6c 70 50 61 74 |/*..Thin|kHelpPat|
|00000090| 63 68 2e 63 0d 09 0d 09 | 63 6f 64 65 20 66 6f 72 |ch.c....|code for|
|000000a0| 20 74 68 65 20 74 68 69 | 6e 6b 20 68 65 6c 70 65 | the thi|nk helpe|
|000000b0| 72 20 70 61 74 63 68 0d | 09 0d 09 a9 20 31 39 39 |r patch.|.... 199|
|000000c0| 33 20 53 74 65 76 65 20 | 5a 65 6c 6c 65 72 73 0d |3 Steve |Zellers.|
|000000d0| 09 0d 09 3c 72 65 76 69 | 73 69 6f 6e 20 68 69 73 |...<revi|sion his|
|000000e0| 74 6f 72 79 3e 0d 09 30 | 35 2f 31 35 2f 39 33 20 |tory>..0|5/15/93 |
|000000f0| 20 73 6d 7a 20 20 63 72 | 65 61 74 65 64 0d 09 30 | smz cr|eated..0|
|00000100| 35 2f 32 30 2f 39 33 20 | 20 73 6d 7a 20 20 67 65 |5/20/93 | smz ge|
|00000110| 6e 65 72 61 6c 69 7a 65 | 64 20 64 69 73 70 61 74 |neralize|d dispat|
|00000120| 63 68 65 73 2c 20 61 64 | 64 65 64 20 67 72 65 70 |ches, ad|ded grep|
|00000130| 0d 09 30 38 2f 31 38 2f | 39 33 20 20 73 6d 7a 20 |..08/18/|93 smz |
|00000140| 20 66 69 72 73 74 20 62 | 65 74 61 0d 2a 2f 0d 0d | first b|eta.*/..|
|00000150| 23 69 6e 63 6c 75 64 65 | 20 3c 53 65 74 55 70 41 |#include| <SetUpA|
|00000160| 34 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 41 |4.h>.#in|clude <A|
|00000170| 70 70 6c 65 45 76 65 6e | 74 73 2e 68 3e 0d 23 69 |ppleEven|ts.h>.#i|
|00000180| 6e 63 6c 75 64 65 20 22 | 54 68 69 6e 6b 48 65 6c |nclude "|ThinkHel|
|00000190| 70 50 61 74 63 68 2e 68 | 22 0d 23 69 6e 63 6c 75 |pPatch.h|".#inclu|
|000001a0| 64 65 20 22 45 78 63 65 | 70 74 69 6f 6e 73 2e 68 |de "Exce|ptions.h|
|000001b0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 50 55 46 49 |".#inclu|de "PUFI|
|000001c0| 6e 74 65 72 66 61 63 65 | 2e 68 22 0d 23 69 6e 63 |nterface|.h".#inc|
|000001d0| 6c 75 64 65 20 22 4c 69 | 73 74 54 6f 6f 6c 73 2e |lude "Li|stTools.|
|000001e0| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 3c 47 65 73 |h".#incl|ude <Ges|
|000001f0| 74 61 6c 74 45 51 55 2e | 68 3e 0d 0d 74 79 70 65 |taltEQU.|h>..type|
|00000200| 64 65 66 20 70 61 73 63 | 61 6c 20 4f 53 45 72 72 |def pasc|al OSErr|
|00000210| 20 28 2a 41 45 48 61 6e | 64 6c 65 72 50 72 6f 63 | (*AEHan|dlerProc|
|00000220| 29 28 41 70 70 6c 65 45 | 76 65 6e 74 2a 20 65 76 |)(AppleE|vent* ev|
|00000230| 65 6e 74 2c 20 41 70 70 | 6c 65 45 76 65 6e 74 2a |ent, App|leEvent*|
|00000240| 20 72 65 70 6c 79 29 3b | 0d 0d 73 74 61 74 69 63 | reply);|..static|
|00000250| 20 70 61 73 63 61 6c 20 | 4f 53 45 72 72 20 5f 41 | pascal |OSErr _A|
|00000260| 45 48 61 6e 64 6c 65 72 | 50 72 6f 63 28 41 70 70 |EHandler|Proc(App|
|00000270| 6c 65 45 76 65 6e 74 2a | 20 65 76 65 6e 74 2c 20 |leEvent*| event, |
|00000280| 41 70 70 6c 65 45 76 65 | 6e 74 2a 20 72 65 70 6c |AppleEve|nt* repl|
|00000290| 79 2c 20 6c 6f 6e 67 20 | 72 65 66 63 6f 6e 29 0d |y, long |refcon).|
|000002a0| 7b 0d 09 4f 53 45 72 72 | 20 65 72 72 3b 0d 09 41 |{..OSErr| err;..A|
|000002b0| 45 48 61 6e 64 6c 65 72 | 50 72 6f 63 20 70 50 74 |EHandler|Proc pPt|
|000002c0| 72 20 3d 20 28 41 45 48 | 61 6e 64 6c 65 72 50 72 |r = (AEH|andlerPr|
|000002d0| 6f 63 29 20 72 65 66 63 | 6f 6e 3b 0d 09 0d 09 53 |oc) refc|on;....S|
|000002e0| 65 74 55 70 41 34 28 29 | 3b 0d 0d 09 74 72 79 20 |etUpA4()|;...try |
|000002f0| 7b 0d 09 09 65 72 72 20 | 3d 20 28 2a 70 50 74 72 |{...err |= (*pPtr|
|00000300| 29 20 28 65 76 65 6e 74 | 2c 20 72 65 70 6c 79 29 |) (event|, reply)|
|00000310| 3b 0d 09 7d 20 63 61 74 | 63 68 20 7b 0d 09 09 65 |;..} cat|ch {...e|
|00000320| 72 72 20 3d 20 74 68 65 | 45 78 63 65 70 74 69 6f |rr = the|Exceptio|
|00000330| 6e 3b 0d 09 7d 0d 0d 09 | 2f 2f 20 68 61 6e 64 6c |n;..}...|// handl|
|00000340| 65 20 61 6e 79 20 73 70 | 65 63 69 61 6c 20 65 72 |e any sp|ecial er|
|00000350| 72 6f 72 73 20 77 65 20 | 68 61 76 65 0d 09 73 77 |rors we |have..sw|
|00000360| 69 74 63 68 20 28 65 72 | 72 29 20 7b 0d 09 09 63 |itch (er|r) {...c|
|00000370| 61 73 65 20 63 6f 72 45 | 72 72 3a 20 7b 0d 09 09 |ase corE|rr: {...|
|00000380| 09 73 74 61 74 69 63 20 | 63 68 61 72 20 63 45 72 |.static |char cEr|
|00000390| 72 6f 72 53 74 72 69 6e | 67 5b 5d 20 3d 20 22 54 |rorStrin|g[] = "T|
|000003a0| 68 65 20 74 61 72 67 65 | 74 20 77 69 6e 64 6f 77 |he targe|t window|
|000003b0| 20 69 73 6e 27 74 20 73 | 65 74 20 75 70 20 70 72 | isn't s|et up pr|
|000003c0| 6f 70 65 72 6c 79 2e 22 | 3b 0d 09 09 09 41 45 44 |operly."|;....AED|
|000003d0| 65 73 63 20 72 65 70 6c | 79 44 65 73 63 3b 0d 09 |esc repl|yDesc;..|
|000003e0| 09 09 4f 53 45 72 72 20 | 72 65 70 6c 79 45 72 72 |..OSErr |replyErr|
|000003f0| 3b 0d 09 09 09 0d 09 09 | 09 72 65 70 6c 79 45 72 |;.......|.replyEr|
|00000400| 72 20 3d 20 41 45 43 72 | 65 61 74 65 44 65 73 63 |r = AECr|eateDesc|
|00000410| 28 74 79 70 65 43 68 61 | 72 2c 20 63 45 72 72 6f |(typeCha|r, cErro|
|00000420| 72 53 74 72 69 6e 67 2c | 20 73 69 7a 65 6f 66 28 |rString,| sizeof(|
|00000430| 63 45 72 72 6f 72 53 74 | 72 69 6e 67 29 2c 20 26 |cErrorSt|ring), &|
|00000440| 72 65 70 6c 79 44 65 73 | 63 29 3b 0d 09 09 09 46 |replyDes|c);....F|
|00000450| 61 69 6c 45 72 72 28 72 | 65 70 6c 79 45 72 72 29 |ailErr(r|eplyErr)|
|00000460| 3b 0d 09 09 09 0d 09 09 | 09 69 66 20 28 72 65 70 |;.......|.if (rep|
|00000470| 6c 79 45 72 72 20 3d 3d | 20 6e 6f 45 72 72 29 20 |lyErr ==| noErr) |
|00000480| 7b 0d 09 09 09 09 72 65 | 70 6c 79 45 72 72 20 3d |{.....re|plyErr =|
|00000490| 20 41 45 50 75 74 50 61 | 72 61 6d 44 65 73 63 28 | AEPutPa|ramDesc(|
|000004a0| 72 65 70 6c 79 2c 20 6b | 65 79 45 72 72 6f 72 53 |reply, k|eyErrorS|
|000004b0| 74 72 69 6e 67 2c 20 26 | 72 65 70 6c 79 44 65 73 |tring, &|replyDes|
|000004c0| 63 29 3b 0d 09 09 09 09 | 41 45 44 69 73 70 6f 73 |c);.....|AEDispos|
|000004d0| 65 44 65 73 63 28 26 72 | 65 70 6c 79 44 65 73 63 |eDesc(&r|eplyDesc|
|000004e0| 29 3b 0d 09 09 09 7d 0d | 09 09 7d 09 62 72 65 61 |);....}.|..}.brea|
|000004f0| 6b 3b 0d 09 09 09 0d 09 | 09 64 65 66 61 75 6c 74 |k;......|.default|
|00000500| 3a 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 7d 0d 09 |:....bre|ak;..}..|
|00000510| 0d 09 52 65 73 74 6f 72 | 65 41 34 28 29 3b 0d 0d |..Restor|eA4();..|
|00000520| 09 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 7d 0d 0d |.return |err;.}..|
|00000530| 73 74 61 74 69 63 20 70 | 61 73 63 61 6c 20 4f 53 |static p|ascal OS|
|00000540| 45 72 72 20 5f 48 61 6e | 64 6c 65 47 65 74 53 65 |Err _Han|dleGetSe|
|00000550| 6c 65 63 74 69 6f 6e 28 | 41 70 70 6c 65 45 76 65 |lection(|AppleEve|
|00000560| 6e 74 2a 20 65 76 65 6e | 74 2c 20 41 70 70 6c 65 |nt* even|t, Apple|
|00000570| 45 76 65 6e 74 2a 20 72 | 65 70 6c 79 29 0d 7b 0d |Event* r|eply).{.|
|00000580| 09 4f 53 45 72 72 20 65 | 72 72 20 3d 20 6e 6f 45 |.OSErr e|rr = noE|
|00000590| 72 72 3b 0d 09 6c 6f 6e | 67 20 73 65 6c 53 74 61 |rr;..lon|g selSta|
|000005a0| 72 74 2c 20 73 65 6c 45 | 6e 64 3b 0d 09 0d 09 50 |rt, selE|nd;....P|
|000005b0| 55 46 47 65 74 53 65 6c | 65 63 74 69 6f 6e 28 26 |UFGetSel|ection(&|
|000005c0| 73 65 6c 53 74 61 72 74 | 2c 20 26 73 65 6c 45 6e |selStart|, &selEn|
|000005d0| 64 29 3b 0d 09 0d 09 50 | 75 74 53 65 6c 65 63 74 |d);....P|utSelect|
|000005e0| 69 6f 6e 4c 69 73 74 28 | 72 65 70 6c 79 2c 20 73 |ionList(|reply, s|
|000005f0| 65 6c 53 74 61 72 74 2c | 20 73 65 6c 45 6e 64 29 |elStart,| selEnd)|
|00000600| 3b 0d 09 0d 09 72 65 74 | 75 72 6e 20 65 72 72 3b |;....ret|urn err;|
|00000610| 0d 7d 0d 0d 73 74 61 74 | 69 63 20 70 61 73 63 61 |.}..stat|ic pasca|
|00000620| 6c 20 4f 53 45 72 72 20 | 5f 48 61 6e 64 6c 65 53 |l OSErr |_HandleS|
|00000630| 65 74 53 65 6c 65 63 74 | 69 6f 6e 28 41 70 70 6c |etSelect|ion(Appl|
|00000640| 65 45 76 65 6e 74 2a 20 | 65 76 65 6e 74 2c 20 41 |eEvent* |event, A|
|00000650| 70 70 6c 65 45 76 65 6e | 74 2a 20 72 65 70 6c 79 |ppleEven|t* reply|
|00000660| 29 0d 7b 0d 09 4f 53 45 | 72 72 20 65 72 72 20 3d |).{..OSE|rr err =|
|00000670| 20 6e 6f 45 72 72 3b 0d | 09 41 45 44 65 73 63 20 | noErr;.|.AEDesc |
|00000680| 73 65 6c 4c 69 73 74 3b | 0d 09 6c 6f 6e 67 20 73 |selList;|..long s|
|00000690| 65 6c 53 74 61 72 74 2c | 20 73 65 6c 45 6e 64 3b |elStart,| selEnd;|
|000006a0| 0d 09 6c 6f 6e 67 20 63 | 74 50 61 72 61 6d 73 3b |..long c|tParams;|
|000006b0| 0d 09 44 65 73 63 54 79 | 70 65 20 61 63 74 75 61 |..DescTy|pe actua|
|000006c0| 6c 74 79 70 65 3b 0d 09 | 6c 6f 6e 67 20 61 63 74 |ltype;..|long act|
|000006d0| 75 61 6c 73 69 7a 65 3b | 0d 09 41 45 4b 65 79 77 |ualsize;|..AEKeyw|
|000006e0| 6f 72 64 20 61 63 74 75 | 61 6c 6b 65 79 77 6f 72 |ord actu|alkeywor|
|000006f0| 64 3b 0d 0d 09 65 72 72 | 20 3d 20 41 45 47 65 74 |d;...err| = AEGet|
|00000700| 4b 65 79 44 65 73 63 28 | 65 76 65 6e 74 2c 20 6b |KeyDesc(|event, k|
|00000710| 65 79 44 69 72 65 63 74 | 4f 62 6a 65 63 74 2c 20 |eyDirect|Object, |
|00000720| 74 79 70 65 41 45 4c 69 | 73 74 2c 20 26 73 65 6c |typeAELi|st, &sel|
|00000730| 4c 69 73 74 29 3b 0d 09 | 46 61 69 6c 45 72 72 28 |List);..|FailErr(|
|00000740| 65 72 72 29 3b 0d 0d 09 | 65 72 72 20 3d 20 41 45 |err);...|err = AE|
|00000750| 43 6f 75 6e 74 49 74 65 | 6d 73 28 26 73 65 6c 4c |CountIte|ms(&selL|
|00000760| 69 73 74 2c 20 26 63 74 | 50 61 72 61 6d 73 29 3b |ist, &ct|Params);|
|00000770| 0d 09 46 61 69 6c 45 72 | 72 28 65 72 72 29 3b 0d |..FailEr|r(err);.|
|00000780| 0d 09 69 66 20 28 63 74 | 50 61 72 61 6d 73 20 21 |..if (ct|Params !|
|00000790| 3d 20 32 29 0d 09 09 74 | 68 72 6f 77 28 70 61 72 |= 2)...t|hrow(par|
|000007a0| 61 6d 45 72 72 29 3b 0d | 0d 09 65 72 72 20 3d 20 |amErr);.|..err = |
|000007b0| 41 45 47 65 74 4e 74 68 | 50 74 72 28 0d 09 09 26 |AEGetNth|Ptr(...&|
|000007c0| 73 65 6c 4c 69 73 74 2c | 20 31 2c 20 74 79 70 65 |selList,| 1, type|
|000007d0| 4c 6f 6e 67 49 6e 74 65 | 67 65 72 2c 20 26 61 63 |LongInte|ger, &ac|
|000007e0| 74 75 61 6c 6b 65 79 77 | 6f 72 64 2c 20 26 61 63 |tualkeyw|ord, &ac|
|000007f0| 74 75 61 6c 74 79 70 65 | 2c 20 0d 09 09 28 50 74 |tualtype|, ...(Pt|
|00000800| 72 29 20 26 73 65 6c 53 | 74 61 72 74 2c 20 73 69 |r) &selS|tart, si|
|00000810| 7a 65 6f 66 28 73 65 6c | 53 74 61 72 74 29 2c 20 |zeof(sel|Start), |
|00000820| 26 61 63 74 75 61 6c 73 | 69 7a 65 29 3b 0d 09 46 |&actuals|ize);..F|
|00000830| 61 69 6c 45 72 72 28 65 | 72 72 29 3b 0d 0d 09 65 |ailErr(e|rr);...e|
|00000840| 72 72 20 3d 20 41 45 47 | 65 74 4e 74 68 50 74 72 |rr = AEG|etNthPtr|
|00000850| 28 0d 09 09 26 73 65 6c | 4c 69 73 74 2c 20 32 2c |(...&sel|List, 2,|
|00000860| 20 74 79 70 65 4c 6f 6e | 67 49 6e 74 65 67 65 72 | typeLon|gInteger|
|00000870| 2c 20 26 61 63 74 75 61 | 6c 6b 65 79 77 6f 72 64 |, &actua|lkeyword|
|00000880| 2c 20 26 61 63 74 75 61 | 6c 74 79 70 65 2c 20 0d |, &actua|ltype, .|
|00000890| 09 09 28 50 74 72 29 20 | 26 73 65 6c 45 6e 64 2c |..(Ptr) |&selEnd,|
|000008a0| 20 73 69 7a 65 6f 66 28 | 73 65 6c 45 6e 64 29 2c | sizeof(|selEnd),|
|000008b0| 20 26 61 63 74 75 61 6c | 73 69 7a 65 29 3b 0d 09 | &actual|size);..|
|000008c0| 46 61 69 6c 45 72 72 28 | 65 72 72 29 3b 0d 0d 09 |FailErr(|err);...|
|000008d0| 50 55 46 53 65 74 53 65 | 6c 65 63 74 69 6f 6e 28 |PUFSetSe|lection(|
|000008e0| 73 65 6c 53 74 61 72 74 | 2c 20 73 65 6c 45 6e 64 |selStart|, selEnd|
|000008f0| 29 3b 0d 0d 09 72 65 74 | 75 72 6e 20 65 72 72 3b |);...ret|urn err;|
|00000900| 0d 7d 0d 0d 73 74 61 74 | 69 63 20 70 61 73 63 61 |.}..stat|ic pasca|
|00000910| 6c 20 4f 53 45 72 72 20 | 5f 48 61 6e 64 6c 65 47 |l OSErr |_HandleG|
|00000920| 65 74 46 69 6c 65 54 65 | 78 74 28 41 70 70 6c 65 |etFileTe|xt(Apple|
|00000930| 45 76 65 6e 74 2a 20 65 | 76 65 6e 74 2c 20 41 70 |Event* e|vent, Ap|
|00000940| 70 6c 65 45 76 65 6e 74 | 2a 20 72 65 70 6c 79 29 |pleEvent|* reply)|
|00000950| 0d 7b 0d 09 4f 53 45 72 | 72 20 65 72 72 20 3d 20 |.{..OSEr|r err = |
|00000960| 6e 6f 45 72 72 3b 0d 09 | 41 45 44 65 73 63 20 64 |noErr;..|AEDesc d|
|00000970| 65 73 63 3b 0d 09 48 61 | 6e 64 6c 65 20 68 20 3d |esc;..Ha|ndle h =|
|00000980| 20 50 55 46 47 65 74 54 | 65 78 74 28 29 3b 0d 09 | PUFGetT|ext();..|
|00000990| 46 61 69 6c 4e 69 6c 28 | 68 29 3b 0d 0d 09 64 65 |FailNil(|h);...de|
|000009a0| 73 63 2e 64 65 73 63 72 | 69 70 74 6f 72 54 79 70 |sc.descr|iptorTyp|
|000009b0| 65 20 3d 20 27 54 45 58 | 54 27 3b 0d 09 64 65 73 |e = 'TEX|T';..des|
|000009c0| 63 2e 64 61 74 61 48 61 | 6e 64 6c 65 20 3d 20 68 |c.dataHa|ndle = h|
|000009d0| 3b 0d 09 0d 09 65 72 72 | 20 3d 20 41 45 50 75 74 |;....err| = AEPut|
|000009e0| 50 61 72 61 6d 44 65 73 | 63 28 72 65 70 6c 79 2c |ParamDes|c(reply,|
|000009f0| 20 6b 65 79 44 69 72 65 | 63 74 4f 62 6a 65 63 74 | keyDire|ctObject|
|00000a00| 2c 20 26 64 65 73 63 29 | 3b 0d 09 41 45 44 69 73 |, &desc)|;..AEDis|
|00000a10| 70 6f 73 65 44 65 73 63 | 28 26 64 65 73 63 29 3b |poseDesc|(&desc);|
|00000a20| 0d 09 0d 09 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |....retu|rn err;.|
|00000a30| 7d 0d 0d 73 74 61 74 69 | 63 20 70 61 73 63 61 6c |}..stati|c pascal|
|00000a40| 20 4f 53 45 72 72 20 5f | 48 61 6e 64 6c 65 43 6f | OSErr _|HandleCo|
|00000a50| 70 79 53 65 6c 65 63 74 | 69 6f 6e 28 41 70 70 6c |pySelect|ion(Appl|
|00000a60| 65 45 76 65 6e 74 2a 20 | 65 76 65 6e 74 2c 20 41 |eEvent* |event, A|
|00000a70| 70 70 6c 65 45 76 65 6e | 74 2a 20 72 65 70 6c 79 |ppleEven|t* reply|
|00000a80| 29 0d 7b 0d 09 4f 53 45 | 72 72 20 65 72 72 20 3d |).{..OSE|rr err =|
|00000a90| 20 6e 6f 45 72 72 3b 0d | 09 41 45 44 65 73 63 20 | noErr;.|.AEDesc |
|00000aa0| 64 65 73 63 3b 0d 09 48 | 61 6e 64 6c 65 20 68 20 |desc;..H|andle h |
|00000ab0| 3d 20 50 55 46 43 6f 70 | 79 53 65 6c 65 63 74 69 |= PUFCop|ySelecti|
|00000ac0| 6f 6e 28 29 3b 0d 09 46 | 61 69 6c 4e 69 6c 28 68 |on();..F|ailNil(h|
|00000ad0| 29 3b 0d 0d 09 64 65 73 | 63 2e 64 65 73 63 72 69 |);...des|c.descri|
|00000ae0| 70 74 6f 72 54 79 70 65 | 20 3d 20 27 54 45 58 54 |ptorType| = 'TEXT|
|00000af0| 27 3b 0d 09 64 65 73 63 | 2e 64 61 74 61 48 61 6e |';..desc|.dataHan|
|00000b00| 64 6c 65 20 3d 20 68 3b | 0d 09 46 61 69 6c 45 72 |dle = h;|..FailEr|
|00000b10| 72 28 65 72 72 29 3b 0d | 0d 09 65 72 72 20 3d 20 |r(err);.|..err = |
|00000b20| 41 45 50 75 74 50 61 72 | 61 6d 44 65 73 63 28 72 |AEPutPar|amDesc(r|
|00000b30| 65 70 6c 79 2c 20 6b 65 | 79 44 69 72 65 63 74 4f |eply, ke|yDirectO|
|00000b40| 62 6a 65 63 74 2c 20 26 | 64 65 73 63 29 3b 0d 09 |bject, &|desc);..|
|00000b50| 41 45 44 69 73 70 6f 73 | 65 44 65 73 63 28 26 64 |AEDispos|eDesc(&d|
|00000b60| 65 73 63 29 3b 0d 0d 09 | 72 65 74 75 72 6e 20 65 |esc);...|return e|
|00000b70| 72 72 3b 0d 7d 0d 0d 73 | 74 61 74 69 63 20 76 6f |rr;.}..s|tatic vo|
|00000b80| 69 64 20 45 78 74 72 61 | 63 74 53 74 72 69 6e 67 |id Extra|ctString|
|00000b90| 28 41 70 70 6c 65 45 76 | 65 6e 74 2a 20 65 76 65 |(AppleEv|ent* eve|
|00000ba0| 6e 74 2c 20 53 74 72 32 | 35 35 20 73 74 72 69 6e |nt, Str2|55 strin|
|00000bb0| 67 29 0d 7b 0d 09 41 45 | 44 65 73 63 20 74 65 78 |g).{..AE|Desc tex|
|00000bc0| 74 3b 0d 09 73 68 6f 72 | 74 20 74 65 78 74 4c 65 |t;..shor|t textLe|
|00000bd0| 6e 3b 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 09 |n;..OSEr|r err;..|
|00000be0| 0d 20 09 2f 2f 20 65 78 | 74 72 61 63 74 20 61 20 |. .// ex|tract a |
|00000bf0| 73 74 72 69 6e 67 20 66 | 72 6f 6d 20 74 68 65 20 |string f|rom the |
|00000c00| 65 76 65 6e 74 0d 09 65 | 72 72 20 3d 20 41 45 47 |event..e|rr = AEG|
|00000c10| 65 74 4b 65 79 44 65 73 | 63 28 65 76 65 6e 74 2c |etKeyDes|c(event,|
|00000c20| 20 6b 65 79 44 69 72 65 | 63 74 4f 62 6a 65 63 74 | keyDire|ctObject|
|00000c30| 2c 20 74 79 70 65 43 68 | 61 72 2c 20 26 74 65 78 |, typeCh|ar, &tex|
|00000c40| 74 29 3b 0d 09 46 61 69 | 6c 45 72 72 28 65 72 72 |t);..Fai|lErr(err|
|00000c50| 29 3b 0d 09 46 61 69 6c | 4e 69 6c 28 74 65 78 74 |);..Fail|Nil(text|
|00000c60| 2e 64 61 74 61 48 61 6e | 64 6c 65 29 3b 0d 0d 09 |.dataHan|dle);...|
|00000c70| 74 65 78 74 4c 65 6e 20 | 3d 20 47 65 74 48 61 6e |textLen |= GetHan|
|00000c80| 64 6c 65 53 69 7a 65 28 | 74 65 78 74 2e 64 61 74 |dleSize(|text.dat|
|00000c90| 61 48 61 6e 64 6c 65 29 | 3b 0d 09 69 66 20 28 74 |aHandle)|;..if (t|
|00000ca0| 65 78 74 4c 65 6e 20 3e | 20 32 35 34 29 0d 09 09 |extLen >| 254)...|
|00000cb0| 74 65 78 74 4c 65 6e 20 | 3d 20 32 35 34 3b 0d 09 |textLen |= 254;..|
|00000cc0| 73 74 72 69 6e 67 5b 30 | 5d 20 3d 20 74 65 78 74 |string[0|] = text|
|00000cd0| 4c 65 6e 3b 0d 09 42 6c | 6f 63 6b 4d 6f 76 65 28 |Len;..Bl|ockMove(|
|00000ce0| 2a 74 65 78 74 2e 64 61 | 74 61 48 61 6e 64 6c 65 |*text.da|taHandle|
|00000cf0| 2c 20 26 73 74 72 69 6e | 67 5b 31 5d 2c 20 74 65 |, &strin|g[1], te|
|00000d00| 78 74 4c 65 6e 29 3b 0d | 0d 09 41 45 44 69 73 70 |xtLen);.|..AEDisp|
|00000d10| 6f 73 65 44 65 73 63 28 | 26 74 65 78 74 29 3b 0d |oseDesc(|&text);.|
|00000d20| 7d 0d 0d 73 74 61 74 69 | 63 20 70 61 73 63 61 6c |}..stati|c pascal|
|00000d30| 20 4f 53 45 72 72 20 5f | 48 61 6e 64 6c 65 47 65 | OSErr _|HandleGe|
|00000d40| 74 4d 61 72 6b 65 72 28 | 41 70 70 6c 65 45 76 65 |tMarker(|AppleEve|
|00000d50| 6e 74 2a 20 65 76 65 6e | 74 2c 20 41 70 70 6c 65 |nt* even|t, Apple|
|00000d60| 45 76 65 6e 74 2a 20 72 | 65 70 6c 79 29 0d 7b 0d |Event* r|eply).{.|
|00000d70| 09 4f 53 45 72 72 20 65 | 72 72 3b 0d 09 53 74 72 |.OSErr e|rr;..Str|
|00000d80| 32 35 35 20 6d 61 72 6b | 65 72 53 74 72 69 6e 67 |255 mark|erString|
|00000d90| 3b 0d 09 50 55 46 4d 61 | 72 6b 65 72 20 6d 61 72 |;..PUFMa|rker mar|
|00000da0| 6b 65 72 3b 0d 09 41 45 | 44 65 73 63 20 6d 61 72 |ker;..AE|Desc mar|
|00000db0| 6b 65 72 4c 69 73 74 3b | 0d 09 0d 09 45 78 74 72 |kerList;|....Extr|
|00000dc0| 61 63 74 53 74 72 69 6e | 67 28 65 76 65 6e 74 2c |actStrin|g(event,|
|00000dd0| 20 6d 61 72 6b 65 72 53 | 74 72 69 6e 67 29 3b 0d | markerS|tring);.|
|00000de0| 09 0d 09 2f 2f 20 67 65 | 74 20 74 68 65 20 6d 61 |...// ge|t the ma|
|00000df0| 72 6b 65 72 0d 09 50 55 | 46 47 65 74 4d 61 72 6b |rker..PU|FGetMark|
|00000e00| 65 72 50 6f 73 28 6d 61 | 72 6b 65 72 53 74 72 69 |erPos(ma|rkerStri|
|00000e10| 6e 67 2c 20 26 6d 61 72 | 6b 65 72 29 3b 0d 0d 09 |ng, &mar|ker);...|
|00000e20| 2f 2f 20 72 65 74 75 72 | 6e 20 74 68 65 20 6d 61 |// retur|n the ma|
|00000e30| 72 6b 65 72 0d 09 4d 61 | 6b 65 4d 61 72 6b 65 72 |rker..Ma|keMarker|
|00000e40| 4c 69 73 74 28 26 6d 61 | 72 6b 65 72 2c 20 26 6d |List(&ma|rker, &m|
|00000e50| 61 72 6b 65 72 4c 69 73 | 74 29 3b 0d 0d 09 65 72 |arkerLis|t);...er|
|00000e60| 72 20 3d 20 41 45 50 75 | 74 50 61 72 61 6d 44 65 |r = AEPu|tParamDe|
|00000e70| 73 63 28 72 65 70 6c 79 | 2c 20 6b 65 79 44 69 72 |sc(reply|, keyDir|
|00000e80| 65 63 74 4f 62 6a 65 63 | 74 2c 20 26 6d 61 72 6b |ectObjec|t, &mark|
|00000e90| 65 72 4c 69 73 74 29 3b | 0d 09 41 45 44 69 73 70 |erList);|..AEDisp|
|00000ea0| 6f 73 65 44 65 73 63 28 | 26 6d 61 72 6b 65 72 4c |oseDesc(|&markerL|
|00000eb0| 69 73 74 29 3b 0d 0d 09 | 72 65 74 75 72 6e 20 65 |ist);...|return e|
|00000ec0| 72 72 3b 0d 7d 0d 0d 73 | 74 61 74 69 63 20 70 61 |rr;.}..s|tatic pa|
|00000ed0| 73 63 61 6c 20 4f 53 45 | 72 72 20 5f 48 61 6e 64 |scal OSE|rr _Hand|
|00000ee0| 6c 65 44 65 6c 65 74 65 | 4d 61 72 6b 65 72 28 41 |leDelete|Marker(A|
|00000ef0| 70 70 6c 65 45 76 65 6e | 74 2a 20 65 76 65 6e 74 |ppleEven|t* event|
|00000f00| 2c 20 41 70 70 6c 65 45 | 76 65 6e 74 2a 20 72 65 |, AppleE|vent* re|
|00000f10| 70 6c 79 29 0d 7b 0d 09 | 4f 53 45 72 72 20 65 72 |ply).{..|OSErr er|
|00000f20| 72 20 3d 20 6e 6f 45 72 | 72 3b 0d 09 53 74 72 32 |r = noEr|r;..Str2|
|00000f30| 35 35 20 6d 61 72 6b 65 | 72 53 74 72 69 6e 67 3b |55 marke|rString;|
|00000f40| 0d 0d 09 45 78 74 72 61 | 63 74 53 74 72 69 6e 67 |...Extra|ctString|
|00000f50| 28 65 76 65 6e 74 2c 20 | 6d 61 72 6b 65 72 53 74 |(event, |markerSt|
|00000f60| 72 69 6e 67 29 3b 0d 09 | 0d 09 2f 2f 20 64 65 6c |ring);..|..// del|
|00000f70| 65 74 65 20 69 74 0d 09 | 50 55 46 44 65 6c 65 74 |ete it..|PUFDelet|
|00000f80| 65 4d 61 72 6b 65 72 28 | 6d 61 72 6b 65 72 53 74 |eMarker(|markerSt|
|00000f90| 72 69 6e 67 29 3b 0d 09 | 0d 09 72 65 74 75 72 6e |ring);..|..return|
|00000fa0| 20 65 72 72 3b 0d 7d 0d | 0d 73 74 61 74 69 63 20 | err;.}.|.static |
|00000fb0| 70 61 73 63 61 6c 20 4f | 53 45 72 72 20 5f 48 61 |pascal O|SErr _Ha|
|00000fc0| 6e 64 6c 65 4d 61 72 6b | 28 41 70 70 6c 65 45 76 |ndleMark|(AppleEv|
|00000fd0| 65 6e 74 2a 20 65 76 65 | 6e 74 2c 20 41 70 70 6c |ent* eve|nt, Appl|
|00000fe0| 65 45 76 65 6e 74 2a 20 | 72 65 70 6c 79 29 0d 7b |eEvent* |reply).{|
|00000ff0| 0d 09 4f 53 45 72 72 20 | 65 72 72 20 3d 20 6e 6f |..OSErr |err = no|
|00001000| 45 72 72 3b 0d 09 53 74 | 72 32 35 35 20 6d 61 72 |Err;..St|r255 mar|
|00001010| 6b 65 72 53 74 72 69 6e | 67 3b 0d 0d 09 45 78 74 |kerStrin|g;...Ext|
|00001020| 72 61 63 74 53 74 72 69 | 6e 67 28 65 76 65 6e 74 |ractStri|ng(event|
|00001030| 2c 20 6d 61 72 6b 65 72 | 53 74 72 69 6e 67 29 3b |, marker|String);|
|00001040| 0d 09 0d 09 2f 2f 20 64 | 65 6c 65 74 65 20 69 74 |....// d|elete it|
|00001050| 0d 09 50 55 46 4d 61 72 | 6b 53 65 6c 65 63 74 69 |..PUFMar|kSelecti|
|00001060| 6f 6e 28 6d 61 72 6b 65 | 72 53 74 72 69 6e 67 29 |on(marke|rString)|
|00001070| 3b 0d 09 0d 09 72 65 74 | 75 72 6e 20 65 72 72 3b |;....ret|urn err;|
|00001080| 0d 7d 0d 0d 73 74 61 74 | 69 63 20 70 61 73 63 61 |.}..stat|ic pasca|
|00001090| 6c 20 4f 53 45 72 72 20 | 5f 48 61 6e 64 6c 65 47 |l OSErr |_HandleG|
|000010a0| 65 74 4d 61 72 6b 65 72 | 73 28 41 70 70 6c 65 45 |etMarker|s(AppleE|
|000010b0| 76 65 6e 74 2a 20 65 76 | 65 6e 74 2c 20 41 70 70 |vent* ev|ent, App|
|000010c0| 6c 65 45 76 65 6e 74 2a | 20 72 65 70 6c 79 29 0d |leEvent*| reply).|
|000010d0| 7b 0d 09 4f 53 45 72 72 | 20 65 72 72 3b 0d 09 41 |{..OSErr| err;..A|
|000010e0| 45 44 65 73 63 20 72 65 | 74 75 72 6e 4d 61 72 6b |EDesc re|turnMark|
|000010f0| 65 72 4c 69 73 74 3b 0d | 09 6c 6f 6e 67 20 73 65 |erList;.|.long se|
|00001100| 6c 53 74 61 72 74 2c 20 | 73 65 6c 45 6e 64 3b 0d |lStart, |selEnd;.|
|00001110| 09 50 55 46 4d 61 72 6b | 65 72 20 6d 61 72 6b 65 |.PUFMark|er marke|
|00001120| 72 3b 0d 09 0d 09 65 72 | 72 20 3d 20 41 45 43 72 |r;....er|r = AECr|
|00001130| 65 61 74 65 4c 69 73 74 | 28 6e 69 6c 2c 20 30 2c |eateList|(nil, 0,|
|00001140| 20 66 61 6c 73 65 2c 20 | 26 72 65 74 75 72 6e 4d | false, |&returnM|
|00001150| 61 72 6b 65 72 4c 69 73 | 74 29 3b 0d 09 46 61 69 |arkerLis|t);..Fai|
|00001160| 6c 45 72 72 28 65 72 72 | 29 3b 0d 0d 09 74 72 79 |lErr(err|);...try|
|00001170| 20 7b 0d 09 09 73 68 6f | 72 74 20 69 3b 0d 09 09 | {...sho|rt i;...|
|00001180| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 74 72 75 65 |for (i =| 0; true|
|00001190| 3b 20 20 69 2b 2b 29 20 | 7b 0d 09 09 09 69 66 20 |; i++) |{....if |
|000011a0| 28 21 20 50 55 46 47 65 | 74 4e 74 68 4d 61 72 6b |(! PUFGe|tNthMark|
|000011b0| 65 72 28 69 2c 20 26 6d | 61 72 6b 65 72 29 29 0d |er(i, &m|arker)).|
|000011c0| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 50 75 |....brea|k;....Pu|
|000011d0| 73 68 4d 61 72 6b 65 72 | 28 26 6d 61 72 6b 65 72 |shMarker|(&marker|
|000011e0| 2c 20 26 72 65 74 75 72 | 6e 4d 61 72 6b 65 72 4c |, &retur|nMarkerL|
|000011f0| 69 73 74 29 3b 0d 09 09 | 7d 0d 09 09 65 72 72 20 |ist);...|}...err |
|00001200| 3d 20 41 45 50 75 74 50 | 61 72 61 6d 44 65 73 63 |= AEPutP|aramDesc|
|00001210| 28 72 65 70 6c 79 2c 20 | 6b 65 79 44 69 72 65 63 |(reply, |keyDirec|
|00001220| 74 4f 62 6a 65 63 74 2c | 20 26 72 65 74 75 72 6e |tObject,| &return|
|00001230| 4d 61 72 6b 65 72 4c 69 | 73 74 29 3b 0d 09 09 41 |MarkerLi|st);...A|
|00001240| 45 44 69 73 70 6f 73 65 | 44 65 73 63 28 26 72 65 |EDispose|Desc(&re|
|00001250| 74 75 72 6e 4d 61 72 6b | 65 72 4c 69 73 74 29 3b |turnMark|erList);|
|00001260| 0d 09 7d 20 63 61 74 63 | 68 20 7b 0d 09 09 41 45 |..} catc|h {...AE|
|00001270| 44 69 73 70 6f 73 65 44 | 65 73 63 28 26 72 65 74 |DisposeD|esc(&ret|
|00001280| 75 72 6e 4d 61 72 6b 65 | 72 4c 69 73 74 29 3b 0d |urnMarke|rList);.|
|00001290| 09 09 74 68 72 6f 77 28 | 74 68 65 45 78 63 65 70 |..throw(|theExcep|
|000012a0| 74 69 6f 6e 29 3b 0d 09 | 7d 0d 09 0d 09 72 65 74 |tion);..|}....ret|
|000012b0| 75 72 6e 20 65 72 72 3b | 0d 7d 0d 0d 73 74 61 74 |urn err;|.}..stat|
|000012c0| 69 63 20 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |ic pasca|l OSErr |
|000012d0| 5f 48 61 6e 64 6c 65 43 | 61 6c 6c 4d 65 6e 75 28 |_HandleC|allMenu(|
|000012e0| 41 70 70 6c 65 45 76 65 | 6e 74 2a 20 65 76 65 6e |AppleEve|nt* even|
|000012f0| 74 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 2a 20 72 |t, Apple|Event* r|
|00001300| 65 70 6c 79 29 0d 7b 0d | 09 4f 53 45 72 72 20 65 |eply).{.|.OSErr e|
|00001310| 72 72 3b 0d 09 41 45 44 | 65 73 63 20 74 65 78 74 |rr;..AED|esc text|
|00001320| 44 65 73 63 3b 0d 09 53 | 74 72 32 35 35 20 73 3b |Desc;..S|tr255 s;|
|00001330| 0d 0d 09 2f 2f 20 65 78 | 74 72 61 63 74 20 61 20 |...// ex|tract a |
|00001340| 73 74 72 69 6e 67 20 66 | 72 6f 6d 20 74 68 65 20 |string f|rom the |
|00001350| 65 76 65 6e 74 0d 09 65 | 72 72 20 3d 20 41 45 47 |event..e|rr = AEG|
|00001360| 65 74 4b 65 79 44 65 73 | 63 28 65 76 65 6e 74 2c |etKeyDes|c(event,|
|00001370| 20 6b 65 79 44 69 72 65 | 63 74 4f 62 6a 65 63 74 | keyDire|ctObject|
|00001380| 2c 20 74 79 70 65 43 68 | 61 72 2c 20 26 74 65 78 |, typeCh|ar, &tex|
|00001390| 74 44 65 73 63 29 3b 0d | 09 46 61 69 6c 45 72 72 |tDesc);.|.FailErr|
|000013a0| 28 65 72 72 29 3b 0d 09 | 46 61 69 6c 4e 69 6c 28 |(err);..|FailNil(|
|000013b0| 74 65 78 74 44 65 73 63 | 2e 64 61 74 61 48 61 6e |textDesc|.dataHan|
|000013c0| 64 6c 65 29 3b 0d 0d 09 | 73 5b 30 5d 20 3d 20 47 |dle);...|s[0] = G|
|000013d0| 65 74 48 61 6e 64 6c 65 | 53 69 7a 65 28 74 65 78 |etHandle|Size(tex|
|000013e0| 74 44 65 73 63 2e 64 61 | 74 61 48 61 6e 64 6c 65 |tDesc.da|taHandle|
|000013f0| 29 3b 0d 09 69 66 20 28 | 73 5b 30 5d 20 3e 20 32 |);..if (|s[0] > 2|
|00001400| 35 34 29 0d 09 09 73 5b | 30 5d 20 3d 20 32 35 34 |54)...s[|0] = 254|
|00001410| 3b 0d 09 42 6c 6f 63 6b | 4d 6f 76 65 28 2a 74 65 |;..Block|Move(*te|
|00001420| 78 74 44 65 73 63 2e 64 | 61 74 61 48 61 6e 64 6c |xtDesc.d|ataHandl|
|00001430| 65 2c 20 26 73 5b 31 5d | 2c 20 73 5b 30 5d 29 3b |e, &s[1]|, s[0]);|
|00001440| 0d 09 41 45 44 69 73 70 | 6f 73 65 44 65 73 63 28 |..AEDisp|oseDesc(|
|00001450| 26 74 65 78 74 44 65 73 | 63 29 3b 0d 0d 09 50 55 |&textDes|c);...PU|
|00001460| 46 43 61 6c 6c 4d 65 6e | 75 28 73 29 3b 0d 0d 09 |FCallMen|u(s);...|
|00001470| 72 65 74 75 72 6e 20 6e | 6f 45 72 72 3b 0d 7d 0d |return n|oErr;.}.|
|00001480| 0d 73 74 61 74 69 63 20 | 70 61 73 63 61 6c 20 4f |.static |pascal O|
|00001490| 53 45 72 72 20 5f 48 61 | 6e 64 6c 65 47 65 74 46 |SErr _Ha|ndleGetF|
|000014a0| 53 53 70 65 63 28 41 70 | 70 6c 65 45 76 65 6e 74 |SSpec(Ap|pleEvent|
|000014b0| 2a 20 65 76 65 6e 74 2c | 20 41 70 70 6c 65 45 76 |* event,| AppleEv|
|000014c0| 65 6e 74 2a 20 72 65 70 | 6c 79 29 0d 7b 0d 09 4f |ent* rep|ly).{..O|
|000014d0| 53 45 72 72 20 65 72 72 | 20 3d 20 6e 6f 45 72 72 |SErr err| = noErr|
|000014e0| 3b 0d 09 41 45 44 65 73 | 63 20 64 65 73 63 3b 0d |;..AEDes|c desc;.|
|000014f0| 09 46 53 53 70 65 63 20 | 73 70 65 63 3b 0d 0d 09 |.FSSpec |spec;...|
|00001500| 50 55 46 47 65 74 46 69 | 6c 65 53 70 65 63 28 26 |PUFGetFi|leSpec(&|
|00001510| 73 70 65 63 29 3b 0d 0d | 09 65 72 72 20 3d 20 41 |spec);..|.err = A|
|00001520| 45 43 72 65 61 74 65 44 | 65 73 63 28 74 79 70 65 |ECreateD|esc(type|
|00001530| 46 53 53 2c 20 28 50 74 | 72 29 20 26 73 70 65 63 |FSS, (Pt|r) &spec|
|00001540| 2c 20 73 69 7a 65 6f 66 | 28 46 53 53 70 65 63 29 |, sizeof|(FSSpec)|
|00001550| 2c 20 26 64 65 73 63 29 | 3b 0d 09 46 61 69 6c 45 |, &desc)|;..FailE|
|00001560| 72 72 28 65 72 72 29 3b | 0d 09 0d 09 65 72 72 20 |rr(err);|....err |
|00001570| 3d 20 41 45 50 75 74 50 | 61 72 61 6d 44 65 73 63 |= AEPutP|aramDesc|
|00001580| 28 72 65 70 6c 79 2c 20 | 6b 65 79 44 69 72 65 63 |(reply, |keyDirec|
|00001590| 74 4f 62 6a 65 63 74 2c | 20 26 64 65 73 63 29 3b |tObject,| &desc);|
|000015a0| 0d 09 41 45 44 69 73 70 | 6f 73 65 44 65 73 63 28 |..AEDisp|oseDesc(|
|000015b0| 26 64 65 73 63 29 3b 0d | 0d 09 72 65 74 75 72 6e |&desc);.|..return|
|000015c0| 20 65 72 72 3b 0d 7d 0d | 0d 73 74 61 74 69 63 20 | err;.}.|.static |
|000015d0| 70 61 73 63 61 6c 20 4f | 53 45 72 72 20 5f 48 61 |pascal O|SErr _Ha|
|000015e0| 6e 64 6c 65 50 61 73 74 | 65 54 65 78 74 28 41 70 |ndlePast|eText(Ap|
|000015f0| 70 6c 65 45 76 65 6e 74 | 2a 20 65 76 65 6e 74 2c |pleEvent|* event,|
|00001600| 20 41 70 70 6c 65 45 76 | 65 6e 74 2a 20 72 65 70 | AppleEv|ent* rep|
|00001610| 6c 79 29 0d 7b 0d 09 4f | 53 45 72 72 20 65 72 72 |ly).{..O|SErr err|
|00001620| 3b 0d 09 41 45 44 65 73 | 63 20 74 65 78 74 44 65 |;..AEDes|c textDe|
|00001630| 73 63 3b 0d 09 0d 09 2f | 2f 20 65 78 74 72 61 63 |sc;..../|/ extrac|
|00001640| 74 20 61 20 73 74 72 69 | 6e 67 20 66 72 6f 6d 20 |t a stri|ng from |
|00001650| 74 68 65 20 65 76 65 6e | 74 0d 09 65 72 72 20 3d |the even|t..err =|
|00001660| 20 41 45 47 65 74 4b 65 | 79 44 65 73 63 28 65 76 | AEGetKe|yDesc(ev|
|00001670| 65 6e 74 2c 20 6b 65 79 | 44 69 72 65 63 74 4f 62 |ent, key|DirectOb|
|00001680| 6a 65 63 74 2c 20 74 79 | 70 65 43 68 61 72 2c 20 |ject, ty|peChar, |
|00001690| 26 74 65 78 74 44 65 73 | 63 29 3b 0d 09 46 61 69 |&textDes|c);..Fai|
|000016a0| 6c 45 72 72 28 65 72 72 | 29 3b 0d 09 46 61 69 6c |lErr(err|);..Fail|
|000016b0| 4e 69 6c 28 74 65 78 74 | 44 65 73 63 2e 64 61 74 |Nil(text|Desc.dat|
|000016c0| 61 48 61 6e 64 6c 65 29 | 3b 0d 09 0d 09 74 72 79 |aHandle)|;....try|
|000016d0| 20 7b 0d 09 09 50 55 46 | 50 61 73 74 65 54 65 78 | {...PUF|PasteTex|
|000016e0| 74 28 74 65 78 74 44 65 | 73 63 2e 64 61 74 61 48 |t(textDe|sc.dataH|
|000016f0| 61 6e 64 6c 65 29 3b 0d | 09 09 41 45 44 69 73 70 |andle);.|..AEDisp|
|00001700| 6f 73 65 44 65 73 63 28 | 26 74 65 78 74 44 65 73 |oseDesc(|&textDes|
|00001710| 63 29 3b 0d 09 7d 20 63 | 61 74 63 68 20 7b 0d 09 |c);..} c|atch {..|
|00001720| 09 41 45 44 69 73 70 6f | 73 65 44 65 73 63 28 26 |.AEDispo|seDesc(&|
|00001730| 74 65 78 74 44 65 73 63 | 29 3b 0d 09 09 74 68 72 |textDesc|);...thr|
|00001740| 6f 77 28 74 68 65 45 78 | 63 65 70 74 69 6f 6e 29 |ow(theEx|ception)|
|00001750| 3b 0d 09 7d 0d 09 0d 09 | 72 65 74 75 72 6e 20 6e |;..}....|return n|
|00001760| 6f 45 72 72 3b 0d 7d 0d | 0d 73 74 61 74 69 63 20 |oErr;.}.|.static |
|00001770| 70 61 73 63 61 6c 20 4f | 53 45 72 72 20 5f 48 61 |pascal O|SErr _Ha|
|00001780| 6e 64 6c 65 4d 6f 76 65 | 57 69 6e 28 41 70 70 6c |ndleMove|Win(Appl|
|00001790| 65 45 76 65 6e 74 2a 20 | 65 76 65 6e 74 2c 20 41 |eEvent* |event, A|
|000017a0| 70 70 6c 65 45 76 65 6e | 74 2a 20 72 65 70 6c 79 |ppleEven|t* reply|
|000017b0| 29 0d 7b 0d 09 4f 53 45 | 72 72 20 65 72 72 3b 0d |).{..OSE|rr err;.|
|000017c0| 09 44 65 73 63 54 79 70 | 65 20 61 63 74 75 61 6c |.DescTyp|e actual|
|000017d0| 54 79 70 65 3b 0d 09 53 | 69 7a 65 20 61 63 74 75 |Type;..S|ize actu|
|000017e0| 61 6c 53 69 7a 65 3b 0d | 09 50 6f 69 6e 74 20 70 |alSize;.|.Point p|
|000017f0| 57 68 65 72 65 2c 20 70 | 53 69 7a 65 3b 0d 0d 09 |Where, p|Size;...|
|00001800| 65 72 72 20 3d 20 41 45 | 47 65 74 50 61 72 61 6d |err = AE|GetParam|
|00001810| 50 74 72 28 65 76 65 6e | 74 2c 20 27 77 68 72 65 |Ptr(even|t, 'whre|
|00001820| 27 2c 20 27 51 44 70 74 | 27 2c 20 26 61 63 74 75 |', 'QDpt|', &actu|
|00001830| 61 6c 54 79 70 65 2c 20 | 28 50 74 72 29 20 26 70 |alType, |(Ptr) &p|
|00001840| 57 68 65 72 65 2c 20 73 | 69 7a 65 6f 66 28 50 6f |Where, s|izeof(Po|
|00001850| 69 6e 74 29 2c 20 26 61 | 63 74 75 61 6c 53 69 7a |int), &a|ctualSiz|
|00001860| 65 29 3b 0d 09 46 61 69 | 6c 45 72 72 28 65 72 72 |e);..Fai|lErr(err|
|00001870| 29 3b 0d 09 0d 09 65 72 | 72 20 3d 20 41 45 47 65 |);....er|r = AEGe|
|00001880| 74 50 61 72 61 6d 50 74 | 72 28 65 76 65 6e 74 2c |tParamPt|r(event,|
|00001890| 20 27 73 69 7a 65 27 2c | 20 27 51 44 70 74 27 2c | 'size',| 'QDpt',|
|000018a0| 20 26 61 63 74 75 61 6c | 54 79 70 65 2c 20 28 50 | &actual|Type, (P|
|000018b0| 74 72 29 20 26 70 53 69 | 7a 65 2c 20 73 69 7a 65 |tr) &pSi|ze, size|
|000018c0| 6f 66 28 50 6f 69 6e 74 | 29 2c 20 26 61 63 74 75 |of(Point|), &actu|
|000018d0| 61 6c 53 69 7a 65 29 3b | 0d 09 46 61 69 6c 45 72 |alSize);|..FailEr|
|000018e0| 72 28 65 72 72 29 3b 0d | 09 0d 09 50 55 46 5a 6f |r(err);.|...PUFZo|
|000018f0| 6f 6d 57 69 6e 64 6f 77 | 28 70 57 68 65 72 65 2c |omWindow|(pWhere,|
|00001900| 20 70 53 69 7a 65 29 3b | 0d 0d 09 72 65 74 75 72 | pSize);|...retur|
|00001910| 6e 20 65 72 72 3b 0d 7d | 0d 09 0d 73 74 61 74 69 |n err;.}|...stati|
|00001920| 63 20 70 61 73 63 61 6c | 20 4f 53 45 72 72 20 5f |c pascal| OSErr _|
|00001930| 48 61 6e 64 6c 65 47 65 | 74 57 69 6e 50 6f 73 28 |HandleGe|tWinPos(|
|00001940| 41 70 70 6c 65 45 76 65 | 6e 74 2a 20 65 76 65 6e |AppleEve|nt* even|
|00001950| 74 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 2a 20 72 |t, Apple|Event* r|
|00001960| 65 70 6c 79 29 0d 7b 0d | 09 4f 53 45 72 72 20 65 |eply).{.|.OSErr e|
|00001970| 72 72 3b 0d 09 57 69 6e | 64 6f 77 50 74 72 20 77 |rr;..Win|dowPtr w|
|00001980| 3b 0d 09 52 65 63 74 20 | 72 3b 0d 09 0d 09 77 20 |;..Rect |r;....w |
|00001990| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 28 29 3b |= FrontW|indow();|
|000019a0| 0d 09 69 66 20 28 77 20 | 3d 3d 20 6e 69 6c 29 0d |..if (w |== nil).|
|000019b0| 09 09 74 68 72 6f 77 28 | 63 6f 72 45 72 72 29 3b |..throw(|corErr);|
|000019c0| 0d 09 0d 2f 2f 09 72 20 | 3d 20 77 2d 3e 70 6f 72 |...//.r |= w->por|
|000019d0| 74 42 69 74 73 2e 62 6f | 75 6e 64 73 3b 0d 09 72 |tBits.bo|unds;..r|
|000019e0| 20 3d 20 28 2a 2a 28 28 | 57 69 6e 64 6f 77 50 65 | = (**((|WindowPe|
|000019f0| 65 6b 29 20 77 29 2d 3e | 73 74 72 75 63 52 67 6e |ek) w)->|strucRgn|
|00001a00| 29 2e 72 67 6e 42 42 6f | 78 3b 0d 09 65 72 72 20 |).rgnBBo|x;..err |
|00001a10| 3d 20 41 45 50 75 74 50 | 61 72 61 6d 50 74 72 28 |= AEPutP|aramPtr(|
|00001a20| 72 65 70 6c 79 2c 20 6b | 65 79 44 69 72 65 63 74 |reply, k|eyDirect|
|00001a30| 4f 62 6a 65 63 74 2c 20 | 27 71 64 72 74 27 2c 20 |Object, |'qdrt', |
|00001a40| 28 50 74 72 29 20 26 72 | 2c 20 73 69 7a 65 6f 66 |(Ptr) &r|, sizeof|
|00001a50| 28 52 65 63 74 29 29 3b | 0d 09 46 61 69 6c 45 72 |(Rect));|..FailEr|
|00001a60| 72 28 65 72 72 29 3b 0d | 0d 09 72 65 74 75 72 6e |r(err);.|..return|
|00001a70| 20 65 72 72 3b 0d 7d 0d | 09 0d 73 74 61 74 69 63 | err;.}.|..static|
|00001a80| 20 76 6f 69 64 20 49 6e | 73 74 61 6c 6c 48 61 6e | void In|stallHan|
|00001a90| 64 6c 65 72 28 4f 53 54 | 79 70 65 20 6d 73 67 2c |dler(OST|ype msg,|
|00001aa0| 20 41 45 48 61 6e 64 6c | 65 72 50 72 6f 63 20 70 | AEHandl|erProc p|
|00001ab0| 72 6f 63 29 0d 7b 0d 09 | 41 45 49 6e 73 74 61 6c |roc).{..|AEInstal|
|00001ac0| 6c 45 76 65 6e 74 48 61 | 6e 64 6c 65 72 28 63 45 |lEventHa|ndler(cE|
|00001ad0| 76 65 6e 74 43 6c 61 73 | 73 2c 20 6d 73 67 2c 20 |ventClas|s, msg, |
|00001ae0| 5f 41 45 48 61 6e 64 6c | 65 72 50 72 6f 63 2c 20 |_AEHandl|erProc, |
|00001af0| 28 6c 6f 6e 67 29 20 70 | 72 6f 63 2c 20 66 61 6c |(long) p|roc, fal|
|00001b00| 73 65 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 6d 61 69 |se);.}..|void mai|
|00001b10| 6e 28 29 0d 7b 0d 09 6c | 6f 6e 67 20 72 65 73 75 |n().{..l|ong resu|
|00001b20| 6c 74 3b 0d 09 0d 09 52 | 65 6d 65 6d 62 65 72 41 |lt;....R|ememberA|
|00001b30| 30 28 29 3b 0d 09 53 65 | 74 55 70 41 34 28 29 3b |0();..Se|tUpA4();|
|00001b40| 0d 0d 09 69 66 20 28 47 | 65 73 74 61 6c 74 28 67 |...if (G|estalt(g|
|00001b50| 65 73 74 61 6c 74 53 79 | 73 74 65 6d 56 65 72 73 |estaltSy|stemVers|
|00001b60| 69 6f 6e 2c 20 26 72 65 | 73 75 6c 74 29 20 3d 3d |ion, &re|sult) ==|
|00001b70| 20 6e 6f 45 72 72 20 26 | 26 20 72 65 73 75 6c 74 | noErr &|& result|
|00001b80| 20 3e 3d 20 30 78 30 37 | 30 30 29 20 7b 0d 09 09 | >= 0x07|00) {...|
|00001b90| 49 6e 73 74 61 6c 6c 48 | 61 6e 64 6c 65 72 28 63 |InstallH|andler(c|
|00001ba0| 47 65 74 53 65 6c 65 63 | 74 69 6f 6e 2c 20 5f 48 |GetSelec|tion, _H|
|00001bb0| 61 6e 64 6c 65 47 65 74 | 53 65 6c 65 63 74 69 6f |andleGet|Selectio|
|00001bc0| 6e 29 3b 0d 09 09 49 6e | 73 74 61 6c 6c 48 61 6e |n);...In|stallHan|
|00001bd0| 64 6c 65 72 28 63 53 65 | 74 53 65 6c 65 63 74 69 |dler(cSe|tSelecti|
|00001be0| 6f 6e 2c 20 5f 48 61 6e | 64 6c 65 53 65 74 53 65 |on, _Han|dleSetSe|
|00001bf0| 6c 65 63 74 69 6f 6e 29 | 3b 0d 09 09 49 6e 73 74 |lection)|;...Inst|
|00001c00| 61 6c 6c 48 61 6e 64 6c | 65 72 28 63 47 65 74 54 |allHandl|er(cGetT|
|00001c10| 65 78 74 2c 20 5f 48 61 | 6e 64 6c 65 47 65 74 46 |ext, _Ha|ndleGetF|
|00001c20| 69 6c 65 54 65 78 74 29 | 3b 0d 09 09 49 6e 73 74 |ileText)|;...Inst|
|00001c30| 61 6c 6c 48 61 6e 64 6c | 65 72 28 63 43 6f 70 79 |allHandl|er(cCopy|
|00001c40| 53 65 6c 65 63 74 69 6f | 6e 2c 20 5f 48 61 6e 64 |Selectio|n, _Hand|
|00001c50| 6c 65 43 6f 70 79 53 65 | 6c 65 63 74 69 6f 6e 29 |leCopySe|lection)|
|00001c60| 3b 0d 09 09 49 6e 73 74 | 61 6c 6c 48 61 6e 64 6c |;...Inst|allHandl|
|00001c70| 65 72 28 63 43 61 6c 6c | 4d 65 6e 75 2c 20 5f 48 |er(cCall|Menu, _H|
|00001c80| 61 6e 64 6c 65 43 61 6c | 6c 4d 65 6e 75 29 3b 0d |andleCal|lMenu);.|
|00001c90| 09 09 49 6e 73 74 61 6c | 6c 48 61 6e 64 6c 65 72 |..Instal|lHandler|
|00001ca0| 28 63 47 65 74 57 69 6e | 64 6f 77 53 70 65 63 2c |(cGetWin|dowSpec,|
|00001cb0| 20 5f 48 61 6e 64 6c 65 | 47 65 74 46 53 53 70 65 | _Handle|GetFSSpe|
|00001cc0| 63 29 3b 0d 09 09 49 6e | 73 74 61 6c 6c 48 61 6e |c);...In|stallHan|
|00001cd0| 64 6c 65 72 28 63 4d 6f | 76 65 57 69 6e 64 6f 77 |dler(cMo|veWindow|
|00001ce0| 2c 20 5f 48 61 6e 64 6c | 65 4d 6f 76 65 57 69 6e |, _Handl|eMoveWin|
|00001cf0| 29 3b 0d 09 09 49 6e 73 | 74 61 6c 6c 48 61 6e 64 |);...Ins|tallHand|
|00001d00| 6c 65 72 28 63 47 65 74 | 57 69 6e 50 6f 73 2c 20 |ler(cGet|WinPos, |
|00001d10| 5f 48 61 6e 64 6c 65 47 | 65 74 57 69 6e 50 6f 73 |_HandleG|etWinPos|
|00001d20| 29 3b 0d 09 09 0d 09 09 | 49 6e 73 74 61 6c 6c 48 |);......|InstallH|
|00001d30| 61 6e 64 6c 65 72 28 63 | 47 65 74 4d 61 72 6b 65 |andler(c|GetMarke|
|00001d40| 72 2c 20 5f 48 61 6e 64 | 6c 65 47 65 74 4d 61 72 |r, _Hand|leGetMar|
|00001d50| 6b 65 72 29 3b 0d 09 09 | 49 6e 73 74 61 6c 6c 48 |ker);...|InstallH|
|00001d60| 61 6e 64 6c 65 72 28 63 | 47 65 74 41 6c 6c 4d 61 |andler(c|GetAllMa|
|00001d70| 72 6b 65 72 73 2c 20 5f | 48 61 6e 64 6c 65 47 65 |rkers, _|HandleGe|
|00001d80| 74 4d 61 72 6b 65 72 73 | 29 3b 0d 09 09 49 6e 73 |tMarkers|);...Ins|
|00001d90| 74 61 6c 6c 48 61 6e 64 | 6c 65 72 28 63 44 65 6c |tallHand|ler(cDel|
|00001da0| 65 74 65 4d 61 72 6b 65 | 72 2c 20 5f 48 61 6e 64 |eteMarke|r, _Hand|
|00001db0| 6c 65 44 65 6c 65 74 65 | 4d 61 72 6b 65 72 29 3b |leDelete|Marker);|
|00001dc0| 0d 09 09 49 6e 73 74 61 | 6c 6c 48 61 6e 64 6c 65 |...Insta|llHandle|
|00001dd0| 72 28 63 50 61 73 74 65 | 54 65 78 74 2c 20 5f 48 |r(cPaste|Text, _H|
|00001de0| 61 6e 64 6c 65 50 61 73 | 74 65 54 65 78 74 29 3b |andlePas|teText);|
|00001df0| 0d 09 09 49 6e 73 74 61 | 6c 6c 48 61 6e 64 6c 65 |...Insta|llHandle|
|00001e00| 72 28 63 4d 61 72 6b 53 | 65 6c 65 63 74 69 6f 6e |r(cMarkS|election|
|00001e10| 2c 20 5f 48 61 6e 64 6c | 65 4d 61 72 6b 29 3b 0d |, _Handl|eMark);.|
|00001e20| 0d 09 09 49 6e 73 74 61 | 6c 6c 50 55 46 50 61 74 |...Insta|llPUFPat|
|00001e30| 63 68 65 73 28 29 3b 0d | 09 7d 0d 09 0d 09 52 65 |ches();.|.}....Re|
|00001e40| 73 74 6f 72 65 41 34 28 | 29 3b 0d 7d 0d 00 00 00 |storeA4(|);.}....|
|00001e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e80| 00 00 01 00 00 00 01 92 | 00 00 00 92 00 00 00 52 |........|.......R|
|00001e90| 00 00 07 ff 00 54 05 54 | 6f 6f 6c 73 61 72 69 2e |.....T.T|oolsari.|
|00001ea0| 65 73 73 00 ff ff ff ff | ff ff ff ff 00 00 00 01 |ess.....|........|
|00001eb0| 12 54 68 69 6e 6b 48 65 | 6c 70 65 72 50 61 74 63 |.ThinkHe|lperPatc|
|00001ec0| 68 2e 63 6b 02 00 00 f8 | 54 45 58 54 4b 41 48 4c |h.ck....|TEXTKAHL|
|00001ed0| 00 f8 54 45 58 54 4b 41 | 48 4c 01 00 00 3c 00 00 |..TEXTKA|HL...<..|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 41 52 a8 1b 24 7b 00 00 | 1d cd 00 00 01 e4 ff ff |AR..${..|........|
|00001f00| 00 00 00 01 00 03 07 07 | 00 00 00 05 06 00 00 00 |........|........|
|00001f10| 08 37 00 53 0c 21 77 68 | 61 74 69 73 74 2e 68 69 |.7.S.!wh|atist.hi|
|00001f20| 73 00 ff ff ff ff ff ff | ff ff 00 00 00 01 00 03 |s.......|........|
|00001f30| 07 07 00 00 00 05 06 00 | 00 00 08 3b 00 21 0c 21 |........|...;.!.!|
|00001f40| 46 72 6f 6e 74 69 65 2e | 31 61 34 00 ff ff ff ff |Frontie.|1a4.....|
|00001f50| ff ff ff ff 00 00 00 01 | 00 03 07 07 00 00 00 05 |........|........|
|00001f60| 06 00 00 00 08 3b 00 21 | 0c 21 46 72 6f 6e 74 69 |.....;.!|.!Fronti|
|00001f70| 65 2e 31 61 32 73 ff ff | ff ff ff ff ff ff 00 00 |e.1a2s..|........|
|00001f80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fa0| 00 00 00 00 00 00 00 06 | 00 04 00 29 00 03 01 dd |........|...)....|
|00001fb0| 02 7d 00 be 00 96 03 17 | 02 d0 a8 97 f2 2c 00 00 |.}......|.....,..|
|00001fc0| 1b 7e 00 00 1b 7e 00 00 | 19 c1 01 00 00 00 00 42 |.~...~..|.......B|
|00001fd0| 00 03 00 00 1b 0f 00 00 | 1b 0f 15 41 45 49 6e 73 |........|...AEIns|
|00001fe0| 74 61 6c 6c 45 76 65 6e | 74 48 61 6e 64 6c 65 72 |tallEven|tHandler|
|00001ff0| 00 00 08 8b 00 00 08 aa | 05 66 72 65 64 00 00 00 |........|.fred...|
|00002000| 07 be 00 00 08 4e 0b 74 | 65 73 74 6d 61 72 6b 65 |.....N.t|estmarke|
|00002010| 72 00 00 00 01 00 00 00 | 01 92 00 00 00 92 00 00 |r.......|........|
|00002020| 00 52 00 96 4a 8c 10 e6 | 00 00 00 1c 00 3e 00 00 |.R..J...|.....>..|
|00002030| 4d 50 53 52 00 01 00 0a | 03 ed 00 00 00 00 00 00 |MPSR....|........|
|00002040| 00 00 00 00 03 ef ff ff | 00 00 00 4c 00 00 00 00 |........|...L....|
|00002050| 13 43 72 65 61 74 65 64 | 20 62 79 20 43 4d 61 73 |.Created| by CMas|
|00002060| 74 65 72 aa 00 00 00 00 | 00 00 00 00 00 00 00 00 |ter.....|........|
|00002070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+