home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 June / Macworld (1999-06).dmg / Shareware World / Info / For Developers / MacZoop2.0.sea / MacZoop2.0 / Required Classes / ZObject.h < prev    next >
MacBinary  |  1999-02-24  |  4.8 KB  |  [TEXT/CWIE]

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: ZObject.h

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Feb 24 14:53:58 1999, modified Wed Feb 24 14:53:58 1999, creator 'CWIE', type ASCII, 4154 bytes "ZObject.h" , at 0x10ba 428 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[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 5a 4f 62 6a 65 63 | 74 2e 68 00 00 00 00 00 |..ZObjec|t.h.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 10 3a 00 | 00 01 ac b2 fa 09 56 b2 |......:.|......V.|
|00000060| fa 09 56 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..V.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 cc 6f 00 00 |........|.....o..|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000e0| 2a 2a 0d 2a 0d 2a 0d 2a | 09 09 09 4d 61 63 5a 6f |**.*.*.*|...MacZo|
|000000f0| 6f 70 20 2d 20 22 74 68 | 65 20 66 72 61 6d 65 77 |op - "th|e framew|
|00000100| 6f 72 6b 20 66 6f 72 20 | 74 68 65 20 72 65 73 74 |ork for |the rest|
|00000110| 20 6f 66 20 75 73 22 09 | 09 20 0d 2a 0d 2a 0d 2a | of us".|. .*.*.*|
|00000120| 0d 2a 09 09 09 5a 4f 62 | 6a 65 63 74 2e 68 09 09 |.*...ZOb|ject.h..|
|00000130| 09 2d 2d 20 74 68 65 20 | 72 6f 6f 74 20 6f 62 6a |.-- the |root obj|
|00000140| 65 63 74 20 28 61 62 73 | 74 72 61 63 74 20 63 6c |ect (abs|tract cl|
|00000150| 61 73 73 29 0d 2a 0d 2a | 0d 2a 0d 2a 0d 2a 0d 2a |ass).*.*|.*.*.*.*|
|00000160| 09 09 09 a9 20 31 39 39 | 38 2c 20 47 72 61 68 61 |.... 199|8, Graha|
|00000170| 6d 20 43 6f 78 0d 2a 0d | 2a 0d 2a 0d 2a 0d 2a 2a |m Cox.*.|*.*.*.**|
|00000180| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000190| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|000001e0| 0d 0d 0d 23 70 72 61 67 | 6d 61 20 6f 6e 63 65 0d |...#prag|ma once.|
|000001f0| 0d 23 69 66 6e 64 65 66 | 20 5f 5f 5a 4f 42 4a 45 |.#ifndef| __ZOBJE|
|00000200| 43 54 5f 5f 0d 23 64 65 | 66 69 6e 65 09 5f 5f 5a |CT__.#de|fine.__Z|
|00000210| 4f 42 4a 45 43 54 5f 5f | 0d 0d 63 6c 61 73 73 09 |OBJECT__|..class.|
|00000220| 5a 4f 62 6a 65 63 74 3b | 0d 63 6c 61 73 73 09 5a |ZObject;|.class.Z|
|00000230| 53 74 72 65 61 6d 3b 0d | 63 6c 61 73 73 09 5a 43 |Stream;.|class.ZC|
|00000240| 6c 61 73 73 52 65 67 69 | 73 74 72 79 3b 0d 0d 74 |lassRegi|stry;..t|
|00000250| 79 70 65 64 65 66 20 5a | 4f 62 6a 65 63 74 2a 20 |ypedef Z|Object* |
|00000260| 28 2a 43 6f 6e 73 74 72 | 75 63 74 6f 72 46 75 6e |(*Constr|uctorFun|
|00000270| 63 74 69 6f 6e 29 28 29 | 3b 0d 0d 2f 2a 0d 0d 49 |ction)()|;../*..I|
|00000280| 6e 20 6f 72 64 65 72 20 | 74 6f 20 70 65 72 6d 69 |n order |to permi|
|00000290| 74 20 4d 61 63 5a 6f 6f | 70 20 74 6f 20 69 6d 70 |t MacZoo|p to imp|
|000002a0| 6c 65 6d 65 6e 74 20 6f | 62 6a 65 63 74 20 73 74 |lement o|bject st|
|000002b0| 72 65 61 6d 69 6e 67 20 | 28 70 65 72 73 69 73 74 |reaming |(persist|
|000002c0| 65 6e 74 20 6f 62 6a 65 | 63 74 73 29 2c 20 61 6c |ent obje|cts), al|
|000002d0| 6c 20 6f 62 6a 65 63 74 | 73 0d 6e 65 65 64 20 74 |l object|s.need t|
|000002e0| 6f 20 68 61 76 65 20 61 | 20 63 6f 6d 6d 6f 6e 20 |o have a| common |
|000002f0| 72 6f 6f 74 2e 20 54 68 | 69 73 20 69 73 20 69 74 |root. Th|is is it|
|00000300| 2d 20 5a 4f 62 6a 65 63 | 74 2e 20 4d 6f 73 74 20 |- ZObjec|t. Most |
|00000310| 63 6c 61 73 73 65 73 20 | 75 6c 74 69 6d 61 74 65 |classes |ultimate|
|00000320| 6c 79 20 64 65 72 69 76 | 65 20 66 72 6f 6d 20 74 |ly deriv|e from t|
|00000330| 68 69 73 20 61 6e 64 0d | 61 72 65 20 74 68 75 73 |his and.|are thus|
|00000340| 20 73 74 72 65 61 6d 61 | 62 6c 65 2e 0d 0d 5a 4f | streama|ble...ZO|
|00000350| 62 6a 65 63 74 20 72 65 | 6c 69 65 73 20 6f 6e 20 |bject re|lies on |
|00000360| 5a 43 6c 61 73 73 52 65 | 67 69 73 74 72 79 20 74 |ZClassRe|gistry t|
|00000370| 6f 20 73 74 6f 72 65 20 | 61 20 74 61 62 6c 65 20 |o store |a table |
|00000380| 6f 66 20 63 6c 61 73 73 | 20 49 44 27 73 2c 20 6e |of class| ID's, n|
|00000390| 61 6d 65 73 20 61 6e 64 | 20 69 6e 74 61 6e 74 69 |ames and| intanti|
|000003a0| 61 74 69 6f 6e 0d 66 75 | 6e 63 74 69 6f 6e 73 2e |ation.fu|nctions.|
|000003b0| 20 45 76 65 72 79 20 63 | 6c 61 73 73 20 79 6f 75 | Every c|lass you|
|000003c0| 20 77 69 73 68 20 74 6f | 20 63 72 65 61 74 65 20 | wish to| create |
|000003d0| 66 72 6f 6d 20 61 20 73 | 74 72 65 61 6d 20 6d 75 |from a s|tream mu|
|000003e0| 73 74 20 62 65 20 72 65 | 67 69 73 74 65 72 65 64 |st be re|gistered|
|000003f0| 20 77 69 74 68 20 3c 67 | 43 6c 61 73 73 65 73 3e | with <g|Classes>|
|00000400| 20 69 6e 0d 6f 72 64 65 | 72 20 74 6f 20 77 6f 72 | in.orde|r to wor|
|00000410| 6b 2d 20 74 68 69 73 20 | 69 73 20 6e 6f 72 6d 61 |k- this |is norma|
|00000420| 6c 6c 79 20 64 6f 6e 65 | 20 61 74 20 61 70 70 20 |lly done| at app |
|00000430| 73 74 61 72 74 75 70 20 | 74 69 6d 65 20 77 68 65 |startup |time whe|
|00000440| 6e 20 5a 41 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |n ZAppli|cation's|
|00000450| 20 52 65 67 69 73 74 65 | 72 43 6c 61 73 73 65 73 | Registe|rClasses|
|00000460| 28 29 0d 6d 65 74 68 6f | 64 20 69 73 20 63 61 6c |().metho|d is cal|
|00000470| 6c 65 64 2e 20 54 68 65 | 20 73 74 61 6e 64 61 72 |led. The| standar|
|00000480| 64 20 6d 65 74 68 6f 64 | 20 6f 6e 6c 79 20 72 65 |d method| only re|
|00000490| 67 69 73 74 65 72 73 20 | 74 68 65 20 72 65 71 75 |gisters |the requ|
|000004a0| 69 72 65 64 20 63 6c 61 | 73 73 65 73 2e 0d 0d 43 |ired cla|sses...C|
|000004b0| 6c 61 73 73 20 49 44 27 | 73 20 61 72 65 20 66 6f |lass ID'|s are fo|
|000004c0| 75 72 2d 63 68 61 72 20 | 63 6f 64 65 73 2e 20 4d |ur-char |codes. M|
|000004d0| 61 63 5a 6f 6f 70 20 72 | 65 73 65 72 76 65 73 20 |acZoop r|eserves |
|000004e0| 61 6c 6c 20 6c 6f 77 65 | 72 2d 63 61 73 65 20 6f |all lowe|r-case o|
|000004f0| 6e 6c 79 20 63 6f 64 65 | 73 20 66 6f 72 20 69 74 |nly code|s for it|
|00000500| 73 65 6c 66 2d 20 66 6f | 72 0d 63 6c 61 73 73 65 |self- fo|r.classe|
|00000510| 73 20 6f 66 20 79 6f 75 | 72 20 6f 77 6e 2c 20 75 |s of you|r own, u|
|00000520| 73 65 20 6f 6e 65 20 6f | 72 20 6d 6f 72 65 20 75 |se one o|r more u|
|00000530| 70 70 65 72 20 63 61 73 | 65 20 6c 65 74 74 65 72 |pper cas|e letter|
|00000540| 73 20 61 6e 64 20 6d 61 | 6b 65 20 73 75 72 65 20 |s and ma|ke sure |
|00000550| 69 74 27 73 20 75 6e 69 | 71 75 65 2e 20 54 68 65 |it's uni|que. The|
|00000560| 20 63 6c 61 73 73 49 44 | 0d 6d 75 73 74 20 62 65 | classID|.must be|
|00000570| 20 61 73 73 69 67 6e 65 | 64 20 69 6e 20 79 6f 75 | assigne|d in you|
|00000580| 72 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 2e 0d 0d |r constr|uctor...|
|00000590| 49 6e 20 61 64 64 69 74 | 69 6f 6e 2c 20 61 6c 6c |In addit|ion, all|
|000005a0| 20 73 74 72 65 61 6d 61 | 62 6c 65 20 63 6c 61 73 | streama|ble clas|
|000005b0| 73 65 73 20 6d 75 73 74 | 20 68 61 76 65 20 61 20 |ses must| have a |
|000005c0| 64 65 66 61 75 6c 74 20 | 63 6f 6e 73 74 72 75 63 |default |construc|
|000005d0| 74 6f 72 2d 20 69 2e 65 | 2e 20 6f 6e 65 20 74 68 |tor- i.e|. one th|
|000005e0| 61 74 20 68 61 73 20 6e | 6f 0d 70 61 72 61 6d 65 |at has n|o.parame|
|000005f0| 74 65 72 73 2e 20 59 6f | 75 20 6d 75 73 74 20 61 |ters. Yo|u must a|
|00000600| 6c 73 6f 20 77 72 69 74 | 65 20 61 20 43 4f 4e 53 |lso writ|e a CONS|
|00000610| 54 52 55 43 54 49 4f 4e | 20 46 55 4e 43 54 49 4f |TRUCTION| FUNCTIO|
|00000620| 4e 2c 20 77 68 69 63 68 | 20 6a 75 73 74 20 6d 61 |N, which| just ma|
|00000630| 6b 65 73 20 61 6e 20 6f | 62 6a 65 63 74 20 6f 66 |kes an o|bject of|
|00000640| 20 74 68 65 0d 64 65 63 | 6c 61 72 65 64 20 74 79 | the.dec|lared ty|
|00000650| 70 65 20 75 73 69 6e 67 | 20 74 68 65 20 64 65 66 |pe using| the def|
|00000660| 61 75 6c 74 20 63 6f 6e | 73 74 72 75 63 74 6f 72 |ault con|structor|
|00000670| 2e 20 54 68 69 73 20 67 | 6f 65 73 20 6c 69 6b 65 |. This g|oes like|
|00000680| 20 74 68 69 73 3a 0d 0d | 5a 4f 62 6a 65 63 74 2a | this:..|ZObject*|
|00000690| 09 4d 79 43 6f 6e 73 74 | 72 75 63 74 6f 72 46 75 |.MyConst|ructorFu|
|000006a0| 6e 63 74 69 6f 6e 28 29 | 0d 7b 0d 09 72 65 74 75 |nction()|.{..retu|
|000006b0| 72 6e 20 6e 65 77 20 4d | 79 43 6c 61 73 73 28 29 |rn new M|yClass()|
|000006c0| 3b 0d 7d 0d 0d 54 68 65 | 20 66 75 6e 63 74 69 6f |;.}..The| functio|
|000006d0| 6e 20 69 73 20 70 61 73 | 73 65 64 20 74 6f 20 5a |n is pas|sed to Z|
|000006e0| 43 6c 61 73 73 52 65 67 | 69 73 74 72 79 27 73 20 |ClassReg|istry's |
|000006f0| 52 65 67 69 73 74 65 72 | 43 6c 61 73 73 28 29 20 |Register|Class() |
|00000700| 6d 65 74 68 6f 64 2c 20 | 61 6c 6f 6e 67 20 77 69 |method, |along wi|
|00000710| 74 68 20 74 68 65 20 63 | 6c 61 73 73 49 44 20 61 |th the c|lassID a|
|00000720| 6e 64 0d 63 6c 61 73 73 | 20 6e 61 6d 65 2e 0d 0d |nd.class| name...|
|00000730| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 61 |The foll|owing ma|
|00000740| 63 72 6f 73 20 61 72 65 | 20 70 72 6f 76 69 64 65 |cros are| provide|
|00000750| 64 20 74 6f 20 6d 61 6b | 65 20 61 6c 6c 20 74 68 |d to mak|e all th|
|00000760| 69 73 20 73 65 74 75 70 | 20 6d 75 63 68 20 65 61 |is setup| much ea|
|00000770| 73 69 65 72 2e 20 54 68 | 65 79 20 65 78 70 61 6e |sier. Th|ey expan|
|00000780| 64 20 74 6f 20 74 68 65 | 20 70 72 6f 70 65 72 0d |d to the| proper.|
|00000790| 63 6c 61 73 73 20 49 44 | 20 61 6e 64 20 63 6f 6e |class ID| and con|
|000007a0| 73 74 72 75 63 74 6f 72 | 20 66 75 6e 63 74 69 6f |structor| functio|
|000007b0| 6e 20 64 65 66 65 69 6e | 69 74 69 6f 6e 73 20 73 |n defein|itions s|
|000007c0| 6f 20 79 6f 75 20 63 61 | 6e 20 73 69 6d 70 6c 79 |o you ca|n simply|
|000007d0| 20 64 65 70 6c 6f 79 20 | 74 68 65 6d 20 69 6e 20 | deploy |them in |
|000007e0| 79 6f 75 72 20 63 6c 61 | 73 73 65 73 20 61 6e 64 |your cla|sses and|
|000007f0| 0d 66 6f 72 67 65 74 20 | 61 62 6f 75 74 20 27 65 |.forget |about 'e|
|00000800| 6d 2e 0d 0d 2a 2f 0d 0d | 2f 2f 20 54 68 69 73 20 |m...*/..|// This |
|00000810| 68 61 6e 64 79 20 6d 61 | 63 72 6f 20 73 61 76 65 |handy ma|cro save|
|00000820| 73 20 79 6f 75 20 68 61 | 76 69 6e 67 20 74 6f 20 |s you ha|ving to |
|00000830| 64 6f 20 6d 75 63 68 20 | 77 6f 72 6b 20 74 6f 20 |do much |work to |
|00000840| 63 72 65 61 74 65 20 79 | 6f 75 20 63 6c 61 73 73 |create y|ou class|
|00000850| 20 63 6f 6e 73 74 72 75 | 63 74 6f 72 20 66 75 6e | constru|ctor fun|
|00000860| 63 74 69 6f 6e 73 2e 20 | 41 6c 6c 0d 2f 2f 20 79 |ctions. |All.// y|
|00000870| 6f 75 20 68 61 76 65 20 | 74 6f 20 64 6f 20 69 73 |ou have |to do is|
|00000880| 20 70 75 74 20 74 68 69 | 73 20 61 74 20 74 68 65 | put thi|s at the|
|00000890| 20 74 6f 70 20 6f 66 20 | 79 6f 75 72 20 2e 63 70 | top of |your .cp|
|000008a0| 70 20 66 69 6c 65 20 77 | 68 65 72 65 20 79 6f 75 |p file w|here you|
|000008b0| 20 77 61 6e 74 20 61 20 | 63 6f 6e 73 74 72 75 63 | want a |construc|
|000008c0| 74 6f 72 20 66 75 6e 63 | 74 69 6f 6e 2c 0d 2f 2f |tor func|tion,.//|
|000008d0| 20 70 61 73 73 69 6e 67 | 20 74 68 65 20 63 6c 61 | passing| the cla|
|000008e0| 73 73 20 6e 61 6d 65 2e | 20 54 68 69 73 20 77 69 |ss name.| This wi|
|000008f0| 6c 6c 20 62 65 20 65 78 | 70 61 6e 64 65 64 20 69 |ll be ex|panded i|
|00000900| 6e 74 6f 20 61 20 63 6f | 6e 73 74 72 75 63 74 6f |nto a co|nstructo|
|00000910| 72 20 66 75 6e 63 74 69 | 6f 6e 20 6f 66 20 74 68 |r functi|on of th|
|00000920| 65 20 63 6f 72 72 65 63 | 74 20 74 79 70 65 2e 0d |e correc|t type..|
|00000930| 2f 2f 20 69 2e 65 2e 20 | 43 4c 41 53 53 43 4f 4e |// i.e. |CLASSCON|
|00000940| 53 54 52 55 43 54 4f 52 | 28 20 5a 57 69 6e 64 6f |STRUCTOR|( ZWindo|
|00000950| 77 20 29 3b 20 2d 3e 20 | 5a 4f 62 6a 65 63 74 2a |w ); -> |ZObject*|
|00000960| 20 43 46 5f 5a 57 69 6e | 64 6f 77 28 29 20 7b 20 | CF_ZWin|dow() { |
|00000970| 72 65 74 75 72 6e 20 6e | 65 77 20 5a 57 69 6e 64 |return n|ew ZWind|
|00000980| 6f 77 28 29 3b 20 7d 3b | 0d 0d 23 64 65 66 69 6e |ow(); };|..#defin|
|00000990| 65 09 09 43 4c 41 53 53 | 43 4f 4e 53 54 52 55 43 |e..CLASS|CONSTRUC|
|000009a0| 54 4f 52 28 20 78 20 29 | 09 09 5a 4f 62 6a 65 63 |TOR( x )|..ZObjec|
|000009b0| 74 2a 09 43 46 5f 23 23 | 78 23 23 28 29 20 7b 20 |t*.CF_##|x##() { |
|000009c0| 72 65 74 75 72 6e 20 6e | 65 77 20 78 28 29 3b 20 |return n|ew x(); |
|000009d0| 7d 0d 0d 2f 2f 20 74 6f | 20 70 6c 61 63 65 20 61 |}..// to| place a|
|000009e0| 20 70 72 6f 74 6f 74 79 | 70 65 20 66 6f 72 20 74 | prototy|pe for t|
|000009f0| 68 65 20 63 6f 6e 73 74 | 72 75 63 74 6f 72 20 66 |he const|ructor f|
|00000a00| 75 6e 63 74 69 6f 6e 2c | 20 75 73 65 20 74 68 69 |unction,| use thi|
|00000a10| 73 2e 20 4e 4f 74 65 20 | 74 68 61 74 20 6e 6f 72 |s. NOte |that nor|
|00000a20| 6d 61 6c 6c 79 20 74 68 | 69 73 20 69 73 20 75 6e |mally th|is is un|
|00000a30| 6e 65 63 65 73 73 61 72 | 79 0d 2f 2f 20 73 69 6e |necessar|y.// sin|
|00000a40| 63 65 20 74 68 65 20 44 | 45 46 49 4e 45 43 4c 41 |ce the D|EFINECLA|
|00000a50| 53 53 49 44 20 77 69 6c | 6c 20 61 6c 73 6f 20 64 |SSID wil|l also d|
|00000a60| 6f 20 74 68 69 73 20 66 | 6f 72 20 79 6f 75 20 69 |o this f|or you i|
|00000a70| 6e 20 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |n the ap|propriat|
|00000a80| 65 20 70 6c 61 63 65 2e | 0d 0d 23 64 65 66 69 6e |e place.|..#defin|
|00000a90| 65 09 09 43 4c 41 53 53 | 43 46 50 52 4f 54 4f 54 |e..CLASS|CFPROTOT|
|00000aa0| 59 50 45 28 20 78 20 29 | 09 09 5a 4f 62 6a 65 63 |YPE( x )|..ZObjec|
|00000ab0| 74 2a 09 43 46 5f 23 23 | 78 23 23 28 29 0d 0d 2f |t*.CF_##|x##()../|
|00000ac0| 2f 20 74 6f 20 65 73 74 | 61 62 6c 69 73 68 20 74 |/ to est|ablish t|
|00000ad0| 68 65 20 70 72 6f 70 65 | 72 20 63 6c 61 73 73 20 |he prope|r class |
|00000ae0| 49 44 20 69 64 65 6e 74 | 69 66 69 65 72 20 66 6f |ID ident|ifier fo|
|00000af0| 72 20 79 6f 75 72 20 63 | 6c 61 73 73 2c 20 70 75 |r your c|lass, pu|
|00000b00| 74 20 74 68 69 73 20 69 | 6e 20 79 6f 75 72 20 63 |t this i|n your c|
|00000b10| 6c 61 73 73 20 68 65 61 | 64 65 72 3a 0d 2f 2f 20 |lass hea|der:.// |
|00000b20| 78 20 69 73 20 74 68 65 | 20 63 6c 61 73 73 20 69 |x is the| class i|
|00000b30| 64 65 6e 74 69 66 69 65 | 72 2c 20 65 2e 67 2e 20 |dentifie|r, e.g. |
|00000b40| 5a 57 69 6e 64 6f 77 2c | 20 69 64 20 69 73 20 74 |ZWindow,| id is t|
|00000b50| 68 65 20 64 65 73 69 72 | 65 64 20 49 44 2c 20 65 |he desir|ed ID, e|
|00000b60| 2e 67 2e 20 27 7a 77 69 | 6e 27 2e 0d 0d 23 64 65 |.g. 'zwi|n'...#de|
|00000b70| 66 69 6e 65 09 09 44 45 | 46 49 4e 45 43 4c 41 53 |fine..DE|FINECLAS|
|00000b80| 53 49 44 28 20 78 2c 20 | 69 64 20 29 09 09 65 6e |SID( x, |id )..en|
|00000b90| 75 6d 20 7b 09 43 4c 41 | 53 53 5f 23 23 78 20 3d |um {.CLA|SS_##x =|
|00000ba0| 20 69 64 20 7d 3b 20 43 | 4c 41 53 53 43 46 50 52 | id }; C|LASSCFPR|
|00000bb0| 4f 54 4f 54 59 50 45 28 | 20 78 20 29 0d 0d 2f 2f |OTOTYPE(| x )..//|
|00000bc0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 74 68 | to dete|rmine th|
|00000bd0| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 20 63 6f |e name o|f the co|
|00000be0| 6e 73 74 72 75 63 74 6f | 72 20 66 75 6e 63 74 69 |nstructo|r functi|
|00000bf0| 6f 6e 20 66 72 6f 6d 20 | 79 6f 75 72 20 63 6c 61 |on from |your cla|
|00000c00| 73 73 20 69 64 65 6e 74 | 69 66 69 65 72 2c 20 75 |ss ident|ifier, u|
|00000c10| 73 65 3a 0d 0d 23 64 65 | 66 69 6e 65 09 09 43 4f |se:..#de|fine..CO|
|00000c20| 4e 53 54 52 55 43 54 4f | 52 46 55 4e 43 54 49 4f |NSTRUCTO|RFUNCTIO|
|00000c30| 4e 28 20 78 20 29 09 43 | 46 5f 23 23 78 0d 0d 2f |N( x ).C|F_##x../|
|00000c40| 2f 20 74 6f 20 6d 61 6b | 65 20 61 20 72 65 61 64 |/ to mak|e a read|
|00000c50| 61 62 6c 65 20 70 61 73 | 63 61 6c 20 73 74 79 6c |able pas|cal styl|
|00000c60| 65 20 63 6c 61 73 73 20 | 6e 61 6d 65 20 66 6f 72 |e class |name for|
|00000c70| 20 79 6f 75 72 20 63 6c | 61 73 73 3a 0d 0d 23 64 | your cl|ass:..#d|
|00000c80| 65 66 69 6e 65 09 09 43 | 4c 41 53 53 4e 41 4d 45 |efine..C|LASSNAME|
|00000c90| 28 20 78 20 29 09 43 4c | 49 54 45 52 41 4c 28 20 |( x ).CL|ITERAL( |
|00000ca0| 5c 70 23 23 78 20 29 0d | 0d 2f 2f 20 68 61 6e 64 |\p##x ).|.// hand|
|00000cb0| 79 20 77 61 79 20 74 6f | 20 67 65 74 20 79 6f 75 |y way to| get you|
|00000cc0| 72 20 63 6c 61 73 73 20 | 49 44 20 66 72 6f 6d 20 |r class |ID from |
|00000cd0| 79 6f 75 72 20 63 6c 61 | 73 73 20 6e 61 6d 65 0d |your cla|ss name.|
|00000ce0| 0d 23 64 65 66 69 6e 65 | 09 09 43 4c 41 53 53 49 |.#define|..CLASSI|
|00000cf0| 44 28 20 78 20 29 09 43 | 4c 41 53 53 5f 23 23 78 |D( x ).C|LASS_##x|
|00000d00| 0d 0d 0d 2f 2f 20 53 6f | 20 77 68 65 6e 20 72 65 |...// So| when re|
|00000d10| 67 69 73 74 65 72 69 6e | 67 20 61 20 63 6c 61 73 |gisterin|g a clas|
|00000d20| 73 2c 20 79 6f 75 20 6e | 65 65 64 20 6f 6e 6c 79 |s, you n|eed only|
|00000d30| 20 64 6f 3a 0d 2f 2f 20 | 67 43 6c 61 73 73 65 73 | do:.// |gClasses|
|00000d40| 2d 3e 52 65 67 69 73 74 | 65 72 43 6c 61 73 73 28 |->Regist|erClass(|
|00000d50| 20 43 4c 41 53 53 49 44 | 28 20 5a 57 69 6e 64 6f | CLASSID|( ZWindo|
|00000d60| 77 20 29 2c 20 43 4f 4e | 53 54 52 55 43 54 4f 52 |w ), CON|STRUCTOR|
|00000d70| 46 55 4e 43 54 49 4f 4e | 28 20 5a 57 69 6e 64 6f |FUNCTION|( ZWindo|
|00000d80| 77 20 29 2c 20 43 4c 41 | 53 53 4e 41 4d 45 28 20 |w ), CLA|SSNAME( |
|00000d90| 5a 57 69 6e 64 6f 77 20 | 29 29 3b 0d 0d 2f 2f 20 |ZWindow |));..// |
|00000da0| 65 76 65 6e 20 62 65 74 | 74 65 72 2c 20 5a 43 6c |even bet|ter, ZCl|
|00000db0| 61 73 73 52 65 67 69 73 | 74 72 79 20 68 61 73 20 |assRegis|try has |
|00000dc0| 61 20 6d 61 63 72 6f 20 | 74 68 61 74 20 65 78 70 |a macro |that exp|
|00000dd0| 61 6e 64 73 20 74 6f 20 | 74 68 69 73 20 66 72 6f |ands to |this fro|
|00000de0| 6d 20 61 20 73 69 6e 67 | 6c 65 20 63 6c 61 73 73 |m a sing|le class|
|00000df0| 20 69 64 65 6e 74 69 66 | 69 65 72 3a 0d 2f 2f 20 | identif|ier:.// |
|00000e00| 65 2e 67 2e 20 52 45 47 | 49 53 54 45 52 43 4c 41 |e.g. REG|ISTERCLA|
|00000e10| 53 53 28 20 5a 57 69 6e | 64 6f 77 20 29 3b 0d 0d |SS( ZWin|dow );..|
|00000e20| 0d 0d 44 45 46 49 4e 45 | 43 4c 41 53 53 49 44 28 |..DEFINE|CLASSID(|
|00000e30| 20 5a 4f 62 6a 65 63 74 | 2c 20 27 7a 6f 62 6a 27 | ZObject|, 'zobj'|
|00000e40| 20 29 3b 0d 0d 2f 2f 20 | 63 6c 61 73 73 20 64 65 | );..// |class de|
|00000e50| 66 69 6e 69 74 69 6f 6e | 3a 0d 0d 63 6c 61 73 73 |finition|:..class|
|00000e60| 09 5a 4f 62 6a 65 63 74 | 0d 7b 0d 70 72 6f 74 65 |.ZObject|.{.prote|
|00000e70| 63 74 65 64 3a 0d 09 4f | 53 54 79 70 65 09 09 63 |cted:..O|SType..c|
|00000e80| 6c 61 73 73 49 44 3b 09 | 09 09 09 09 09 09 2f 2f |lassID;.|......//|
|00000e90| 20 63 6c 61 73 73 20 49 | 44 20 6f 66 20 6f 62 6a | class I|D of obj|
|00000ea0| 65 63 74 2d 20 73 75 62 | 63 6c 61 73 73 65 73 20 |ect- sub|classes |
|00000eb0| 6d 75 73 74 20 73 65 74 | 20 74 68 69 73 0d 09 6c |must set| this..l|
|00000ec0| 6f 6e 67 09 09 69 6e 73 | 74 61 6e 63 65 49 44 3b |ong..ins|tanceID;|
|00000ed0| 09 09 09 09 09 09 09 2f | 2f 20 69 6e 73 74 61 6e |......./|/ instan|
|00000ee0| 63 65 20 49 44 2d 20 6e | 6f 74 20 79 65 74 20 75 |ce ID- n|ot yet u|
|00000ef0| 73 65 64 2e 20 52 65 73 | 65 72 76 65 64 2e 0d 09 |sed. Res|erved...|
|00000f00| 0d 70 75 62 6c 69 63 3a | 0d 09 5a 4f 62 6a 65 63 |.public:|..ZObjec|
|00000f10| 74 28 29 20 7b 20 63 6c | 61 73 73 49 44 20 3d 20 |t() { cl|assID = |
|00000f20| 43 4c 41 53 53 5f 5a 4f | 62 6a 65 63 74 3b 20 69 |CLASS_ZO|bject; i|
|00000f30| 6e 73 74 61 6e 63 65 49 | 44 20 3d 20 30 3b 20 7d |nstanceI|D = 0; }|
|00000f40| 3b 0d 09 76 69 72 74 75 | 61 6c 20 7e 5a 4f 62 6a |;..virtu|al ~ZObj|
|00000f50| 65 63 74 28 29 7b 7d 3b | 0d 09 0d 2f 2f 20 69 6e |ect(){};|...// in|
|00000f60| 66 6f 3a 0d 09 76 6f 69 | 64 09 47 65 74 43 6c 61 |fo:..voi|d.GetCla|
|00000f70| 73 73 4e 61 6d 65 28 20 | 53 74 72 32 35 35 20 61 |ssName( |Str255 a|
|00000f80| 4e 61 6d 65 20 29 3b 0d | 09 6c 6f 6e 67 09 47 65 |Name );.|.long.Ge|
|00000f90| 74 43 6c 61 73 73 52 65 | 66 28 29 20 7b 20 72 65 |tClassRe|f() { re|
|00000fa0| 74 75 72 6e 20 63 6c 61 | 73 73 49 44 3b 20 7d 3b |turn cla|ssID; };|
|00000fb0| 0d 09 6c 6f 6e 67 09 47 | 65 74 49 6e 73 74 61 6e |..long.G|etInstan|
|00000fc0| 63 65 49 44 28 29 20 7b | 20 72 65 74 75 72 6e 20 |ceID() {| return |
|00000fd0| 69 6e 73 74 61 6e 63 65 | 49 44 3b 20 7d 3b 0d 09 |instance|ID; };..|
|00000fe0| 76 6f 69 64 09 53 65 74 | 43 6c 61 73 73 49 44 28 |void.Set|ClassID(|
|00000ff0| 20 4f 53 54 79 70 65 20 | 69 64 20 29 20 7b 20 63 | OSType |id ) { c|
|00001000| 6c 61 73 73 49 44 20 3d | 20 69 64 3b 20 7d 3b 0d |lassID =| id; };.|
|00001010| 09 0d 2f 2f 20 73 74 72 | 65 61 6d 69 6e 67 3a 0d |..// str|eaming:.|
|00001020| 09 76 69 72 74 75 61 6c | 20 76 6f 69 64 09 52 65 |.virtual| void.Re|
|00001030| 61 64 46 72 6f 6d 53 74 | 72 65 61 6d 28 20 5a 53 |adFromSt|ream( ZS|
|00001040| 74 72 65 61 6d 2a 20 61 | 53 74 72 65 61 6d 20 29 |tream* a|Stream )|
|00001050| 20 7b 7d 3b 0d 09 76 69 | 72 74 75 61 6c 20 76 6f | {};..vi|rtual vo|
|00001060| 69 64 09 57 72 69 74 65 | 54 6f 53 74 72 65 61 6d |id.Write|ToStream|
|00001070| 28 20 5a 53 74 72 65 61 | 6d 2a 20 61 53 74 72 65 |( ZStrea|m* aStre|
|00001080| 61 6d 20 29 20 7b 7d 3b | 0d 7d 3b 0d 0d 0d 0d 65 |am ) {};|.};....e|
|00001090| 78 74 65 72 6e 20 5a 43 | 6c 61 73 73 52 65 67 69 |xtern ZC|lassRegi|
|000010a0| 73 74 72 79 2a 09 67 43 | 6c 61 73 73 65 73 3b 0d |stry*.gC|lasses;.|
|000010b0| 0d 0d 0d 23 65 6e 64 69 | 66 0d 00 00 00 00 00 00 |...#endi|f.......|
|000010c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000010f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001100| 00 00 01 00 00 00 01 5a | 00 00 00 5a 00 00 00 52 |.......Z|...Z...R|
|00001110| 00 01 00 00 2e 00 00 00 | 00 00 00 00 44 00 00 00 |........|....D...|
|00001120| 0e 54 45 58 54 43 57 49 | 45 00 00 00 00 04 00 00 |.TEXTCWI|E.......|
|00001130| 09 5a 4f 62 6a 65 63 74 | 2e 68 02 00 00 00 50 61 |.ZObject|.h....Pa|
|00001140| 72 74 53 49 54 21 00 00 | 00 00 00 00 00 00 00 01 |rtSIT!..|........|
|00001150| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001170| 00 00 b3 41 d6 35 00 00 | 00 00 00 00 01 ac 00 00 |...A.5..|........|
|00001180| 45 00 00 00 0e 54 45 58 | 54 43 57 49 45 00 00 00 |E....TEX|TCWIE...|
|00001190| 00 04 00 00 00 ad af a5 | c1 ad af a5 c1 00 00 00 |........|........|
|000011a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011b0| 00 00 00 00 00 00 00 00 | 28 00 00 00 8c 00 00 00 |........|(.......|
|000011c0| 03 10 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 01 00 00 30 00 00 00 |........|....0...|
|000011e0| 00 00 00 00 46 00 00 00 | 02 54 45 58 54 43 57 49 |....F...|.TEXTCWI|
|000011f0| 45 01 00 00 00 04 00 00 | 00 b1 2a e7 a2 b1 2a e7 |E.......|..*...*.|
|00001200| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001220| 00 00 00 00 00 00 00 02 | 00 04 00 38 00 30 02 5f |........|...8.0._|
|00001230| 02 b0 00 38 00 30 02 5f | 02 b0 b2 f9 c3 09 00 00 |...8.0._|........|
|00001240| 0e d8 00 00 0e d8 00 00 | 0c 29 01 00 00 00 00 02 |........|.)......|
|00001250| 00 00 00 00 00 04 00 01 | 00 01 00 00 01 00 00 00 |........|........|
|00001260| 01 5a 00 00 00 5a 00 00 | 00 52 03 c2 82 dc 3b 20 |.Z...Z..|.R....; |
|00001270| 00 00 00 1c 00 52 00 01 | 4d 50 53 52 00 01 00 12 |.....R..|MPSR....|
|00001280| 4d 57 42 42 00 00 00 2a | 03 ed ff ff 00 00 00 00 |MWBB...*|........|
|00001290| 00 00 00 00 03 ef ff ff | 00 00 00 4c 00 00 00 00 |........|...L....|
|000012a0| 03 f0 ff ff 00 00 00 52 | 00 00 00 00 00 00 00 00 |.......R|........|
|000012b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+