home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / B-C / Control Panel 0.9.5.sit / Control Panel Project 0.9.5 / ShowIconFamily.c < prev   
MacBinary  |  1994-10-06  |  10.5 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: ShowIconFamily.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, Thu Oct 6 01:38:19 1994, modified Thu Oct 6 01:38:19 1994, creator Think C, type ASCII, 10145 bytes "ShowIconFamily.c" , at 0x2821 382 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 10 53 68 6f 77 49 63 | 6f 6e 46 61 6d 69 6c 79 |..ShowIc|onFamily|
|00000010| 2e 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.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 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 27 a1 00 | 00 01 7e aa b9 3d cb aa |.....'..|..~..=..|
|00000060| b9 3d cb 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 32 cf 00 00 |........|....2...|
|00000080| 2f 2a 0d 09 53 68 6f 77 | 49 63 6f 6e 46 61 6d 69 |/*..Show|IconFami|
|00000090| 6c 79 2e 63 0d 09 0d 09 | 53 68 6f 77 49 4e 49 54 |ly.c....|ShowINIT|
|000000a0| 20 63 6f 6d 70 61 74 69 | 62 6c 65 20 72 6f 75 74 | compati|ble rout|
|000000b0| 69 6e 65 20 74 68 61 74 | 20 73 68 6f 77 73 20 27 |ine that| shows '|
|000000c0| 49 43 4e 23 27 20 61 6e | 64 20 27 69 63 6c 78 27 |ICN#' an|d 'iclx'|
|000000d0| 20 66 6c 61 76 6f 72 20 | 69 63 6f 6e 73 2e 0d 09 | flavor |icons...|
|000000e0| 46 6f 72 20 75 73 65 20 | 62 79 20 61 6c 6c 20 49 |For use |by all I|
|000000f0| 4e 49 54 73 20 69 6e 20 | 53 79 73 74 65 6d 20 37 |NITs in |System 7|
|00000100| 20 61 6e 64 20 62 65 79 | 6f 6e 64 2e 0d 09 0d 09 | and bey|ond.....|
|00000110| 62 79 20 50 61 74 72 69 | 63 6b 20 43 2e 20 42 65 |by Patri|ck C. Be|
|00000120| 61 72 64 2e 0d 09 6d 6f | 64 69 66 69 65 64 20 62 |ard...mo|dified b|
|00000130| 79 20 4a 61 6d 65 73 20 | 57 2e 20 57 61 6c 6b 65 |y James |W. Walke|
|00000140| 72 20 66 6f 72 20 63 6f | 6d 70 61 74 69 62 69 6c |r for co|mpatibil|
|00000150| 69 74 79 20 77 69 74 68 | 20 49 63 6f 6e 57 72 61 |ity with| IconWra|
|00000160| 70 20 31 2e 32 2c 0d 09 | 61 6e 64 20 66 6f 72 20 |p 1.2,..|and for |
|00000170| 75 73 65 20 61 73 20 61 | 20 73 65 70 61 72 61 74 |use as a| separat|
|00000180| 65 20 63 6f 64 65 20 72 | 65 73 6f 75 72 63 65 2e |e code r|esource.|
|00000190| 0d 09 0d 09 4d 6f 64 69 | 66 69 65 64 20 31 31 2f |....Modi|fied 11/|
|000001a0| 31 39 2f 39 33 20 62 79 | 20 4b 65 6e 20 57 6f 72 |19/93 by| Ken Wor|
|000001b0| 6c 65 79 20 74 6f 20 72 | 65 6d 6f 76 65 20 61 6e |ley to r|emove an|
|000001c0| 79 20 6e 65 63 65 73 73 | 69 74 79 20 66 6f 72 20 |y necess|ity for |
|000001d0| 73 74 61 74 69 63 73 20 | 61 6e 64 0d 09 67 6c 6f |statics |and..glo|
|000001e0| 62 61 6c 73 2e 20 20 4e | 6f 20 6c 6f 6e 67 65 72 |bals. N|o longer|
|000001f0| 20 72 65 71 75 69 72 65 | 73 20 41 34 20 72 65 67 | require|s A4 reg|
|00000200| 69 73 74 65 72 20 74 6f | 20 62 65 20 73 65 74 20 |ister to| be set |
|00000210| 75 70 2e 0d 09 0d 09 49 | 6e 73 74 72 75 63 74 69 |up.....I|nstructi|
|00000220| 6f 6e 73 20 66 6f 72 20 | 75 73 65 3a 0d 09 0d 09 |ons for |use:....|
|00000230| 09 a5 20 43 72 65 61 74 | 65 20 61 20 66 61 6d 69 |.. Creat|e a fami|
|00000240| 6c 79 20 6f 66 20 69 63 | 6f 6e 73 20 77 69 74 68 |ly of ic|ons with|
|00000250| 20 52 65 73 45 64 69 74 | 20 32 2e 31 20 6f 72 20 | ResEdit| 2.1 or |
|00000260| 6c 61 74 65 72 2e 20 20 | 54 68 69 73 20 77 69 6c |later. |This wil|
|00000270| 6c 0d 09 09 09 69 6e 63 | 6c 75 64 65 20 27 49 43 |l....inc|lude 'IC|
|00000280| 4e 23 27 2c 20 27 69 63 | 6c 34 27 2c 20 26 20 27 |N#', 'ic|l4', & '|
|00000290| 69 63 6c 38 27 20 69 63 | 6f 6e 73 2e 0d 09 09 0d |icl8' ic|ons.....|
|000002a0| 09 09 54 6f 20 75 73 65 | 20 77 69 74 68 69 6e 20 |..To use| within |
|000002b0| 61 20 6c 61 72 67 65 72 | 20 49 4e 49 54 20 70 72 |a larger| INIT pr|
|000002c0| 6f 6a 65 63 74 3a 0d 09 | 09 09 a5 20 23 64 65 66 |oject:..|... #def|
|000002d0| 69 6e 65 20 53 45 50 41 | 52 41 54 45 5f 43 4f 44 |ine SEPA|RATE_COD|
|000002e0| 45 20 30 20 20 62 65 6c | 6f 77 2e 0d 09 09 09 a5 |E 0 bel|ow......|
|000002f0| 20 55 73 65 20 53 65 74 | 55 70 41 34 20 74 6f 20 | Use Set|UpA4 to |
|00000300| 73 65 74 20 75 70 20 54 | 68 69 6e 6b 20 43 20 67 |set up T|hink C g|
|00000310| 6c 6f 62 61 6c 73 2e 09 | 2a 2a 20 6e 6f 74 20 72 |lobals..|** not r|
|00000320| 65 71 75 69 72 65 64 20 | 2d 20 6b 77 20 2a 2a 0d |equired |- kw **.|
|00000330| 09 09 09 a5 20 43 61 6c | 6c 20 53 68 6f 77 49 63 |.... Cal|l ShowIc|
|00000340| 6f 6e 46 61 6d 69 6c 79 | 28 29 20 77 69 74 68 20 |onFamily|() with |
|00000350| 74 68 65 20 72 65 73 6f | 75 72 63 65 20 69 64 20 |the reso|urce id |
|00000360| 6f 66 20 74 68 65 20 66 | 61 6d 69 6c 79 0d 09 09 |of the f|amily...|
|00000370| 09 09 74 68 61 74 20 79 | 6f 75 20 75 73 65 64 2e |..that y|ou used.|
|00000380| 0d 09 09 0d 09 09 54 6f | 20 75 73 65 20 61 73 20 |......To| use as |
|00000390| 61 20 73 65 70 61 72 61 | 74 65 20 63 6f 64 65 20 |a separa|te code |
|000003a0| 72 65 73 6f 75 72 63 65 | 3a 0d 09 09 09 a5 20 23 |resource|:..... #|
|000003b0| 64 65 66 69 6e 65 20 53 | 45 50 41 52 41 54 45 5f |define S|EPARATE_|
|000003c0| 43 4f 44 45 20 31 20 20 | 62 65 6c 6f 77 2e 0d 09 |CODE 1 |below...|
|000003d0| 09 09 a5 20 53 65 74 20 | 74 68 65 20 70 72 6f 6a |... Set |the proj|
|000003e0| 65 63 74 20 74 79 70 65 | 20 74 6f 20 63 6f 64 65 |ect type| to code|
|000003f0| 20 72 65 73 6f 75 72 63 | 65 2c 20 73 65 74 20 74 | resourc|e, set t|
|00000400| 68 65 20 63 6f 64 65 20 | 74 79 70 65 0d 09 09 09 |he code |type....|
|00000410| 09 61 6e 64 20 72 65 73 | 6f 75 72 63 65 20 49 44 |.and res|ource ID|
|00000420| 20 28 49 20 75 73 65 20 | 74 79 70 65 20 27 43 6f | (I use |type 'Co|
|00000430| 64 65 27 2c 20 49 44 20 | 2d 34 30 34 38 20 66 6f |de', ID |-4048 fo|
|00000440| 72 20 63 64 65 76 73 29 | 2c 0d 09 09 09 09 63 6f |r cdevs)|,.....co|
|00000450| 6d 70 69 6c 65 20 61 6e | 64 20 6d 65 72 67 65 20 |mpile an|d merge |
|00000460| 69 6e 74 6f 20 79 6f 75 | 72 20 49 4e 49 54 20 6f |into you|r INIT o|
|00000470| 72 20 63 64 65 76 20 66 | 69 6c 65 2e 0d 09 09 09 |r cdev f|ile.....|
|00000480| a5 20 49 6e 20 79 6f 75 | 72 20 6d 61 69 6e 20 49 |. In you|r main I|
|00000490| 4e 49 54 20 63 6f 64 65 | 2c 20 63 61 6c 6c 20 53 |NIT code|, call S|
|000004a0| 68 6f 77 49 63 6f 6e 46 | 61 6d 69 6c 79 20 6c 69 |howIconF|amily li|
|000004b0| 6b 65 20 73 6f 3a 0d 09 | 09 09 09 73 68 6f 77 5f |ke so:..|...show_|
|000004c0| 69 6e 69 74 20 3d 20 47 | 65 74 52 65 73 6f 75 72 |init = G|etResour|
|000004d0| 63 65 28 20 27 43 6f 64 | 65 27 2c 20 2d 34 30 34 |ce( 'Cod|e', -404|
|000004e0| 38 20 29 3b 0d 09 09 09 | 09 48 4c 6f 63 6b 28 20 |8 );....|.HLock( |
|000004f0| 73 68 6f 77 5f 69 6e 69 | 74 20 29 3b 0d 09 09 09 |show_ini|t );....|
|00000500| 09 43 61 6c 6c 50 61 73 | 63 61 6c 28 20 69 63 6f |.CallPas|cal( ico|
|00000510| 6e 5f 66 61 6d 69 6c 79 | 5f 49 44 2c 20 2a 73 68 |n_family|_ID, *sh|
|00000520| 6f 77 5f 69 6e 69 74 20 | 29 3b 0d 09 09 09 09 48 |ow_init |);.....H|
|00000530| 55 6e 6c 6f 63 6b 28 20 | 73 68 6f 77 5f 69 6e 69 |Unlock( |show_ini|
|00000540| 74 20 29 3b 0d 0d 09 45 | 6e 68 61 6e 63 65 6d 65 |t );...E|nhanceme|
|00000550| 6e 74 73 3a 0d 09 09 0d | 09 09 a5 20 55 73 65 73 |nts:....|... Uses|
|00000560| 20 27 69 63 6c 78 27 20 | 26 20 27 49 43 4e 23 27 | 'iclx' |& 'ICN#'|
|00000570| 20 69 63 6f 6e 73 20 66 | 72 6f 6d 20 74 68 65 20 | icons f|rom the |
|00000580| 46 69 6e 64 65 72 27 73 | 20 22 69 63 6f 6e 20 66 |Finder's| "icon f|
|00000590| 61 6d 69 6c 79 22 20 69 | 6e 20 53 79 73 74 65 6d |amily" i|n System|
|000005a0| 20 37 2e 0d 09 09 a5 20 | 47 65 6e 65 72 61 74 65 | 7..... |Generate|
|000005b0| 73 20 61 20 70 6f 73 69 | 74 69 6f 6e 20 66 6f 72 |s a posi|tion for|
|000005c0| 20 69 63 6f 6e 73 20 74 | 68 61 74 20 69 73 20 67 | icons t|hat is g|
|000005d0| 75 61 72 61 6e 74 65 65 | 64 20 74 6f 20 62 65 20 |uarantee|d to be |
|000005e0| 6f 6e 20 73 63 72 65 65 | 6e 2c 20 77 68 69 6c 65 |on scree|n, while|
|000005f0| 0d 09 09 20 20 72 65 6d | 61 69 6e 69 6e 67 20 63 |... rem|aining c|
|00000600| 6f 6d 70 61 74 69 62 6c | 65 20 77 69 74 68 20 70 |ompatibl|e with p|
|00000610| 72 65 76 69 6f 75 73 20 | 72 65 6c 65 61 73 65 73 |revious |releases|
|00000620| 20 6f 66 20 53 68 6f 77 | 49 6e 69 74 2e 0d 09 0d | of Show|Init....|
|00000630| 09 54 68 69 73 20 63 6f | 64 65 20 69 73 20 63 6f |.This co|de is co|
|00000640| 6d 70 6c 65 74 65 6c 79 | 20 70 75 62 6c 69 63 20 |mpletely| public |
|00000650| 64 6f 6d 61 69 6e 2e 20 | 20 4c 65 74 27 73 20 68 |domain. | Let's h|
|00000660| 6f 70 65 20 74 68 69 73 | 20 62 65 63 6f 6d 65 73 |ope this| becomes|
|00000670| 20 61 20 6e 65 77 20 73 | 74 61 6e 64 61 72 64 2e | a new s|tandard.|
|00000680| 0d 09 0d 09 54 68 69 73 | 20 63 6f 64 65 20 69 73 |....This| code is|
|00000690| 20 64 65 72 69 76 65 64 | 20 66 72 6f 6d 20 74 68 | derived| from th|
|000006a0| 65 20 6f 72 69 67 69 6e | 61 6c 20 53 68 6f 77 49 |e origin|al ShowI|
|000006b0| 6e 69 74 20 62 79 20 50 | 61 75 6c 20 4d 65 72 63 |nit by P|aul Merc|
|000006c0| 65 72 2c 20 44 61 72 69 | 6e 20 41 64 6c 65 72 2c |er, Dari|n Adler,|
|000006d0| 0d 09 50 61 75 6c 20 53 | 6e 69 76 65 6c 79 2c 20 |..Paul S|nively, |
|000006e0| 61 6e 64 20 53 74 65 76 | 65 20 43 61 70 70 73 2e |and Stev|e Capps.|
|000006f0| 0d 09 0d 09 53 70 65 63 | 69 61 6c 20 74 68 61 6e |....Spec|ial than|
|00000700| 6b 73 20 74 6f 20 42 65 | 6e 20 48 61 6c 6c 65 72 |ks to Be|n Haller|
|00000710| 20 26 20 52 6f 62 20 56 | 61 74 65 72 6c 61 75 73 | & Rob V|aterlaus|
|00000720| 20 66 6f 72 20 76 61 6c | 75 61 62 6c 65 20 73 75 | for val|uable su|
|00000730| 67 67 65 73 74 69 6f 6e | 73 20 61 6e 64 20 68 65 |ggestion|s and he|
|00000740| 6c 70 2e 0d 20 2a 2f 0d | 0d 23 64 65 66 69 6e 65 |lp.. */.|.#define|
|00000750| 20 53 45 50 41 52 41 54 | 45 5f 43 4f 44 45 09 30 | SEPARAT|E_CODE.0|
|00000760| 0d 0d 23 69 66 20 53 45 | 50 41 52 41 54 45 5f 43 |..#if SE|PARATE_C|
|00000770| 4f 44 45 0d 23 69 6e 63 | 6c 75 64 65 20 3c 53 65 |ODE.#inc|lude <Se|
|00000780| 74 55 70 41 34 2e 68 3e | 09 2f 2a 20 4a 57 57 20 |tUpA4.h>|./* JWW |
|00000790| 2a 2f 0d 23 65 6e 64 69 | 66 0d 0d 23 69 66 6e 64 |*/.#endi|f..#ifnd|
|000007a0| 65 66 20 6e 69 6c 0d 23 | 64 65 66 69 6e 65 20 6e |ef nil.#|define n|
|000007b0| 69 6c 20 28 28 76 6f 69 | 64 2a 29 30 4c 29 0d 23 |il ((voi|d*)0L).#|
|000007c0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 74 6f |endif.#i|fndef to|
|000007d0| 70 4c 65 66 74 0d 23 64 | 65 66 69 6e 65 20 74 6f |pLeft.#d|efine to|
|000007e0| 70 4c 65 66 74 28 72 29 | 20 28 28 50 6f 69 6e 74 |pLeft(r)| ((Point|
|000007f0| 2a 29 26 72 29 5b 30 5d | 29 0d 23 65 6e 64 69 66 |*)&r)[0]|).#endif|
|00000800| 0d 23 69 66 6e 64 65 66 | 20 62 6f 74 52 69 67 68 |.#ifndef| botRigh|
|00000810| 74 0d 23 64 65 66 69 6e | 65 20 62 6f 74 52 69 67 |t.#defin|e botRig|
|00000820| 68 74 28 72 29 20 28 28 | 50 6f 69 6e 74 2a 29 26 |ht(r) ((|Point*)&|
|00000830| 72 29 5b 31 5d 29 0d 23 | 65 6e 64 69 66 0d 0d 74 |r)[1]).#|endif..t|
|00000840| 79 70 65 64 65 66 20 73 | 74 72 75 63 74 20 71 64 |ypedef s|truct qd|
|00000850| 47 6c 6f 62 61 6c 73 20 | 7b 0d 09 63 68 61 72 20 |Globals |{..char |
|00000860| 70 72 69 76 61 74 65 73 | 5b 37 36 5d 3b 0d 09 6c |privates|[76];..l|
|00000870| 6f 6e 67 20 72 61 6e 64 | 53 65 65 64 3b 0d 09 42 |ong rand|Seed;..B|
|00000880| 69 74 4d 61 70 20 73 63 | 72 65 65 6e 42 69 74 73 |itMap sc|reenBits|
|00000890| 3b 0d 09 43 75 72 73 6f | 72 20 61 72 72 6f 77 3b |;..Curso|r arrow;|
|000008a0| 0d 09 50 61 74 74 65 72 | 6e 20 64 6b 47 72 61 79 |..Patter|n dkGray|
|000008b0| 3b 0d 09 50 61 74 74 65 | 72 6e 20 6c 74 47 72 61 |;..Patte|rn ltGra|
|000008c0| 79 3b 0d 09 50 61 74 74 | 65 72 6e 20 67 72 61 79 |y;..Patt|ern gray|
|000008d0| 3b 0d 09 50 61 74 74 65 | 72 6e 20 62 6c 61 63 6b |;..Patte|rn black|
|000008e0| 3b 0d 09 50 61 74 74 65 | 72 6e 20 77 68 69 74 65 |;..Patte|rn white|
|000008f0| 3b 0d 09 47 72 61 66 50 | 74 72 20 74 68 65 50 6f |;..GrafP|tr thePo|
|00000900| 72 74 3b 0d 09 6c 6f 6e | 67 09 65 6e 64 3b 0d 7d |rt;..lon|g.end;.}|
|00000910| 20 71 64 47 6c 6f 62 61 | 6c 73 3b 0d 0d 2f 2a 20 | qdGloba|ls;../* |
|00000920| 50 72 6f 74 6f 74 79 70 | 65 73 20 2a 2f 0d 0d 73 |Prototyp|es */..s|
|00000930| 74 61 74 69 63 20 73 68 | 6f 72 74 09 43 68 65 63 |tatic sh|ort.Chec|
|00000940| 6b 53 75 6d 28 20 72 65 | 67 69 73 74 65 72 20 73 |kSum( re|gister s|
|00000950| 68 6f 72 74 20 78 20 29 | 3b 0d 73 74 61 74 69 63 |hort x )|;.static|
|00000960| 20 76 6f 69 64 09 09 47 | 65 74 49 63 6f 6e 52 65 | void..G|etIconRe|
|00000970| 63 74 28 20 72 65 67 69 | 73 74 65 72 20 52 65 63 |ct( regi|ster Rec|
|00000980| 74 2a 20 69 63 6f 6e 52 | 65 63 74 2c 20 47 72 61 |t* iconR|ect, Gra|
|00000990| 66 50 74 72 20 70 6f 72 | 74 20 29 3b 0d 73 74 61 |fPtr por|t );.sta|
|000009a0| 74 69 63 20 76 6f 69 64 | 09 09 4e 65 78 74 5f 70 |tic void|..Next_p|
|000009b0| 6f 73 69 74 69 6f 6e 28 | 20 76 6f 69 64 20 29 3b |osition(| void );|
|000009c0| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 09 09 44 72 |.static |void..Dr|
|000009d0| 61 77 42 57 49 63 6f 6e | 28 20 73 68 6f 72 74 20 |awBWIcon|( short |
|000009e0| 69 63 6f 6e 49 64 2c 20 | 47 72 61 66 50 74 72 20 |iconId, |GrafPtr |
|000009f0| 70 6f 72 74 20 29 3b 0d | 73 74 61 74 69 63 20 48 |port );.|static H|
|00000a00| 61 6e 64 6c 65 09 43 68 | 6f 6f 73 65 49 63 6f 6e |andle.Ch|ooseIcon|
|00000a10| 28 20 73 68 6f 72 74 20 | 69 63 6f 6e 49 64 2c 20 |( short |iconId, |
|00000a20| 73 68 6f 72 74 2a 20 73 | 75 67 67 65 73 74 65 64 |short* s|uggested|
|00000a30| 44 65 70 74 68 20 29 3b | 0d 73 74 61 74 69 63 20 |Depth );|.static |
|00000a40| 76 6f 69 64 09 09 44 72 | 61 77 43 6f 6c 6f 72 49 |void..Dr|awColorI|
|00000a50| 63 6f 6e 28 20 73 68 6f | 72 74 20 69 63 6f 6e 49 |con( sho|rt iconI|
|00000a60| 64 2c 20 43 47 72 61 66 | 50 74 72 20 70 6f 72 74 |d, CGraf|Ptr port|
|00000a70| 2c 20 73 68 6f 72 74 20 | 74 68 65 44 65 70 74 68 |, short |theDepth|
|00000a80| 20 29 3b 0d 0d 2f 2a 20 | 74 68 69 73 20 69 73 20 | );../* |this is |
|00000a90| 77 68 65 72 65 20 69 74 | 20 61 6c 6c 20 68 61 70 |where it| all hap|
|00000aa0| 70 65 6e 73 2e 20 2a 2f | 0d 0d 23 69 66 20 53 45 |pens. */|..#if SE|
|00000ab0| 50 41 52 41 54 45 5f 43 | 4f 44 45 0d 76 6f 69 64 |PARATE_C|ODE.void|
|00000ac0| 20 6d 61 69 6e 28 73 68 | 6f 72 74 20 69 63 6f 6e | main(sh|ort icon|
|00000ad0| 49 64 29 0d 23 65 6c 73 | 65 0d 76 6f 69 64 20 53 |Id).#els|e.void S|
|00000ae0| 68 6f 77 49 63 6f 6e 46 | 61 6d 69 6c 79 28 73 68 |howIconF|amily(sh|
|00000af0| 6f 72 74 20 69 63 6f 6e | 49 64 29 0d 23 65 6e 64 |ort icon|Id).#end|
|00000b00| 69 66 0d 7b 0d 09 6c 6f | 6e 67 09 09 6f 6c 64 41 |if.{..lo|ng..oldA|
|00000b10| 35 3b 0d 09 71 64 47 6c | 6f 62 61 6c 73 09 71 64 |5;..qdGl|obals.qd|
|00000b20| 3b 09 09 09 09 09 2f 2a | 20 6f 75 72 20 51 44 20 |;...../*| our QD |
|00000b30| 67 6c 6f 62 61 6c 73 2e | 20 2a 2f 0d 09 53 79 73 |globals.| */..Sys|
|00000b40| 45 6e 76 52 65 63 09 65 | 6e 76 69 72 6f 6e 6d 65 |EnvRec.e|nvironme|
|00000b50| 6e 74 3b 09 09 2f 2a 20 | 6d 61 63 68 69 6e 65 20 |nt;../* |machine |
|00000b60| 63 6f 6e 66 69 67 75 72 | 61 74 69 6f 6e 2e 20 2a |configur|ation. *|
|00000b70| 2f 0d 09 43 47 72 61 66 | 50 6f 72 74 09 67 70 3b |/..CGraf|Port.gp;|
|00000b80| 09 09 09 09 09 2f 2a 20 | 6f 75 72 20 67 72 61 66 |...../* |our graf|
|00000b90| 70 6f 72 74 2e 20 2a 2f | 0d 09 73 68 6f 72 74 09 |port. */|..short.|
|00000ba0| 09 74 68 65 44 65 70 74 | 68 3b 09 09 09 2f 2a 20 |.theDept|h;.../* |
|00000bb0| 74 68 65 20 64 65 70 74 | 68 20 74 68 65 20 6d 6f |the dept|h the mo|
|00000bc0| 6e 69 74 6f 72 20 69 73 | 20 69 6e 20 2a 2f 09 2f |nitor is| in */./|
|00000bd0| 2a 20 6b 77 20 2a 2f 0d | 09 0d 23 69 66 20 53 45 |* kw */.|..#if SE|
|00000be0| 50 41 52 41 54 45 5f 43 | 4f 44 45 0d 09 52 65 6d |PARATE_C|ODE..Rem|
|00000bf0| 65 6d 62 65 72 41 30 28 | 29 3b 20 2f 2a 20 4a 57 |emberA0(|); /* JW|
|00000c00| 57 20 2a 2f 0d 09 53 65 | 74 55 70 41 34 28 29 3b |W */..Se|tUpA4();|
|00000c10| 20 2f 2a 20 4a 57 57 20 | 2a 2f 0d 23 65 6e 64 69 | /* JWW |*/.#endi|
|00000c20| 66 0d 09 0d 09 2f 2a 20 | 67 65 74 20 61 20 76 61 |f..../* |get a va|
|00000c30| 6c 75 65 20 66 6f 72 20 | 41 35 2c 20 61 20 73 74 |lue for |A5, a st|
|00000c40| 72 75 63 74 75 72 65 20 | 74 68 61 74 20 6d 69 72 |ructure |that mir|
|00000c50| 72 6f 72 73 20 71 64 20 | 67 6c 6f 62 61 6c 73 2e |rors qd |globals.|
|00000c60| 20 2a 2f 0d 09 6f 6c 64 | 41 35 20 3d 20 53 65 74 | */..old|A5 = Set|
|00000c70| 41 35 28 28 6c 6f 6e 67 | 29 26 71 64 2e 65 6e 64 |A5((long|)&qd.end|
|00000c80| 29 3b 0d 09 49 6e 69 74 | 47 72 61 66 28 26 71 64 |);..Init|Graf(&qd|
|00000c90| 2e 74 68 65 50 6f 72 74 | 29 3b 0d 09 0d 09 2f 2a |.thePort|);..../*|
|00000ca0| 20 66 69 6e 64 20 6f 75 | 74 20 77 68 61 74 20 6b | find ou|t what k|
|00000cb0| 69 6e 64 20 6f 66 20 6d | 61 63 68 69 6e 65 20 74 |ind of m|achine t|
|00000cc0| 68 69 73 20 69 73 2e 20 | 2a 2f 0d 09 53 79 73 45 |his is. |*/..SysE|
|00000cd0| 6e 76 69 72 6f 6e 73 28 | 63 75 72 53 79 73 45 6e |nvirons(|curSysEn|
|00000ce0| 76 56 65 72 73 2c 20 26 | 65 6e 76 69 72 6f 6e 6d |vVers, &|environm|
|00000cf0| 65 6e 74 29 3b 0d 09 69 | 66 20 28 65 6e 76 69 72 |ent);..i|f (envir|
|00000d00| 6f 6e 6d 65 6e 74 2e 68 | 61 73 43 6f 6c 6f 72 51 |onment.h|asColorQ|
|00000d10| 44 29 20 7b 0d 09 09 74 | 68 65 44 65 70 74 68 20 |D) {...t|heDepth |
|00000d20| 3d 20 28 2a 2a 28 2a 2a | 47 65 74 4d 61 69 6e 44 |= (**(**|GetMainD|
|00000d30| 65 76 69 63 65 28 29 29 | 2e 67 64 50 4d 61 70 29 |evice())|.gdPMap)|
|00000d40| 2e 70 69 78 65 6c 53 69 | 7a 65 3b 0d 09 09 69 66 |.pixelSi|ze;...if|
|00000d50| 20 28 74 68 65 44 65 70 | 74 68 20 3c 20 34 29 0d | (theDep|th < 4).|
|00000d60| 09 09 09 74 68 65 44 65 | 70 74 68 20 3d 20 31 3b |...theDe|pth = 1;|
|00000d70| 0d 09 7d 20 65 6c 73 65 | 20 7b 0d 09 09 74 68 65 |..} else| {...the|
|00000d80| 44 65 70 74 68 20 3d 20 | 31 3b 0d 09 7d 0d 0d 09 |Depth = |1;..}...|
|00000d90| 2f 2a 20 73 65 65 20 77 | 68 61 74 20 74 79 70 65 |/* see w|hat type|
|00000da0| 20 6f 66 20 70 6f 72 74 | 20 74 6f 20 6f 70 65 6e | of port| to open|
|00000db0| 2e 20 2a 2f 0d 09 69 66 | 20 28 74 68 65 44 65 70 |. */..if| (theDep|
|00000dc0| 74 68 20 3e 3d 20 34 29 | 20 7b 0d 09 09 4f 70 65 |th >= 4)| {...Ope|
|00000dd0| 6e 43 50 6f 72 74 28 26 | 67 70 29 3b 0d 09 7d 20 |nCPort(&|gp);..} |
|00000de0| 65 6c 73 65 20 7b 0d 09 | 09 4f 70 65 6e 50 6f 72 |else {..|.OpenPor|
|00000df0| 74 28 28 47 72 61 66 50 | 74 72 29 26 67 70 29 3b |t((GrafP|tr)&gp);|
|00000e00| 0d 09 7d 0d 09 0d 09 69 | 66 20 28 74 68 65 44 65 |..}....i|f (theDe|
|00000e10| 70 74 68 20 3d 3d 20 31 | 29 0d 09 09 44 72 61 77 |pth == 1|)...Draw|
|00000e20| 42 57 49 63 6f 6e 28 20 | 69 63 6f 6e 49 64 2c 20 |BWIcon( |iconId, |
|00000e30| 28 47 72 61 66 50 74 72 | 29 26 67 70 20 29 3b 0d |(GrafPtr|)&gp );.|
|00000e40| 09 65 6c 73 65 0d 09 09 | 44 72 61 77 43 6f 6c 6f |.else...|DrawColo|
|00000e50| 72 49 63 6f 6e 28 20 69 | 63 6f 6e 49 64 2c 20 26 |rIcon( i|conId, &|
|00000e60| 67 70 2c 20 74 68 65 44 | 65 70 74 68 20 29 3b 0d |gp, theD|epth );.|
|00000e70| 09 0d 09 4e 65 78 74 5f | 70 6f 73 69 74 69 6f 6e |...Next_|position|
|00000e80| 28 29 3b 20 2f 2a 20 4a | 57 57 20 2a 2f 0d 0d 09 |(); /* J|WW */...|
|00000e90| 53 65 74 41 35 28 6f 6c | 64 41 35 29 3b 0d 23 69 |SetA5(ol|dA5);.#i|
|00000ea0| 66 20 53 45 50 41 52 41 | 54 45 5f 43 4f 44 45 0d |f SEPARA|TE_CODE.|
|00000eb0| 09 52 65 73 74 6f 72 65 | 41 34 28 29 3b 0d 23 65 |.Restore|A4();.#e|
|00000ec0| 6e 64 69 66 0d 7d 0d 0d | 2f 2a 0d 09 53 68 6f 77 |ndif.}..|/*..Show|
|00000ed0| 49 6e 69 74 27 73 20 69 | 6e 66 6f 72 6d 61 74 69 |Init's i|nformati|
|00000ee0| 6f 6e 20 69 73 20 6e 65 | 73 74 6c 65 64 20 61 74 |on is ne|stled at|
|00000ef0| 20 74 68 65 20 74 61 69 | 6c 20 65 6e 64 20 6f 66 | the tai|l end of|
|00000f00| 20 43 75 72 41 70 4e 61 | 6d 65 2e 0d 09 49 74 20 | CurApNa|me...It |
|00000f10| 63 6f 6e 73 69 73 74 73 | 20 6f 66 20 61 20 73 68 |consists| of a sh|
|00000f20| 6f 72 74 20 77 68 69 63 | 68 20 65 6e 63 6f 64 65 |ort whic|h encode|
|00000f30| 73 20 74 68 65 20 6e 65 | 78 74 20 68 6f 72 69 7a |s the ne|xt horiz|
|00000f40| 6f 6e 74 61 6c 20 6f 66 | 66 73 65 74 2c 0d 09 61 |ontal of|fset,..a|
|00000f50| 6e 64 20 61 6e 6f 74 68 | 65 72 20 73 68 6f 72 74 |nd anoth|er short|
|00000f60| 20 77 68 69 63 68 20 69 | 73 20 74 68 61 74 20 76 | which i|s that v|
|00000f70| 61 6c 75 65 20 63 68 65 | 63 6b 73 75 6d 6d 65 64 |alue che|cksummed|
|00000f80| 20 77 69 74 68 20 74 68 | 65 20 66 75 6e 63 74 69 | with th|e functi|
|00000f90| 6f 6e 20 62 65 6c 6f 77 | 2e 0d 20 2a 2f 0d 0d 23 |on below|.. */..#|
|00000fa0| 64 65 66 69 6e 65 20 43 | 75 72 41 70 4e 61 6d 65 |define C|urApName|
|00000fb0| 5f 4c 4d 09 30 78 39 31 | 30 0d 23 64 65 66 69 6e |_LM.0x91|0.#defin|
|00000fc0| 65 20 53 68 6f 77 49 4e | 49 54 54 61 62 6c 65 20 |e ShowIN|ITTable |
|00000fd0| 28 28 73 68 6f 72 74 2a | 29 28 43 75 72 41 70 4e |((short*|)(CurApN|
|00000fe0| 61 6d 65 5f 4c 4d 20 2b | 20 33 32 20 2d 20 34 29 |ame_LM +| 32 - 4)|
|00000ff0| 29 0d 23 64 65 66 69 6e | 65 20 43 68 65 63 6b 53 |).#defin|e CheckS|
|00001000| 75 6d 43 6f 6e 73 74 20 | 30 78 31 30 32 31 09 09 |umConst |0x1021..|
|00001010| 2f 2a 20 6d 61 67 69 63 | 20 76 61 6c 75 65 20 74 |/* magic| value t|
|00001020| 6f 20 63 68 65 63 6b 2d | 73 75 6d 20 77 69 74 68 |o check-|sum with|
|00001030| 2e 20 2a 2f 0d 0d 23 64 | 65 66 69 6e 65 20 49 6e |. */..#d|efine In|
|00001040| 69 74 69 61 6c 58 50 6f | 73 69 74 69 6f 6e 20 38 |itialXPo|sition 8|
|00001050| 09 09 09 2f 2a 20 69 6e | 69 74 69 61 6c 20 68 6f |.../* in|itial ho|
|00001060| 72 69 7a 6f 6e 74 61 6c | 20 6f 66 66 73 65 74 2e |rizontal| offset.|
|00001070| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 20 59 4f 66 66 | */.#def|ine YOff|
|00001080| 73 65 74 09 09 09 34 30 | 09 09 09 2f 2a 20 63 6f |set...40|.../* co|
|00001090| 6e 73 74 61 6e 74 20 66 | 72 6f 6d 20 62 6f 74 74 |nstant f|rom bott|
|000010a0| 6f 6d 20 74 6f 20 70 6c | 61 63 65 20 74 68 65 20 |om to pl|ace the |
|000010b0| 69 63 6f 6e 2e 20 2a 2f | 0d 23 64 65 66 69 6e 65 |icon. */|.#define|
|000010c0| 20 58 4f 66 66 73 65 74 | 09 09 09 34 30 09 09 09 | XOffset|...40...|
|000010d0| 2f 2a 20 61 6d 6f 75 6e | 74 20 74 6f 20 63 68 61 |/* amoun|t to cha|
|000010e0| 6e 67 65 20 69 74 20 62 | 79 2e 20 2a 2f 0d 0d 2f |nge it b|y. */../|
|000010f0| 2a 20 43 68 65 63 6b 53 | 75 6d 28 29 20 63 6f 6d |* CheckS|um() com|
|00001100| 70 75 74 65 73 20 74 68 | 65 20 6d 61 67 69 63 20 |putes th|e magic |
|00001110| 76 61 6c 75 65 20 74 6f | 20 64 65 74 65 72 6d 69 |value to| determi|
|00001120| 6e 65 20 69 66 20 53 68 | 6f 77 49 6e 69 74 27 73 |ne if Sh|owInit's|
|00001130| 20 68 61 76 65 20 72 75 | 6e 20 61 6c 72 65 61 64 | have ru|n alread|
|00001140| 79 2e 20 2a 2f 0d 0d 73 | 74 61 74 69 63 20 73 68 |y. */..s|tatic sh|
|00001150| 6f 72 74 20 43 68 65 63 | 6b 53 75 6d 28 72 65 67 |ort Chec|kSum(reg|
|00001160| 69 73 74 65 72 20 73 68 | 6f 72 74 20 78 29 0d 7b |ister sh|ort x).{|
|00001170| 0d 09 61 73 6d 20 7b 0d | 09 09 72 6f 6c 2e 77 09 |..asm {.|..rol.w.|
|00001180| 23 31 2c 20 78 0d 09 7d | 0d 09 72 65 74 75 72 6e |#1, x..}|..return|
|00001190| 20 28 78 20 5e 20 43 68 | 65 63 6b 53 75 6d 43 6f | (x ^ Ch|eckSumCo|
|000011a0| 6e 73 74 29 3b 0d 7d 0d | 0d 2f 2a 0d 09 47 65 74 |nst);.}.|./*..Get|
|000011b0| 49 63 6f 6e 52 65 63 74 | 28 29 20 67 65 6e 65 72 |IconRect|() gener|
|000011c0| 61 74 65 73 20 61 6e 20 | 61 70 70 72 6f 70 72 69 |ates an |appropri|
|000011d0| 61 74 65 20 72 65 63 74 | 61 6e 67 6c 65 20 74 6f |ate rect|angle to|
|000011e0| 20 64 69 73 70 6c 61 79 | 20 74 68 65 0d 09 6e 65 | display| the..ne|
|000011f0| 78 74 20 49 4e 49 54 27 | 73 20 69 63 6f 6e 20 69 |xt INIT'|s icon i|
|00001200| 6e 2e 0d 09 49 74 20 69 | 73 20 61 6c 73 6f 20 72 |n...It i|s also r|
|00001210| 65 73 70 6f 6e 73 69 62 | 6c 65 20 66 6f 72 20 75 |esponsib|le for u|
|00001220| 70 64 61 74 69 6e 67 20 | 74 68 65 20 68 6f 72 69 |pdating |the hori|
|00001230| 7a 6f 6e 74 61 6c 0d 09 | 70 6f 73 69 74 69 6f 6e |zontal..|position|
|00001240| 20 69 6e 20 6c 6f 77 20 | 6d 65 6d 6f 72 79 2e 20 | in low |memory. |
|00001250| 20 54 68 69 73 20 69 73 | 20 61 20 64 65 70 61 72 | This is| a depar|
|00001260| 74 75 72 65 20 66 72 6f | 6d 0d 09 74 68 65 20 6f |ture fro|m..the o|
|00001270| 72 69 67 69 6e 61 6c 20 | 53 68 6f 77 49 6e 69 74 |riginal |ShowInit|
|00001280| 20 63 6f 64 65 2c 20 77 | 68 69 63 68 20 75 70 64 | code, w|hich upd|
|00001290| 61 74 65 73 20 6c 6f 77 | 0d 09 6d 65 6d 6f 72 79 |ates low|..memory|
|000012a0| 20 41 46 54 45 52 20 64 | 69 73 70 6c 61 79 69 6e | AFTER d|isplayin|
|000012b0| 67 20 74 68 65 20 69 63 | 6f 6e 2e 20 2d 2d 20 63 |g the ic|on. -- c|
|000012c0| 68 61 6e 67 65 64 20 62 | 79 20 4a 57 57 0d 09 54 |hanged b|y JWW..T|
|000012d0| 68 69 73 20 63 6f 64 65 | 20 77 6f 6e 27 74 20 67 |his code| won't g|
|000012e0| 65 6e 65 72 61 74 65 20 | 61 6e 20 69 63 6f 6e 20 |enerate |an icon |
|000012f0| 70 6f 73 69 74 69 6f 6e | 20 75 6e 74 69 6c 20 69 |position| until i|
|00001300| 74 20 69 73 20 63 65 72 | 74 61 69 6e 20 74 68 61 |t is cer|tain tha|
|00001310| 74 20 74 68 65 20 69 63 | 6f 6e 20 63 61 6e 20 62 |t the ic|on can b|
|00001320| 65 20 6c 6f 61 64 65 64 | 2c 20 73 6f 20 74 68 65 |e loaded|, so the|
|00001330| 0d 09 73 61 6d 65 20 62 | 65 68 61 76 69 6f 75 72 |..same b|ehaviour|
|00001340| 20 6f 63 63 75 72 73 2e | 0d 09 0d 09 54 68 69 73 | occurs.|....This|
|00001350| 20 72 6f 75 74 69 6e 65 | 20 61 6c 73 6f 20 67 65 | routine| also ge|
|00001360| 6e 65 72 61 74 65 73 20 | 61 20 72 65 63 74 61 6e |nerates |a rectan|
|00001370| 67 6c 65 20 77 68 69 63 | 68 20 69 73 20 67 75 61 |gle whic|h is gua|
|00001380| 72 61 6e 74 65 65 64 20 | 74 6f 20 62 65 20 6f 6e |ranteed |to be on|
|00001390| 73 63 72 65 65 6e 2e 20 | 20 49 74 0d 09 64 6f 65 |screen. | It..doe|
|000013a0| 73 20 74 68 69 73 20 62 | 79 20 74 61 6b 69 6e 67 |s this b|y taking|
|000013b0| 20 74 68 65 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 20 | the hor|izontal |
|000013c0| 6f 66 66 73 65 74 20 6d | 6f 64 75 6c 6f 20 74 68 |offset m|odulo th|
|000013d0| 65 20 73 63 72 65 65 6e | 20 77 69 64 74 68 20 74 |e screen| width t|
|000013e0| 6f 20 67 65 6e 65 72 61 | 74 65 0d 09 74 68 65 20 |o genera|te..the |
|000013f0| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 70 6f 73 69 74 |horizont|al posit|
|00001400| 69 6f 6e 20 6f 66 20 74 | 68 65 20 69 63 6f 6e 2c |ion of t|he icon,|
|00001410| 20 61 6e 64 20 74 68 65 | 20 6f 66 66 73 65 74 20 | and the| offset |
|00001420| 64 69 76 69 64 65 64 20 | 62 79 20 74 68 65 20 73 |divided |by the s|
|00001430| 63 72 65 65 6e 0d 09 77 | 69 64 74 68 20 74 6f 20 |creen..w|idth to |
|00001440| 67 65 6e 65 72 61 74 65 | 20 74 68 65 20 70 72 6f |generate| the pro|
|00001450| 70 65 72 20 72 6f 77 2e | 0d 09 0d 09 6b 77 20 2d |per row.|....kw -|
|00001460| 20 49 20 6d 6f 64 69 66 | 69 65 64 20 74 68 69 73 | I modif|ied this|
|00001470| 20 72 6f 75 74 69 6e 65 | 20 74 6f 20 74 61 6b 65 | routine| to take|
|00001480| 20 74 68 65 20 65 78 74 | 72 61 20 27 70 6f 72 74 | the ext|ra 'port|
|00001490| 27 20 61 72 67 75 6d 65 | 6e 74 2e 0d 20 2a 2f 0d |' argume|nt.. */.|
|000014a0| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 20 47 65 74 |.static |void Get|
|000014b0| 49 63 6f 6e 52 65 63 74 | 28 72 65 67 69 73 74 65 |IconRect|(registe|
|000014c0| 72 20 52 65 63 74 2a 20 | 69 63 6f 6e 52 65 63 74 |r Rect* |iconRect|
|000014d0| 2c 20 47 72 61 66 50 74 | 72 20 70 6f 72 74 29 0d |, GrafPt|r port).|
|000014e0| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 73 68 6f 72 |{..regis|ter shor|
|000014f0| 74 20 73 63 72 65 65 6e | 57 69 64 74 68 20 3d 20 |t screen|Width = |
|00001500| 70 6f 72 74 2d 3e 70 6f | 72 74 52 65 63 74 2e 72 |port->po|rtRect.r|
|00001510| 69 67 68 74 20 2d 20 70 | 6f 72 74 2d 3e 70 6f 72 |ight - p|ort->por|
|00001520| 74 52 65 63 74 2e 6c 65 | 66 74 3b 0d 09 2f 2a 20 |tRect.le|ft;../* |
|00001530| 69 66 20 77 65 20 61 72 | 65 20 74 68 65 20 66 69 |if we ar|e the fi|
|00001540| 72 73 74 20 49 4e 49 54 | 20 74 6f 20 72 75 6e 20 |rst INIT| to run |
|00001550| 77 65 20 6e 65 65 64 20 | 74 6f 20 69 6e 69 74 69 |we need |to initi|
|00001560| 61 6c 69 7a 65 20 74 68 | 65 20 68 6f 72 69 7a 6f |alize th|e horizo|
|00001570| 6e 74 61 6c 20 76 61 6c | 75 65 2e 20 2a 2f 0d 09 |ntal val|ue. */..|
|00001580| 69 66 20 28 43 68 65 63 | 6b 53 75 6d 28 53 68 6f |if (Chec|kSum(Sho|
|00001590| 77 49 4e 49 54 54 61 62 | 6c 65 5b 30 5d 29 20 21 |wINITTab|le[0]) !|
|000015a0| 3d 20 53 68 6f 77 49 4e | 49 54 54 61 62 6c 65 5b |= ShowIN|ITTable[|
|000015b0| 31 5d 29 0d 09 09 53 68 | 6f 77 49 4e 49 54 54 61 |1])...Sh|owINITTa|
|000015c0| 62 6c 65 5b 30 5d 20 3d | 20 49 6e 69 74 69 61 6c |ble[0] =| Initial|
|000015d0| 58 50 6f 73 69 74 69 6f | 6e 3b 0d 09 0d 09 2f 2a |XPositio|n;..../*|
|000015e0| 20 63 6f 6d 70 75 74 65 | 20 74 6f 70 20 6c 65 66 | compute| top lef|
|000015f0| 74 20 6f 66 20 69 63 6f | 6e 27 73 20 72 65 63 74 |t of ico|n's rect|
|00001600| 2e 20 2a 2f 0d 09 69 63 | 6f 6e 52 65 63 74 2d 3e |. */..ic|onRect->|
|00001610| 6c 65 66 74 20 3d 20 28 | 53 68 6f 77 49 4e 49 54 |left = (|ShowINIT|
|00001620| 54 61 62 6c 65 5b 30 5d | 20 25 20 73 63 72 65 65 |Table[0]| % scree|
|00001630| 6e 57 69 64 74 68 29 3b | 0d 09 69 63 6f 6e 52 65 |nWidth);|..iconRe|
|00001640| 63 74 2d 3e 74 6f 70 20 | 3d 20 70 6f 72 74 2d 3e |ct->top |= port->|
|00001650| 70 6f 72 74 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |portRect|.bottom |
|00001660| 2d 20 59 4f 66 66 73 65 | 74 20 2a 20 28 31 20 2b |- YOffse|t * (1 +|
|00001670| 20 28 53 68 6f 77 49 4e | 49 54 54 61 62 6c 65 5b | (ShowIN|ITTable[|
|00001680| 30 5d 20 2f 20 73 63 72 | 65 65 6e 57 69 64 74 68 |0] / scr|eenWidth|
|00001690| 29 29 3b 0d 09 69 63 6f | 6e 52 65 63 74 2d 3e 72 |));..ico|nRect->r|
|000016a0| 69 67 68 74 20 3d 20 69 | 63 6f 6e 52 65 63 74 2d |ight = i|conRect-|
|000016b0| 3e 6c 65 66 74 20 2b 20 | 33 32 3b 0d 09 69 63 6f |>left + |32;..ico|
|000016c0| 6e 52 65 63 74 2d 3e 62 | 6f 74 74 6f 6d 20 3d 20 |nRect->b|ottom = |
|000016d0| 69 63 6f 6e 52 65 63 74 | 2d 3e 74 6f 70 20 2b 20 |iconRect|->top + |
|000016e0| 33 32 3b 0d 09 0d 7d 0d | 0d 2f 2a 0d 09 4a 57 57 |32;...}.|./*..JWW|
|000016f0| 3a 20 49 6e 20 42 65 61 | 72 64 27 73 20 6f 72 69 |: In Bea|rd's ori|
|00001700| 67 69 6e 61 6c 20 76 65 | 72 73 69 6f 6e 2c 20 74 |ginal ve|rsion, t|
|00001710| 68 69 73 20 77 61 73 20 | 64 6f 6e 65 20 61 74 20 |his was |done at |
|00001720| 74 68 65 20 65 6e 64 20 | 6f 66 0d 09 47 65 74 49 |the end |of..GetI|
|00001730| 63 6f 6e 52 65 63 74 2e | 20 54 68 61 74 20 63 61 |conRect.| That ca|
|00001740| 75 73 65 64 20 69 6e 63 | 6f 72 72 65 63 74 20 62 |used inc|orrect b|
|00001750| 65 68 61 76 69 6f 72 20 | 77 68 65 6e 20 49 63 6f |ehavior |when Ico|
|00001760| 6e 57 72 61 70 20 31 2e | 32 20 77 61 73 0d 09 75 |nWrap 1.|2 was..u|
|00001770| 73 65 64 20 74 6f 20 77 | 72 61 70 20 69 63 6f 6e |sed to w|rap icon|
|00001780| 73 2e 20 20 4e 61 6d 65 | 6c 79 2c 20 69 66 20 61 |s. Name|ly, if a|
|00001790| 6e 20 49 4e 49 54 20 75 | 73 69 6e 67 20 74 68 61 |n INIT u|sing tha|
|000017a0| 74 20 76 65 72 73 69 6f | 6e 20 6f 66 0d 09 53 68 |t versio|n of..Sh|
|000017b0| 6f 77 49 63 6f 6e 46 61 | 6d 69 6c 79 20 77 61 73 |owIconFa|mily was|
|000017c0| 20 74 68 65 20 66 69 72 | 73 74 20 69 6e 20 61 20 | the fir|st in a |
|000017d0| 72 6f 77 2c 20 74 68 65 | 6e 20 74 68 65 20 73 65 |row, the|n the se|
|000017e0| 63 6f 6e 64 20 69 63 6f | 6e 20 69 6e 20 74 68 61 |cond ico|n in tha|
|000017f0| 74 0d 09 72 6f 77 20 77 | 6f 75 6c 64 20 6c 61 6e |t..row w|ould lan|
|00001800| 64 20 6f 6e 20 74 6f 70 | 20 6f 66 20 69 74 2e 0d |d on top| of it..|
|00001810| 2a 2f 0d 73 74 61 74 69 | 63 20 76 6f 69 64 20 4e |*/.stati|c void N|
|00001820| 65 78 74 5f 70 6f 73 69 | 74 69 6f 6e 28 20 76 6f |ext_posi|tion( vo|
|00001830| 69 64 20 29 0d 7b 0d 09 | 2f 2a 20 61 64 76 61 6e |id ).{..|/* advan|
|00001840| 63 65 20 74 68 65 20 70 | 6f 73 69 74 69 6f 6e 20 |ce the p|osition |
|00001850| 66 6f 72 20 74 68 65 20 | 6e 65 78 74 20 69 63 6f |for the |next ico|
|00001860| 6e 2e 20 2a 2f 0d 09 53 | 68 6f 77 49 4e 49 54 54 |n. */..S|howINITT|
|00001870| 61 62 6c 65 5b 30 5d 20 | 2b 3d 20 58 4f 66 66 73 |able[0] |+= XOffs|
|00001880| 65 74 3b 0d 09 0d 09 2f | 2a 20 72 65 63 6f 6d 70 |et;..../|* recomp|
|00001890| 75 74 65 20 74 68 65 20 | 63 68 65 63 6b 73 75 6d |ute the |checksum|
|000018a0| 2e 20 2a 2f 0d 09 53 68 | 6f 77 49 4e 49 54 54 61 |. */..Sh|owINITTa|
|000018b0| 62 6c 65 5b 31 5d 20 3d | 20 43 68 65 63 6b 53 75 |ble[1] =| CheckSu|
|000018c0| 6d 28 53 68 6f 77 49 4e | 49 54 54 61 62 6c 65 5b |m(ShowIN|ITTable[|
|000018d0| 30 5d 29 3b 09 0d 7d 0d | 0d 2f 2a 20 44 72 61 77 |0]);..}.|./* Draw|
|000018e0| 42 57 49 63 6f 6e 28 29 | 20 64 72 61 77 73 20 74 |BWIcon()| draws t|
|000018f0| 68 65 20 27 49 43 4e 23 | 27 20 6d 65 6d 62 65 72 |he 'ICN#|' member|
|00001900| 20 6f 66 20 74 68 65 20 | 69 63 6f 6e 20 66 61 6d | of the |icon fam|
|00001910| 69 6c 79 2e 20 2a 2f 0d | 2f 2a 20 6b 77 20 2d 20 |ily. */.|/* kw - |
|00001920| 49 20 6d 6f 64 69 66 69 | 65 64 20 74 68 69 73 20 |I modifi|ed this |
|00001930| 72 6f 75 74 69 6e 65 20 | 74 6f 20 74 61 6b 65 20 |routine |to take |
|00001940| 74 68 65 20 65 78 74 72 | 61 20 27 70 6f 72 74 27 |the extr|a 'port'|
|00001950| 20 61 72 67 75 6d 65 6e | 74 2e 20 2a 2f 0d 0d 73 | argumen|t. */..s|
|00001960| 74 61 74 69 63 20 76 6f | 69 64 20 44 72 61 77 42 |tatic vo|id DrawB|
|00001970| 57 49 63 6f 6e 28 73 68 | 6f 72 74 20 69 63 6f 6e |WIcon(sh|ort icon|
|00001980| 49 64 2c 20 47 72 61 66 | 50 74 72 20 70 6f 72 74 |Id, Graf|Ptr port|
|00001990| 29 0d 7b 0d 09 48 61 6e | 64 6c 65 20 69 63 6f 6e |).{..Han|dle icon|
|000019a0| 3b 0d 09 52 65 63 74 20 | 69 63 6f 6e 52 65 63 74 |;..Rect |iconRect|
|000019b0| 3b 0d 09 42 69 74 4d 61 | 70 20 73 6f 75 72 63 65 |;..BitMa|p source|
|000019c0| 2c 20 64 65 73 74 69 6e | 61 74 69 6f 6e 3b 0d 09 |, destin|ation;..|
|000019d0| 0d 09 69 63 6f 6e 20 3d | 20 47 65 74 31 52 65 73 |..icon =| Get1Res|
|000019e0| 6f 75 72 63 65 28 27 49 | 43 4e 23 27 2c 20 69 63 |ource('I|CN#', ic|
|000019f0| 6f 6e 49 64 29 3b 0d 09 | 69 66 20 28 21 69 63 6f |onId);..|if (!ico|
|00001a00| 6e 29 0d 09 09 72 65 74 | 75 72 6e 3b 0d 09 48 4c |n)...ret|urn;..HL|
|00001a10| 6f 63 6b 28 69 63 6f 6e | 29 3b 0d 09 0d 09 47 65 |ock(icon|);....Ge|
|00001a20| 74 49 63 6f 6e 52 65 63 | 74 28 26 69 63 6f 6e 52 |tIconRec|t(&iconR|
|00001a30| 65 63 74 2c 20 70 6f 72 | 74 29 3b 0d 0d 09 2f 2a |ect, por|t);.../*|
|00001a40| 20 70 72 65 70 61 72 65 | 20 74 68 65 20 73 6f 75 | prepare| the sou|
|00001a50| 72 63 65 20 61 6e 64 20 | 64 65 73 74 69 6e 61 74 |rce and |destinat|
|00001a60| 69 6f 6e 20 62 69 74 6d | 61 70 73 2e 20 2a 2f 0d |ion bitm|aps. */.|
|00001a70| 09 73 6f 75 72 63 65 2e | 62 61 73 65 41 64 64 72 |.source.|baseAddr|
|00001a80| 20 3d 20 2a 69 63 6f 6e | 20 2b 20 31 32 38 3b 09 | = *icon| + 128;.|
|00001a90| 09 09 09 09 2f 2a 20 6d | 61 73 6b 20 61 64 64 72 |..../* m|ask addr|
|00001aa0| 65 73 73 2e 20 2a 2f 0d | 09 73 6f 75 72 63 65 2e |ess. */.|.source.|
|00001ab0| 72 6f 77 42 79 74 65 73 | 20 3d 20 34 3b 0d 09 53 |rowBytes| = 4;..S|
|00001ac0| 65 74 52 65 63 74 28 26 | 73 6f 75 72 63 65 2e 62 |etRect(&|source.b|
|00001ad0| 6f 75 6e 64 73 2c 20 30 | 2c 20 30 2c 20 33 32 2c |ounds, 0|, 0, 32,|
|00001ae0| 20 33 32 29 3b 0d 09 64 | 65 73 74 69 6e 61 74 69 | 32);..d|estinati|
|00001af0| 6f 6e 20 3d 20 70 6f 72 | 74 2d 3e 70 6f 72 74 42 |on = por|t->portB|
|00001b00| 69 74 73 3b 0d 09 0d 09 | 2f 2a 20 74 72 61 6e 73 |its;....|/* trans|
|00001b10| 66 65 72 20 74 68 65 20 | 6d 61 73 6b 2e 20 2a 2f |fer the |mask. */|
|00001b20| 0d 09 43 6f 70 79 42 69 | 74 73 28 26 73 6f 75 72 |..CopyBi|ts(&sour|
|00001b30| 63 65 2c 20 26 64 65 73 | 74 69 6e 61 74 69 6f 6e |ce, &des|tination|
|00001b40| 2c 20 26 73 6f 75 72 63 | 65 2e 62 6f 75 6e 64 73 |, &sourc|e.bounds|
|00001b50| 2c 20 26 69 63 6f 6e 52 | 65 63 74 2c 20 73 72 63 |, &iconR|ect, src|
|00001b60| 42 69 63 2c 20 6e 69 6c | 29 3b 0d 09 0d 09 2f 2a |Bic, nil|);..../*|
|00001b70| 20 61 6e 64 20 74 68 65 | 20 69 63 6f 6e 2e 20 2a | and the| icon. *|
|00001b80| 2f 0d 09 73 6f 75 72 63 | 65 2e 62 61 73 65 41 64 |/..sourc|e.baseAd|
|00001b90| 64 72 20 3d 20 2a 69 63 | 6f 6e 3b 09 0d 09 43 6f |dr = *ic|on;...Co|
|00001ba0| 70 79 42 69 74 73 28 26 | 73 6f 75 72 63 65 2c 20 |pyBits(&|source, |
|00001bb0| 26 64 65 73 74 69 6e 61 | 74 69 6f 6e 2c 20 26 73 |&destina|tion, &s|
|00001bc0| 6f 75 72 63 65 2e 62 6f | 75 6e 64 73 2c 20 26 69 |ource.bo|unds, &i|
|00001bd0| 63 6f 6e 52 65 63 74 2c | 20 73 72 63 4f 72 2c 20 |conRect,| srcOr, |
|00001be0| 6e 69 6c 29 3b 0d 09 0d | 09 52 65 6c 65 61 73 65 |nil);...|.Release|
|00001bf0| 52 65 73 6f 75 72 63 65 | 28 69 63 6f 6e 29 3b 0d |Resource|(icon);.|
|00001c00| 7d 0d 0d 2f 2a 0d 09 43 | 68 6f 6f 73 65 49 63 6f |}../*..C|hooseIco|
|00001c10| 6e 28 29 20 63 68 6f 6f | 73 65 73 20 74 68 65 20 |n() choo|ses the |
|00001c20| 6f 70 74 69 6d 61 6c 20 | 69 63 6f 6e 20 66 6f 72 |optimal |icon for|
|00001c30| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 73 63 72 | the cur|rent scr|
|00001c40| 65 65 6e 20 64 65 70 74 | 68 2e 0d 09 0d 09 50 72 |een dept|h.....Pr|
|00001c50| 69 6f 72 69 74 69 65 73 | 20 66 6f 72 20 63 68 6f |iorities| for cho|
|00001c60| 6f 73 69 6e 67 20 69 63 | 6f 6e 73 3a 0d 09 09 31 |osing ic|ons:...1|
|00001c70| 2e 20 6d 61 74 63 68 20 | 74 68 65 20 62 69 74 20 |. match |the bit |
|00001c80| 64 65 70 74 68 20 74 6f | 20 74 68 65 20 69 63 6f |depth to| the ico|
|00001c90| 6e 2e 0d 09 09 32 2e 20 | 75 73 65 20 61 6c 74 65 |n....2. |use alte|
|00001ca0| 72 6e 61 74 65 20 62 69 | 74 20 64 65 70 74 68 20 |rnate bi|t depth |
|00001cb0| 76 65 72 73 69 6f 6e 20 | 69 66 20 61 76 61 69 6c |version |if avail|
|00001cc0| 61 62 6c 65 2e 0d 09 09 | 33 2e 20 64 72 61 77 20 |able....|3. draw |
|00001cd0| 74 68 65 20 62 6c 61 63 | 6b 20 26 20 77 68 69 74 |the blac|k & whit|
|00001ce0| 65 20 76 65 72 73 69 6f | 6e 2e 0d 20 2a 2f 0d 09 |e versio|n.. */..|
|00001cf0| 0d 73 74 61 74 69 63 20 | 48 61 6e 64 6c 65 20 43 |.static |Handle C|
|00001d00| 68 6f 6f 73 65 49 63 6f | 6e 28 73 68 6f 72 74 20 |hooseIco|n(short |
|00001d10| 69 63 6f 6e 49 64 2c 20 | 73 68 6f 72 74 2a 20 73 |iconId, |short* s|
|00001d20| 75 67 67 65 73 74 65 64 | 44 65 70 74 68 29 0d 7b |uggested|Depth).{|
|00001d30| 0d 09 73 68 6f 72 74 20 | 64 65 70 74 68 20 3d 20 |..short |depth = |
|00001d40| 2a 73 75 67 67 65 73 74 | 65 64 44 65 70 74 68 3b |*suggest|edDepth;|
|00001d50| 0d 09 48 61 6e 64 6c 65 | 20 69 63 6f 6e 20 3d 20 |..Handle| icon = |
|00001d60| 6e 69 6c 3b 0d 0d 09 69 | 66 20 28 64 65 70 74 68 |nil;...i|f (depth|
|00001d70| 20 3d 3d 20 34 29 20 7b | 0d 09 09 69 63 6f 6e 20 | == 4) {|...icon |
|00001d80| 3d 20 47 65 74 31 52 65 | 73 6f 75 72 63 65 28 27 |= Get1Re|source('|
|00001d90| 69 63 6c 34 27 2c 20 69 | 63 6f 6e 49 64 29 3b 0d |icl4', i|conId);.|
|00001da0| 09 09 69 66 20 28 21 69 | 63 6f 6e 29 20 7b 0d 09 |..if (!i|con) {..|
|00001db0| 09 09 2f 2a 20 74 72 79 | 20 61 6c 74 65 72 6e 61 |../* try| alterna|
|00001dc0| 74 65 20 64 65 70 74 68 | 2e 20 2a 2f 0d 09 09 09 |te depth|. */....|
|00001dd0| 69 63 6f 6e 20 3d 20 47 | 65 74 31 52 65 73 6f 75 |icon = G|et1Resou|
|00001de0| 72 63 65 28 27 69 63 6c | 38 27 2c 20 69 63 6f 6e |rce('icl|8', icon|
|00001df0| 49 64 29 3b 0d 09 09 09 | 69 66 20 28 69 63 6f 6e |Id);....|if (icon|
|00001e00| 29 0d 09 09 09 09 64 65 | 70 74 68 20 3d 20 38 3b |).....de|pth = 8;|
|00001e10| 0d 09 09 7d 0d 09 7d 20 | 65 6c 73 65 20 7b 0d 09 |...}..} |else {..|
|00001e20| 09 64 65 70 74 68 20 3d | 20 38 3b 0d 09 09 69 63 |.depth =| 8;...ic|
|00001e30| 6f 6e 20 3d 20 47 65 74 | 31 52 65 73 6f 75 72 63 |on = Get|1Resourc|
|00001e40| 65 28 27 69 63 6c 38 27 | 2c 20 69 63 6f 6e 49 64 |e('icl8'|, iconId|
|00001e50| 29 3b 0d 09 09 69 66 20 | 28 21 69 63 6f 6e 29 20 |);...if |(!icon) |
|00001e60| 7b 0d 09 09 09 2f 2a 20 | 74 72 79 20 61 6c 74 65 |{..../* |try alte|
|00001e70| 72 6e 61 74 65 20 64 65 | 70 74 68 2e 20 2a 2f 0d |rnate de|pth. */.|
|00001e80| 09 09 09 69 63 6f 6e 20 | 3d 20 47 65 74 31 52 65 |...icon |= Get1Re|
|00001e90| 73 6f 75 72 63 65 28 27 | 69 63 6c 34 27 2c 20 69 |source('|icl4', i|
|00001ea0| 63 6f 6e 49 64 29 3b 0d | 09 09 09 69 66 20 28 69 |conId);.|...if (i|
|00001eb0| 63 6f 6e 29 0d 09 09 09 | 09 64 65 70 74 68 20 3d |con)....|.depth =|
|00001ec0| 20 34 3b 0d 09 09 7d 0d | 09 7d 0d 09 0d 09 2a 73 | 4;...}.|.}....*s|
|00001ed0| 75 67 67 65 73 74 65 64 | 44 65 70 74 68 20 3d 20 |uggested|Depth = |
|00001ee0| 64 65 70 74 68 3b 0d 09 | 72 65 74 75 72 6e 20 69 |depth;..|return i|
|00001ef0| 63 6f 6e 3b 0d 7d 0d 0d | 2f 2a 20 44 72 61 77 43 |con;.}..|/* DrawC|
|00001f00| 6f 6c 6f 72 49 63 6f 6e | 28 29 20 64 72 61 77 73 |olorIcon|() draws|
|00001f10| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00001f20| 20 69 63 6f 6e 20 66 6f | 72 20 74 68 65 20 63 75 | icon fo|r the cu|
|00001f30| 72 72 65 6e 74 20 73 63 | 72 65 65 6e 20 64 65 70 |rrent sc|reen dep|
|00001f40| 74 68 2e 20 2a 2f 0d 2f | 2a 20 6b 77 20 2d 20 49 |th. */./|* kw - I|
|00001f50| 20 6d 6f 64 69 66 69 65 | 64 20 74 68 69 73 20 72 | modifie|d this r|
|00001f60| 6f 75 74 69 6e 65 20 74 | 6f 20 74 61 6b 65 20 74 |outine t|o take t|
|00001f70| 68 65 20 65 78 74 72 61 | 20 61 72 67 75 6d 65 6e |he extra| argumen|
|00001f80| 74 73 20 27 70 6f 72 74 | 27 20 61 6e 64 20 27 74 |ts 'port|' and 't|
|00001f90| 68 65 44 65 70 74 68 27 | 20 2a 2f 0d 0d 73 74 61 |heDepth'| */..sta|
|00001fa0| 74 69 63 20 76 6f 69 64 | 20 44 72 61 77 43 6f 6c |tic void| DrawCol|
|00001fb0| 6f 72 49 63 6f 6e 28 73 | 68 6f 72 74 20 69 63 6f |orIcon(s|hort ico|
|00001fc0| 6e 49 64 2c 20 43 47 72 | 61 66 50 74 72 20 70 6f |nId, CGr|afPtr po|
|00001fd0| 72 74 2c 20 73 68 6f 72 | 74 20 74 68 65 44 65 70 |rt, shor|t theDep|
|00001fe0| 74 68 29 0d 7b 0d 09 73 | 68 6f 72 74 20 64 65 70 |th).{..s|hort dep|
|00001ff0| 74 68 54 6f 55 73 65 3b | 0d 09 48 61 6e 64 6c 65 |thToUse;|..Handle|
|00002000| 20 6d 61 73 6b 2c 20 69 | 63 6f 6e 3b 0d 09 43 54 | mask, i|con;..CT|
|00002010| 61 62 48 61 6e 64 6c 65 | 20 63 6c 75 74 3b 0d 09 |abHandle| clut;..|
|00002020| 50 69 78 4d 61 70 48 61 | 6e 64 6c 65 20 73 6f 75 |PixMapHa|ndle sou|
|00002030| 72 63 65 3b 0d 09 42 69 | 74 4d 61 70 20 6d 61 73 |rce;..Bi|tMap mas|
|00002040| 6b 42 69 74 73 3b 0d 09 | 6c 6f 6e 67 20 72 6f 77 |kBits;..|long row|
|00002050| 42 79 74 65 73 3b 0d 09 | 52 65 63 74 20 69 63 6f |Bytes;..|Rect ico|
|00002060| 6e 52 65 63 74 2c 20 62 | 6f 75 6e 64 73 3b 0d 09 |nRect, b|ounds;..|
|00002070| 0d 09 2f 2a 20 62 79 20 | 64 65 66 61 75 6c 74 20 |../* by |default |
|00002080| 77 65 20 77 69 6c 6c 20 | 62 65 20 75 73 69 6e 67 |we will |be using|
|00002090| 20 74 68 65 20 61 63 74 | 75 61 6c 20 64 65 70 74 | the act|ual dept|
|000020a0| 68 20 6f 66 20 74 68 65 | 20 73 63 72 65 65 6e 2e |h of the| screen.|
|000020b0| 20 2a 2f 0d 09 64 65 70 | 74 68 54 6f 55 73 65 20 | */..dep|thToUse |
|000020c0| 3d 20 74 68 65 44 65 70 | 74 68 3b 0d 09 69 63 6f |= theDep|th;..ico|
|000020d0| 6e 20 3d 20 43 68 6f 6f | 73 65 49 63 6f 6e 28 69 |n = Choo|seIcon(i|
|000020e0| 63 6f 6e 49 64 2c 20 26 | 64 65 70 74 68 54 6f 55 |conId, &|depthToU|
|000020f0| 73 65 29 3b 0d 09 0d 09 | 2f 2a 20 69 66 20 6e 6f |se);....|/* if no|
|00002100| 20 63 6f 6c 6f 72 20 69 | 63 6f 6e 20 61 76 61 69 | color i|con avai|
|00002110| 6c 61 62 6c 65 2c 20 64 | 72 61 77 20 74 68 65 20 |lable, d|raw the |
|00002120| 62 6c 61 63 6b 20 26 20 | 77 68 69 74 65 20 69 63 |black & |white ic|
|00002130| 6f 6e 2e 20 2a 2f 0d 09 | 69 66 20 28 21 69 63 6f |on. */..|if (!ico|
|00002140| 6e 29 20 7b 0d 09 09 44 | 72 61 77 42 57 49 63 6f |n) {...D|rawBWIco|
|00002150| 6e 28 69 63 6f 6e 49 64 | 2c 20 28 47 72 61 66 50 |n(iconId|, (GrafP|
|00002160| 74 72 29 70 6f 72 74 29 | 3b 0d 09 09 72 65 74 75 |tr)port)|;...retu|
|00002170| 72 6e 3b 0d 09 7d 0d 09 | 48 4c 6f 63 6b 28 69 63 |rn;..}..|HLock(ic|
|00002180| 6f 6e 29 3b 0d 09 0d 09 | 2f 2a 20 67 65 74 20 74 |on);....|/* get t|
|00002190| 68 65 20 62 6c 61 63 6b | 20 26 20 77 68 69 74 65 |he black| & white|
|000021a0| 20 69 63 6f 6e 20 74 6f | 20 67 65 74 20 74 68 65 | icon to| get the|
|000021b0| 20 6d 61 73 6b 20 64 72 | 61 77 6e 2e 20 2a 2f 0d | mask dr|awn. */.|
|000021c0| 09 6d 61 73 6b 20 3d 20 | 47 65 74 31 52 65 73 6f |.mask = |Get1Reso|
|000021d0| 75 72 63 65 28 27 49 43 | 4e 23 27 2c 20 69 63 6f |urce('IC|N#', ico|
|000021e0| 6e 49 64 29 3b 0d 09 69 | 66 20 28 21 6d 61 73 6b |nId);..i|f (!mask|
|000021f0| 29 0d 09 09 72 65 74 75 | 72 6e 3b 0d 09 48 4c 6f |)...retu|rn;..HLo|
|00002200| 63 6b 28 6d 61 73 6b 29 | 3b 0d 0d 09 2f 2a 20 67 |ck(mask)|;.../* g|
|00002210| 65 74 20 74 68 65 20 63 | 6f 72 72 65 63 74 20 63 |et the c|orrect c|
|00002220| 6f 6c 6f 72 20 6c 6f 6f | 6b 75 70 20 74 61 62 6c |olor loo|kup tabl|
|00002230| 65 2e 20 2a 2f 0d 09 63 | 6c 75 74 20 3d 20 47 65 |e. */..c|lut = Ge|
|00002240| 74 43 54 61 62 6c 65 28 | 64 65 70 74 68 54 6f 55 |tCTable(|depthToU|
|00002250| 73 65 29 3b 0d 09 69 66 | 20 28 21 63 6c 75 74 29 |se);..if| (!clut)|
|00002260| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 0d 09 2f 2a |...retur|n;..../*|
|00002270| 20 63 72 65 61 74 65 20 | 61 20 70 69 78 6d 61 70 | create |a pixmap|
|00002280| 20 74 6f 20 73 74 69 63 | 6b 20 74 68 65 20 69 63 | to stic|k the ic|
|00002290| 6f 6e 20 62 69 74 73 20 | 69 6e 74 6f 20 66 6f 72 |on bits |into for|
|000022a0| 20 73 63 72 65 65 6e 20 | 62 6c 69 74 74 69 6e 67 | screen |blitting|
|000022b0| 2e 20 2a 2f 0d 09 73 6f | 75 72 63 65 20 3d 20 4e |. */..so|urce = N|
|000022c0| 65 77 50 69 78 4d 61 70 | 28 29 3b 0d 09 69 66 20 |ewPixMap|();..if |
|000022d0| 28 21 73 6f 75 72 63 65 | 29 20 7b 0d 09 09 44 69 |(!source|) {...Di|
|000022e0| 73 70 6f 73 43 54 61 62 | 6c 65 28 63 6c 75 74 29 |sposCTab|le(clut)|
|000022f0| 3b 0d 09 09 72 65 74 75 | 72 6e 3b 0d 09 7d 0d 09 |;...retu|rn;..}..|
|00002300| 0d 09 2f 2a 20 73 65 74 | 20 75 70 20 74 68 65 20 |../* set| up the |
|00002310| 73 6f 75 72 63 65 20 70 | 69 78 6d 61 70 20 77 69 |source p|ixmap wi|
|00002320| 74 68 20 74 68 65 20 61 | 70 70 72 6f 70 72 69 61 |th the a|ppropria|
|00002330| 74 65 20 62 6f 75 6e 64 | 73 2c 20 64 65 70 74 68 |te bound|s, depth|
|00002340| 2c 20 61 6e 64 20 63 6c | 75 74 2e 20 2a 2f 0d 09 |, and cl|ut. */..|
|00002350| 62 6f 75 6e 64 73 2e 74 | 6f 70 20 3d 20 62 6f 75 |bounds.t|op = bou|
|00002360| 6e 64 73 2e 6c 65 66 74 | 20 3d 20 30 3b 0d 09 62 |nds.left| = 0;..b|
|00002370| 6f 75 6e 64 73 2e 62 6f | 74 74 6f 6d 20 3d 20 62 |ounds.bo|ttom = b|
|00002380| 6f 75 6e 64 73 2e 72 69 | 67 68 74 20 3d 20 33 32 |ounds.ri|ght = 32|
|00002390| 3b 0d 09 72 6f 77 42 79 | 74 65 73 20 3d 20 28 28 |;..rowBy|tes = ((|
|000023a0| 28 64 65 70 74 68 54 6f | 55 73 65 20 2a 20 33 32 |(depthTo|Use * 32|
|000023b0| 29 20 2b 20 31 35 29 20 | 2f 20 31 36 29 20 2a 20 |) + 15) |/ 16) * |
|000023c0| 32 3b 0d 09 28 2a 2a 73 | 6f 75 72 63 65 29 2e 62 |2;..(**s|ource).b|
|000023d0| 61 73 65 41 64 64 72 20 | 3d 20 2a 69 63 6f 6e 3b |aseAddr |= *icon;|
|000023e0| 0d 09 28 2a 2a 73 6f 75 | 72 63 65 29 2e 72 6f 77 |..(**sou|rce).row|
|000023f0| 42 79 74 65 73 20 3d 20 | 28 28 73 68 6f 72 74 29 |Bytes = |((short)|
|00002400| 72 6f 77 42 79 74 65 73 | 29 20 7c 20 30 78 38 30 |rowBytes|) | 0x80|
|00002410| 30 30 3b 0d 09 28 2a 2a | 73 6f 75 72 63 65 29 2e |00;..(**|source).|
|00002420| 62 6f 75 6e 64 73 20 3d | 20 62 6f 75 6e 64 73 3b |bounds =| bounds;|
|00002430| 0d 09 28 2a 2a 73 6f 75 | 72 63 65 29 2e 70 69 78 |..(**sou|rce).pix|
|00002440| 65 6c 54 79 70 65 20 3d | 20 30 3b 09 09 09 2f 2a |elType =| 0;.../*|
|00002450| 20 63 68 75 6e 6b 79 20 | 6d 6f 64 65 6c 2e 20 2a | chunky |model. *|
|00002460| 2f 0d 09 28 2a 2a 73 6f | 75 72 63 65 29 2e 70 69 |/..(**so|urce).pi|
|00002470| 78 65 6c 53 69 7a 65 20 | 3d 20 64 65 70 74 68 54 |xelSize |= depthT|
|00002480| 6f 55 73 65 3b 0d 09 28 | 2a 2a 73 6f 75 72 63 65 |oUse;..(|**source|
|00002490| 29 2e 63 6d 70 43 6f 75 | 6e 74 20 3d 20 31 3b 09 |).cmpCou|nt = 1;.|
|000024a0| 09 09 2f 2a 20 69 66 20 | 69 6e 20 33 32 20 62 69 |../* if |in 32 bi|
|000024b0| 74 20 6d 6f 64 65 20 74 | 68 69 73 20 77 69 6c 6c |t mode t|his will|
|000024c0| 20 62 65 20 33 2c 20 73 | 6f 20 6d 75 73 74 20 63 | be 3, s|o must c|
|000024d0| 68 61 6e 67 65 2e 20 2a | 2f 0d 09 28 2a 2a 73 6f |hange. *|/..(**so|
|000024e0| 75 72 63 65 29 2e 63 6d | 70 53 69 7a 65 20 3d 20 |urce).cm|pSize = |
|000024f0| 64 65 70 74 68 54 6f 55 | 73 65 3b 09 2f 2a 20 6f |depthToU|se;./* o|
|00002500| 6e 6c 79 20 63 68 75 6e | 6b 79 20 69 6d 61 67 65 |nly chun|ky image|
|00002510| 73 20 75 73 65 64 2e 20 | 2a 2f 0d 09 44 69 73 70 |s used. |*/..Disp|
|00002520| 6f 73 43 54 61 62 6c 65 | 28 28 2a 2a 73 6f 75 72 |osCTable|((**sour|
|00002530| 63 65 29 2e 70 6d 54 61 | 62 6c 65 29 3b 09 2f 2a |ce).pmTa|ble);./*|
|00002540| 20 64 69 73 70 6f 73 65 | 20 6f 66 20 64 65 66 61 | dispose| of defa|
|00002550| 75 6c 74 2c 20 75 6e 69 | 6e 69 74 69 61 6c 69 7a |ult, uni|nitializ|
|00002560| 65 64 20 74 61 62 6c 65 | 2e 20 2a 2f 0d 09 28 2a |ed table|. */..(*|
|00002570| 2a 73 6f 75 72 63 65 29 | 2e 70 6d 54 61 62 6c 65 |*source)|.pmTable|
|00002580| 20 3d 20 63 6c 75 74 3b | 0d 0d 09 2f 2a 20 67 65 | = clut;|.../* ge|
|00002590| 74 20 70 6f 73 69 74 69 | 6f 6e 20 74 6f 20 64 72 |t positi|on to dr|
|000025a0| 61 77 20 69 63 6f 6e 20 | 69 6e 2e 20 2a 2f 0d 09 |aw icon |in. */..|
|000025b0| 47 65 74 49 63 6f 6e 52 | 65 63 74 28 26 69 63 6f |GetIconR|ect(&ico|
|000025c0| 6e 52 65 63 74 2c 20 28 | 47 72 61 66 50 74 72 29 |nRect, (|GrafPtr)|
|000025d0| 70 6f 72 74 29 3b 0d 0d | 09 2f 2a 20 70 72 65 70 |port);..|./* prep|
|000025e0| 61 72 65 20 74 68 65 20 | 6d 61 73 6b 20 62 69 74 |are the |mask bit|
|000025f0| 6d 61 70 2e 20 2a 2f 0d | 09 6d 61 73 6b 42 69 74 |map. */.|.maskBit|
|00002600| 73 2e 62 61 73 65 41 64 | 64 72 20 3d 20 2a 6d 61 |s.baseAd|dr = *ma|
|00002610| 73 6b 20 2b 20 31 32 38 | 3b 09 09 09 09 09 2f 2a |sk + 128|;...../*|
|00002620| 20 6d 61 73 6b 20 61 64 | 64 72 65 73 73 2e 20 2a | mask ad|dress. *|
|00002630| 2f 0d 09 6d 61 73 6b 42 | 69 74 73 2e 72 6f 77 42 |/..maskB|its.rowB|
|00002640| 79 74 65 73 20 3d 20 34 | 3b 0d 09 6d 61 73 6b 42 |ytes = 4|;..maskB|
|00002650| 69 74 73 2e 62 6f 75 6e | 64 73 20 3d 20 62 6f 75 |its.boun|ds = bou|
|00002660| 6e 64 73 3b 0d 0d 09 2f | 2a 20 70 75 6e 63 68 20 |nds;.../|* punch |
|00002670| 6f 75 74 20 74 68 65 20 | 6d 61 73 6b 2e 20 2a 2f |out the |mask. */|
|00002680| 09 0d 09 43 6f 70 79 42 | 69 74 73 28 26 6d 61 73 |...CopyB|its(&mas|
|00002690| 6b 42 69 74 73 2c 20 28 | 42 69 74 4d 61 70 2a 29 |kBits, (|BitMap*)|
|000026a0| 26 70 6f 72 74 2d 3e 70 | 6f 72 74 50 69 78 4d 61 |&port->p|ortPixMa|
|000026b0| 70 2c 20 26 62 6f 75 6e | 64 73 2c 20 26 69 63 6f |p, &boun|ds, &ico|
|000026c0| 6e 52 65 63 74 2c 20 73 | 72 63 42 69 63 2c 20 6e |nRect, s|rcBic, n|
|000026d0| 69 6c 29 3b 0d 09 0d 09 | 2f 2a 20 64 72 61 77 20 |il);....|/* draw |
|000026e0| 74 68 65 20 61 63 74 75 | 61 6c 20 63 6f 6c 6f 72 |the actu|al color|
|000026f0| 20 69 63 6f 6e 2e 20 2a | 2f 0d 09 48 4c 6f 63 6b | icon. *|/..HLock|
|00002700| 28 28 48 61 6e 64 6c 65 | 29 73 6f 75 72 63 65 29 |((Handle|)source)|
|00002710| 3b 0d 09 43 6f 70 79 42 | 69 74 73 28 28 42 69 74 |;..CopyB|its((Bit|
|00002720| 4d 61 70 2a 29 2a 73 6f | 75 72 63 65 2c 20 28 42 |Map*)*so|urce, (B|
|00002730| 69 74 4d 61 70 2a 29 26 | 70 6f 72 74 2d 3e 70 6f |itMap*)&|port->po|
|00002740| 72 74 50 69 78 4d 61 70 | 2c 20 26 62 6f 75 6e 64 |rtPixMap|, &bound|
|00002750| 73 2c 20 26 69 63 6f 6e | 52 65 63 74 2c 20 73 72 |s, &icon|Rect, sr|
|00002760| 63 4f 72 2c 20 6e 69 6c | 29 3b 0d 09 0d 09 2f 2a |cOr, nil|);..../*|
|00002770| 20 72 65 6c 65 61 73 65 | 20 65 76 65 72 79 74 68 | release| everyth|
|00002780| 69 6e 67 20 77 65 27 76 | 65 20 61 6c 6c 6f 63 61 |ing we'v|e alloca|
|00002790| 74 65 64 2e 20 2a 2f 0d | 09 28 2a 2a 73 6f 75 72 |ted. */.|.(**sour|
|000027a0| 63 65 29 2e 62 61 73 65 | 41 64 64 72 20 3d 20 6e |ce).base|Addr = n|
|000027b0| 69 6c 3b 0d 09 44 69 73 | 70 6f 73 50 69 78 4d 61 |il;..Dis|posPixMa|
|000027c0| 70 28 73 6f 75 72 63 65 | 29 3b 0d 09 0d 09 2f 2a |p(source|);..../*|
|000027d0| 20 72 65 6c 65 61 73 65 | 20 74 68 65 20 69 63 6f | release| the ico|
|000027e0| 6e 20 61 6e 64 20 6d 61 | 73 6b 2e 20 2a 2f 0d 09 |n and ma|sk. */..|
|000027f0| 52 65 6c 65 61 73 65 52 | 65 73 6f 75 72 63 65 28 |ReleaseR|esource(|
|00002800| 69 63 6f 6e 29 3b 0d 09 | 52 65 6c 65 61 73 65 52 |icon);..|ReleaseR|
|00002810| 65 73 6f 75 72 63 65 28 | 6d 61 73 6b 29 3b 0d 7d |esource(|mask);.}|
|00002820| 0d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002880| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00002890| 00 00 30 34 0b 48 79 70 | 65 72 58 43 6d 64 2e 68 |..04.Hyp|erXCmd.h|
|000028a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028b0| 10 53 68 6f 77 49 63 6f | 6e 46 61 6d 69 6c 79 2e |.ShowIco|nFamily.|
|000028c0| 63 6f 02 00 00 00 50 61 | 72 74 53 49 54 78 00 00 |co....Pa|rtSITx..|
|000028d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 aa da 77 9a 00 00 | 00 00 00 00 01 7e 00 00 |....w...|.....~..|
|00002900| 00 00 00 00 00 00 00 00 | 00 00 06 a4 25 00 00 00 |........|....%...|
|00002910| 30 a6 05 61 73 6d 2e 68 | 00 00 00 00 00 00 00 00 |0..asm.h|........|
|00002920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002930| 00 00 00 00 06 d0 25 00 | 00 00 30 a8 0a 42 61 6c |......%.|..0..Bal|
|00002940| 6c 6f 6f 6e 73 2e 68 00 | 00 00 00 00 00 00 00 00 |loons.h.|........|
|00002950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 06 b4 |........|........|
|00002960| 25 00 00 00 30 a8 06 45 | 50 50 43 2e 68 00 00 00 |%...0..E|PPC.h...|
|00002970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002980| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029a0| 00 00 00 00 00 00 00 06 | 00 04 00 2a 00 03 01 dd |........|...*....|
|000029b0| 02 7d 00 38 00 14 01 51 | 02 40 aa b8 f7 82 00 00 |.}.8...Q|.@......|
|000029c0| 0a 9d 00 00 0a 9d 00 00 | 00 00 00 00 00 00 01 00 |........|........|
|000029d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 b3 2a e4 |...L...L|...2..*.|
|000029e0| 10 2a 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.*.....2|..MPSR..|
|000029f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 a6 c4 44 00 00 |........|.....D..|
+--------+-------------------------+-------------------------+--------+--------+