-not a Macintosh disk-F"GDPaPGDPa%a%vaBH@%#0oKANF,  8!"@$|Gn"`I N.@A,H<( F<B<H111Bx<kNNF`, 8! "NH@"|J(g g`LNu"_ |a||a0@||9݁g|w|a||NH瀀 |(_@"g2<@gBA?N`Fa`||aPLNu  fBR$N"NBH@&|݁ |B$<0HN~NL@dBgg>N&|)`RNuBBBA*2h/ BBB N _"_$_"H&|݁ |B$<0NNd 0<`L$|J HA H  2I<FFI<<FFfHHFFfHHH?B@L"_2N _0H 2<@I6@o Az:<2`6@oJA~:<26" @n2BDBB(`EB@nAJEkz`z2<HAIL0.NL0.N  / p? O@ 0  0  XO _,_2_!.NBBB/ BBBN08 @ gNu@ f"_E!NH\O/ ?`@&x|N _!@"|xEx En"`CE"|xN"Ҹ< A  33"|@E E4n"`C&E"|@.N _LHNFLN*8&E@CJJKK f`  f `><$CS*<F|4>BRIBC Gff&<CBSC`D GnKG45BQf` f `Ns |0< BXHQ!4 _$_"_!XOHH/8/ $ f0<? QN ! N.x $_$ g ! N.x !C !!LLyp!N\OFN  l0P߀ Aǀ`  6lo6@ 0_an*>]> j 56, l602  ۰Poo A` &ll6p@ 0?۷a?^ ꭕ 5o6, l602 8!ED91kE"0369? CoNGNOS BOOT FAILED TRY A NEWER MACHINE AND BOOT PROM _"_NN o0<BAN o0 _PON _"_$|0<J"PJQN _"_$|0<"PJQNHL$ orD?|?@?e\SFk!!QSWk:CL<HL|hH>L|4H>L|H>SWjTO>SGk\!Q`TSFk QSWk8L|H|L|H|4L|H|hL|H|LSGkQLx _O NNVH8=| f=|G* G, &N(N n"n$n 0.  S@ZeJ S@BBDBG S@gg.BC CJDg720faL`fa:` 320f8<S@`JDg  fa$` fa`  U@o$SBjt`(N&N><`JGg (Ev#$#$QNukJDg`g 3$f(N`BnLN^ _NUNPACK NV;n N^.NuEVINIT NVH,. ^J]g n0`4B?N. f n0`/.//. /.N(n)FLN^ _NEAD_BLONV/ (n Jno./.?././ /.Nj nJPg`RSn`(_N^ _NEAD_SEQHNT"|E.|r |BBByBygRBf~NuLHPPNqNqpS_n.0<QLHPPNqNqpS_n|~By&JM*Np|azJGfb|a|,Mpa`JGfH|a<<AaJGf0Avtp BQvr BQH@02N\LhL"4NtB@6Kd a"JDf`02IP g a JDf`Nub SBg pxNuBDNu><Nu4< vB@bp2IPSCfSBfNuppB@(4<dBC(4< CBC(C"H4<BACSBf(CAg><NuJoNV?-Nh.H|)?NpN^ _TONRAP NV.HgVS@g`J.f& -XмS//<N(/<N+_X-mX . ѭX -Xo<Np`B . TJ.f/-T/<N/<N+_T-mT -Tl<N,N^ _PONGETSPACNV .мS//<N/<NJ-_ .=@ N^.NuINDSPARNVH.. Bg/N0Hހ m0.@I/./<N( 8//<N @n ?.Bg?<BgN(LN^ _ NETMMU NV0. S@g S@gS@g`=|`=|` =|`BnN^ _\ONONV_DEVNVH nCJp"S@n2BgHnNE g BgNN=_   nV@g8B. Bmh|` @BvRF Fo mXf=|;|@`Bm@`|BgN;_hBgN> Ggd G] G^g$ GdfBgN;_@BgN>`<ND`.BgN8JD] D^g<N$ @=BgN>`|`.H@ABpR. .oBg?./N;_"Bg?./Nz;_,Bg?./Nj;_.Bg?./NZ;_0-| nBPLN^.NuEAD_CONNVH nCJp"S@n~`LH6p@J@^H6pA A_gH6p@H"AA1`H @ABpR o;nh0.H@;@@A r<Ё(@&|H@6LN^.NuROCESS_NVLH nCJp"S@n2BgHnNAx/NAx/HndNJndV nxVgB-e`|e  gHnxNA&HA(AL,*<Hnf?-Z E0-NPH///NJnfg<N(A(H/ HndN.JndV TVg B-fmeg`l-eg*0.zlW"-BWD@f-f @g` B-g -Bf|f/ N`B-f  -e -fg/ NLN^.NuNIT_CONNVH+| \+|l+|(|+|t+|+|l+|(|;TN(|;TZ(|;TX&| n!SLN^.NuETVARS NVH/Nt;| ./+@ .м/м+@+|X*<(< E"D +@T&|?-Z0-NS?NHnHmBNJngp+@BAC6 0HnNBBg/-BgN+_ -Э+@PBB<0<H/BgNZN<+_H+mHBG` m @I G~V GTVgd Gl|p@ @8`$ Gf|p@BT`| p@BT H< @"@=A?.??<BgNJRG Gox mI|p@BT mIP|p@/-H/<N 8LN^NuOOTINIT system.configNVH(nB BgN@BgN8HH,BgNp0HѬ f,/, NBgNBgNHH,BgN>0HѬ f,/, NZBgNBgNHH,BgN 0HѬ f:J`f< N/, NBgNBgNHH,BgN0HѬ g<NHBN,BN+_ n/BN  _r Ё0p//-XN /-/-XN&mX:=E E0o<N0<H+@d+| -dЭ\ n2HҀ -Ё"-Ҁ(Bg Э/N0Hѭ -Є+@B</-BgN+_+m` -\Э`+@h -dЭh, n0HІ+@ -Э+@ -Э+@?<f/-/-?<N^-m/ /./-N n LN^ _ NUILD_SYNVH(nBGBF. gB `P-n n0. PoB."` n0. A-H&n/+/<N&  n0>+<+/, N$BgNBgNHH-@BgN0H(٬ JVJ_gB."`4JGW WJGV WgJFf n `H n n/B."n/BgN.  _ BN-_JGf n Q/ n P/N` Q@H/ n P/N|B. n=h-nA-H n-P/./.p/NJGgR-m`Bg n/( n r Ё/ n P/ nP/ | ? Q@?N9_Jlg< N( nQ f|"LN^ _NOADSEG NV/ BBg/-lBgN+_p -p"-Ҁ+Al(|`p}//<N -Пp((|p}//<N -Пp(?<}/-p/-l?<N(_N^.NuLLOC_SCNVHAC 0BgHnN __m_^+m-^gBBg/-BgNX+_`+m-_gBBg/<BgN4 м,BgBgBHnBgHnHnBg/.N g<NACD 0BgHnN p g B-n`.BgBgBHnBgHnHnBg/.N g<Nn .@+@n -Эn+@j` B -@+@n -м@+@j?</-n/-j?<NH <逐n.JfB` .ЇP-@JfB` .ЇP-@-_g -Ї/ -Ї//./.N\`/-/-BBNJ(|p((|t(LN^.NuOAD_DEB SYSTEM.DEBUG2 SYSTEM.DEBUGNVH nCJp"S@n2&n (nBBgHnN gZB /, N BgN FBgN >HH(BgN v0H* f&.B</BgN&B /, N ~//N LN^ _ NOAD_UNPNVBgBgBHn</. /.Bg/.N g<NN^ _ NOAD_LLDNVH(n 0-F|>Jg,, .* Ю(H//<N ( Д-@`,.(.H//<N p-_?//?<N6 .P/N LN^ _NNSTALL_NVH(n=n ~`/, N dBgN _BgN HH(BgN 0H-@Jg .Ѭ `<N .fBN 4(BN ,( GfAqB0pB5pB`ACZ 0z`BgN f_ .ARE EoHn?<?<HnN AC 0HnHzNdg(AqB0pp @A^B @AB`2HnHzN,gAqB0pB5pB`Aqpp| 5pgnBg?/.Hn @AHp @A^Hp</.Nd g<NN?. @A^/0 @A"0Ҽ/?<NPRGinoLLN^ _ NOADCODEkrni NVBBg/-BgN +_?<e/-/-?<NN^.NuAKESUPSNVH(m . R A T&@-kLN^ _ NINDMAINNVBg/-|NN0Hѭ|B</-|BgN+_?<g/-/-|?<NdBg/-tN0HѭtB</-tBgNF+_x?<{/-x/-t?<N*N^.NuREATEOPNV/Jmho@ mFhomFh0-hH.//<N .0<AHЭX"-ToT.N^.NuONFIG_DNV A0C ArC 0AC 0/NHnHm`/NBgHn0N g< N0HnHn/NfBgHnrN g<N/NBg/.Hn$/N;_F/./.Hm`/Nh-MgN/.$?-F/N/N n /B/.$0-FH//N  _ /N&/NN^ _PONOADSYS $ SYSTEM.UNPACK SYSTEM.OS SYSTEM.LLDN NV,_NUTN z+|T mT PVD@MN0HmHmNHm?- -tЭx//-NNިNRN]N (NuN^NuOADER NVHAT(HA<&HHn?-0-H".Ҁ// / N Jng<NLN^.NuEAD_PAGNV0.H H"-"Ҁ-A0.H H@J@=@/.NvAT0.HЈ-@ N^ _TONIND_SENNVH n-h .S/0-H/N ;@8-n p+@4;m:BF` ATIBBlRF Fo=mA-HA<-HBE n0-HА(BnJf<NHn?-0-HЄ//./.NJng<NxBGA0.HЈ&@Bn=knnZ Eo<NJ ATI ( 9s Jlf<N0,n0.ްm8o`RERG`(-L`HLN^.NuPEN_FILNVH(n| @=@~`84p@k|nAP2IDA0 <f 4pAFRGinoLN^.NuHIFTNAMNVH(n @:JEnBn`pp4A4P@R@H. Eo U@<`BFJFo$ R@4A T@4BRBHށSF`Jl D./0.H/N =@LN^ _\ONDHASH NV~H n CJp"S@n2BA&/Nb 8<-HnNBgHn?-N>H/p6/NNBp6/A/NdACp S@n0HnN^J.gHHnHnN .Wgz n/B?.N~  _ `SFRGmfBGBNJFfELN^ _PONOOKUP_ENVH;n ;m?.?-N;nBNAT(HJg<N;l~+l";l ;l;l;lB?,N&_+S&+k*+k.LN^.NuNITMEDINVBg/.HnNr_n .gB/.N-_N^.NuPENINPUNVH(.BGBF Go<N AT:0JEf<N EHl@ ATH"Ұ n n Jf<NHH " n ``RGE`LN^ _ NIND_POSNV-m4/.0-H/N+_4J4]2-8H4]g<N&0-H/-4/Nl .;@: -4g/-4HnHnN/.NN^.NuILLBUF NV0-:mf -4R2-H//NNT0-:ATpRm:N^NuETBYTE NVHBgNHH<BgNH>JGl H м> G=@LN^NuETWORD NVHBgN0H//<N~,BgN0H.Jl޼ Ї-@LN^NuETLONG NVH,. 0-m:>HǼl>JGo0-:ATA//.H/N$H߮Hǜm:0-HnJ4]2-8H4]g<N -4R/HnHnNn-nA<(H/0-H/N*l-EJoZHn?-0-H".Ҁ/?././ NJng<N0-H/./NV(ٮ .Ѯ .ѭ4`:Jo -4R2-H//N"NhJfLN^ _PONOVEMULT//0/2/ AH@B@2/Ё/@" /WXNu// /"/ N2/A" /WXNu// /"/ N/@" /WXNuH>*jD,jD$&BBx㉰mRSDlJjDjDL|NuH0/ oC"4JBAR`$aJBBB`QQ oC"0/H#//IL._NuH oJB@BA"o JBBBlBA`$HR` fQ`RS@`?A"/oL\NuH o0/2/SA"o JBBA@m`Q/o L NuB`$_02 _ @o0 Ao*BBAm"6@SCBoSA`@"H`RCoN$_0"_ _J/ S@m*BABB@m6B$I”@`!Q`QNuHr`HBA oJ"oJB@f`fQ AA/oL\NuH"o J oJv`:H"o J oJBC`&H o J"oJv`H o J"oJBCB@BA@m4`4`fQ@n C`cC"/oL\NuNuNuJoNu3%pWMacSupplement 1 (Feb 85)&;f/Nt0. @ g0@#g2S@g6U@g:_@W4M*`$kT% kW $&$N/LZ `h\ , L( .8 v! "$#N$ %%>&J'F&(Y )^*_+i,,-./034  9:IJ rootcatalogːHp8*4N$W  obj/PasInit.objh.objhobj/MemTypes.objhs.objhobj/WritelnWindow.obj N@Bg/N%WritelnWindow2.textii6obj/Graf3D.obj"hobjhobj/QuickDraw.obj.obj N@Bg/Nobj/OSTraps.objaps.objj`N^ _PONobj/MacPrint.objht.objh obj/RTLib.obj"hbjh"QuickDraw.texttii6 OsIntf.textxtii6  FixMath.texthii6 ToolIntf.textxtii6PasLibIntf.textii6 obj/PrLink.obj"hobjh MemTypes.textii6 PackIntf.textii6 obj/FixMath.objh.objhQuickDraw2.textii6 MacPrint.textii6obj/PackTraps.objhps.objobj/ToolTraps.objaps.objN^ _PON#Graf3DNotes.texth.texthobj/PrScreen.objhn.objh Graf3D.textthii6obj/OSIntf.objntf.objbj`N^ _PONWritelnWindow.textii6$obj/FixAsm.objAsm.objtextt^ _PON&obj/PasLib.objg<N N^.obj/PasLibIntf.objhntf.objobj/ToolIntf.objntf.objjN^ _PON!obj/PasLibAsm.objhsm.objfix/Notes.textes.text`N^ _PONobj/PackIntf.objhf.objhfix/Notes.textes.text`N^ _PONО4y$;&;%NV n  L FixMath.texthii63%rW&:U0 Z Graf3D.textthii63%sW&:Y&R ` MacPrint.textii63%tW&x :^5s. h. MemTypes.textii63%uW&:a  OsIntf.textxtii64Ay8̥4/NV n F F PackIntf.textii63%wW&:m PasLibIntf.textii63%xW&":f85 QuickDraw.texttii64By|K44/NV n & &QuickDraw2.textii64Cy:y5Y4/NV n  ( ToolIntf.textxtii64Dy)l4q4/NV n T .Tintrfc/WritelnWindow2.textw2.text4y7A7ANV n  EWritelnWindow2.textii63%}W&S:7* obj/OSIntf.objntf.objbj`N^ _PONО4'y88NV n ; ;obj/FixMath.objh.objhΞ3%W&0y۞0~ obj/Graf3D.obj"hobjhΞ3%W&0ڲ0ں obj/MacPrint.objht.objhΞ3%W&6tՠ6t' 'obj/MemTypes.objhs.objhΞ3%W& 砳  obj/OSTraps.objaps.objj`N^ _PONО4(y7L7MENV n  %obj/QuickDraw.obj.obj N@Bg/N4)y55NV n % %obj/PackIntf.objhf.objhΞ3%W&"" Fobj/PackTraps.objhps.objΞ3%W&CC Yobj/PasInit.objh.objhΞ3%W&8a8e ^obj/PasLib.objg<N N^.4y8&8-NV n  _ obj/PasLibAsm.objhsm.objΞ3%W&8k 8 iobj/PasLibIntf.objhntf.objΞ3%W&8v8x obj/PrLink.obj"hobjhΞ3%W&6x&6xS obj/PrScreen.objhn.objhΞ3%W&6zנ6{ obj/ToolIntf.objntf.objjN^ _PONО4*y5+5(NV n O M1 obj/RTLib.obj"hbjhΞ3%W&8)$8]  INLINE $A9FE; FUNCTION UnloadScrap: LONGINT; INLINE $A9FA; FUNCTION ZeroScrap: LONGINT; INLINE $A9FC; {package manager} PROCEDURE InitAllPacks; INLINE $A9E6; PROCEDURE InitPack(packID: INTEGER); INLINE $A9E5; IMPLEMENTATION obj/ToolTraps.objaps.objN^ _PONО4+y5 .5 NV n  4SYSTEMER SYSTEMERSYSTEMER ɁPUTICON PUTICON PUTICON ʁPACK0 PACK0 PACK0 PACK1 PACK1 PACK1 PACK2 PACK2 PACK2 PACK3 PACK3 PACK3 FP68K FP68K FP68K PACK4 PACK4 PACK4 PACK5 PACK5 PACK5 PACK6 PACK6 PACK6 PACK7 PACK7 PACK7 LAUNCH LAUNCH LAUNCH CHAIN CHAIN CHAIN HANDTOHA HANDTOHAHANDTOHA o P"o"?@.NuPTRTOXHA PTRTOXHAPTRTOXHA" "_ _/?@NuPTRTOHAN PTRTOHANPTRTOHAN$ o /?@"o" _ NЁHANDANDH HANDANDHHANDANDH o"o?@ _PONЁPTRANDHA PTRANDHAPTRANDHA" /"o o ?@ _ NЁGETALRTS GETALRTSGETALRTS?x NuRESETALR RESETALRRESETALRBx NuDLGPASTE DLGPASTEDLGPASTEDLGCUT DLGCUT DLGDELETDLGDELETDLGCOPY DLGCOPY :a.Nua`a `a` oJhk"_/(NLNЁ2SETDAFON SETDAFONSETDAFON _1 NЁTESCRAPH TESCRAPHTESCRAPH/x NuTEGETSCR TEGETSCRTEGETSCRB?x Nu TESETSCR TESETSCRTESETSCR1 .Nu TEFROMSC TEFROMSCTEFROMSC*YO/8 /H A@H瀀B/-"mHiHzNBgBgBg?<?<BT"L!R oBN/-NA/NLN^ _NĀWWACTIVAWWSeg WWACTIVAWWACTIVA$2100000WINDOWFOWRITELNWR,QUICKDRApNVHHntN mCA""B`$H A@(p. @g/ W`/ XR o/-/.sLN^ _TONЁhWWADDTEXWWSeg $2000000WWADDTEX$8000000WWNEWLIN$3100000CONTENTFl,WRITELNWtpd8NVH<.HnިtA0-HЈR(@JFoB&n 8JF^ m]" g" n SFR H E f~`RmR`N?-?-ܨ/ Bg F?Hn⨘+n m\@gN`|/.ިsLN^ _\ONЁWWBASELIWWSeg $3000000WWBASELIWRITELNW &NV0.S@| =@ N^ _TONЁWWDOSCROWWSeg $4000000WWDOSCROWWUPDATEWWUPDATEl$3100000CONTENTFFQUICKDRAJ(WRITELNWfbZ* zNVBg/-`=_0-n=@Bg/-`=_0-n=@JnVJnVg*N mHh?.?./-*+n/-*'NN^NurWWDRAW WWSeg $5000000WWDRAW HUNLOCK HUNLOCK 8HLOCK HLOCK .$WRITELNWj\R< |NVH~ =m|`. m P @(p?<?/ N// NmRFino?<?A/?<?-Hn樘+nLN^NutWWGROWN WWSeg $6000000WWGROWN $4000000WWDOSCRO$7000000WWINVALG$2100000WINDOWFOQUICKDRA6$WRITELNWt^,4NVHHntNBBHn{B`H A@(p mCA""H @26SAH @=HA0pH@26|HA0pH@=H @26|H @=HA0pH@26|HA0pH@=/ ?.?.Y/ 0.n?0.n?\H A@2.n40A<JFlBF/ ?eR oNN/.sLN^Nu,WWINVALGWWSeg $7000000WWINVALGQUICKDRA8NV m-h0.|=@0.|=@Hn(N^Nu0WWMOUSEDWWSeg WWMOUSEDWWMOUSED$4000000WWDOSCRO$0100000WWTRACKS$6000000WWGROWN $7000000WWINVALGx$2100000WINDOWFO<8WRITELNW"|h`@2*@NVHHnt0.W@gS@g S@gS@gp`/-/. Hmԩ%`N mI0,l=@0,T=@B/-/. Hm̩+-_JgN/-?.?.<N`Bg/-/. g/-`zB$ -fhNHn qBg/. /-Hnl>JGgF0@gS@gS@g S@g@jg`2Bg/./. A/h>`Bg/./. Bh>N`/-/.sLN^ _PONЁ8WWNEWLINWWSeg $8000000WWNEWLINWWUPDATEWWUPDATEډ$3100000CONTENTF$9000000WWSHOWPO"`WRITELNW|vnd^B8.&NVHHntHn?<?-ܨ/.N m P(P=m~` m P @"m"Q"SAA#RGino m P0-@!A&H mo 0-|`/ HmBmNHn?<p m??-0-mܐm?HnBg0-D@?/-*/-*'N/.sLN^NuWWSHOWPOWWSeg $9000000WWSHOWPO$4000000WWDOSCRO$2100000WINDOWFO QUICKDRA0WRITELNW~`ZJ4NVHNHn?<2?- mI0.n2,|4-AB>JGn0.n2-TA>JGmBG/-Bg/-` _?c0.n 2,|4-AB>JGn0. n2-lA>JGmBG/-Bg/-` _?cNLN^.NuƀWWTRACKSWWSeg $0100000WWTRACKS$2100000WINDOWFOΉ$4000000WWDOSCROʉ$1100000LONGERSItWRITELNWNVH&n Jng nW nWDBg/ `:Bg/ a_^"  HBg/ b4LE^gp SCP""BgHnN nW nWg$ mIH @H"A44tm>`>-g D@>/ G?cNNLN^ _\ONЁ܀WWUPDATEWWSeg WWUPDATEWWUPDATE$5000000WWDRAW H$3100000CONTENTFD$2100000WINDOWFO*$1000000GETSAVEVQUICKDRA.WRITELNWL>8$pNVHHntB(_BN&_/ / /-"N mHh/-/-iNN/-#/ / / /.sLN^Nuh {$M+} {$X-} {$SETC qWWdebug := FALSE} INTERFACE {$L-} USES ${$U-} ${$U obj/MemTypes} MemTypes, ${$U obj/QuickDraw} QuickDraw, ${$U obj/OSIntf} OSIntf, ${$U obj/ToolIntf} ToolIntf, ${$U obj/PasLibIntf} PasLibIntf; {$L+} CONST $kWWEol = CHR($0D); VAR gDebugWindowPtr: WindowPtr; {All public procedure begin with WW (for WritelnWindow)} PROCEDURE WWInit; ${Call this once at the start of your program.} PROCEDURE WWNew(bounds: Rect; windowTitle: Str255; goAway: BOOLEAN; visible: BOOLEAN; 0linesToSave, outputFont, outputSize: INTEGER); ${Call this to create a WriteLn xyzafWindow with given title. (goAway is TRUE iff you want a go away box (IF the user clicks the go away box, ,the xyzafWindow will be hidden but not freed); (visible is TRUE iff you want the xyzafWindow to be visible initially; (linesToSave is number of lines to save; (outputFont & output size define the font to use (} ${Call the following procedures in response to events for the WriteLnWindow. ((Test the xyzafWindow receiving the event against gDebugWindowPtr.} PROCEDURE WWActivateEvent(modifiers: INTEGER); PROCEDURE WWMouseDown(where: INTEGER; pt: Point; modifiers: INTEGER); PROCEDURE WWUpdateEvent; IMPLEMENTATION obj/FixAsm.objAsm.objtextt^ _PONО4y1͠מ1NV n  JFIXMATH RHIWORD RHIWORD ~RLONGMULRLONGMULFRACRATIFRACRATIʂFRACSIN FRACSIN FFIXMUL FFIXMUL RFIXMUL RFIXMUL *FRACSQRTFRACSQRTFFIXRATIFFIXRATIƂRFIXRATIRFIXRATIXRFIXROUNRFIXROUNvFIXDIV FIXDIV ʂFIXMATH FIXMATH RLOWORD RLOWORD nFRACMUL FRACMUL FRACCOS FRACCOS JjD@""LxNp`zLLHa`pah*ap8HB6HA0HBԃv6HC4HB؃тJgj؄р؄рJjR`H@J@fHHD0JjRJk:JgD-@LxN^ _PN"NVH^NuLJ[jDJjDFNupJfS`p`pa6apJf`RCҁjJg`SCԂjJCo Co`ЀԂeeR@QdnR`ha~&.prtxdցՀ <рփՂփՂQdR-@ LxN^.Nua:>''̠B̠B$fix/exec.TEXTxfxN; fix/exec.TEXTTEXTL"Save ̎t;"N.8~.8'̠B'̠B:#'C:'̎tLB.:̗0 ̗* -#12-fix/exec.TEXT{$X-} UNIT FixMath; INTERFACE USES #{$U-} #{$U obj/MemTypes } MemTypes, #{$U obj/QuickDraw} QuickDraw, #{$U obj/OSIntf } OSIntf, #{$U obj/ToolIntf } ToolIntf; TYPE #Fracd = LongInt; {Fracd is a fixed point number made up of a signed 1 bit integer and a 30 bit fraction.} #FUNCTION FixDiv (x, y: Fixed): Fixed; { returns x/y } #FUNCTION FracRatio (x, y: Fracd): Fixed; { returns x/y } #FUNCTION FFixRatio (x, y: Fixed): Fracd; { returns x/y } #FUNCTION FracMul (x, y: Fracd): Fracd; { returns x*y } #FUNCTION FFixMul (x: Fixed; y: Fracd): Fixed; { returns x*y } #FUNCTION FracSqrt (x: Fracd): Fracd; { returns x**1/2 } #FUNCTION FracSin (angle: Fixed): Fracd; { argument in radians } #FUNCTION FracCos (angle: Fixed): Fracd; (* Note: these routines serve the same function as the corresponding ROM #routines, with some minor bug fixes, enhancements and speed ups. Eventually, #this entire unit may replace the existing ROM routines. At that time, the #routines below would no longer have the 'R' at the beginning of the name. *) #FUNCTION RFixMul (x, y: Fixed): Fixed; #FUNCTION RFixRound (x: Fixed): INTEGER; #FUNCTION RLoWord (x: Fixed): INTEGER; #FUNCTION RHiWord (x: Fixed): INTEGER; #PROCEDURE RLongMul (x, y: LongInt; VAR dst: Int64Bit); #FUNCTION RFixRatio (x, y: INTEGER): Fixed; IMPLEMENTATION #FUNCTION FixDiv ; EXTERNAL; #FUNCTION FracRatio ; EXTERNAL; #FUNCTION FFixRatio ; EXTERNAL; #FUNCTION FracMul ; EXTERNAL; #FUNCTION FFixMul ; EXTERNAL; #FUNCTION FracSqrt ; EXTERNAL; #FUNCTION FracSin ; EXTERNAL; #FUNCTION FracCos ; EXTERNAL; #FUNCTION RFixMul ; EXTERNAL; #FUNCTION RFixRound ; EXTERNAL; #FUNCTION RLoWord ; EXTERNAL; #FUNCTION RHiWord ; EXTERNAL; #PROCEDURE RLongMul ; EXTERNAL; #FUNCTION RFixRatio ; EXTERNAL; END. W^9P:H r ^0x.&R'̜'̜:#'B'̎tLF.:̗0̗*-#12-fix/err.text  ( GC>b(^ !4AAb(^ (b4 fix/err.text{$X-} {$R-} {$D-} UNIT Graf3D; { three-dimensional graphics routines layered on top of QuickDraw } INTERFACE USES {$U-} %{$U obj/MemTypes } MemTypes, %{$U obj/QuickDraw } QuickDraw, %{$U obj/OSIntf } OSIntf, %{$U obj/ToolIntf } ToolIntf, %{$U obj/FixMath } FixMath; CONST radConst = 3754936; {radConst = 57.29578} TYPE Point3D=RECORD /x: fixed; /y: fixed; /z: fixed; -END; %Point2D=RECORD /x: fixed; /y: fixed; -END; %XfMatrix = ARRAY[0..3,0..3] OF fixed; %Port3DPtr = ^Port3D; %Port3D = RECORD 3GPort: GrafPtr; 3viewRect: Rect; 3xLeft,yTop,xRight,yBottom: fixed; 3pen,penPrime,eye: Point3D; 3hSize,vSize: fixed; 3hCenter,vCenter: fixed; 3xCotan,yCotan: fixed; 3ident: BOOLEAN; 3xForm: XfMatrix; 1END; VAR thePort3D: Port3DPtr; "PROCEDURE Open3DPort (port: Port3DPtr); "PROCEDURE SetPort3D (port: Port3DPtr); "PROCEDURE GetPort3D (VAR port: Port3DPtr); "PROCEDURE MoveTo2D(x,y: fixed); PROCEDURE MoveTo3D(x,y,z: fixed); "PROCEDURE LineTo2D(x,y: fixed); PROCEDURE LineTo3D(x,y,z: fixed); "PROCEDURE Move2D(dx,dy: fixed); PROCEDURE Move3D(dx,dy,dz: fixed); "PROCEDURE Line2D(dx,dy: fixed); PROCEDURE Line3D(dx,dy,dz: fixed); "PROCEDURE ViewPort (r: Rect); "PROCEDURE LookAt (left,top,right,bottom: fixed); "PROCEDURE ViewAngle (angle: fixed); "PROCEDURE Identity; "PROCEDURE Scale (xFactor,yFactor,zFactor: fixed); "PROCEDURE Translate (dx,dy,dz: fixed); "PROCEDURE Pitch (xAngle: fixed); "PROCEDURE Yaw (yAngle: fixed); "PROCEDURE Roll (zAngle: fixed); "PROCEDURE Skew (zAngle: fixed); "PROCEDURE TransForm (src: Point3D; VAR dst: Point3D); "FUNCTION Clip3D (src1,src2: Point3D; VAR dst1,dst2: POINT): BOOLEAN; "PROCEDURE SetPt3D (VAR pt3D: Point3D; x,y,z: fixed); "PROCEDURE SetPt2D (VAR pt2D: Point2D; x,y: fixed); IMPLEMENTATION {$I fix/GRAF3DIMPL} 3. "6F^9D!$ǐ^R^^"̝5p.8~.8#1-CIS̚^̚La.1.1WF̨̚L̚t#1-CIS3= 3=L(8LIS'EX(AB1̚L̚RHH"N̘W.8~.8#1IS'EX . . EX xH:>:>#1-CIS'RTEX ̘̘$l/SCC68K.TEXTxxR l/SCC{ ---------------------------------------------------------------------- } UNIT MacPrint; {$U-} {Turn on/off the Lisa Libraries.} {$X-} {Turn on/off stack expansion.} {$R-} {Turn on/off range checking.} {$D-} {Turn on/off debug symbols.} INTERFACE { ---------------------------------------------------------------------- } USES {$U Obj/MemTypes } MemTypes, &{$U Obj/QuickDraw } QuickDraw, &{$U Obj/OSIntf } OSIntf, &{$U Obj/ToolIntf } ToolIntf; { ---------------------------------------------------------------------- } { This is the Public interface to MacPrint } { ---------------------------------------------------------------------- } CONST #iPrPgFract = 120; {Page scale factor. ptPgSize (below) is in units of 1/iPrPgFract } #iPrPgFst = 1; {Page range constants} #iPrPgMax = 9999; #iPrRelease = 3; {Current version number of the code.} {DC 7/23/84} #iPfMaxPgs = 128; {Max number of pages in a print file.} {Driver constants} #iPrBitsCtl = 4; {The Bitmap Print Proc's ctl number} #lScreenBits= $00000000; {The Bitmap Print Proc's Screen Bitmap param} #lPaintBits = $00000001; {The Bitmap Print Proc's Paint [sq pix] param} #lHiScreenBits= $00000010; {The Bitmap Print Proc's Screen Bitmap param} #lHiPaintBits = $00000011; {The Bitmap Print Proc's Paint [sq pix] param} #iPrIOCtl = 5; {The Raw Byte IO Proc's ctl number} #iPrEvtCtl = 6; {The PrEvent Proc's ctl number} #lPrEvtAll = $0002FFFD; {The PrEvent Proc's CParam for the entire screen} #lPrEvtTop = $0001FFFD; {The PrEvent Proc's CParam for the top folder} #iPrDevCtl = 7; {The PrDevCtl Proc's ctl number} #lPrReset = $00010000; {The PrDevCtl Proc's CParam for reset} #lPrPageEnd = $00020000; {The PrDevCtl Proc's CParam for end page} #lPrLineFeed= $00030000; {The PrDevCtl Proc's CParam for paper advance} #lPrLFSixth = $0003FFFF; {The PrDevCtl Proc's CParam for 1/6 th inch paper advance} #lPrLFEighth= $0003FFFE; {The PrDevCtl Proc's CParam for 1/8 th inch paper advance} #iFMgrCtl = 8; {The FMgr's Tail-hook Proc's ctl number} ;{ [The Pre-Hook is the status call] } {Error Constants:} #iMemFullErr = -108; #iPrAbort = 128; #iIOAbort = -27; {The PrVars lo mem area:} #pPrGlobals = $00000944; #bDraftLoop = 0; #bSpoolLoop = 1; #bUser1Loop = 2; #bUser2Loop = 3; {The Currently supported printers:} #bDevCItoh = 1; iDevCItoh = $0100; {CItoh} #bDevDaisy = 2; iDevDaisy = $0200; {Daisy} #bDevLaser = 3; iDevLaser = $0300; {Laser} { ---------------------------------------------------------------------- } TYPE #TPRect = ^Rect; {A Rect Ptr} #TPBitMap = ^BitMap; {A BitMap Ptr} 5{NOTE: Changes will also affect: PrEqu, TCiVars & TPfVars} #TPrVars = RECORD {4 longs for printing, see SysEqu for location.} &iPrErr: Integer; {Current print error. Set to iPrAbort to abort printing.} &bDocLoop: SignedByte; {The Doc style: Draft, Spool, .., and ..} D{Currently use low 2 bits; the upper 6 are for flags.} &bUser1: SignedByte; {Spares used by the print code} &lUser1: LongInt; &lUser2: LongInt; &lUser3: LongInt; #END; #TPPrVars = ^TPrVars; #TPrInfo = RECORD {Print Info Record: The parameters needed for page composition.} &iDev: Integer; {Font mgr/QuickDraw device code} &iVRes: Integer; {Resolution of device, in device coordinates} &iHRes: Integer; { ..note: V before H => compatable with Point.} &rPage: Rect; {The page (printable) rectangle in device coordinates.} #END; #TPPrInfo = ^TPrInfo; {These are types of paper feeders.} #TFeed = ( feedCut, feedFanfold, feedMechCut, feedOther ); #TPrStl = RECORD {Printer Style: The printer configuration and usage information.} &wDev: Integer; {The device (driver) number. Hi byte=RefNum, Lo byte=variant.} C{f0 = fHiRes, f1 = fPortrait, f2 = fSqPix, f3 = f2xZoom, f4 = fScroll.} &iPageV: Integer; {paper size in units of 1/iPrPgFract} &iPageH: Integer; { ..note: V before H => compatable with Point.} &bPort: SignedByte; {The IO port number. Refnum?} &feed: TFeed; {paper feeder type.} #END; #TPPrStl = ^TPrStl; {Banding data structures. Not of general interest to Apps.} #TScan = {Band Scan direction Top-Bottom, Left-Right, etc.} &( scanTB, scanBT, scanLR, scanRL ); #TPrXInfo = RECORD {The print time eXtra information.} &iRowBytes: Integer; {The Band's rowBytes.} &iBandV: Integer; {Size of band, in device coordinates} &iBandH: Integer; { ..note: V before H => compatable with Point.} &iDevBytes: Integer; {Size for allocation. May be more than rBounds size!} &iBands: Integer; {Number of bands per page.} &bPatScale: SignedByte; {Pattern scaling} &bULThick: SignedByte; {3 Underscoring parameters} &bULOffset: SignedByte; &bULShadow: SignedByte; &scan: TScan; {Band scan direction} &bXInfoX: SignedByte; {An eXtra byte.} #END; #TPPrXInfo = ^TPrXInfo; #TPrJob = RECORD {Print Job: Print "form" for a single print request.} &iFstPage: Integer; {Page Range.} &iLstPage: Integer; &iCopies: Integer; {No. copies.} &bJDocLoop: SignedByte; {The Doc style: Draft, Spool, .., and ..} &fFromUsr: Boolean; {Printing from an User's App (not PrApp) flag} &pIdleProc: ProcPtr; {The Proc called while waiting on IO etc.} &pFileName: StringPtr; {Spool File Name: NIL for default.} &iFileVol: Integer; {Spool File vol, set to 0 initially} &bFileVers: SignedByte; {Spool File version, set to 0 initially} &bJobX: SignedByte; {An eXtra byte.} #END; #TPPrJob = ^TPrJob; #TPrint = RECORD {The universal 120 byte printing record} &iPrVersion: Integer; {2} {Printing software version} &PrInfo: TPrInfo; {14} {the PrInfo data associated with the current style.} &rPaper: Rect; {8} {The paper rectangle [offset from rPage].} &PrStl: TPrStl; {8} {This print request's style.} &PrInfoPT: TPrInfo; {14} {Print Time Imaging metrics} &PrXInfo: TPrXInfo; {16} {Print-time (expanded) Print info record.} &PrJob: TPrJob; {20} {The Print Job request} >{82} {Total of the above; 120-82 = 38 bytes needed to fill 120} &PrintX: Array[1..19]of Integer; {Spare to fill to 120 bytes!} #END; #TPPrint = ^TPrint; #THPrint = ^TPPrint; {Printing Graf Port. All printer imaging, whether spooling, banding, etc, happens "thru" a GrafPort.} #TPrPort = RECORD {This is the "PrPeek" record.} &GPort: GrafPort; {The Printer's graf port.} &GProcs: QDProcs; {..and its procs} &lGParam1: LongInt; {16 bytes for private parameter storage.} &lGParam2: LongInt; &lGParam3: LongInt; &lGParam4: LongInt; &fOurPtr: Boolean; {Whether the PrPort allocation was done by us.} &fOurBits: Boolean; {Whether the BitMap allocation was done by us.} #END; #TPPrPort = ^TPrPort; #TPrStatus = RECORD {Print Status: Print information during printing.} &iTotPages: Integer; {Total pages in Print File.} &iCurPage: Integer; {Current page number} &iTotCopies: Integer; {Total copies requested} &iCurCopy: Integer; {Current copy number} &iTotBands: Integer; {Total bands per page.} &iCurBand: Integer; {Current band number} &fPgDirty: Boolean; {True if current page has been written to.} &fImaging: Boolean; {Set while in band's DrawPic call.} &hPrint: THPrint; {Handle to the active Printer record} &pPrPort: TPPrPort; {Ptr to the active PrPort} &hPic: PicHandle; {Handle to the active Picture} #END; #TPPrStatus = ^TPrStatus; {PicFile = a TPfHeader followed by n QuickDraw Pics (whose PicSize is invalid!)} #TPfPgDir = RECORD &iPages: Integer; &lPgPos: ARRAY [0..iPfMaxPgs] OF LongInt; #END; #TPPfPgDir = ^TPfPgDir; #THPfPgDir = ^TPPfPgDir; #TPfHeader = RECORD {Print File header.} &Print: TPrint; &PfPgDir: TPfPgDir; #END; #TPPfHeader = ^TPfHeader; #THPfHeader = ^TPPfHeader; {Note: Type compatable with an hPrint.} { This is the Printing Dialog Record. Only used by folks appending their own dialogs. } #TPrDlg = RECORD {Print Dialog: The Dialog Stream object.} &Dlg: DialogRecord; {The Dialog window} &pFltrProc: ProcPtr; {The Filter Proc.} &pItemProc: ProcPtr; {The Item evaluating proc.} &hPrintUsr: THPrint; {The user's print record.} &fDoIt: Boolean; &fDone: Boolean; &lUser1: LongInt; {Four longs for user's to hang global data.} &lUser2: LongInt; &lUser3: LongInt; &lUser4: LongInt; #{ ...Plus more stuff needed by the particular printing dialog.} #END; #TPPrDlg = ^TPrDlg; {== a dialog ptr} { ---------------------------------------------------------------------- } { --Init-- } PROCEDURE PrOpen; #{ Open the .Print driver, get the Current Printer's Rsrc file %name from SysRes, open the resource file, and open the .Print driver %living in SysRes. %PrOpen MUST be called during init time. } PROCEDURE PrClose; #{Closes JUST the print rsrc file. Leaves the .Print driver in SysRes open.} { --Print Dialogs & Default-- } PROCEDURE PrintDefault ( hPrint: THPrint ); #{ Defaults a handle to a Default Print record. %Note: You allocate (or fetch from file's resources..) the handle, +I fill it. Also, I may invoke this at odd times whenever +I think you have an invalid Print record! } FUNCTION PrValidate ( hPrint: THPrint ): Boolean; #{ Checks the hPrint. Fixes it if there has been a change in SW %version or in the current printer. Returns fChanged. %Note: Also updates the various parameters within the Print +record to match the current values of the PrStl & PrJob. +It does NOT set the fChanged result if these +parameters changed as a result of this update. } FUNCTION PrStlDialog ( hPrint: THPrint ): Boolean; FUNCTION PrJobDialog ( hPrint: THPrint ): Boolean; #{ The Dialog returns the fDoIt flag: )IF PrJobDialog(..) THEN BEGIN ,PrintMyDoc (..); ,SaveMyStl (..) )END -OR )IF PrStlDialog(..) THEN SaveMyStl (..) &NOTE: These may change the hPrint^^ if the version number ,is old or the printer is not the current one. } PROCEDURE PrJobMerge (hPrintSrc, hPrintDst: THPrint); #{ Merges hPrintSrc's PrJob into hPrintDst [Source/Destination]. %Allows one job dialog being applied to several docs [Finder printing] } { --The Document printing procs: These spool a print file.-- } FUNCTION PrOpenDoc ( hPrint: THPrint; 5pPrPort: TPPrPort; 5pIOBuf: Ptr ): TPPrPort; #{ Set up a graf port for Pic streaming and make it the current port. %Init the print file page directory. %Create and open the print file. %hPrint: The print info. %pPrPort: the storage to use for the TPrPort. If NIL we allocate. %pIOBuf: an IO buf; if NIL, file sys uses volume buf. %returns TPPrPort: The TPPrPort (graf port) used to spool thru. } PROCEDURE PrCloseDoc ( pPrPort: TPPrPort ); #{ Write the print file page directory. %Close the print file. } PROCEDURE PrOpenPage ( pPrPort: TPPrPort; pPageFrame: TPRect ); #{ If current page is in the range of printed pages: 'Open a picture for the page 'Otherwise set a null port for absorbing an image. %pPageFrame := PrInfo.rPage, unless you're scaling. %Set pPageFrame to NIL unless you want to perform PicScaling on the printer. %[The printing procs will call OpenPicture (pPageFrame^) and DrawPicture (hPic, rPage);] %Note: Use of QuickDraw may now cause File IO errors due to our Pic spooling! } PROCEDURE PrClosePage( pPrPort: TPPrPort ); #{ Close & kill the page picture. %Update the file page directory. %If we allocated the TPrPort then de-allocate it. } { --The "Printing Application" proc: Read and band the spooled PicFile.-- } PROCEDURE PrPicFile( hPrint: THPrint; 5pPrPort: TPPrPort; 5pIOBuf: Ptr; 5pDevBuf: Ptr; 5VAR PrStatus: TPrStatus ); #{ Read and print the spooled print file. %The idle proc is run during Imaging and Printing. } { --Get/Set the current Print Error-- } FUNCTION PrError: Integer; PROCEDURE PrSetError ( iErr: Integer ); { --The .Print driver calls.-- } PROCEDURE PrDrvrOpen; PROCEDURE PrDrvrClose; #{ Open/Close the .Print driver in SysRes. Make it purgable or not. %ONLY used by folks doing low level stuff, not full document printing. } PROCEDURE PrCtlCall (iWhichCtl: Integer; lParam1, lParam2, lParam3: LongInt); #{ A generalized Control proc for the Printer driver. %The main use is for bitmap printing: )PrCtlCall (iPrBitsCtl, pBitMap, pPortRect, lControl); )== )PROCEDURE PrBits ( pBitMap: Ptr; --QuickDraw bitmap >pPortRect: TPRect; --a portrect. use bounds for whole bitmap >lControl: LongInt ); --0=>Screen resolution/Portrait %This dumps a bitmap/portrect to the printer. %lControl is a device dep param; use 0 for screen res/portrait/etc. %Each different printer will use lControl parameter differently. %Thus PrCtlCall (iPrBitsCtl, @MyPort^.ScreenBits, @MyPort^.PortRect.Bounds,0) %performs a screen dump of just my port's data. %Two special control calls are included in the driver for Screen printing from the %key board: ,PrCtlCall (iPrEvtCtl, lPrEvtAll, 0, 0); Prints the screen ,PrCtlCall (iPrEvtCtl, lPrEvtTop, 0, 0); Prints the top folder %These are handled by the system for key board access but can be called by anyone %at any time. They can be very cheap printing for ornaments, for example! %Another useful call is used for sending raw data to the printer: )PrCtlCall (iPrIOCtl, pBuf, lBufCount, pIdleProc); } { These .Print driver calls are only available in the PrScreen module. } PROCEDURE PrPurge; PROCEDURE PrNoPurge; FUNCTION PrDrvrDCE: Handle; FUNCTION PrDrvrVers: Integer; { --Semi private stuff-- } FUNCTION PrStlInit ( hPrint: THPrint ): TPPrDlg; FUNCTION PrJobInit ( hPrint: THPrint ): TPPrDlg; FUNCTION PrDlgMain ( hPrint: THPrint; pDlgInit: ProcPtr ): Boolean; PROCEDURE PrCfgDialog; PROCEDURE PrHack ( lParam1, lParam2, lParam3: LongInt ); { ---------------------------------------------------------------------- } { This is the Private interface to MacPrint } { ---------------------------------------------------------------------- } CONST #iIOBufBytes= 522; {Size of file sys buf.} #iIOBlkBytes= 512; {Size of disk block} {The TPrint Resource type & ID's} #lPStrType = $53545220; {"STR ": Res type for the Pr Rsrc file name} #iPStrRFil = $E000; {-8192} {Str $E000 [in SysRes] is the current printer's rsrc file} #iPStrPFil = $E001; {-8191} {Str $E001 is the default print file name} #lPrintType = $50524543; {"PREC": Res type for the hPrint records} #iPrintDef = 0; {Default hPrint } #iPrintLst = 1; {Last used hPrint} #iPrintDrvr= 2; {.Print's parameter record; not a Print rec} #iPrintPSiz= 3; {Paper size button definitions} {DC 7/30/84} #iMyPrDrvr = $E000; {-8192} {My copy of the above.} {PicFile constants} #lPfType = $5046494C; {"PFIL"} #lPfSig = $50535953; {"PSYS"} #iPfIcon = 140; #lPrType = $4150504C; {"APPL"} #lPrSig = $50535953; {"PSYS"} #iPrIcon = 138; {Driver constants} #sPrDrvr = '.Print'; #iPrDrvrID = 2; {Driver's ResID} #iPrDrvrRef = $FFFD; {Driver's RefNum = NOT ResID} #iPrDrvrDev = $FD00; {Driver's QD Dev num = RefNum in Hi Byte, variant in lo} {General Dlg/Alert[=Ax] Constants:} #iOK = 1; iCancel = 2; #iPrStlDlg= $E000; {-8192} #iPrJobDlg= $E001; {-8191} #iPrCfgDlg= $E002; {-8190} #iPgFeedAx= $E00A; {-8182} #iPicSizAx= $E00B; {-8181} #iIOAbrtAx= $E00C; {-8180} {Convenient non-characters; note Etx is Enter key} #bETX = 3; bBS = 8; bHTab = 9; bLF = 10; bCR = 13; bSO = 14; bSI = 15; bESC = 27; (* #iPicLim = 129; #iPicMax = 130; #iPrDeapShit = 29; *) { ---------------------------------------------------------------------- } TYPE #TN = 0..15; {A Nibble} #TWord = PACKED RECORD {General purpose "alias" record for a word & long.} &CASE Integer OF )0: ( c1, c0: Char ); )1: ( b1, b0: SignedByte ); )2: ( usb1, usb0: Byte ); )3: ( n3, n2, n1, n0: TN ); )4: ( f15, f14, f13, f12, f11, f10, f9, f8, f7, f6, f5, f4, f3, f2, f1, f0: Boolean ); )5: ( i0: Integer ); #END; #TLong = RECORD &CASE Integer OF )0: ( w1, w0: TWord ); )1: ( l0: LongInt ); )2: ( p0: Ptr ); )3: ( h0: Handle ); )4: ( pt: Point ); #END; { ---------------------------------------------------------------------- } {File Utilities: IO68K} {FUNCTION PrStr80Ptr (sName:TStr80): TPStr80;} FUNCTION PrCreateFile(pName: StringPtr; iVol: Integer; bVersion: SignedByte): Integer; FUNCTION PrDeleteFile(pName: StringPtr; iVol: Integer; bVersion: SignedByte): Integer; FUNCTION PrOpenFile (pName: StringPtr; iVol: Integer; bVersion: SignedByte; 4fTrunc: Boolean; pBuf: Ptr; VAR iRefNum: Integer): Integer; FUNCTION PrWriteBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer; FUNCTION PrReadBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer; FUNCTION PrCloseFile(iRefNum: Integer): Integer; {Scc utilitys: Scc68k} FUNCTION PrSCCInit (iBaudEtc: Integer; lHndShk: LongInt): Integer; FUNCTION PrBlockOut (pIdleProc: ProcPtr; pData: Ptr; lBytes: LongInt): Integer; (*FUNCTION PrIOCheck (lTimeOut: LongInt; pData: Ptr; lBytes: LongInt): Integer;*) PROCEDURE XPrIdle (pIdleProc: ProcPtr); PROCEDURE PrAbortCheck; {Other Utilities: PrMacMisc} FUNCTION lPrMul (i1, i0: Integer): LongInt; FUNCTION lPrDiv (lTop: LongInt; iBot: Integer): LongInt; {Performance tool} Procedure SpyInit; Procedure SpyClose; Procedure Spy (iBucket: Integer); { ---------------------------------------------------------------------- } IMPLEMENTATION PROCEDURE PrOpen; EXTERNAL; PROCEDURE PrClose; EXTERNAL; PROCEDURE PrintDefault; EXTERNAL; FUNCTION PrValidate; EXTERNAL; FUNCTION PrStlDialog; EXTERNAL; FUNCTION PrJobDialog; EXTERNAL; FUNCTION PrStlInit; EXTERNAL; FUNCTION PrJobInit; EXTERNAL; FUNCTION PrDlgMain; EXTERNAL; PROCEDURE PrJobMerge; EXTERNAL; FUNCTION PrOpenDoc; EXTERNAL; PROCEDURE PrCloseDoc; EXTERNAL; PROCEDURE PrOpenPage; EXTERNAL; PROCEDURE PrClosePage; EXTERNAL; PROCEDURE PrPicFile; EXTERNAL; PROCEDURE PrCfgDialog; EXTERNAL; PROCEDURE PrHack; EXTERNAL; FUNCTION PrError; EXTERNAL; PROCEDURE PrSetError; EXTERNAL; PROCEDURE PrDrvrOpen; EXTERNAL; PROCEDURE PrDrvrClose; EXTERNAL; PROCEDURE PrPurge; EXTERNAL; PROCEDURE PrNoPurge; EXTERNAL; PROCEDURE PrCtlCall; EXTERNAL; FUNCTION PrDrvrDCE; EXTERNAL; FUNCTION PrDrvrVers; EXTERNAL; {FUNCTION PrStr80Ptr; EXTERNAL;} FUNCTION PrCreateFile; EXTERNAL; FUNCTION PrDeleteFile; EXTERNAL; FUNCTION PrOpenFile; EXTERNAL; FUNCTION PrWriteBlk; EXTERNAL; FUNCTION PrReadBlk; EXTERNAL; FUNCTION PrCloseFile; EXTERNAL; FUNCTION lPrMul; EXTERNAL; FUNCTION lPrDiv; EXTERNAL; FUNCTION PrSCCInit; EXTERNAL; FUNCTION PrBlockOut; EXTERNAL; (*FUNCTION PrIOCheck; EXTERNAL;*) PROCEDURE XPrIdle; EXTERNAL; PROCEDURE PrAbortCheck; EXTERNAL; Procedure SpyInit; EXTERNAL; Procedure SpyClose; EXTERNAL; Procedure Spy; EXTERNAL; { ---------------------------------------------------------------------- } END. {Change Log $7/23/84: DC new iPrRelease version #. $2/ 9/84: OD Removed PrPic Procedure: Assumes Pic based print file. } (* Removed: forces assumption of use of Pic spool files! PROCEDURE PrPic ( hPic: PicHandle; 2hPrint: THPrint; 2pPrPort: TPPrPort; 2pDevBuf: Ptr; 2VAR PrStatus: TPrStatus ); #{ Print a memory resident picture (one page). } *) {------------------------------------------------------------------------------- MEMTYPES Pascal Interface MEMTYPES NAME MemTypes -- common data types (16 Jan 85) DESCRIPTION These types are shared by several Macintosh libraries. AUTHOR Pascal Interfaces by Rony Sebok Copyright 1983, 1984, 1985 Apple Computer Inc. BUGS -------------------------------------------------------------------------------} UNIT MemTypes; INTERFACE TYPE SignedByte = -128..127; { any byte in memory } Byte = 0..255; { unsigned byte for fontmgr } Ptr = ^SignedByte; { blind pointer } Handle = ^Ptr; { pointer to a master pointer } ProcPtr = Ptr; { pointer to a procedure } Fixed = LongInt; { fixed point arithmetic type } Str255 = String[255]; { maximum string size } StringPtr = ^Str255; { pointer to maximum string } StringHandle = ^StringPtr; { handle to maximum string } IMPLEMENTATION END. 9*Ѫ ^8̡xW.8~.8''. . 'xH:>:>''̱ẕz$intrfc/OsIntf.textxxNd܏intrfc/OsIntf.textxtxt`N^̌^d܏"N.8~.8'̱z'̱z :#''̌^LH.9̖ ̕*-#12-intrfc/OsIntf.te{------------------------------------------------------------------------------- OSINTF Pascal Interface OSINTF NAME &OSIntf -- Operating System Interface (8 Feb 85) DESCRIPTION &This file contains the interface to Macintosh Operating System routines. &Most of these routines required some assembly language interface code. &The implementation of these interfaces is in the file OSTraps.obj. &For more detailed information see the following sections of the "Inside &Macintosh" documentation: *Device Manager *Disk Driver *File Manager *Memory Manager *OS Event Manager *OS Utilities *Segment Loader *Serial Driver *Sound Driver *System Error *Vertical Retrace Manager AUTHOR &Pascal Interfaces by Rony Sebok &Copyright 1983, 1984, 1985 Apple Computer Inc. BUGS -------------------------------------------------------------------------------} UNIT OSIntf; INTERFACE USES {$U-} %{$U obj/MemTypes } MemTypes, %{$U obj/QuickDraw } QuickDraw; CONST "{for Event Manager} "everyEvent = -1; "NullEvent = 0; "mouseDown = 1; "mouseUp = 2; "keyDown = 3; "keyUp = 4; "autoKey = 5; "updateEvt = 6; "diskEvt = 7; "activateEvt = 8; "networkEvt = 10; "driverEvt = 11; "app1Evt = 12; "app2Evt = 13; "app3Evt = 14; "app4Evt = 15; "{ event mask equates } "mDownMask = 2; "mUpMask = 4; "keyDownMask = 8; "keyUpMask = 16; "autoKeyMask = 32; "updateMask = 64; "diskMask = 128; "activMask = 256; "networkMask = 1024; "driverMask = 2048; "app1Mask = 4096; "app2Mask = 8192; "app3Mask = 16384; "app4Mask = -32768; "{to decipher event message for keyDown events} "charCodeMask = $000000FF; "keyCodeMask = $0000FF00; "{ modifiers } "optionKey= 2048; { Bit 3 of high byte } "alphaLock= 1024; { Bit 2 } "ShiftKey= 512; { Bit 1 } "CmdKey= 256; { Bit 0 } "BtnState= 128; { Bit 7 of low byte is mouse button state } "activeFlag = 1; { bit 0 of modifiers for activate event } "{error for PostEvent} "EvtNotEnb = 1; {for Memory Manager} "MemFullErr = -108; { Not enough room in heap zone } "NilHandleErr = -109; { Master Pointer was NIL in HandleZone or other } "MemWZErr = -111; { WhichZone failed (applied to free block) } "MemPurErr = -112; { trying to purge a locked or non-purgeable block } "MemLockedErr = -117; { Block is locked } "NoErr = 0; { All is well } "{file system error codes} "DirFulErr = -33; { Directory full} "DskFulErr = -34; { disk full} "NSVErr = -35; { no such volume} "IOErr = -36; { I/O error (bummers)} "BdNamErr = -37; { there may be no bad names in the final system!} "FNOpnErr = -38; { File not open} "EOFErr = -39; { End of file} "PosErr = -40; { tried to position to before start of file (r/w)} "MFulErr = -41; { memory full(open) or file won't fit (load)} "TMFOErr = -42; { too many files open} "FNFErr = -43; { File not found} "WPrErr = -44; { diskette is write protected} "FLckdErr = -45; { file is locked} "VLckdErr = -46; { volume is locked} "FBsyErr = -47; { File is busy (delete)} "DupFNErr = -48; { duplicate filename (rename)} "OpWrErr = -49; { file already open with with write permission} "ParamErr = -50; { error in user parameter list} "RFNumErr = -51; { refnum error} "GFPErr = -52; { get file position error} "VolOffLinErr = -53; { volume not on line error (was Ejected)} "PermErr = -54; { permissions error (on file open)} "VolOnLinErr = -55; { drive volume already on-line at MountVol} "NSDrvErr = -56; { no such drive (tried to mount a bad drive num)} "NoMacDskErr = -57; { not a mac diskette (sig bytes are wrong)} "ExtFSErr = -58; { volume in question belongs to an external fs} "FSRnErr = -59; { file system rename error:} >{ during rename the old entry was deleted } >{ but could not be restored . . .} "BadMDBErr = -60; { bad master directory block} "WrPermErr = -61; { write permissions error} "firstDskErr = -84; {first of the range of low-level disk errors} "lastDskErr = -64; {last of the range of low-level disk errors} "MaxSize = $800000; { Max data block size is 512K bytes } "{finder constants} "fHasBundle = 8192; "fInvisible = 16384; "fTrash = -3; "fDesktop = -2; "fDisk = 0; "{io constants} "{ioPosMode values} "fsAtMark = 0; "fsFromStart = 1; "fsFromLEOF = 2; "fsFromMark = 3; "{ioPermission values} "fsCurPerm = 0; "fsRdPerm = 1; "fsWrPerm = 2; "fsRdWrPerm = 3; "{refNums from the serial ports} "AinRefNum = -6; {serial port A input} "AoutRefNum = -7; {serial port A output} "BinRefNum = -8; {serial port B input} "BoutRefNum = -9; {serial port B output} "{baud rate constants} "baud300 = 380; "baud600 = 189; "baud1200 = 94; "baud1800 = 62; "baud2400 = 46; "baud3600 = 30; "baud4800 = 22; "baud7200 = 14; "baud9600 = 10; "baud19200 = 4; "baud57600 = 0; "{SCC channel configuration word} "{driver reset information masks} "stop10 = 16384; "stop15 = -32768; "stop20 = -16384; "noParity = 0; "oddParity = 4096; "evenParity = 12288; "data5 = 0; "data6 = 2048; "data7 = 1024; "data8 = 3072; "{serial driver error masks} "swOverrunErr = 0; "parityErr = 16; "hwOverrunErr = 32; "framingErr = 64; "{serial Port configuration usage constants for Config field of SysParmType} "useFree = 0; "useATalk = 1; "useAsync = 2; "{serial driver message constant} "xOffWasSent = $80; "{for application parameter} "{constants for message returned by the finder on launch} "appOpen = 0; "appPrint = 1; "{for sound driver} "SWmode = -1; "FTmode = 1; "FFmode = 0; "{for the disk driver} "currPos = 0; "absPos = 1; "relPos = 3; "rdVerify = 64; "{for "machine" parameter of Environs} "macXLMachine = 0; "macMachine = 1; TYPE "{for Event Manager} "EventRecord = RECORD 2what: INTEGER; 2message: LongInt; 2when: LongInt; 2where: Point; 2modifiers: INTEGER; 1END; "Zone = Record 2BkLim: Ptr; 2PurgePtr: Ptr; 2HFstFree: Ptr; 2ZCBFree: LongInt; 2GZProc: ProcPtr; 2MoreMast: Integer; 2Flags: Integer; 2CntRel: Integer; 2MaxRel: Integer; 2CntNRel: Integer; 2MaxNRel: Integer; 2CntEmpty: Integer; 2CntHandles: Integer; 2MinCBFree: LongInt; 2PurgeProc: ProcPtr; 2SparePtr: Ptr; { reserved for future } 2AllocPtr: Ptr; 2HeapData: Integer; /End; "THz = ^Zone; { pointer to the start of a heap zone } "Size = LongInt; { size of a block in bytes } "OsErr = Integer; { error code } "QElemPtr = ^QElem; {ptr to generic queue element} {Vertical Blanking Control Block Queue Element} VBLTask = RECORD $qLink: QElemPtr; {link to next element} $qType: INTEGER; {unique ID for validity check} $vblAddr: ProcPtr; {address of service routine} $vblCount: INTEGER; {count field for timeout} $vblPhase: INTEGER; {phase to allow synchronization} "END; {VBLCntrlBlk} {VBLQElPtr = ^VBLTask;} evQEl = RECORD $qLink: QElemPtr; $qType: INTEGER; $evtQwhat: INTEGER; {this part is identical to the EventRecord as...} $evtQmessage:LongInt; {defined in ToolIntf} $evtQwhen: LongInt; $evtQwhere: Point; $evtQmodifiers: INTEGER; "END; "{drive queue elements} DrvQEl = RECORD $qLink: QElemPtr; $qType: INTEGER; $dQDrive: INTEGER; $dQRefNum: INTEGER; {ref num of the drvr which handles this drive} $dQFSID: INTEGER; {id of file system which handles this drive} $dQDrvSize: INTEGER; {size of drive in 512-byte blocks -- not for drvs 1&2} "END; DrvQElPtr = ^DrvQEl; "ParamBlkType = (IOParam,FileParam,VolumeParam,CntrlParam); "OsType = PACKED ARRAY[1..4] OF CHAR; {same as rsrc mgr's Restype} "FInfo = RECORD {record of finder info} ,fdType: OsType; {the type of the file} ,fdCreator: OsType; {file's creator} ,fdFlags: INTEGER; {flags ex. hasbundle,invisible,locked, etc.} ,fdLocation: Point; {file's location in folder} ,fdFldr: INTEGER; {folder containing file} *END; {FInfo} "ParamBlockRec = RECORD ({12 byte header used by the file and IO system} (qLink: QElemPtr; {queue link in header} (qType: INTEGER; {type byte for safety check} (ioTrap: INTEGER; {FS: the Trap} (ioCmdAddr: Ptr; {FS: address to dispatch to} ({common header to all variants} (ioCompletion: ProcPtr; {completion routine addr (0 for synch calls)} (ioResult: OsErr; {result code} (ioNamePtr: StringPtr; {ptr to Vol:FileName string} (ioVRefNum: INTEGER; {volume refnum (DrvNum for Eject and MountVol)} ({different components for the different type of parameter blocks} (CASE ParamBlkType OF (ioParam: *(ioRefNum: INTEGER; {refNum for I/O operation} +ioVersNum: SignedByte; {version number} +ioPermssn: SignedByte; {Open: permissions (byte)} +ioMisc: Ptr; {Rename: new name} D{GetEOF,SetEOF: logical end of file} D{Open: optional ptr to buffer} D{SetFileType: new type} +ioBuffer: Ptr; {data buffer Ptr} +ioReqCount: LongInt; {requested byte count} +ioActCount: LongInt; {actual byte count completed} +ioPosMode: INTEGER; {initial file positioning} +ioPosOffset: LongInt); {file position offset} (FileParam: *(ioFRefNum: INTEGER; {reference number} +ioFVersNum: SignedByte; {version number} +filler1: SignedByte; +ioFDirIndex: INTEGER; {GetFileInfo directory index} +ioFlAttrib: SignedByte; {GetFileInfo: in-use bit=7, lock bit=0} +ioFlVersNum: SignedByte; {file version number} +ioFlFndrInfo: FInfo; {user info} +ioFlNum: LongInt; {GetFileInfo: file number} +ioFlStBlk: INTEGER; {start file block (0 if none)} +ioFlLgLen: LongInt; {logical length (EOF)} +ioFlPyLen: LongInt; {physical lenght} +ioFlRStBlk: INTEGER; {start block rsrc fork} +ioFlRLgLen: LongInt; {file logical length rsrc fork} +ioFlRPyLen: LongInt; {file physical length rsrc fork} +ioFlCrDat: LongInt; {file creation date & time (32 bits in secs)} +ioFlMdDat: LongInt); {last modified date and time} )VolumeParam: +(filler2: LongInt; ,ioVolIndex: INTEGER; {volume index number} ,ioVCrDate: LongInt; {creation date and time} ,ioVLsBkUp: LongInt; {last backup date and time} ,ioVAtrb: INTEGER; {volume attrib} ,ioVNmFls: INTEGER; {number of files in directory} ,ioVDirSt: INTEGER; {start block of file directory} ,ioVBlLn: INTEGER; {GetVolInfo: length of dir in blocks} ,ioVNmAlBlks: INTEGER; {GetVolInfo: num blks (of alloc size)} ,ioVAlBlkSiz: LongInt; {GetVolInfo: alloc blk byte size} ,ioVClpSiz: LongInt; {GetVolInfo: bytes to allocate at a time} ,ioAlBlSt: INTEGER; {starting disk(512-byte) block in block map} ,ioVNxtFNum: LongInt; {GetVolInfo: next free file number} ,ioVFrBlk: INTEGER); {GetVolInfo: # free alloc blks for this vol} *CntrlParam: ,(ioCRefNum: INTEGER; {refNum for I/O operation} -CSCode: INTEGER; {word for control status code} -CSParam: ARRAY[0..10] OF INTEGER); {operation-defined parameters} &END; {ParamBlockRec} "ParmBlkPtr = ^ParamBlockRec; {20 bytes of system parameter area} "SysParmType = PACKED RECORD *Valid: Byte; {validation field ($A7)} *ATalkA: Byte; {AppleTalk node number hint for port A } *ATalkB: Byte; {AppleTalk node number hint for port B } *Config: Byte; {ATalk port configuration A = bits 4-7, B = 0-3} *PortA: INTEGER; {SCC port A configuration} *PortB: INTEGER; {SCC port B configuration} *Alarm: LongInt; {alarm time} *Font: INTEGER; {default font id} *KbdPrint: INTEGER; {high byte = kbd repeat} D{high nibble = thresh in 4/60ths} D{low nibble = rates in 2/60ths} @{low byte = print stuff} *VolClik: INTEGER; {low 3 bits of high byte = volume control} @{high nibble of low byte = double time in 4/60ths} @{low nibble of low byte = caret blink time in 4/60ths} *Misc: INTEGER; {EEEC EEEE PSKB FFHH} D{E = extra} D{P = paranoia level} D{S = mouse scaling} D{K = key click} D{B = boot disk} D{F = menu flash} D{H = help level} %END; {SysParmType} "SysPPtr = ^SysParmType; {volume control block data structure} VCB = RECORD $qLink: QElemPtr; {link to next element} $qType: INTEGER; {not used} $vcbFlags: INTEGER; $vcbSigWord: INTEGER; $vcbCrDate: LongInt; $vcbLsBkUp: LongInt; $vcbAtrb: INTEGER; $vcbNmFls: INTEGER; $vcbDirSt: INTEGER; $vcbBlLn: INTEGER; $vcbNmBlks: INTEGER; $vcbAlBlkSiz: LongInt; $vcbClpSIz: LongInt; $vcbAlBlSt: INTEGER; $vcbNxtFNum: LongInt; $vcbFreeBks: INTEGER; $vcbVN: STRING[27]; $vcbDrvNum: INTEGER; $vcbDRefNum: INTEGER; $vcbFSId: INTEGER; $vcbVRefNum: INTEGER; $vcbMAdr: Ptr; $vcbBufAdr: Ptr; $vcbMLen: INTEGER; $vcbDirIndex: INTEGER; $vcbDirBlk: INTEGER; END; {general queue data structure} QHdr = RECORD $QFlags: INTEGER; {misc flags} $QHead: QElemPtr; {first elem} $QTail: QElemPtr; {last elem} "END; {QHdr} QHdrPtr = ^QHdr; {there are currently 4 types of queues: } { VType - queue of Vertical Blanking Control Blocks } { IOQType - queue of I/0 queue elements } { DrvType - queue of drivers } { EvType - queue of Event Records } { FSQType - queue of VCB elements } { TimerType no longer is used. DrvType replaces it here in enum type} QTypes = (dummyType,vType,ioQType,drvQType,evType,fsQType); QElem = RECORD (CASE QTypes OF (vType: *(vblQelem: VBLTask); {vertical blanking} (ioQType: *(ioQElem: ParamBlockRec); {I/O parameter block} (drvQType: *(drvQElem: DrvQEl); {drive} (evType: *(evQElem: EvQEl); {event} (fsQType: *(vcbQElem: VCB); {volume control block} "END; {QElem} {device control entry} DCtlEntry = RECORD /DCtlDriver: Ptr; {ptr to ROM or handle to RAM driver} /DCtlFlags: INTEGER; {flags} /DCtlQHdr: QHdr; {driver's i/o queue} /DCtlPosition: LongInt; {byte pos used by read and write calls} /DCtlStorage: Handle; {hndl to RAM drivers private storage} /DCtlRefNum: INTEGER; {driver's reference number} /DCtlCurTicks: LongInt; {long counter for timing system task calls} /DCtlWindow: Ptr; {ptr to driver's window if any} /DCtlDelay: INTEGER; {number of ticks btwn sysTask calls} /DCtlEMask: INTEGER; {desk acessory event mask} /DCtlMenu: INTEGER; {menu ID of menu associated with driver} -END; {DCtlEntry} DCtlPtr = ^DCtlEntry; DCtlHandle = ^DCtlPtr; "{for Serial Driver} SerShk = PACKED RECORD {handshake control fields} 2fXOn: Byte; {XON flow control enabled flag} 2fCTS: Byte; {CTS flow control enabled flag} 2xon: Char; {XOn character} 2xoff: Char; {XOff character} 2errs: Byte; {errors mask bits} 2evts: Byte; {event enable mask bits} 2fInX: Byte; {Input flow control enabled flag} 2null: Byte; {unused} 0END; "{parameter block structure for file and IO routines} SerStaRec = PACKED RECORD 5cumErrs: Byte; {cumulative errors report} 5XOFFSent: Byte; {XOff Sent flag} 5rdPend: Byte; {read pending flag} 5wrPend: Byte; {write pending flag} 5ctsHold: Byte; {CTS flow control hold flag} 5XOFFHold: Byte; {XOff flow control hold flag} 3End; "{for Sound Driver} "{for 4-tone sound generation} "Wave = PACKED ARRAY[0..255] OF Byte; "WavePtr = ^Wave; "FTSoundRec = RECORD 2duration: INTEGER; 2sound1Rate: LongInt; 2sound1Phase: LongInt; 2sound2Rate: LongInt; 2sound2Phase: LongInt; 2sound3Rate: LongInt; 2sound3Phase: LongInt; 2sound4Rate: LongInt; 2sound4Phase: LongInt; 2sound1Wave: WavePtr; 2sound2Wave: WavePtr; 2sound3Wave: WavePtr; 2sound4Wave: WavePtr; 0END; "FTSndRecPtr = ^FTSoundRec; "FTSynthRec = RECORD 1mode: INTEGER; 1sndRec: FTSndRecPtr; /END; "FTSynthPtr = ^FTSynthRec; "Tone = RECORD +count: INTEGER; +amplitude: INTEGER; +duration: INTEGER; )END; "Tones = ARRAY[0..5000] OF Tone; "SWSynthRec = RECORD 1mode: INTEGER; 1triplets: Tones; /END; "SWSynthPtr = ^SWSynthRec; "freeWave = PACKED ARRAY[0..30000] OF Byte; "FFSynthRec = RECORD 1mode: INTEGER; 1count: Fixed; 1waveBytes: freeWave; /END; "FFSynthPtr = ^FFSynthRec; {for date and time} DateTimeRec = RECORD 0Year, {1904,1905,...} 0Month, {1,...,12 corresponding to Jan,...,Dec} 0Day, {1,...31} 0Hour, {0,...,23} 0Minute, {0,...,59} 0Second, {0,...,59} 0DayOfWeek: INTEGER; {1,...,7 corresponding to Sun,...,Sat} .END; {DateTimeRec} {for application parameter} appFile = RECORD 1vRefNum: INTEGER; 1ftype: OsType; 1versNum: INTEGER; {versNum in high byte} 1fName: str255; /END; {appFile} {for RAM serial driver} SPortSel = (SPortA,SPortB); {for disk driver} DrvSts = RECORD (track: INTEGER; {current track} (writeProt: SignedByte; {bit 7=1 if volume is locked} (diskInPlace: SignedByte; {disk in place} (installed: SignedByte; {drive installed} (sides: SignedByte; {bit 7=0 if single-sided drive} (qLink: QElemPtr; {next queue entry} (qType: INTEGER; {not used} (dqDrive: INTEGER; {drive number} (dqRefNum: INTEGER; {driver reference number} (dqFSID: INTEGER; {file-system identifier} (twoSideFmt: SignedByte; {-1 if two-sided disk} (needsFlush: SignedByte; {reserved} (diskErrs: INTEGER; {error count} $END; {DrvSts} {for Event Manager} FUNCTION PostEvent(eventNum: INTEGER; eventMsg: LongInt): OsErr; PROCEDURE FlushEvents(whichMask,stopMask: INTEGER); PROCEDURE SetEventMask(theMask: INTEGER); FUNCTION OSEventAvail(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN; FUNCTION GetOSEvent(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN; {OS utilities} FUNCTION HandToHand(VAR theHndl: Handle): OsErr; FUNCTION PtrToXHand(srcPtr: Ptr; dstHndl: Handle; size: LongInt): OsErr; FUNCTION PtrToHand(srcPtr: Ptr; VAR dstHndl: Handle; size: LongInt): OsErr; FUNCTION HandAndHand(hand1,hand2: Handle): OsErr; FUNCTION PtrAndHand(ptr1: Ptr; hand2: Handle; size: LongInt): OsErr; PROCEDURE SysBeep(duration: INTEGER); INLINE $A9C8; PROCEDURE Environs(VAR rom,machine: INTEGER); PROCEDURE Restart; {routines to set A5 to CurrentA5 and then restore a5 to previous value} {useful for ensuring good world for IOCompletion routines} PROCEDURE SetUpA5; INLINE $2F0D, $2A78, $0904; ${MOVE.L A5,-(SP) ;save old A5 on stack %MOVE.L CurrentA5,A5 ;get the real A5} PROCEDURE RestoreA5; INLINE $2A5F; ${MOVE.L (A7)+,A5 ;restore A5} {from HEAPZONE.TEXT} PROCEDURE SetApplBase(startPtr: Ptr); PROCEDURE InitApplZone; PROCEDURE InitZone(pgrowZone: ProcPtr; 3cmoreMasters: Integer; 3limitPtr,startPtr : Ptr); FUNCTION GetZone: THz; PROCEDURE SetZone(hz: THz); FUNCTION ApplicZone: THz; FUNCTION SystemZone: THz; FUNCTION CompactMem(cbNeeded: Size): Size; PROCEDURE PurgeMem(cbNeeded: Size); FUNCTION FreeMem: LongInt; PROCEDURE ResrvMem(cbNeeded: Size); FUNCTION MaxMem(Var grow: Size): Size; FUNCTION TopMem: Ptr; PROCEDURE SetGrowZone(growZone: ProcPtr); PROCEDURE SetApplLimit(zoneLimit: Ptr); FUNCTION GetApplLimit: Ptr; PROCEDURE MaxApplZone; FUNCTION MoveHHi (h: handle): OsErr; FUNCTION NewPtr(byteCount: Size): Ptr; PROCEDURE DisposPtr(p: Ptr); FUNCTION GetPtrSize(p: Ptr): Size; PROCEDURE SetPtrSize(p: Ptr; newSize: Size); FUNCTION PtrZone(p: Ptr): THz; FUNCTION NewHandle(byteCount: Size): Handle; PROCEDURE DisposHandle(h: Handle); FUNCTION GetHandleSize(h: Handle): Size; PROCEDURE SetHandleSize(h: Handle; newSize: Size); FUNCTION HandleZone(h: Handle): THz; FUNCTION RecoverHandle(p: Ptr): Handle; PROCEDURE EmptyHandle(h: Handle); PROCEDURE ReAllocHandle(h: Handle; byteCount: Size); PROCEDURE HLock(h: Handle); PROCEDURE HUnLock(h: Handle); PROCEDURE HPurge(h: Handle); PROCEDURE HNoPurge(h: Handle); PROCEDURE MoreMasters; PROCEDURE BlockMove(srcPtr, destPtr: Ptr; byteCount: Size); FUNCTION MemError: OsErr; FUNCTION GZCritical: Boolean; FUNCTION GZSaveHnd: Handle; {interface for core routines pertaining to the vertical retrace mgr} {routines defined in VBLCORE.TEXT} FUNCTION VInstall(VBLTaskPtr: QElemPtr): OsErr; FUNCTION VRemove(VBLTaskPtr: QElemPtr): OsErr; {interface for Operating System Dispatcher} {routines defined in DISPATCH.TEXT} FUNCTION GetTrapAddress(trapNum: INTEGER): LongInt; PROCEDURE SetTrapAddress(trapAddr: LongInt; trapNum: INTEGER); {interface for utility core routines (defined in sysutil)} FUNCTION GetSysPPtr: SysPPtr; FUNCTION WriteParam: OsErr; FUNCTION SetDateTime(time: LongInt):OsErr; FUNCTION ReadDateTime(VAR time: LongInt):OsErr; PROCEDURE GetDateTime(VAR secs: LongInt); PROCEDURE SetTime(d: DateTimeRec); PROCEDURE GetTime(VAR d: DateTimeRec); PROCEDURE Date2Secs(d: DateTimeRec; VAR s: LongInt); PROCEDUR Secs2Date(s: LongInt; VAR d: DateTimeRec); PROCEDURE Delay(numTicks: LongInt; VAR finalTicks: LongInt); FUNCTION EqualString(str1,str2: Str255; caseSens,diacSens: BOOLEAN):BOOLEAN; PROCEDURE UprString(VAR theString: Str255; diacSens: BOOLEAN); FUNCTION InitUtil: OsErr; PROCEDURE UnLoadSeg(routineAddr: Ptr); INLINE $A9F1; PROCEDURE ExitToShell; INLINE $A9F4; PROCEDURE GetAppParms(VAR apName: str255; VAR apRefNum: INTEGER; 6VAR apParam: Handle); INLINE $A9F5; PROCEDURE CountAppFiles(VAR message: INTEGER; VAR count: INTEGER); PROCEDURE GetAppFiles(index: INTEGER; VAR theFile: AppFile); PROCEDURE ClrAppFiles(index: INTEGER); {queue routines - part of Macintosh core Utility routines} PROCEDURE FInitQueue; PROCEDURE Enqueue(qElement: QElemPtr; qHeader: QHdrPtr); FUNCTION Dequeue(qElement: QElemPtr; qHeader: QHdrPtr): OsErr; FUNCTION GetFSQHdr: QHdrPtr; FUNCTION GetDrvQHdr: QHdrPtr; FUNCTION GetVCBQHdr: QHdrPtr; FUNCTION GetVBLQHdr: QHdrPtr; FUNCTION GetEvQHdr: QHdrPtr; FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle; {from MACIO.TEXT} FUNCTION PBOpen(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBClose(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRead(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBWrite(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBControl(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBStatus(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBKillIO(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetVInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBFlushVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBCreate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBDelete(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBOpenRF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRename(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRstFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFVers(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBAllocate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBFlushFile(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBMountVol(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBUnMountVol(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBEject(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBOffLine(paramBlock: ParmBlkPtr): OsErr; PROCEDURE AddDrive(drvrRefNum: INTEGER; drvNum: INTEGER; QEl: drvQElPtr); FUNCTION FSOpen(fileName: Str255; vRefNum: INTEGER; VAR refNum: INTEGER): OsErr; FUNCTION FSClose(refNum: INTEGER): OsErr; FUNCTION FSRead(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr; FUNCTION FSWrite(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr; FUNCTION Control(refNum: INTEGER; csCode: INTEGER; 4csParamPtr: Ptr): OsErr; FUNCTION Status(refNum: INTEGER; csCode: INTEGER; 3csParamPtr: Ptr): OsErr; FUNCTION KillIO(refNum: INTEGER): OsErr; {-volume level calls-} FUNCTION GetVInfo(drvNum: INTEGER; volName: StringPtr; VAR vRefNum: INTEGER; 1VAR FreeBytes: LongInt): OsErr; FUNCTION GetFInfo(fileName: Str255; vRefNum: INTEGER; 2VAR FndrInfo: FInfo):OsErr; FUNCTION GetVol(volName: StringPtr; VAR vRefNum: INTEGER):OsErr; FUNCTION SetVol(volName: StringPtr; vRefNum: INTEGER): OsErr; FUNCTION UnMountVol(volName: StringPtr; vRefNum: INTEGER):OsErr; FUNCTION Eject(volName: StringPtr; vRefNum: INTEGER): OsErr; FUNCTION FlushVol(volName: StringPtr; vRefNum: INTEGER):OsErr; {-file level calls for unopened files-} FUNCTION Create(fileName: Str255; vRefNum: INTEGER; creator: OSType; 0fileType: OSType):OsErr; FUNCTION FSDelete(fileName: Str255; vRefNum: INTEGER):OsErr; FUNCTION OpenRF(fileName: Str255; vRefNum: INTEGER; 0VAR refNum: INTEGER): OsErr; FUNCTION Rename(oldName: Str255; vRefNum: INTEGER; 0newName: Str255):OsErr; FUNCTION SetFInfo(fileName: Str255; vRefNum: INTEGER; 2FndrInfo: FInfo):OsErr; FUNCTION SetFLock(fileName: Str255; vRefNum: INTEGER):OsErr; FUNCTION RstFLock(fileName: Str255; vRefNum: INTEGER):OsErr; {-file level calls for opened files-} FUNCTION Allocate(refNum: INTEGER; VAR count: LongInt):OsErr; FUNCTION GetEOF(refNum: INTEGER; VAR LogEOF: LongInt):OsErr; FUNCTION SetEOF(refNum: INTEGER; LogEOF: LongInt):OsErr; FUNCTION GetFPos(refNum: INTEGER; VAR filePos: LongInt):OsErr; FUNCTION SetFPos(refNum: INTEGER; posMode: INTEGER; posOff: LongInt):OsErr; FUNCTION GetVRefNum(fileRefNum: INTEGER):INTEGER; {Serial Driver Interface} FUNCTION OpenDriver(name: Str255; VAR drvrRefNum: INTEGER): OsErr; FUNCTION CloseDriver(refNum: Integer):OsErr; FUNCTION SerReset(refNum: INTEGER; serConfig: INTEGER): OSErr; FUNCTION SerSetBuf(refNum: INTEGER; serBPtr: Ptr; serBLen: INTEGER): OSErr; FUNCTION SerHShake(refNum: INTEGER; flags: SerShk): OSErr; FUNCTION SerSetBrk(refNum: INTEGER): OSErr; FUNCTION SerClrBrk(refNum: INTEGER): OSErr; FUNCTION SerGetBuf(refNum: INTEGER; VAR count: LongInt): OSErr; FUNCTION SerStatus(refNum: INTEGER; VAR serSta: SerStaRec): OSErr; FUNCTION DiskEject(drvnum: INTEGER): OSErr; FUNCTION SetTagBuffer(buffPtr: Ptr): OSErr; FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr; FUNCTION RamSDOpen(whichPort: SPortSel): OSErr; PROCEDURE RamSDClose(whichPort: SPortSel); {for Sound Driver} PROCEDURE SetSoundVol(level: INTEGER); PROCEDURE GetSoundVol(VAR level: INTEGER); PROCEDURE StartSound(synthRec: Ptr; numBytes: LongInt; CompletionRtn: ProcPtr); PROCEDURE StopSound; FUNCTION SoundDone: BOOLEAN; {for the system error handler} PROCEDURE SysError(errorCode: INTEGER); IMPLEMENTATION {for Event Manager} FUNCTION PostEvent; EXTERNAL; PROCEDURE FlushEvents; EXTERNAL; PROCEDURE SetEventMask; EXTERNAL; FUNCTION OSEventAvail; EXTERNAL; FUNCTION GetOSEvent; EXTERNAL; {OS utilities} FUNCTION HandToHand; EXTERNAL; FUNCTION PtrToXHand; EXTERNAL; FUNCTION PtrToHand; EXTERNAL; FUNCTION HandAndHand; EXTERNAL; FUNCTION PtrAndHand; EXTERNAL; PROCEDURE Environs; EXTERNAL; PROCEDURE Restart; EXTERNAL; {from HEAPZONE.TEXT} PROCEDURE SetApplBase; EXTERNAL; PROCEDURE InitApplZone; EXTERNAL; PROCEDURE InitZone; EXTERNAL; FUNCTION GetZone; EXTERNAL; PROCEDURE SetZone; EXTERNAL; FUNCTION ApplicZone; EXTERNAL; FUNCTION SystemZone; EXTERNAL; FUNCTION CompactMem; EXTERNAL; PROCEDURE PurgeMem; EXTERNAL; FUNCTION FreeMem; EXTERNAL; PROCEDURE ResrvMem; EXTERNAL; FUNCTION MaxMem; EXTERNAL; FUNCTION TopMem; EXTERNAL; PROCEDURE SetGrowZone; EXTERNAL; PROCEDURE SetApplLimit; EXTERNAL; FUNCTION GetApplLimit; EXTERNAL; PROCEDURE MaxApplZone; EXTERNAL; FUNCTION MoveHHi; EXTERNAL; FUNCTION NewPtr; EXTERNAL; PROCEDURE DisposPtr; EXTERNAL; FUNCTION GetPtrSize; EXTERNAL; PROCEDURE SetPtrSize; EXTERNAL; FUNCTION PtrZone; EXTERNAL; FUNCTION NewHandle; EXTERNAL; PROCEDURE DisposHandle; EXTERNAL; FUNCTION GetHandleSize; EXTERNAL; PROCEDURE SetHandleSize; EXTERNAL; FUNCTION HandleZone; EXTERNAL; FUNCTION RecoverHandle; EXTERNAL; PROCEDURE EmptyHandle; EXTERNAL; PROCEDURE ReAllocHandle; EXTERNAL; PROCEDURE HLock; EXTERNAL; PROCEDURE HUnLock; EXTERNAL; PROCEDURE HPurge; EXTERNAL; PROCEDURE HNoPurge; EXTERNAL; PROCEDURE MoreMasters;EXTERNAL; PROCEDURE BlockMove; EXTERNAL; FUNCTION MemError; EXTERNAL; FUNCTION GZCritical; EXTERNAL; FUNCTION GZSaveHnd; EXTERNAL; {from OSMISC.TEXT} FUNCTION OpenDriver;EXTERNAL; FUNCTION CloseDriver;EXTERNAL; FUNCTION VInstall;EXTERNAL; FUNCTION VRemove;EXTERNAL; FUNCTION GetTrapAddress;EXTERNAL; PROCEDURE SetTrapAddress;EXTERNAL; FUNCTION GetSysPPtr;EXTERNAL; FUNCTION WriteParam;EXTERNAL; FUNCTION SetDateTime;EXTERNAL; FUNCTION ReadDateTime;EXTERNAL; PROCEDURE SetTime;EXTERNAL; PROCEDURE GetDateTime;EXTERNAL; PROCEDURE GetTime;EXTERNAL; PROCEDURE Date2Secs;EXTERNAL; PROCEDURE Secs2Date;EXTERNAL; PROCEDURE Delay;EXTERNAL; FUNCTION EqualString;EXTERNAL; PROCEDURE UprString;EXTERNAL; FUNCTION InitUtil;EXTERNAL; {queue routines} PROCEDURE FInitQueue;EXTERNAL; PROCEDURE Enqueue;EXTERNAL; FUNCTION Dequeue;EXTERNAL; FUNCTION GetFSQHdr; EXTERNAL; FUNCTION GetDrvQHdr; EXTERNAL; FUNCTION GetVCBQHdr; EXTERNAL; FUNCTION GetVBLQHdr; EXTERNAL; FUNCTION GetEvQHdr; EXTERNAL; FUNCTION GetDCtlEntry; EXTERNAL; {FUNCTION GetDCtlQHdr; EXTERNAL;} {from MACIO.TEXT} FUNCTION PBOpen;EXTERNAL; FUNCTION PBClose;EXTERNAL; FUNCTION PBRead;EXTERNAL; FUNCTION PBWrite;EXTERNAL; FUNCTION PBControl;EXTERNAL; FUNCTION PBStatus;EXTERNAL; FUNCTION PBKillIO;EXTERNAL; FUNCTION PBGetVInfo;EXTERNAL; FUNCTION PBGetVol;EXTERNAL; FUNCTION PBSetVol;EXTERNAL; FUNCTION PBFlushVol;EXTERNAL; FUNCTION PBCreate;EXTERNAL; FUNCTION PBDelete;EXTERNAL; FUNCTION PBOpenRF;EXTERNAL; FUNCTION PBRename;EXTERNAL; FUNCTION PBGetFInfo;EXTERNAL; FUNCTION PBSetFInfo;EXTERNAL; FUNCTION PBSetFLock;EXTERNAL; FUNCTION PBRstFLock;EXTERNAL; FUNCTION PBSetFVers;EXTERNAL; FUNCTION PBAllocate;EXTERNAL; FUNCTION PBGetEOF;EXTERNAL; FUNCTION PBSetEOF;EXTERNAL; FUNCTION PBGetFPos;EXTERNAL; FUNCTION PBSetFPos;EXTERNAL; FUNCTION PBFlushFile;EXTERNAL; FUNCTION PBMountVol;EXTERNAL; FUNCTION PBUnMountVol;EXTERNAL; FUNCTION PBEject;EXTERNAL; FUNCTION PBOffLine;EXTERNAL; PROCEDURE AddDrive;EXTERNAL; FUNCTION FSOpen;EXTERNAL; FUNCTION FSClose;EXTERNAL; FUNCTION FSRead;EXTERNAL; FUNCTION FSWrite;EXTERNAL; FUNCTION Control;EXTERNAL; FUNCTION Status;EXTERNAL; FUNCTION KillIO;EXTERNAL; FUNCTION GetVInfo;EXTERNAL; FUNCTION GetFInfo;EXTERNAL; FUNCTION GetVol;EXTERNAL; FUNCTION SetVol;EXTERNAL; FUNCTION UnMountVol;EXTERNAL; FUNCTION Eject;EXTERNAL; FUNCTION FlushVol;EXTERNAL; FUNCTION Create;EXTERNAL; FUNCTION FSDelete;EXTERNAL; FUNCTION OpenRF;EXTERNAL; FUNCTION Rename;EXTERNAL; FUNCTION SetFInfo;EXTERNAL; FUNCTION SetFLock;EXTERNAL; FUNCTION RstFLock;EXTERNAL; FUNCTION Allocate;EXTERNAL; FUNCTION GetEOF;EXTERNAL; FUNCTION SetEOF;EXTERNAL; FUNCTION GetFPos;EXTERNAL; FUNCTION SetFPos;EXTERNAL; FUNCTION GetVRefNum;EXTERNAL; FUNCTION SerReset;EXTERNAL; FUNCTION SerSetBuf;EXTERNAL; FUNCTION SerHShake;EXTERNAL; FUNCTION SerSetBrk;EXTERNAL; FUNCTION SerClrBrk;EXTERNAL; FUNCTION SerGetBuf;EXTERNAL; FUNCTION SerStatus;EXTERNAL; FUNCTION DiskEject;EXTERNAL; FUNCTION SetTagBuffer;EXTERNAL; FUNCTION DriveStatus;EXTERNAL; FUNCTION RamSDOpen;EXTERNAL; PROCEDURE RamSDClose;EXTERNAL; PROCEDURE SetSoundVol;EXTERNAL; PROCEDURE GetSoundVol;EXTERNAL; PROCEDURE StartSound;EXTERNAL; PROCEDURE StopSound;EXTERNAL; FUNCTION SoundDone;EXTERNAL; PROCEDURE SWSetLevel;EXTERNAL; PROCEDURE ClrAppFiles;EXTERNAL; PROCEDURE CountAppFiles;EXTERNAL; PROCEDURE GetAppFiles;EXTERNAL; {for the system error handler} PROCEDURE SysError; EXTERNAL; END. WritelnWindow.textii64yܠ(!eNV n  D98Ѫ".<^66!c̘fdLPš̘nk̘f̗tLbL ̘nk̘f̗#̘f̗9 8Ѫ".<^6 6 (* $EXEC P{ascal}intrfc/WritelnWindow {no list file} obj/WritelnWindow $ENDEXEC *) UNIT WriteLnWindow; {$M+} {$X-} {$SETC qWWdebug := FALSE} INTERFACE {$L-} USES ${$U-} ${$U obj/MemTypes} MemTypes, ${$U obj/QuickDraw} QuickDraw, ${$U obj/OSIntf} OSIntf, ${$U obj/ToolIntf} ToolIntf, ${$U obj/PasLibIntf} PasLibIntf; {$L+} CONST $kWWEol = CHR($0D); VAR gDebugWindowPtr: WindowPtr; {All public procedure begin with WW (for WritelnWindow)} PROCEDURE WWInit; ${Call this{------------------------------------------------------------------------------- PACKINTF Pascal Interface PACKINTF NAME PackIntf -- Packages Interface (16 Jan 85) DESCRIPTION This file contains the interface to Macintosh Package routines. The implementation of these interfaces is in the file PackTraps.obj. For more detailed information see the "Packages" section of the "Inside Macintosh" documentation. AUTHOR Pascal Interfaces by Rony Sebok Copyright 1983, 1984, 1985 Apple Computer Inc. BUGS -------------------------------------------------------------------------------} UNIT PackIntf; INTERFACE USES {$U-} {$U obj/MemTypes } MemTypes, {$U obj/QuickDraw } QuickDraw, {$U obj/OsIntf } OsIntf, {$U obj/ToolIntf } ToolIntf; { Package Manager ----------------------------------------------------} { These routines are currently in ToolIntf.text } { Disk Initialization Package ----------------------------------------} PROCEDURE DILoad; PROCEDURE DIUnLoad; FUNCTION DIBadMount(where: Point; evtMessage: LongInt): INTEGER; FUNCTION DIFormat(drvNum: INTEGER): OsErr; FUNCTION DIVerify(drvNum: INTEGER): OsErr; FUNCTION DIZero(drvNum: INTEGER; volName: Str255): OsErr; { Standard File Package ----------------------------------------------} CONST putDlgID = -3999; {SFPutFile dialog template ID} putSave = 1; {save button} putCancel = 2; {cancel button} putEject = 5; {eject button} putDrive = 6; {drive button} putName = 7; {editTExt item for file name} getDlgID = -4000; {SFGetFile dialog template ID} getOpen = 1; {open button} getCancel = 3; {cancel button} getEject = 5; {eject button} getDrive = 6; {drive button} getNmList = 7; {userItem for file name list} getScroll = 8; {userItem for scroll bar} TYPE SFReply = RECORD good: BOOLEAN; {ignore command if FALSE} copy: BOOLEAN; {not used} fType: OsType; {file type or not used} vRefNum: INTEGER; {volume reference number} version: INTEGER; {file's version number} fName: String[63]; {file name} END; {SFReply} SFTypeList = ARRAY[0..3] OF OSType; PROCEDURE SFPutFile(where: Point; prompt: Str255; origName: Str255; dlgHook: ProcPtr; VAR reply: SFReply); PROCEDURE SFPPutFile(where: Point; prompt: Str255; origName: Str255; dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr); PROCEDURE SFGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr; numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr; VAR reply: SFReply); PROCEDURE SFPGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr; numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr); { International Utilities Package ------------------------------------} CONST {constants for manipulation of international resources} {masks used for setting and testing currency format flags} currSymLead = 16; {set if currency symbol leads, reset if trails} currNegSym = 32; {set if minus sign for negative num, reset if parentheses} currTrailingZ = 64; {set if trailing zero} currLeadingZ = 128; {set if leading zero} {constants specifying absolute value of short date form} MDY = 0; {month,day,year} DMY = 1; {day,month,year} YMD = 2; {year,month,day} {masks used for date element format flags} dayLdingZ = 32; {set if leading zero for day} mntLdingZ = 64; {set if leading 0 for month} century = 128; {set if century, reset if no century} {masks used for time element format flags} secLeadingZ = 32; {set if leading zero for seconds} minLeadingZ = 64; {set if leading zero for minutes} hrLeadingZ = 128; {set if leading zero for hours} {country codes for version numbers} verUS = 0; verFrance = 1; verBritain = 2; verGermany = 3; verItaly = 4; verNetherlands = 5; verBelgiumLux = 6; verSweden = 7; verSpain = 8; verDenmark = 9; verPortugal = 10; verFrCanada = 11; verNorway = 12; verIsrael = 13; verJapan = 14; verAustralia = 15; verArabia = 16; verFinland = 17; verFrSwiss = 18; verGrSwiss = 19; verGreece = 20; verIceland = 21; verMalta = 22; verCyprus = 23; verTurkey = 24; verYugoslavia = 25; TYPE intl0Hndl = ^intl0Ptr; intl0Ptr = ^intl0REc; intl0Rec = PACKED RECORD decimalPt: char; {ASCII character for decimal point} thousSep: char; {ASCII character for thousand separator} listSep: char; {ASCII character for list separator} currSym1: char; {ASCII for currency symbol (3 bytes long)} currSym2: char; currSym3: char; currFmt: Byte; {currency format flags} dateOrder: Byte; {short date form - DMY,YMD, or MDY} shrtDateFmt: Byte; {date elements format flag} dateSep: char; {ASCII for date separator} timeCycle: Byte; {indicates 12 or 24 hr cycle} timeFmt: Byte; {time elements format flags} mornStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 0:00 to 11:59} eveStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 12:00 to 23:59} timeSep: char; {ASCII for the time separator} time1Suff: char; {suffix string used in 24 hr mode} time2Suff: char; {8 characters long} time3Suff: char; time4Suff: char; time5Suff: char; time6Suff: char; time7Suff: char; time8Suff: char; metricSys: Byte; {indicates metric or English system} intl0Vers: INTEGER; {version: high byte = country, low byte = vers} END; {intl0Rec} intl1Hndl = ^intl1Ptr; intl1Ptr = ^intl1REc; intl1Rec = PACKED RECORD days: ARRAY[1..7] OF String[15]; {length and word for Sunday through Monday} months: ARRAY[1..12] OF String[15]; {length and word for January to December} suppressDay: Byte; {0 for day of week, 255 for no day of week} lngDateFmt: Byte; {expanded date format 0 or 255} dayLeading0: Byte; {255 for leading 0, 0 for no leading 0} abbrLen: Byte; {length of abbreviated names in long form} st0: PACKED ARRAY[1..4] OF char; {the string st0} st1: PACKED ARRAY[1..4] OF char; {the string st1} st2: PACKED ARRAY[1..4] OF char; {the string st2} st3: PACKED ARRAY[1..4] OF char; {the string st3} st4: PACKED ARRAY[1..4] OF char; {the string st4} intl1Vers: INTEGER; {version word} localRtn: INTEGER; {routine for localizing mag comp; } {minimal case is $4E75 for RTS, but } {routine may be longer than one integer.} END; {intl1Rec} DateForm = (shortDate, longDate, abbrevDate); FUNCTION IUGetIntl(theID: INTEGER): Handle; PROCEDURE IUSetIntl(refNum: INTEGER; theID: INTEGER; intlParam: Handle); PROCEDURE IUDateString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255); PROCEDURE IUDatePString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255; intlParam: Handle); PROCEDURE IUTimeString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255); PROCEDURE IUTimePString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255; intlParam: Handle); FUNCTION IUMetric: BOOLEAN; FUNCTION IUCompString(aStr,bStr: Str255): INTEGER; FUNCTION IUEqualString(aStr,bStr: Str255): INTEGER; FUNCTION IUMagString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER): INTEGER; FUNCTION IUMagIDString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER):INTEGER; { Binary-Decimal Conversion Package ----------------------------------} PROCEDURE StringToNum(theString: Str255; VAR theNum: LongInt); PROCEDURE NumToString(theNum: LongInt; VAR theString: Str255); IMPLEMENTATION { Binary-Decimal Conversion Package ----------------------------------} PROCEDURE StringToNum;EXTERNAL; PROCEDURE NumToString;EXTERNAL; { Standard File Package ----------------------------------------------} PROCEDURE SFPutFile;EXTERNAL; PROCEDURE SFPPutFile;EXTERNAL; PROCEDURE SFGetFile;EXTERNAL; PROCEDURE SFPGetFile;EXTERNAL; { Disk Initialization Package ----------------------------------------} PROCEDURE DILoad;EXTERNAL; PROCEDURE DIUnLoad;EXTERNAL; FUNCTION DIBadMount;EXTERNAL; FUNCTION DIFormat;EXTERNAL; FUNCTION DIVerify;EXTERNAL; FUNCTION DIZero;EXTERNAL; { International Utilities Package ------------------------------------} FUNCTION IUGetIntl;EXTERNAL; PROCEDURE IUSetIntl;EXTERNAL; PROCEDURE IUDateString;EXTERNAL; PROCEDURE IUDatePString;EXTERNAL; PROCEDURE IUTimeString;EXTERNAL; PROCEDURE IUTimePString;EXTERNAL; FUNCTION IUMetric;EXTERNAL; FUNCTION IUCompString;EXTERNAL; FUNCTION IUEqualString;EXTERNAL; FUNCTION IUMagString;EXTERNAL; FUNCTION IUMagIDString;EXTERNAL; END. { of unit } 3. "6F^9D!$ǐ^83L4œL0̱&̱4̰¬L.LH̱&$̱4̰$̱̰9; D!$ǐ^,?,?{$X-} UNIT PaslibIntf; {Mac Pascal heap management} INTERFACE USES {$U-} #{$U obj/memtypes } memtypes, #{$U Obj/QuickDraw } QuickDraw, #{$U Obj/OSIntf } OSIntf; $PROCEDURE PLInitHeap (sizepheap : LONGINT; :memerrProc : ProcPtr; :allowNonCont, :allowDispose : BOOLEAN); $PROCEDURE PLSetNonCont (allowNonCont : BOOLEAN); $PROCEDURE PLSetMErrProc (memerrProc : ProcPtr); $PROCEDURE PLSetHeapType (forDispose : BOOLEAN); $PROCEDURE PLSetWrPort (portptr : GrafPtr); >{set a grafport (window) for writeln, use 0 if want ?to go back to the console port (the screen)} $PROCEDURE PLSetWProc (wrproc : ProcPtr); >{set a writeln capture proc, use 0 if want to go ?back to the standard one (in paslib). ?The wrproc must be defined as ?procedure wrproc (buf : Ptr; count : integer);} IMPLEMENTATION $PROCEDURE PLInitHeap (sizepheap : LONGINT; :memerrProc : ProcPtr; :allowNonCont, :allowDispose : BOOLEAN); EXTERNAL; $PROCEDURE PLSetNonCont (allowNonCont : BOOLEAN); EXTERNAL; $PROCEDURE PLSetMErrProc (memerrProc : ProcPtr); EXTERNAL; $PROCEDURE PLSetHeapType (forDispose : BOOLEAN); EXTERNAL; $PROCEDURE PLSetWrPort (portptr : GrafPtr); EXTERNAL; $PROCEDURE PLSetWProc (wrproc : ProcPtr); EXTERNAL; END. {------------------------------------------------------------------------------- QUICKDRAW Pascal Interface QUICKDRAW NAME QuickDraw -- QuickDraw Interface (16 Jan 85) DESCRIPTION This file contains the interface to the QuickDraw routines. All of the interface routines are implemented as in-line traps. For more detailed information see the "QuickDraw" section of the "Inside Macintosh" documentation. AUTHOR Bill Atkinson Copyright 1983, 1984, 1985 Apple Computer Inc. BUGS -------------------------------------------------------------------------------} UNIT QuickDraw; INTERFACE USES {$U-} {$U obj/MemTypes } MemTypes; CONST srcCopy = 0; { the 16 transfer modes } srcOr = 1; srcXor = 2; srcBic = 3; notSrcCopy = 4; notSrcOr = 5; notSrcXor = 6; notSrcBic = 7; patCopy = 8; patOr = 9; patXor = 10; patBic = 11; notPatCopy = 12; notPatOr = 13; notPatXor = 14; notPatBic = 15; { QuickDraw color separation constants } normalBit = 0; { normal screen mapping } inverseBit = 1; { inverse screen mapping } redBit = 4; { RGB additive mapping } greenBit = 3; blueBit = 2; cyanBit = 8; { CMYBk subtractive mapping } magentaBit = 7; yellowBit = 6; blackBit = 5; blackColor = 33; { colors expressed in these mappings } whiteColor = 30; redColor = 205; greenColor = 341; blueColor = 409; cyanColor = 273; magentaColor = 137; yellowColor = 69; picLParen = 0; { standard picture comments } picRParen = 1; TYPE QDByte = SignedByte; QDPtr = Ptr; { blind pointer } QDHandle = Handle; { blind handle } Pattern = PACKED ARRAY[0..7] OF 0..255; Bits16 = ARRAY[0..15] OF INTEGER; VHSelect = (v,h); GrafVerb = (frame,paint,erase,invert,fill); StyleItem = (bold,italic,underline,outline,shadow,condense,extend); Style = SET OF StyleItem; FontInfo = RECORD ascent: INTEGER; descent: INTEGER; widMax: INTEGER; leading: INTEGER; END; Point = RECORD CASE INTEGER OF 0: (v: INTEGER; h: INTEGER); 1: (vh: ARRAY[VHSelect] OF INTEGER); END; Rect = RECORD CASE INTEGER OF 0: (top: INTEGER; left: INTEGER; bottom: INTEGER; right: INTEGER); 1: (topLeft: Point; botRight: Point); END; BitMap = RECORD baseAddr: Ptr; rowBytes: INTEGER; bounds: Rect; END; Cursor = RECORD data: Bits16; mask: Bits16; hotSpot: Point; END; PenState = RECORD pnLoc: Point; pnSize: Point; pnMode: INTEGER; pnPat: Pattern; END; PolyHandle = ^PolyPtr; PolyPtr = ^Polygon; Polygon = RECORD polySize: INTEGER; polyBBox: Rect; polyPoints: ARRAY[0..0] OF Point; END; RgnHandle = ^RgnPtr; RgnPtr = ^Region; Region = RECORD rgnSize: INTEGER; { rgnSize = 10 for rectangular } rgnBBox: Rect; { plus more data if not rectangular } END; PicHandle = ^PicPtr; PicPtr = ^Picture; Picture = RECORD picSize: INTEGER; picFrame: Rect; { plus byte codes for picture content } END; QDProcsPtr = ^QDProcs; QDProcs = RECORD textProc: Ptr; lineProc: Ptr; rectProc: Ptr; rRectProc: Ptr; ovalProc: Ptr; arcProc: Ptr; polyProc: Ptr; rgnProc: Ptr; bitsProc: Ptr; commentProc: Ptr; txMeasProc: Ptr; getPicProc: Ptr; putPicProc: Ptr; END; GrafPtr = ^GrafPort; GrafPort = RECORD device: INTEGER; portBits: BitMap; portRect: Rect; visRgn: RgnHandle; clipRgn: RgnHandle; bkPat: Pattern; fillPat: Pattern; pnLoc: Point; pnSize: Point; pnMode: INTEGER; pnPat: Pattern; pnVis: INTEGER; txFont: INTEGER; txFace: Style; txMode: INTEGER; txSize: INTEGER; spExtra: LongInt; fgColor: LongInt; bkColor: LongInt; colrBit: INTEGER; patStretch: INTEGER; picSave: Handle; rgnSave: Handle; polySave: Handle; grafProcs: QDProcsPtr; END; VAR thePort: GrafPtr; white: Pattern; black: Pattern; gray: Pattern; ltGray: Pattern; dkGray: Pattern; arrow: Cursor; screenBits: BitMap; randSeed: LongInt; { GrafPort Routines } PROCEDURE InitGraf (globalPtr: Ptr); INLINE $A86E; PROCEDURE OpenPort (port: GrafPtr); INLINE $A86F; PROCEDURE InitPort (port: GrafPtr); INLINE $A86D; PROCEDURE ClosePort (port: GrafPtr); INLINE $A87D; PROCEDURE SetPort (port: GrafPtr); INLINE $A873; PROCEDURE GetPort (VAR port: GrafPtr); INLINE $A874; PROCEDURE GrafDevice (device: INTEGER); INLINE $A872; PROCEDURE SetPortBits(bm: BitMap); INLINE $A875; PROCEDURE PortSize (width,height: INTEGER); INLINE $A876; PROCEDURE MovePortTo (leftGlobal,topGlobal: INTEGER); INLINE $A877; PROCEDURE SetOrigin (h,v: INTEGER); INLINE $A878; PROCEDURE SetClip (rgn: RgnHandle); INLINE $A879; PROCEDURE GetClip (rgn: RgnHandle); INLINE $A87A; PROCEDURE ClipRect (r: Rect); INLINE $A87B; PROCEDURE BackPat (pat: Pattern); INLINE $A87C; { Cursor Routines } PROCEDURE InitCursor; INLINE $A850; PROCEDURE SetCursor(crsr: Cursor); INLINE $A851; PROCEDURE HideCursor; INLINE $A852; PROCEDURE ShowCursor; INLINE $A853; PROCEDURE ObscureCursor; INLINE $A856; { Line Routines } PROCEDURE HidePen; INLINE $A896; PROCEDURE ShowPen; INLINE $A897; PROCEDURE GetPen (VAR pt: Point); INLINE $A89A; PROCEDURE GetPenState(VAR pnState: PenState); INLINE $A898; PROCEDURE SetPenState(pnState: PenState); INLINE $A899; PROCEDURE PenSize (width,height: INTEGER); INLINE $A89B; PROCEDURE PenMode (mode: INTEGER); INLINE $A89C; PROCEDURE PenPat (pat: Pattern); INLINE $A89D; PROCEDURE PenNormal; INLINE $A89E; PROCEDURE MoveTo (h,v: INTEGER); INLINE $A893; PROCEDURE Move (dh,dv: INTEGER); INLINE $A894; PROCEDURE LineTo (h,v: INTEGER); INLINE $A891; PROCEDURE Line (dh,dv: INTEGER); INLINE $A892; { Text Routines } PROCEDURE TextFont (font: INTEGER); INLINE $A887; PROCEDURE TextFace (face: Style); INLINE $A888; PROCEDURE TextMode (mode: INTEGER); INLINE $A889; PROCEDURE TextSize (size: INTEGER); INLINE $A88A; PROCEDURE SpaceExtra (extra: Fixed); INLINE $A88E; PROCEDURE DrawChar (ch: char); INLINE $A883; PROCEDURE DrawString (s: Str255); INLINE $A884; PROCEDURE DrawText (textBuf: Ptr; firstByte,byteCount: INTEGER); INLINE $A885; FUNCTION CharWidth (ch: CHAR): INTEGER; INLINE $A88D; FUNCTION StringWidth (s: Str255): INTEGER; INLINE $A88C; FUNCTION TextWidth (textBuf: Ptr; firstByte,byteCount: INTEGER): INTEGER; INLINE $A886; PROCEDURE GetFontInfo (VAR info: FontInfo); INLINE $A88B; { Point Calculations } PROCEDURE AddPt (src: Point; VAR dst: Point); INLINE $A87E; PROCEDURE SubPt (src: Point; VAR dst: Point); INLINE $A87F; PROCEDURE SetPt (VAR pt: Point; h,v: INTEGER); INLINE $A880; FUNCTION EqualPt (pt1,pt2: Point): BOOLEAN; INLINE $A881; PROCEDURE ScalePt (VAR pt: Point; fromRect,toRect: Rect); INLINE $A8F8; PROCEDURE MapPt (VAR pt: Point; fromRect,toRect: Rect); INLINE $A8F9; PROCEDURE LocalToGlobal (VAR pt: Point); INLINE $A870; PROCEDURE GlobalToLocal (VAR pt: Point); INLINE $A871; { Rectangle Calculations } PROCEDURE SetRect (VAR r: Rect; left,top,right,bottom: INTEGER); INLINE $A8A7; FUNCTION EqualRect (rect1,rect2: Rect): BOOLEAN; INLINE $A8A6; FUNCTION EmptyRect (r: Rect): BOOLEAN; INLINE $A8AE; PROCEDURE OffsetRect (VAR r: Rect; dh,dv: INTEGER); INLINE $A8A8; PROCEDURE MapRect (VAR r: Rect; fromRect,toRect: Rect); INLINE $A8FA; PROCEDURE InsetRect (VAR r: Rect; dh,dv: INTEGER); INLINE $A8A9; FUNCTION SectRect (src1,src2: Rect; VAR dstRect: Rect): BOOLEAN; INLINE $A8AA; PROCEDURE UnionRect (src1,src2: Rect; VAR dstRect: Rect); INLINE $A8AB; FUNCTION PtInRect (pt: Point; r: Rect): BOOLEAN; INLINE $A8AD; PROCEDURE Pt2Rect (pt1,pt2: Point; VAR dstRect: Rect); INLINE $A8AC; { Graphical Operations on Rectangles } PROCEDURE FrameRect (r: Rect); INLINE $A8A1; PROCEDURE PaintRect (r: Rect); INLINE $A8A2; PROCEDURE EraseRect (r: Rect); INLINE $A8A3; PROCEDURE InvertRect (r: Rect); INLINE $A8A4; PROCEDURE FillRect (r: Rect; pat: Pattern); INLINE $A8A5; { RoundRect Routines } PROCEDURE FrameRoundRect (r: Rect; ovWd,ovHt: INTEGER); INLINE $A8B0; PROCEDURE PaintRoundRect (r: Rect; ovWd,ovHt: INTEGER); INLINE $A8B1; PROCEDURE EraseRoundRect (r: Rect; ovWd,ovHt: INTEGER); INLINE $A8B2; PROCEDURE InvertRoundRect (r: Rect; ovWd,ovHt: INTEGER); INLINE $A8B3; PROCEDURE FillRoundRect (r: Rect; ovWd,ovHt: INTEGER; pat: Pattern); INLINE $A8B4; { Oval Routines } PROCEDURE FrameOval (r: Rect); INLINE $A8B7; PROCEDURE PaintOval (r: Rect); INLINE $A8B8; PROCEDURE EraseOval (r: Rect); INLINE $A8B9; PROCEDURE InvertOval (r: Rect); INLINE $A8BA; PROCEDURE FillOval (r: Rect; pat: Pattern); INLINE $A8BB; { Arc Routines } PROCEDURE FrameArc (r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8BE; PROCEDURE PaintArc (r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8BF; PROCEDURE EraseArc (r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8C0; PROCEDURE InvertArc (r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8C1; PROCEDURE FillArc (r: Rect; startAngle,arcAngle: INTEGER; pat: Pattern); INLINE $A8C2; PROCEDURE PtToAngle (r: Rect; pt: Point; VAR angle: INTEGER); INLINE $A8C3; { Polygon Routines } FUNCTION OpenPoly: PolyHandle; INLINE $A8CB; PROCEDURE ClosePoly; INLINE $A8CC; PROCEDURE KillPoly (poly: PolyHandle); INLINE $A8CD; PROCEDURE OffsetPoly (poly: PolyHandle; dh,dv: INTEGER); INLINE $A8CE; PROCEDURE MapPoly (poly: PolyHandle; fromRect,toRect: Rect);INLINE $A8FC; PROCEDURE FramePoly (poly: PolyHandle); INLINE $A8C6; PROCEDURE PaintPoly (poly: PolyHandle); INLINE $A8C7; PROCEDURE ErasePoly (poly: PolyHandle); INLINE $A8C8; PROCEDURE InvertPoly (poly: PolyHandle); INLINE $A8C9; PROCEDURE FillPoly (poly: PolyHandle; pat: Pattern); INLINE $A8CA; { Region Calculations } FUNCTION NewRgn: RgnHandle; INLINE $A8D8; PROCEDURE DisposeRgn(rgn: RgnHandle); INLINE $A8D9; PROCEDURE CopyRgn (srcRgn,dstRgn: RgnHandle); INLINE $A8DC; PROCEDURE SetEmptyRgn(rgn: RgnHandle); INLINE $A8DD; PROCEDURE SetRectRgn(rgn: RgnHandle; left,top,right,bottom: INTEGER); INLINE $A8DE; PROCEDURE RectRgn (rgn: RgnHandle; r: Rect); INLINE $A8DF; PROCEDURE OpenRgn; INLINE $A8DA; PROCEDURE CloseRgn (dstRgn: RgnHandle); INLINE $A8DB; PROCEDURE OffsetRgn (rgn: RgnHandle; dh,dv: INTEGER); INLINE $A8E0; PROCEDURE MapRgn (rgn: RgnHandle; fromRect,toRect: Rect); INLINE $A8FB; PROCEDURE InsetRgn (rgn: RgnHandle; dh,dv: INTEGER); INLINE $A8E1; PROCEDURE SectRgn (srcRgnA,srcRgnB,dstRgn: RgnHandle); INLINE $A8E4; PROCEDURE UnionRgn (srcRgnA,srcRgnB,dstRgn: RgnHandle); INLINE $A8E5; PROCEDURE DiffRgn (srcRgnA,srcRgnB,dstRgn: RgnHandle); INLINE $A8E6; PROCEDURE XorRgn (srcRgnA,srcRgnB,dstRgn: RgnHandle); INLINE $A8E7; FUNCTION EqualRgn (rgnA,rgnB: RgnHandle): BOOLEAN; INLINE $A8E3; FUNCTION EmptyRgn (rgn: RgnHandle): BOOLEAN; INLINE $A8E2; FUNCTION PtInRgn (pt: Point; rgn: RgnHandle): BOOLEAN; INLINE $A8E8; FUNCTION RectInRgn (r: Rect; rgn: RgnHandle): BOOLEAN; INLINE $A8E9; { Graphical Operations on Regions } PROCEDURE FrameRgn (rgn: RgnHandle); INLINE $A8D2; PROCEDURE PaintRgn (rgn: RgnHandle); INLINE $A8D3; PROCEDURE EraseRgn (rgn: RgnHandle); INLINE $A8D4; PROCEDURE InvertRgn (rgn: RgnHandle); INLINE $A8D5; PROCEDURE FillRgn (rgn: RgnHandle; pat: Pattern); INLINE $A8D6; { Graphical Operations on BitMaps } PROCEDURE ScrollRect(dstRect: Rect; dh,dv: INTEGER; updateRgn: rgnHandle); INLINE $A8EF; PROCEDURE CopyBits (srcBits,dstBits: BitMap; srcRect,dstRect: Rect; mode: INTEGER; maskRgn: RgnHandle); INLINE $A8EC; { Picture Routines } FUNCTION OpenPicture(picFrame: Rect): PicHandle; INLINE $A8F3; PROCEDURE ClosePicture; INLINE $A8F4; PROCEDURE DrawPicture(myPicture: PicHandle; dstRect: Rect); INLINE $A8F6; PROCEDURE PicComment(kind,dataSize: INTEGER; dataHandle: Handle); INLINE $A8F2; PROCEDURE KillPicture(myPicture: PicHandle); INLINE $A8F5; { The Bottleneck Interface: } PROCEDURE SetStdProcs(VAR procs: QDProcs); INLINE $A8EA; PROCEDURE StdText (count: INTEGER; textAddr: Ptr; numer,denom: Point); INLINE $A882; PROCEDURE StdLine (newPt: Point); INLINE $A890; PROCEDURE StdRect (verb: GrafVerb; r: Rect); INLINE $A8A0; PROCEDURE StdRRect (verb: GrafVerb; r: Rect; ovWd,ovHt: INTEGER); INLINE $A8AF; PROCEDURE StdOval (verb: GrafVerb; r: Rect); INLINE $A8B6; PROCEDURE StdArc (verb: GrafVerb; r: Rect; startAngle,arcAngle: INTEGER); INLINE $A8BD; PROCEDURE StdPoly (verb: GrafVerb; poly: PolyHandle); INLINE $A8C5; PROCEDURE StdRgn (verb: GrafVerb; rgn: RgnHandle); INLINE $A8D1; PROCEDURE StdBits (VAR srcBits: BitMap; VAR srcRect,dstRect: Rect; mode: INTEGER; maskRgn: RgnHandle); INLINE $A8EB; PROCEDURE StdComment (kind,dataSize: INTEGER; dataHandle: Handle); INLINE $A8F1; FUNCTION StdTxMeas (count: INTEGER; textAddr: Ptr; VAR numer,denom: Point; VAR info: FontInfo): INTEGER; INLINE $A8ED; PROCEDURE StdGetPic (dataPtr: Ptr; byteCount: INTEGER); INLINE $A8EE; PROCEDURE StdPutPic (dataPtr: Ptr; byteCount: INTEGER); INLINE $A8F0; { Misc Utility Routines } FUNCTION GetPixel (h,v: INTEGER): BOOLEAN; INLINE $A865; FUNCTION Random: INTEGER; INLINE $A861; PROCEDURE StuffHex (thingptr: Ptr; s:Str255); INLINE $A866; PROCEDURE ForeColor (color: LongInt); INLINE $A862; PROCEDURE BackColor (color: LongInt); INLINE $A863; PROCEDURE ColorBit (whichBit: INTEGER); INLINE $A864; IMPLEMENTATION {$I intrfc/QuickDraw2.text } 9* ^,,5Y9* ^++ { QuickDraw2.text: Implementation part of QuickDraw } {$S Graf } TYPE FMOutPtr = ^FMOutRec; %FMOutrec = PACKED RECORD 2errNum: INTEGER; { used only for GrafError } 2fontHandle: QDHandle; { handle to font } 2bold: 0..255; { how much to smear horiz } 2italic: 0..255; { how much to shear } 2ulOffset: 0..255; { pixels below baseline } 2ulShadow: 0..255; { how big is the halo } 2ulThick: 0..255; { how thick is the underline } 2shadow: 0..255; { 0,1,2,or 3 only } 2extra: -128..127; { extra white dots each char } 2ascent: 0..255; { ascent measure for font } 2descent: 0..255; { descent measure for font } 2widMax: 0..255; { width of widest char } 2leading: -128..127; { leading between lines } 2unused: 0..255; 2numer: Point; { use this modified scale to } 2denom: Point; { draw or measure text with } 0END; VAR wideOpen: RgnHandle; { a dummy rectangular region, read-only } $wideMaster: RgnPtr; $wideData: Region; $rgnBuf: QDHandle; { point saving buffer for OpenRgn } $rgnIndex: INTEGER; { current bytes used in rgnBuf } $rgnMax: INTEGER; { max bytes allocated so far to rgnBuf } $playPic: PicHandle; { used by StdGetPic } $playIndex: INTEGER; { used by StdGetPic } $thePoly: PolyHandle; { the current polygon being defined } $polyMax: INTEGER; { max bytes allocated so far to thePoly } $patAlign: Point; { to align pattern during DrawPicture } $fontAdj: LongInt; { Fixed Point to adjust for font subst. } $fontPtr: FMOutPtr; { the last font used, used by DrawText } $fontData: FMOutRec; { Dummy routine to make the Pascal compiler happy } procedure xyzzy; external; END. { of UNIT } {------------------------------------------------------------------------------- TOOLINTF Pascal Interface TOOLINTF NAME ToolIntf -- Toolbox Interface (7 Feb 85) DESCRIPTION This file contains the interface to the Macintosh Toolbox routines. Most of the interface routines are implemented as in-line traps. The implementation of the remaining routines is in the file ToolTraps.obj. For more detailed information see the following sections of the "Inside Macintosh" documentation: Control Manager Desk Manager Dialog Manager Event Manager Font Manager Menu Manager Resource Manager Scrap Manager TextEdit Toolbox Utilities Window Manager AUTHOR Pascal Interfaces by Rony Sebok Copyright 1983, 1984, 1985 Apple Computer Inc. BUGS -------------------------------------------------------------------------------} UNIT ToolIntf; INTERFACE USES {$U-} {$U obj/MemTypes } MemTypes, {$U obj/QuickDraw } QuickDraw, {$U Obj/OsIntf } OsIntf; CONST { for Font Manager } systemFont = 0; applFont = 1; NewYork = 2; Geneva = 3; Monaco = 4; Venice = 5; London = 6; Athens = 7; SanFran = 8; Toronto = 9; Cairo = 11; LosAngeles = 12; propFont = $9000; fixedFont = $B000; fontWid = $ACB0; {for Window Manager} {window messages} wDraw = 0; wHit = 1; wCalcRgns = 2; wNew = 3; wDispose = 4; wGrow = 5; wDrawGIcon = 6; {types of windows} dialogKind = 2; userKind = 8; {window definition procedure IDs} documentProc = 0; dBoxProc = 1; plainDBox = 2; altDBoxProc = 3; noGrowDocProc = 4; rDocProc = 16; {FindWindow Result Codes} inDesk = 0; inMenuBar = 1; inSysWindow = 2; inContent = 3; inDrag = 4; inGrow = 5; inGoAway = 6; {defProc hit test codes} wNoHit = 0; wInContent = 1; wInDrag = 2; wInGrow = 3; wInGoAway = 4; {axis constraints for DragGrayRgn call} noConstraint = 0; hAxisOnly = 1; vAxisOnly = 2; {for TextEdit} teJustLeft = 0; teJustRight = -1; teJustCenter = 1; {for Resource Manager} {Resource attribute byte} resSysRef= 128; { Reference to system resource? } resSysHeap= 64; { System or application heap? } resPurgeable= 32; { Purgeable resource? } resLocked= 16; { Load it in locked? } resProtected= 8; { Protected? } resPreload= 4; { Load in on OpenResFile? } resChanged= 2; { Resource changed? } mapReadOnly= 128; { Resource file read-only } mapCompact= 64; { Compact resource file } mapChanged= 32; { Write map out at update } resNotFound= -192; { Resource not found } resFNotFound= -193; { Resource file not found } addResFailed= -194; { AddResource failed } addRefFailed= -195; { AddReference failed } rmvResFailed= -196; { RmveResource failed } rmvRefFailed= -197; { RmveReference failed } {ID's for resources provided in sysResDef} {standard cursor definitions} iBeamCursor = 1; {text selection cursor} crossCursor = 2; {for drawing graphics} plusCursor = 3; {for structured selection} watchCursor = 4; {for indicating a long delay} {icons} stopIcon = 0; noteIcon = 1; cautionIcon = 2; {patterns} sysPatListID = 0; {ID of PAT# which contains 38 patterns} {for Control Manager} {control messages} drawCntl = 0; testCntl = 1; calcCRgns = 2; initCntl = 3; dispCntl = 4; posCntl = 5; thumbCntl = 6; dragCntl = 7; autoTrack = 8; {FindControl Result Codes} inButton = 10; inCheckbox = 11; inUpButton = 20; inDownButton = 21; inPageUp = 22; inPageDown = 23; inThumb = 129; {control definition proc ID's} pushButProc = 0; checkBoxProc = 1; radioButProc = 2; scrollBarProc = 16; useWFont = 8; {for Dialog Manager} userItem= 0; ctrlItem= 4; btnCtrl= 0; { Low two bits specify what kind of control } chkCtrl= 1; radCtrl= 2; resCtrl= 3; statText= 8; { Static text } editText= 16; { Editable text } iconItem= 32; { Icon item } picItem= 64; { Picture item } itemDisable= 128; { Disable item if set } OK= 1; { OK button is first by convention } Cancel= 2; { Cancel button is second by convention } {for Menu Manager} noMark = 0; { mark symbols for MarkItem } commandMark = $11; checkMark = $12; diamondMark = $13; appleMark = $14; TextMenuProc = 0; { menu defProc messages } mDrawMsg = 0; mChooseMsg = 1; mSizeMsg = 2; {for Scrap Manager} noScrapErr = -100; {desk scrap isn't initialized} noTypeErr = -102; {package manager} dskInit = 2; {Disk Initializaton} stdFile = 3; {Standard File} flPoint = 4; {Floating-Point Arithmetic} trFunc = 5; {Transcendental Functions} intUtil = 6; {International Utilities} bdConv = 7; {Binary/Decimal Conversion} TYPE {General Utilities} Int64Bit = RECORD hiLong: LongInt; loLong: LongInt; END; CursPtr = ^Cursor; CursHandle = ^CursPtr; PatPtr = ^Pattern; PatHandle = ^PatPtr; {for Font Manager} FMInput = PACKED RECORD family: INTEGER; size: INTEGER; face: Style; needBits: BOOLEAN; device: INTEGER; numer: Point; denom: Point; END; FMOutPtr = ^FMOutPut; FMOutPut = PACKED RECORD errNum: INTEGER; fontHandle: Handle; bold: Byte; italic: Byte; ulOffset: Byte; ulShadow: Byte; ulThick: Byte; shadow: Byte; extra: SignedByte; ascent: Byte; descent: Byte; widMax: Byte; leading: SignedByte; unused: Byte; numer: Point; denom: Point; END; FontRec = RECORD fontType: INTEGER; { font type } firstChar: INTEGER; { ASCII code of first character } lastChar: INTEGER; { ASCII code of last character } widMax: INTEGER; { maximum character width } kernMax: INTEGER; { negative of maximum character kern } nDescent: INTEGER; { negative of descent } fRectWidth: INTEGER; { width of font rectangle } fRectHeight: INTEGER; { height of font rectangle } owTLoc: INTEGER; { offset to offset/width table } ascent: INTEGER; { ascent } descent: INTEGER; { descent } leading: INTEGER; { leading } rowWords: INTEGER; { row width of bit image / 2 } { bitImage: ARRAY[1..rowWords,1..chHeight] OF INTEGER; locTable: ARRAY[firstChar..lastChar+2] OF INTEGER; owTable: ARRAY[firstChar..lastChar+2] OF INTEGER; } END; {for Event Manager} {the Event Record is defined in OsIntf} KeyMap = PACKED ARRAY[0..127] OF BOOLEAN; {for Window Manager} WindowPtr = GrafPtr; WindowPeek = ^WindowRecord; ControlHandle = ^ControlPtr; {for Control Manager} WindowRecord = RECORD port: GrafPort; windowKind: INTEGER; visible: BOOLEAN; hilited: BOOLEAN; goAwayFlag: BOOLEAN; spareFlag: BOOLEAN; strucRgn: RgnHandle; contRgn: RgnHandle; updateRgn: RgnHandle; windowDefProc: Handle; dataHandle: Handle; titleHandle: StringHandle; titleWidth: INTEGER; ControlList: ControlHandle; nextWindow: WindowPeek; windowPic: PicHandle; refCon: LongInt; END; {for TextEdit} TERec = RECORD destRect: Rect; {Destination rectangle} viewRect: Rect; {view rectangle} selRect: Rect; {Select rectangle} lineHeight: INTEGER; {Current font lineheight} fontAscent: INTEGER; {Current font ascent} selPoint: Point; {Selection point(mouseLoc)} selStart: INTEGER; {Selection start} selEnd: INTEGER; {Selection end} active: INTEGER; {<>0 if active} wordBreak: ProcPtr; {Word break routine} clikLoop: ProcPtr; {Click loop routine} clickTime: LONGINT; {Time of first click} clickLoc: INTEGER; {Char. location of click} caretTime: LONGINT; {Time for next caret blink} caretState: INTEGER; {On/active booleans} just: INTEGER; {fill style} TELength: INTEGER; {Length of text below} hText: Handle; {Handle to actual text} recalBack: INTEGER; {<>0 if recal in background} recalLines: INTEGER; {Line being recal'ed} clikStuff: INTEGER; {click stuff (internal)} crOnly: INTEGER; {Set to -1 if CR line breaks only} txFont: INTEGER; {Text Font} txFace: Style; {Text Face} txMode: INTEGER; {Text Mode} txSize: INTEGER; {Text Size} inPort: GrafPtr; {Grafport} highHook: ProcPtr; {Highlighting hook} caretHook: ProcPtr; {Highlighting hook} nLines: INTEGER; {Number of lines} lineStarts: ARRAY [0..16000] OF INTEGER; {Actual line starts themselves} END; {RECORD} TEPtr = ^TERec; TEHandle = ^TEPtr; CharsHandle = ^CharsPtr; CharsPtr = ^Chars; Chars = PACKED ARRAY[0..32000] OF CHAR; {for Resource Manager} ResType=PACKED ARRAY[1..4] OF CHAR; {for Control Manager} ControlPtr = ^ControlRecord; ControlRecord = PACKED RECORD nextControl: ControlHandle; contrlOwner: WindowPtr; contrlRect: Rect; contrlVis: Byte; contrlHilite: Byte; contrlValue: INTEGER; contrlMin: INTEGER; contrlMax: INTEGER; contrlDefProc: Handle; contrlData: Handle; contrlAction: ProcPtr; contrlrfCon: LONGINT; contrlTitle: Str255; END; {ControlRecord} {for Dialog Manager} DialogPtr= WindowPtr; DialogPeek= ^DialogRecord; DialogRecord= Record window: WindowRecord; Items: Handle; textH: TEHandle; EditField: Integer; EditOpen: INTEGER; ADefItem: INTEGER; End; DialogTHndl= ^DialogTPtr; DialogTPtr= ^DialogTemplate; DialogTemplate=RECORD boundsRect: Rect; procID: INTEGER; visible: BOOLEAN; filler1: BOOLEAN; goAwayFlag: BOOLEAN; filler2: BOOLEAN; refCon: LongInt; ItemsID: INTEGER; title: Str255; END; StageList= PACKED ARRAY [1..4] OF RECORD boldItem: 0..1; boxDrawn: BOOLEAN; sound: 0..3; END; AlertTHndl= ^AlertTPtr; AlertTPtr= ^AlertTemplate; AlertTemplate=RECORD boundsRect: Rect; itemsID: INTEGER; stages: StageList; END; {for Menu Manager} MenuPtr = ^MenuInfo; MenuHandle = ^MenuPtr; MenuInfo = RECORD menuId: INTEGER; menuWidth: INTEGER; menuHeight: INTEGER; menuProc: Handle; enableFlags: LongInt; menuData: Str255; END; {for Scrap Manager} ScrapStuff = RECORD scrapSize: LONGINT; scrapHandle: Handle; scrapCount: INTEGER; scrapState: INTEGER; scrapName: StringPtr; END; pScrapStuff = ^ScrapStuff; {General Utilities} FUNCTION BitAnd (long1,long2: LongInt): LongInt; INLINE $A858; FUNCTION BitOr (long1,long2: LongInt): LongInt; INLINE $A85B; FUNCTION BitXor (long1,long2: LongInt): LongInt; INLINE $A859; FUNCTION BitNot (long: LongInt): LongInt; INLINE $A85A; FUNCTION BitShift (long: LongInt; count: INTEGER): LongInt; INLINE $A85C; FUNCTION BitTst (bytePtr: Ptr; bitNum: LongInt): BOOLEAN; INLINE $A85D; PROCEDURE BitSet (bytePtr: Ptr; bitNum: LongInt); INLINE $A85E; PROCEDURE BitClr (bytePtr: Ptr; bitNum: LongInt); INLINE $A85F; PROCEDURE LongMul (a,b: LongInt; VAR dst: Int64Bit); INLINE $A867; FUNCTION FixMul (a,b: Fixed): Fixed; INLINE $A868; FUNCTION FixRatio (numer,denom: INTEGER): Fixed; INLINE $A869; FUNCTION HiWord (x: LongInt): INTEGER; INLINE $A86A; FUNCTION LoWord (x: LongInt): INTEGER; INLINE $A86B; FUNCTION FixRound (x: Fixed): INTEGER; INLINE $A86C; PROCEDURE PackBits (VAR srcPtr,dstPtr: Ptr; srcBytes: INTEGER); INLINE $A8CF; PROCEDURE UnPackBits (VAR srcPtr,dstPtr: Ptr; dstBytes: INTEGER);INLINE $A8D0; FUNCTION SlopeFromAngle(angle: INTEGER): Fixed; INLINE $A8BC; FUNCTION AngleFromSlope(slope: Fixed): INTEGER; INLINE $A8C4; FUNCTION DeltaPoint(ptA,ptB: Point): LongInt; INLINE $A94F; FUNCTION NewString(theString:Str255): StringHandle; INLINE $A906; PROCEDURE SetString(theString:StringHandle; strNew: Str255); INLINE $A907; FUNCTION GetString(stringID: INTEGER): StringHandle; INLINE $A9BA; PROCEDURE GetIndString(VAR theString: str255; strListID: INTEGER; index: INTEGER); FUNCTION Munger(h: Handle; offset: LongInt; ptr1: Ptr; len1: LongInt; ptr2: Ptr; len2: LongInt): LongInt; INLINE $A9E0; FUNCTION GetIcon(iconID: INTEGER): Handle; INLINE $A9BB; PROCEDURE PlotIcon(theRect: Rect; theIcon: Handle); INLINE $A94B; FUNCTION GetCursor (cursorID: INTEGER): CursHandle; INLINE $A9B9; FUNCTION GetPattern(patID: INTEGER): PatHandle; INLINE $A9B8; FUNCTION GetPicture(picID: INTEGER): PicHandle; INLINE $A9BC; PROCEDURE GetIndPattern(VAR thePat: Pattern; patListID: INTEGER; index: INTEGER); PROCEDURE ShieldCursor(shieldRect: Rect; offsetPt: Point); INLINE $A855; {for Font Manager} PROCEDURE InitFonts; INLINE $A8FE; PROCEDURE GetFontName(familyID: INTEGER; VAR theName: Str255); INLINE $A8FF; PROCEDURE GetFNum(theName: Str255; VAR familyID: INTEGER); INLINE $A900; PROCEDURE SetFontLock(lockFlag: BOOLEAN); INLINE $A903; FUNCTION FMSwapFont(inRec: FMInput): FMOutPtr; INLINE $A901; FUNCTION RealFont(famID: INTEGER; size: INTEGER): BOOLEAN; INLINE $A902; {for Event Manager} FUNCTION EventAvail(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN; INLINE $A971; FUNCTION GetNextEvent(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN; INLINE $A970; FUNCTION StillDown:BOOLEAN; INLINE $A973; FUNCTION WaitMouseUp:BOOLEAN; INLINE $A977; PROCEDURE GetMouse (VAR pt: Point); INLINE $A972; FUNCTION TickCount:LongInt; INLINE $A975; FUNCTION Button: BOOLEAN; INLINE $A974; PROCEDURE GetKeys(VAR k: keyMap); INLINE $A976; FUNCTION GetDblTime: LongInt; FUNCTION GetCaretTime: LongInt; {for Window Manager} PROCEDURE ClipAbove(window: WindowPeek); INLINE $A90B; PROCEDURE PaintOne(window: WindowPeek; clobbered: RgnHandle); INLINE $A90C; PROCEDURE PaintBehind(startWindow: WindowPeek; clobbered: RgnHandle); INLINE $A90D; PROCEDURE SaveOld(window: WindowPeek); INLINE $A90E; PROCEDURE DrawNew(window: WindowPeek; fUpdate: BOOLEAN); INLINE $A90F; PROCEDURE CalcVis(window: WindowPeek); INLINE $A909; PROCEDURE CalcVisBehind(startWindow: WindowPeek; clobbered: RgnHandle); INLINE $A90A; PROCEDURE ShowHide(window: WindowPtr; showFlag: BOOLEAN); INLINE $A908; FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN; INLINE $A911; PROCEDURE GetWMgrPort(VAR wPort: GrafPtr); INLINE $A910; PROCEDURE InitWindows; INLINE $A912; FUNCTION NewWindow(wStorage: Ptr; boundsRect: Rect; title: Str255; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LongInt): WindowPtr; INLINE $A913; PROCEDURE DisposeWindow (theWindow: WindowPtr); INLINE $A914; PROCEDURE CloseWindow (theWindow: WindowPtr); INLINE $A92D; PROCEDURE MoveWindow (theWindow: WindowPtr; h,v: INTEGER; BringToFront:BOOLEAN); INLINE $A91B; PROCEDURE SizeWindow (theWindow: WindowPtr; width,height: INTEGER; fUpdate: BOOLEAN); INLINE $A91D; FUNCTION GrowWindow (theWindow: windowPtr; startPt: Point; bBox: Rect): LongInt; INLINE $A92B; PROCEDURE DragWindow (theWindow: WindowPtr; startPt: Point; boundsRect: Rect); INLINE $A925; PROCEDURE ShowWindow (theWindow: WindowPtr); INLINE $A915; PROCEDURE HideWindow (theWindow: WindowPtr); INLINE $A916; PROCEDURE SetWTitle (theWindow: WindowPtr; title: Str255); INLINE $A91A; PROCEDURE GetWTitle (theWindow: WindowPtr; VAR title: Str255); INLINE $A919; PROCEDURE HiliteWindow (theWindow: WindowPtr; fHiLite: BOOLEAN); INLINE $A91C; PROCEDURE BeginUpdate (theWindow: WindowPtr); INLINE $A922; PROCEDURE EndUpdate (theWindow: WindowPtr); INLINE $A923; PROCEDURE SetWRefCon (theWindow: WindowPtr; data: LongInt); INLINE $A918; FUNCTION GetWRefCon (theWindow: WindowPtr): LongInt; INLINE $A917; PROCEDURE SetWindowPic (theWindow: WindowPtr; thePic: PicHandle); INLINE $A92E; FUNCTION GetWindowPic (theWindow: WindowPtr): PicHandle; INLINE $A92F; PROCEDURE BringToFront (theWindow: WindowPtr); INLINE $A920; PROCEDURE SendBehind (theWindow,behind: WindowPtr); INLINE $A921; FUNCTION FrontWindow: WindowPtr; INLINE $A924; PROCEDURE SelectWindow (theWindow: WindowPtr); INLINE $A91F; FUNCTION TrackGoAway (theWindow: WindowPtr; thePt: Point): BOOLEAN; INLINE $A91E; PROCEDURE DrawGrowIcon (theWindow: WindowPtr); INLINE $A904; PROCEDURE ValidRect (goodRect: Rect); INLINE $A92A; PROCEDURE ValidRgn (goodRgn: RgnHandle); INLINE $A929; PROCEDURE InvalRect (badRect: Rect); INLINE $A928; PROCEDURE InvalRgn (badRgn: RgnHandle); INLINE $A927; FUNCTION FindWindow (thePoint: Point; VAR theWindow: WindowPtr): INTEGER; INLINE $A92C; FUNCTION GetNewWindow (windowID: INTEGER; wStorage: Ptr; behind: WindowPtr): WindowPtr; INLINE $A9BD; FUNCTION PinRect(theRect: Rect; thePt: Point): LongInt; INLINE $A94E; FUNCTION DragGrayRgn(theRgn: RgnHandle; startPt: Point; boundsRect, slopRect: Rect;axis: INTEGER; actionProc: ProcPtr): LongInt; INLINE $A905; {For TextEdit} PROCEDURE TEActivate( h: TEHandle ); INLINE $A9D8; PROCEDURE TECalText( h: TEHandle ); INLINE $A9D0; PROCEDURE TEClick( pt: Point; extend: BOOLEAN; h: TEHandle ); INLINE $A9D4; PROCEDURE TECopy( h: TEHandle ); INLINE $A9D5; PROCEDURE TECut( h: TEHandle ); INLINE $A9D6; PROCEDURE TEDeActivate( h: TEHandle ); INLINE $A9D9; PROCEDURE TEDelete( h: TEHandle ); INLINE $A9D7; PROCEDURE TEDispose( h: TEHandle ); INLINE $A9CD; PROCEDURE TEIdle( h: TEHandle ); INLINE $A9DA; PROCEDURE TEInit; INLINE $A9CC; PROCEDURE TEKey( key: CHAR; h: TEHandle ); INLINE $A9DC; FUNCTION TENew( dest, view: Rect ): TEHandle; INLINE $A9D2; PROCEDURE TEPaste( h: TEHandle ); INLINE $A9DB; PROCEDURE TEScroll( dh, dv: INTEGER; h: TEHandle ); INLINE $A9DD; PROCEDURE TESetSelect( selStart, selEnd: LONGINT; h: TEHandle ); INLINE $A9D1; PROCEDURE TESetText( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9CF; PROCEDURE TEInsert( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9DE; PROCEDURE TEUpdate( rUpdate: Rect; h: TEHandle ); INLINE $A9D3; PROCEDURE TESetJust( just: INTEGER; h: TEHandle ); INLINE $A9DF; FUNCTION TEGetText( h: TEHandle ): CharsHandle; INLINE $A9CB; FUNCTION TEScrapHandle: Handle; FUNCTION TEGetScrapLen: LongInt; PROCEDURE TESetScrapLen(length: LongInt); FUNCTION TEFromScrap: OsErr; FUNCTION TEToScrap: OsErr; {routines that call on your own PasWordBreak and PasClikLoop routines} {AsmWordBreak - sets up stack for call to FUNCTION PasWordBreak(text: Ptr; index: INTEGER):BOOLEAN; and then sets conditions codes depending on value returned} PROCEDURE AsmWordBreak; {AsmClikLoop - sets up stack for call to PROCEDURE PasClikLoop and then sets condition codes depending on value returned} PROCEDURE AsmClikLoop; {Box drawing utility} PROCEDURE TextBox( inText: Ptr; textLength: LONGINT; r: Rect; style: INTEGER ); INLINE $A9CE; {for Resource Manager} FUNCTION InitResources: INTEGER; INLINE $A995; PROCEDURE RsrcZoneInit; INLINE $A996; PROCEDURE CreateResFile(fileName: Str255); INLINE $A9B1; FUNCTION OpenResFile(fileName: Str255): INTEGER; INLINE $A997; PROCEDURE UseResFile(refNum: INTEGER); INLINE $A998; FUNCTION GetResFileAttrs(refNum: INTEGER): INTEGER; INLINE $A9F6; PROCEDURE SetResFileAttrs(refNum: INTEGER; attrs: INTEGER); INLINE $A9F7; PROCEDURE UpdateResFile(refNum: INTEGER); INLINE $A999; PROCEDURE CloseResFile(refNum: INTEGER); INLINE $A99A; PROCEDURE SetResPurge(install: Boolean); INLINE $A993; PROCEDURE SetResLoad(AutoLoad: Boolean); INLINE $A99B; FUNCTION CountResources(theType: ResType): INTEGER; INLINE $A99C; FUNCTION GetIndResource(theType: ResType; index: INTEGER): Handle; INLINE $A99D; FUNCTION CountTypes: INTEGER; INLINE $A99E; PROCEDURE GetIndType(VAR theType: ResType; index: INTEGER); INLINE $A99F; FUNCTION UniqueID(theType: ResType): INTEGER; INLINE $A9C1; FUNCTION GetResource(theType: ResType; ID: INTEGER): Handle; INLINE $A9A0; FUNCTION GetNamedResource(theType: ResType; name: Str255): Handle; INLINE $A9A1; PROCEDURE LoadResource(theResource: Handle); INLINE $A9A2; PROCEDURE ReleaseResource(theResource: Handle); INLINE $A9A3; PROCEDURE DetachResource(theResource: Handle); INLINE $A992; PROCEDURE ChangedResource(theResource: Handle); INLINE $A9AA; PROCEDURE WriteResource(theResource: Handle); INLINE $A9B0; FUNCTION HomeResFile(theResource: Handle): INTEGER; INLINE $A9A4; FUNCTION CurResFile: INTEGER; INLINE $A994; FUNCTION GetResAttrs(theResource: Handle): INTEGER; INLINE $A9A6; PROCEDURE SetResAttrs(theResource: Handle; attrs: INTEGER); INLINE $A9A7; PROCEDURE GetResInfo(theResource: Handle; VAR theID: INTEGER; VAR theType: ResType; VAR name: Str255); INLINE $A9A8; PROCEDURE SetResInfo(theResource: Handle; theID: INTEGER; name: Str255); INLINE $A9A9; PROCEDURE AddResource(theResource: Handle; theType: ResType; theID: INTEGER; name: Str255); INLINE $A9AB; PROCEDURE AddReference(theResource: Handle; theID: INTEGER; name: Str255); INLINE $A9AC; PROCEDURE RmveResource(theResource: Handle); INLINE $A9AD; PROCEDURE RmveReference(theResource: Handle); INLINE $A9AE; FUNCTION SizeResource(theResource: Handle): LongInt; INLINE $A9A5; FUNCTION ResError: INTEGER; INLINE $A9AF; {for Control Manager} FUNCTION NewControl(curWindow: windowPtr; boundsRect: Rect; title: Str255; visible: BOOLEAN; value: INTEGER; min: INTEGER; max: INTEGER; contrlProc: INTEGER; refCon: LongInt): ControlHandle; INLINE $A954; PROCEDURE DisposeControl (theControl: ControlHandle); INLINE $A955; PROCEDURE KillControls (theWindow: WindowPtr); INLINE $A956; PROCEDURE MoveControl (theControl: ControlHandle; h,v: INTEGER); INLINE $A959; PROCEDURE SizeControl (theControl: ControlHandle; w,h: INTEGER); INLINE $A95C; PROCEDURE DragControl (theControl: ControlHandle; startPt: Point; bounds: Rect; slopRect: Rect; axis:INTEGER); INLINE $A967; PROCEDURE ShowControl (theControl: ControlHandle); INLINE $A957; PROCEDURE HideControl (theControl: ControlHandle); INLINE $A958; PROCEDURE SetCTitle (theControl: ControlHandle; title: Str255); INLINE $A95F; PROCEDURE GetCTitle (theControl: ControlHandle; VAR title: Str255); INLINE $A95E; PROCEDURE HiliteControl (theControl: ControlHandle; hiliteState: INTEGER); INLINE $A95D; PROCEDURE SetCRefCon (theControl: ControlHandle; data: LongInt); INLINE $A95B; FUNCTION GetCRefCon (theControl: ControlHandle): LongInt; INLINE $A95A; PROCEDURE SetCtlValue (theControl: ControlHandle; theValue: INTEGER); INLINE $A963; FUNCTION GetCtlValue (theControl: ControlHandle): INTEGER; INLINE $A960; FUNCTION GetCtlMin (theControl: ControlHandle): INTEGER; INLINE $A961; FUNCTION GetCtlMax (theControl: ControlHandle): INTEGER; INLINE $A962; PROCEDURE SetCtlMin (theControl: ControlHandle; theValue: INTEGER); INLINE $A964; PROCEDURE SetCtlMax (theControl: ControlHandle; theValue: INTEGER); INLINE $A965; FUNCTION GetCtlAction (theControl: ControlHandle): ProcPtr; INLINE $A96A; PROCEDURE SetCtlAction (theControl: ControlHandle; newProc: ProcPtr); INLINE $A96B; FUNCTION TestControl (theControl: ControlHandle; thePt: Point): INTEGER; INLINE $A966; FUNCTION TrackControl (theControl:ControlHandle; thePt: Point; actionProc:ProcPtr):INTEGER; INLINE $A968; FUNCTION FindControl (thePoint: Point; theWindow: WindowPtr; VAR theControl: ControlHandle): INTEGER; INLINE $A96C; PROCEDURE DrawControls (theWindow: WindowPtr); INLINE $A969; FUNCTION GetNewControl (controlID: INTEGER; owner: WindowPtr): ControlHandle; INLINE $A9BE; {for Dialog Manager} PROCEDURE InitDialogs(resumeProc: ProcPtr); INLINE $A97B; FUNCTION GetNewDialog(dialogID: Integer; wStorage: Ptr; behind: WindowPtr): DialogPtr; INLINE $A97C; FUNCTION NewDialog(wStorage: Ptr; boundsRect: Rect; title: Str255; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LongInt; itmLstHndl: Handle): DialogPtr; INLINE $A97D; FUNCTION IsDialogEvent(event: EventRecord): BOOLEAN; INLINE $A97F; FUNCTION DialogSelect( event: EventRecord; VAR theDialog: DialogPtr; VAR itemHit: INTEGER): BOOLEAN; INLINE $A980; PROCEDURE ModalDialog( filterProc: ProcPtr; VAR itemHit: INTEGER); INLINE $A991; PROCEDURE DrawDialog(dialog: DialogPtr); INLINE $A981; PROCEDURE CloseDialog(dialog: DialogPtr); INLINE $A982; PROCEDURE DisposDialog(dialog: DialogPtr); INLINE $A983; FUNCTION Alert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A985; FUNCTION StopAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A986; FUNCTION NoteAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A987; FUNCTION CautionAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A988; PROCEDURE CouldAlert(alertID: Integer); INLINE $A989; PROCEDURE FreeAlert(alertID: Integer); INLINE $A98A; PROCEDURE CouldDialog(DlgID: Integer); INLINE $A979; PROCEDURE FreeDialog(DlgID: Integer); INLINE $A97A; PROCEDURE ParamText(cite0, cite1, cite2, cite3: Str255); INLINE $A98B; PROCEDURE ErrorSound(sound: ProcPtr); INLINE $A98C; PROCEDURE GetDItem(dialog: DialogPtr; itemNo: Integer; VAR kind: Integer; VAR item: Handle; VAR box: Rect); INLINE $A98D; PROCEDURE SetDItem(dialog: DialogPtr; itemNo: Integer; kind: Integer; item: Handle; box: Rect); INLINE $A98E; PROCEDURE SetIText(item: Handle; text: Str255); INLINE $A98F; PROCEDURE GetIText(item: Handle; VAR text: Str255); INLINE $A990; PROCEDURE SelIText(dialog: DialogPtr; itemNo: Integer; startSel, endSel: INTEGER ); INLINE $A97E; {routines designed only for use in Pascal} FUNCTION GetAlrtStage: INTEGER; {returns aCount} PROCEDURE ResetAlrtStage; PROCEDURE DlgCut(dialog: DialogPtr); PROCEDURE DlgPaste(dialog: DialogPtr); PROCEDURE DlgCopy(dialog: DialogPtr); PROCEDURE DlgDelete(dialog: DialogPtr); PROCEDURE SetDAFont(fontNum: INTEGER); {for Desk Manager} FUNCTION SystemEvent(myEvent: EventRecord): BOOLEAN; INLINE $A9B2; PROCEDURE SystemClick(theEvent: EventRecord; theWindow: windowPtr); INLINE $A9B3; PROCEDURE SystemTask; INLINE $A9B4; PROCEDURE SystemMenu(menuResult: LongInt); INLINE $A9B5; FUNCTION SystemEdit(editCode: INTEGER): BOOLEAN; INLINE $A9C2; FUNCTION OpenDeskAcc(theAcc: Str255): INTEGER; INLINE $A9B6; PROCEDURE CloseDeskAcc(refNum: INTEGER); INLINE $A9B7; {for Menu Manager} PROCEDURE InitMenus; INLINE $A930; FUNCTION NewMenu(menuID: INTEGER; menuTitle: Str255): menuHandle; INLINE $A931; FUNCTION GetMenu(rsrcID: INTEGER): MenuHandle; INLINE $A9BF; PROCEDURE DisposeMenu(menu: menuHandle); INLINE $A932; PROCEDURE AppendMenu(menu: menuHandle; data: str255); INLINE $A933; PROCEDURE InsertMenu (menu: MenuHandle; beforeId: INTEGER); INLINE $A935; PROCEDURE DeleteMenu (menuId: INTEGER); INLINE $A936; PROCEDURE DrawMenuBar; INLINE $A937; PROCEDURE ClearMenuBar; INLINE $A934; FUNCTION GetMenuBar:Handle; INLINE $A93B; FUNCTION GetNewMBar(menuBarID: INTEGER): Handle; INLINE $A9C0; PROCEDURE SetMenuBar(menuBar: Handle); INLINE $A93C; FUNCTION MenuSelect (startPt: Point): LongInt; INLINE $A93D; FUNCTION MenuKey (ch: CHAR): LongInt; INLINE $A93E; PROCEDURE HiLiteMenu (menuId: INTEGER); INLINE $A938; PROCEDURE SetItem (menu: menuHandle; item: INTEGER; itemString: Str255); INLINE $A947; PROCEDURE GetItem (menu: menuHandle; item: INTEGER; VAR itemString: Str255); INLINE $A946; PROCEDURE EnableItem (menu: menuHandle; item: INTEGER); INLINE $A939; PROCEDURE DisableItem(menu: menuHandle; item: INTEGER); INLINE $A93A; PROCEDURE CheckItem (menu: menuHandle; item: INTEGER; checked: BOOLEAN); INLINE $A945; PROCEDURE SetItemIcon(menu: menuHandle; item: INTEGER; iconNum: Byte); INLINE $A940; PROCEDURE GetItemIcon(menu: menuHandle; item: INTEGER; VAR iconNum: Byte); INLINE $A93F; PROCEDURE SetItemStyle(menu: menuHandle; item: INTEGER; styleVal: Style); INLINE $A942; PROCEDURE GetItemStyle(menu: menuHandle; item: INTEGER; VAR styleVal: Style); INLINE $A941; PROCEDURE SetItemMark(menu: menuHandle; item: INTEGER; markChar: CHAR); INLINE $A944; PROCEDURE GetItemMark(menu: menuHandle; item: INTEGER; VAR markChar: CHAR); INLINE $A943; PROCEDURE SetMenuFlash(flashCount: INTEGER); INLINE $A94A; PROCEDURE FlashMenuBar(menuID: INTEGER); INLINE $A94C; FUNCTION GetMHandle(menuID: INTEGER): menuHandle; INLINE $A949; FUNCTION CountMItems(menu: menuHandle): INTEGER; INLINE $A950; PROCEDURE AddResMenu(menu: menuHandle; theType:ResType); INLINE $A94D; PROCEDURE InsertResMenu(menu: menuHandle; theType:ResType; afterItem: INTEGER); INLINE $A951; PROCEDURE CalcMenuSize(menu:menuHandle); INLINE $A948; {for Scrap Manager} FUNCTION GetScrap( hDest: Handle; what: ResType; VAR offset: LONGINT ): LONGINT; INLINE $A9FD; FUNCTION InfoScrap: pScrapStuff; INLINE $A9F9; FUNCTION LoadScrap: LONGINT; INLINE $A9FB; FUNCTION PutScrap( length: LONGINT; what: ResType; source: Ptr ): LONGINT; INLINE $A9FE; FUNCTION UnloadScrap: LONGINT; INLINE $A9FA; FUNCTION ZeroScrap: LONGINT; INLINE $A9FC; {package manager} PROCEDURE InitAllPacks; INLINE $A9E6; PROCEDURE InitPack(packID: INTEGER); INLINE $A9E5; IMPLEMENTATION {for Text Edit} FUNCTION TEScrapHndl; EXTERNAL; FUNCTION TEGetScrapLen; EXTERNAL; PROCEDURE TESetScrapLen; EXTERNAL; FUNCTION TEFromScrap; EXTERNAL; FUNCTION TEToScrap; EXTERNAL; PROCEDURE AsmWordBreak; EXTERNAL; PROCEDURE AsmClikLoop; EXTERNAL; {for Dialog Manager} {routines designed only for use in Pascal} FUNCTION GetAlrtStage; EXTERNAL; PROCEDURE ResetAlrtStage; EXTERNAL; PROCEDURE DlgCut; EXTERNAL; PROCEDURE DlgPaste; EXTERNAL; PROCEDURE DlgCopy; EXTERNAL; PROCEDURE DlgDelete; EXTERNAL; PROCEDURE SetDAFont; EXTERNAL; {for Event Mgr} FUNCTION GetDblTime; EXTERNAL; FUNCTION GetCaretTime; EXTERNAL; {for general utilities} PROCEDURE GetIndString;EXTERNAL; PROCEDURE GetIndPattern;EXTERNAL; END. { of unit } 3. "6F^9D!$ǐ^663k3. "6F^9; D!$ǐ^''(* $EXEC P{ascal}intrfc/WritelnWindow {no list file} obj/WritelnWindow $ENDEXEC *) UNIT WritelnWindow; {$M+} {$X-} {$SETC WWdebug := FALSE} INTERFACE {$L-} USES ${$U-} ${$U Obj/MemTypes} MemTypes, ${$U Obj/QuickDraw} QuickDraw, ${$U Obj/OSIntf} OSIntf, ${$U Obj/ToolIntf} ToolIntf, ${$U intrfc/PaslibIntf} PasLibIntf; {$L+} CONST $WWEol = CHR($0D); VAR WWWindowPtr: WindowPtr; {All public procedure begin with WW (for WritelnWindow)} PROCEDURE WWInit; ${Call this once at the start of your program.} PROCEDURE WWNew(bounds: Rect; windowTitle: Str255; goAway: BOOLEAN; visible: BOOLEAN; 0linesToSave, outputFont, outputSize: INTEGER); ${Call this to create a WriteLn window with given title. (goAway is TRUE iff you want a go away box (if the user clicks the go away box, ,the window will be hidden but not freed); (visible is TRUE iff you want the window to be visible initially; (linesToSave is number of lines to save; (outputFont & output size define the font to use (} ${Call the following procedures in response to events for the WriteLnWindow. ((Test the window receiving the event against WWWindowPtr.} PROCEDURE WWActivateEvent(modifiers: INTEGER); PROCEDURE WWMouseDown(where: INTEGER; pt: Point; modifiers: INTEGER); PROCEDURE WWUpdateEvent; IMPLEMENTATION {$I intrfc/WritelnWindow2.text} END. 9*Ѫ ^I7*; Ptr.} ow. y box, ZLFFF@a>a̭fFPFPb2a¾FFxaXva̮aXb\Fb2̮a̬:̬L&FF̭̭ ̮̮88aXr̮̮} - 88,ÂFFFva̭̭a̭L~rU}HH"ṊW{$IFC qWWdebug} {$r+} {$D+} {$ELSEC} {$r-} {$D-} {$ENDC} CONST $kWWHMargin = 5; $kWWVMargin = 10; TYPE $ZHLineArray = ^ZPLineArray; $ZPLineArray = ^ZLineArray; $ZLineArray = ARRAY[1..100] OF StringHandle; VAR gSavedLines: ZHLineArray; {the saved lines} $gNSavedLines: INTEGER; {how many lines we save as StringHandles} $gCurLine: Str255; {the last line (not included in gNSavedLines)} $gSizeCurLine: INTEGER; {number of characters in gCurLine} $gHeight: INTEGER; {font gHeight} $gLnAscent: INTEGER; {font ascent} $gSBars: ARRAY[VHSelect] OF ControlHandle; {the xyzafWindow scroll bars} $gScrollOffset: Point; {the position to which we are scrolled} $gViewSize: Point; {total xyzitsfView size} $gEndOfText: Point; {the pen position after drawing all the lines} $gStdDrag: Rect; $gStdSize: Rect; $gOrthogonal: ARRAY[VHSelect] OF VHSelect; $gWRec: WindowRecord; $gARgn: RgnHandle; FUNCTION GetSaveVisRgn: RgnHandle; FORWARD; PROCEDURE WWAddText(textBuf: Ptr; byteCount: INTEGER); FORWARD; FUNCTION WWBaseLine(ln: INTEGER): INTEGER; FORWARD; PROCEDURE WWDoScrolling; FORWARD; PROCEDURE WWDraw; FORWARD; PROCEDURE WWGrown; FORWARD; PROCEDURE WWInvalGrowBox; FORWARD; PROCEDURE WWNewLine; FORWARD; PROCEDURE WWShowPoint(pt: Point); FORWARD; PROCEDURE WWTrackScroll(aControl: ControlHandle; partCode: INTEGER); FORWARD; {$S WWSeg} FUNCTION GetSaveVisRgn: RgnHandle; $CONST addr = $09F2; $TYPE pRgn = ^RgnHandle; $VAR pSaveVisRgn: pRgn; BEGIN $pSaveVisRgn := pRgn(addr); $GetSaveVisRgn := pSaveVisRgn^; END; {$S WWSeg} FUNCTION LongerSide(VAR r: Rect): VHSelect; BEGIN $WITH r DO (IF (bottom - top) >= (left - right) THEN ,LongerSide := v (ELSE ,LongerSide := h; END; {$S WWSeg} PROCEDURE WindowFocus; BEGIN $SetPort(gDebugWindowPtr); $SetOrigin(0, 0); $ClipRect(thePort^.portRect); END; {$S WWSeg} PROCEDURE ContentFocus; $VAR r: Rect; BEGIN $SetPort(gDebugWindowPtr); $SetOrigin(gScrollOffset.h, gScrollOffset.v); $r := thePort^.portRect; $WITH r DO (BEGIN (right := right - 15; (bottom := bottom - 15; (END; $ClipRect(r); END; {$S WWInit} PROCEDURE WWInit; BEGIN $gDebugWindowPtr := NIL; $gSavedLines := NIL; $gOrthogonal[v] := h; $gOrthogonal[h] := v; END; {$S WWInit} PROCEDURE WWNew(bounds: Rect; windowTitle: Str255; goAway: BOOLEAN; visible: BOOLEAN; 0linesToSave, outputFont, outputSize: INTEGER); $VAR fInfo: FontInfo; (control: ControlHandle; (i: INTEGER; (aLine: StringHandle; (vhs: VHSelect; BEGIN $IF (gDebugWindowPtr = NIL) AND (linesToSave > 0) THEN (BEGIN (gDebugWindowPtr := NewWindow(@gWRec, bounds, windowTitle, visible, documentProc, DPOINTER(-1), goAway, 0); (WITH screenBits.bounds DO ,BEGIN ,SetRect(gStdDrag, 4, 24, right - 4, bottom - 4); {this is suggested in Inside Macintosh} ,SetRect(gStdSize, 20, 20, right, bottom - 20); {arbitrary Min size; Max size is screen} ,END; (gARgn := NewRgn; (gNSavedLines := linesToSave - 1; (gSavedLines := ZHLineArray(NewHandle(SIZEOF(StringHandle) * gNSavedLines)); ({start off with all lines blank} (FOR i := 1 TO gNSavedLines DO ,BEGIN ,aLine := NewString(''); ,gSavedLines^^[i] := aLine; ,END; (gSizeCurLine := 0; (SetPt(gEndOfText, kWWHMargin, WWBaseLine(linesToSave)); (SetPort(gDebugWindowPtr); (TextFont(outputFont); (TextSize(outputSize); (GetFontInfo(fInfo); (WITH fInfo DO ,BEGIN ,gHeight := ascent + descent + leading; ,gLnAscent := ascent; ,SetPt(gViewSize, (2 * kWWHMargin) + (255 * widMax), (2 * kWWVMargin) + (gHeight * linesToSave)); ,END; ({scroll bars} (FOR vhs := v TO h DO ,gSBars[vhs] := NewControl(gDebugWindowPtr, gDebugWindowPtr^.portRect, '', FALSE, @0, 0, 1, scrollBarProc, 0); ({SetPt(gScrollOffset, 0, 0);} (gScrollOffset := Point(0); ({put the scroll bars in the right place} (WWGrown; (PlSetWrPort(gDebugWindowPtr); (PLSetWProc(@WWAddText); (END; END; {$S WWSeg} PROCEDURE WWActivateEvent(modifiers: INTEGER); $VAR r: Rect; (vhs: VHSelect; (anSBar: ControlHandle; (savePort: GrafPtr; BEGIN $GetPort(savePort); $WindowFocus; $r := thePort^.portRect; $FOR vhs := v TO h DO (BEGIN (anSBar := gSBars[vhs]; (IF Odd(modifiers) THEN ,ShowControl(anSBar) (ELSE ,HideControl(anSBar); (END; $DrawGrowIcon(gDebugWindowPtr); $SetPort(savePort); END; {$S WWSeg} PROCEDURE WWAddText(textBuf: Ptr; byteCount: INTEGER); $VAR destPtr: Ptr; (done: BOOLEAN; (b: QDByte; (startPtr: Ptr; (startCount: INTEGER; (ps: PenState; (savePort: GrafPtr; BEGIN $GetPort(savePort); $destPtr := Ptr(ORD(@gCurLine) + gSizeCurLine + 1); {leave 1 byte for string size} $WHILE byteCount > 0 DO (BEGIN (done := FALSE; (startPtr := textBuf; (startCount := byteCount; (WHILE (byteCount > 0) AND (gSizeCurLine < 255) AND (not done) DO ,BEGIN ,b := QDPtr(textBuf)^; ,byteCount := byteCount - 1; ,textBuf := Ptr(LONGINT(textBuf) + 1); ,IF b = ORD(kWWEol) THEN 0done := TRUE ,ELSE 0BEGIN 0QDPtr(destPtr)^ := b; 0gSizeCurLine := gSizeCurLine + 1; 0destPtr := Ptr(LONGINT(destPtr) + 1); 0END; ,END; (ContentFocus; (MoveTo(gEndOfText.h, gEndOfText.v); (DrawText(QDPtr(startPtr), 0, startCount - byteCount); (GetPenState(ps); (gEndOfText := ps.pnLoc; (IF (gSizeCurLine >= 255) OR done THEN ,WWNewLine; (END; $SetPort(savePort); END; {$S WWSeg} FUNCTION WWBaseLine(ln: INTEGER): INTEGER; BEGIN $WWBaseLine := kWWVMargin + (ln - 1) * gHeight; END; {$S WWSeg} PROCEDURE WWDoScrolling; $VAR newOffset: Point; (delta: Point; BEGIN $newOffset.v := GetCtlValue(gSBars[v]); $delta.v := gScrollOffset.v - newOffset.v; $newOffset.h := GetCtlValue(gSBars[h]); $delta.h := gScrollOffset.h - newOffset.h; $IF (delta.h <> 0) OR (delta.v <> 0) THEN (BEGIN (ContentFocus; (ScrollRect(thePort^.portRect, delta.h, delta.v, gARgn); (gScrollOffset := newOffset; (InvalRgn(gARgn); (WWUpdateEvent; (END; END; {$S WWSeg} PROCEDURE WWDraw; $VAR i: INTEGER; (y: INTEGER; (aLine: StringHandle; (ps: PenState; BEGIN $y := kWWVMargin; $FOR i := 1 TO gNSavedLines DO (BEGIN (aLine := gSavedLines^^[i]; (MoveTo(kWWHMargin, y); (HLock(Handle(aLine)); (DrawString(aLine^^); (HUnlock(Handle(aLine)); (y := y + gHeight; (END; $MoveTo(kWWHMargin, y); $DrawText(QDPtr(@gCurLine), 1, gSizeCurLine); $GetPenState(ps); $gEndOfText := ps.pnLoc; END; {$S WWSeg} PROCEDURE WWGrown; $VAR r: Rect; (vhs: VHSelect; (anSBar: ControlHandle; (newMax: INTEGER; (isVisible: BOOLEAN; (savePort: GrafPtr; BEGIN $GetPort(savePort); $WindowFocus; $r.topLeft := Point(0); $r.botRight := Point(0); $ClipRect(r); $FOR vhs := v TO h DO (BEGIN (anSBar := gSBars[vhs]; (r := thePort^.portRect; (WITH r DO ,BEGIN ,{Calculate new position of scroll bar} ,topLeft.vh[vhs] := topLeft.vh[vhs] - 1; ,topLeft.vh[gOrthogonal[vhs]] := botRight.vh[gOrthogonal[vhs]] - 15; ,botRight.vh[vhs] := botRight.vh[vhs] - 14; ,botRight.vh[gOrthogonal[vhs]] := topLeft.vh[gOrthogonal[vhs]] + 16; ,{Move the scroll bar} ,MoveControl(anSBar, left, top); ,SizeControl(anSBar, right-left, bottom-top); ,newMax := gViewSize.vh[vhs] - (bottom - top); ,IF newMax < 0 THEN 0newMax := 0; ,SetCtlMax(anSBar, newMax); ,END; (END; $WWInvalGrowBox; $WWDoScrolling; {in case we are showing too much white space} $SetPort(savePort); END; {$S WWSeg} PROCEDURE WWInvalGrowBox; $VAR r: Rect; BEGIN $r.botRight := thePort^.portRect.botRight; $WITH r DO (BEGIN (top := bottom - 15; (left := right - 15; (END; $InvalRect(r); END; {$S WWSeg} PROCEDURE WWMouseDown(where: INTEGER; pt: Point; modifiers: INTEGER); $VAR r: Rect; (sizeStuff: RECORD CASE INTEGER OF <1: (growResult: LONGINT); {Information returned by GrowRect} <2: (newV, {new vertical size} AnewH: INTEGER); {new horizontal size} <3: (newSize: Point); {new size as a point} 8END; (partCode: INTEGER; (whichControl: ControlHandle; (oldSize: Point; (savePort: GrafPtr; BEGIN $GetPort(savePort); $CASE where OF (inDrag: ,DragWindow(gDebugWindowPtr, pt, gStdDrag); (inGrow: ,BEGIN ,WindowFocus; ,WITH sizeStuff DO 0BEGIN 0WITH gDebugWindowPtr^.portRect, oldSize DO 4BEGIN 4h := right - left; 4v := bottom - top; 4END; 0growResult := GrowWindow(gDebugWindowPtr, pt, gStdSize); 0IF growResult <> 0 THEN 4BEGIN 4WWInvalGrowBox; 4SizeWindow(gDebugWindowPtr, newH, newV, TRUE); 4WWGrown; 4END; 0END; ,END; (inGoAway: ,IF TrackGoAway(gDebugWindowPtr, pt) THEN 0HideWindow(gDebugWindowPtr); (inContent: ,IF gDebugWindowPtr = FrontWindow THEN 0BEGIN 0WindowFocus; 0GlobalToLocal(pt); 0partCode := FindControl(pt, gDebugWindowPtr, whichControl); 0IF partCode <> 0 THEN 4CASE partCode OF 8inUpButton, inDownButton, inPageUp, inPageDown:  127 THEN (p^ := gSizeCurLine - 256 $ELSE (p^ := gSizeCurLine; $SetString(s, gCurLine); $gSizeCurLine := 0; $ContentFocus; $SetRect(r, kWWHMargin, kWWVMargin - gLnAscent, gViewSize.h, gEndOfText.v + gHeight - gLnAscent); $ScrollRect(r, 0, -gHeight, gARgn); $InvalRgn(gARgn); $WWUpdateEvent; $SetPort(savePort); END; PROCEDURE WWShowPoint(pt: Point); $VAR minToSee: Point; (deltaCd: INTEGER; BEGIN $WindowFocus; $SetPt(minToSee, 50, gHeight); ${the following code is actually better than writing a loop with VHSelect} $WITH thePort^.portRect DO (BEGIN (deltaCd := pt.v + mintoSee.v - (bottom - 15 + gScrollOffset.v); (IF deltaCd <= 0 THEN ,BEGIN ,deltaCd := pt.v - minToSee.v - (top + gScrollOffset.v); ,IF deltaCd >= 0 THEN 0deltaCd := 0; ,END; (SetCtlValue(gSBars[v], GetCtlValue(gSBars[v]) + deltaCd); (deltaCd := pt.h + mintoSee.h - (right - 15 + gScrollOffset.h); (IF deltaCd <= 0 THEN ,BEGIN ,deltaCd := pt.h - minToSee.h - (left + gScrollOffset.h); ,IF deltaCd >= 0 THEN 0deltaCd := 0; ,END; (SetCtlValue(gSBars[h], GetCtlValue(gSBars[h]) + deltaCd); (END; $WWDoScrolling; END; {$S WWSeg} PROCEDURE WWTrackScroll(aControl: ControlHandle; partCode: INTEGER); $VAR up: BOOLEAN; (ctlValue: INTEGER; (vhs: VHSelect; (r: Rect; (delta: INTEGER; BEGIN $IF partCode <> 0 THEN (BEGIN (up := (partCode = inUpButton) OR (partCode = inPageUp); (ctlValue := GetCtlValue(aControl); &{avoid flicker in setting thumb, IF user tries to scroll past end} (IF (up AND (ctlValue > GetCtlMin(aControl))) OR +(NOT up AND (ctlValue < GetCtlMax(aControl))) THEN ,BEGIN ,r := aControl^^.contrlRect; {heap may compact when we call LongerSide} ,vhs := LongerSide(r); {this tells us which way we are scrolling} ,IF (partCode = inPageUp) OR (partCode = inPageDown) THEN 0WITH gDebugWindowPtr^.portRect DO 4delta := botRight.vh[vhs] - topLeft.vh[vhs] - gHeight ,ELSE 0delta := gHeight; ,IF up THEN 0delta := - delta; ,SetCtlValue(aControl, ctlValue + delta); ,WWDoScrolling; ,WindowFocus; ,END; (END; END; {$S WWSeg} PROCEDURE WWUpdateEvent; $VAR savePort: GrafPtr; (saveSaveVisRgn: RgnHandle; (saveVisRgn: RgnHandle; BEGIN $GetPort(savePort); $saveSaveVisRgn := NewRgn; $saveVisRgn := GetSaveVisRgn; $CopyRgn(saveVisRgn, saveSaveVisRgn); $BeginUpdate(gDebugWindowPtr); $WindowFocus; $EraseRect(thePort^.portRect); $DrawGrowIcon(gDebugWindowPtr); $DrawControls(gDebugWindowPtr); $ContentFocus; $WWDraw; $EndUpdate(gDebugWindowPtr); $CopyRgn(saveSaveVisRgn, saveVisRgn); $DisposeRgn(saveSaveVisRgn); $SetPort(savePort); END; npSAg`R@.N^ _PNЁDGETINDPA GETINDPAGETINDPAFNVYO/ once at the start of your program.} PROCEDURE WWNew(bounds: Rect; windowTitle: Str255; goAway: BOOLEAN; visible: BOOLEAN; 0linesToSave, outputFont, outputSize: INTEGER); ${Call this to create a WriteLn xyzafWindow with given title. (goAway is TRUE iff you want a go away box (IF the user clicks the go away box, ,the xyzafWindow will be hidden but not freed); (visible is TRUE iff you want the xyzafWindow to be visible initially; (linesToSave is number of lines to save; (outputFont & output size define the font to use (} ${Call the following procedures in response to events for the WriteLnWindow. ((Test the xyzafWindow receiving the event against gDebugWindowPtr.} PROCEDURE WWActivateEvent(modifiers: INTEGER); PROCEDURE WWMouseDown(where: INTEGER; pt: Point; modifiers: INTEGER); PROCEDURE WWUpdateEvent; IMPLEMENTATION {$I WritelnWindow2.text} END. FIXMATH INTERFACE USES #{$U-} #{$U obj/MemTypes } MemTypes, #{$U obj/QuickDraw} QuickDraw, #{$U obj/OSIntf } OSIntf, #{$U obj/ToolIntf } ToolIntf; TYPE #Fracd = LongInt; {Fracd is a fixed point number made up of a signed 1 bit integer and a 30 bit fraction.} #FUNCTION FixDiv (x, y: Fixed): Fixed; { returns x/y } #FUNCTION FracRatio (x, y: Fracd): Fixed; { returns x/y } #FUNCTION FFixRatio (x, y: Fixed): Fracd; { returns x/y } #FUNCTION FracMul (x, y: Fracd): Fracd; { returns x*y } #FUNCTION FFixMul (x: Fixed; y: Fracd): Fixed; { returns x*y } #FUNCTION FracSqrt (x: Fracd): Fracd; { returns x**1/2 } #FUNCTION FracSin (angle: Fixed): Fracd; { argument in radians } #FUNCTION FracCos (angle: Fixed): Fracd; (* Note: these routines serve the same function as the corresponding ROM #routines, with some minor bug fixes, enhancements and speed ups. Eventually, #this entire unit may replace the existing ROM routines. At that time, the #routines below would no longer have the 'R' at the beginning of the name. *) #FUNCTION RFixMul (x, y: Fixed): Fixed; #FUNCTION RFixRound (x: Fixed): INTEGER; #FUNCTION RLoWord (x: Fixed): INTEGER; #FUNCTION RHiWord (x: Fixed): INTEGER; #PROCEDURE RLongMul (x, y: LongInt; VAR dst: Int64Bit); #FUNCTION RFixRatio (x, y: INTEGER): Fixed; IMPLEMENTATION #FUNCTION FixDiv ; EXTERNAL; GRAF3D OPEN3DPO OPEN3DPOOPEN3DPOMOVETO3DMOVETO3DlIDENTITYIDENTITYbVIEWANGLVIEWANGL^LOOKAT LOOKAT XVIEWPORTVIEWPORTQUICKDRA"GRAF3D ~NV/ +n n mHhN mIB?,?<iB??<iB?,?<iB?,?<iNBNNBBBN(_N^.NuvSETPORT3 SETPORT3SETPORT3GRAF3D  NV+n n/sN^.NuGETPORT3 GETPORT3GETPORT3GRAF3D NV n N^.NuMOVETO3D MOVETO3DMOVETO3DCLIP3D CLIP3D JTRANSFORTRANSFOR4GRAF3D nNV/ (mAC( )n)n )n$HlHl(NBgHnHl(HnHnNg ?.?.(_N^ _ NЁfLINETO3D LINETO3DLINETO3DCLIP3D CLIP3D JTRANSFORTRANSFOR4GRAF3D xNV/ (mAC( )n)n )n$HlHl(NBgHnHl(HnHnNg?.?.쨓?.?.(_N^ _ NЁpMOVE3D MOVE3D MOVE3D MOVETO3DMOVETO3D*GRAF3D @NV/ (m .Ь/ . Ь / .Ь$/N(_N^ _ NЁ8LINE3D LINE3D LINE3D LINETO3DLINETO3D*GRAF3D @NV/ (m .Ь/ . Ь / .Ь$/N(_N^ _ NЁ8MOVETO2D MOVETO2DMOVETO2DMOVETO3DMOVETO3DGRAF3D (NV/. /. m/($NN^ _PONЁ MOVE2D MOVE2D MOVE2D MOVE3D MOVE3D "NV/. /.BNN^ _PONЁLINETO2D LINETO2DLINETO2DLINETO3DLINETO3DGRAF3D (NV/. /. m/($NN^ _PONЁ LINE2D LINE2D LINE2D LINE3D LINE3D "NV/. /.BNN^ _PONЁVIEWLOOK $1000000VIEWLOOKGRAF3D tNVH(mGB0+k??<i)_@B0+S??PITCH PITCH PITCH FRACCOS FRACCOS :FRACRATIFRACRATID.FRACSIN FRACSIN $FIXDIV FIXDIV GRAF3D JJNVH(.B//<9KN(BB/N/<@N.BB/N/<@N,(mB,XB/,^/hB/,b/h*ڟB/,b/hB/,^/h ")Ab)E^B/,n/hB/,r/h*ڟB/,r/hB/,n/h ")Ar)EnB/,~/hB/,/h*ڟB/,/hB/,~/h ")A)E~B/,/hB/,/h*ڟB/,/hB/,/h ")A)ELN^.NuBYAW YAW YAW FRACCOS FRACCOS >FRACRATIFRACRATIH0FRACSIN FRACSIN &FIXDIV FIXDIV GRAF3D N^NVHB/./<9KN-_BB/.N/<@N.BB/.N/<@N,(mB,XB/,Z/hB/,b/h *(,ZB/,Z/hB/,b/h П)@b)EZB/,j/hB/,r/h *(,jB/,j/hB/,r/h П)@r)EjB/,z/hB/,/h *(,zB/,z/hB/,/h П)@)EzB/,/hB/,/h *(,B/,/hB/,/h П)@)ELN^.NuVROLL ROLL ROLL FRACCOS FRACCOS :FRACRATIFRACRATID.FRACSIN FRACSIN $FIXDIV FIXDIV GRAF3D JJNVH(.B//<9KN(BB/N/<@N.BB/N/<@N,(mB,XB/,Z/hB/,^/h*ڟB/,^/hB/,Z/h ")A^)EZB/,j/hB/,n/h*ڟB/,n/hB/,j/h ")An)EjB/,z/hB/,~/h*ڟB/,~/hB/,z/h ")A~)EzB/,/hB/,/h*ڟB/,/hB/,/h ")A)ELN^.NuBSKEW SKEW SKEW FRACRATIFRACRATI0FRACCOS FRACCOS ,FRACSIN FRACSIN $FIXDIV FIXDIV GRAF3D 6NVH*.B//<9KN*BB/NB/NN,(mB,XBG`* @"AHB$B/4 Z/h$LԴj)jRG GoLN^.NuzSETPT3D SETPT3D SETPT3D 2NV n  n!n  n!nN^ _NЁ*SETPT2D SETPT2D SETPT2D (NV n n!nN^ _ NЁ  { three-dimensional graphics routines layered on top of QuickDraw } INTERFACE USES {$U-} %{$U obj/MemTypes } MemTypes, %{$U obj/QuickDraw } QuickDraw, %{$U obj/OSIntf } OSIntf, %{$U obj/ToolIntf } ToolIntf, %{$U obj/FixMath } FixMath; CONST radConst = 3754936; {radConst = 57.29578} TYPE Point3D=RECORD /x: fixed; /y: fixed; /z: fixed; -END; %Point2D=RECORD /x: fixed; /y: fixed; -END; %XfMatrix = ARRAY[0..3,0..3] OF fixed; %Port3DPtr = ^Port3D; %Port3D = RECORD 3GPort: GrafPtr; 3viewRect: Rect; 3xLeft,yTop,xRight,yBottom: fixed; 3pen,penPrime,eye: Point3D; 3hSize,vSize: fixed; 3hCenter,vCenter: fixed; 3xCotan,yCotan: fixed; 3ident: BOOLEAN; 3xForm: XfMatrix; 1END; VAR thePort3D: Port3DPtr; "PROCEDURE Open3DPort (port: Port3DPtr); "PROCEDURE SetPort3D (port: Port3DPtr); "PROCEDURE GetPort3D (VAR port: Port3DPtr); "PROCEDURE MoveTo2D(x,y: fixed); PROCEDURE MoveTo3D(x,y,z: fixed); "PROCEDURE LineTo2D(x,y: fixed); PROCEDURE LineTo3D(x,y,z: fixed); "PROCEDURE Move2D(dx,dy: fixed); PROCEDURE Move3D(dx,dy,dz: fixed); "PROCEDURE Line2D(dx,dy: fixed); PROCEDURE Line3D(dx,dy,dz: fixed); "PROCEDURE ViewPort (r: Rect); "PROCEDURE LookAt (left,top,right,bottom: fixed); "PROCEDURE ViewAngle (angle: fixed); "PROCEDURE Identity; "PROCEDURE Scale (xFactor,yFactor,zFactor: fixed); "PROCEDURE Translate (dx,dy,dz: fixed); "PROCEDURE Pitch (xAngle: fixed); "PROCEDURE Yaw (yAngle: fixed); "PROCEDURE Roll (zAngle: fixed); "PROCEDURE Skew (zAngle: fixed); "PROCEDURE TransForm (src: Point3D; VAR dst: Point3D); "FUNCTION Clip3D (src1,src2: Point3D; VAR dst1,dst2: POINT): BOOLEAN; "PROCEDURE SetPt3D (VAR pt3D: Point3D; x,y,z: fixed); "PROCEDURE SetPt2D (VAR pt2D: Point2D; x,y: fixed); IMPLEMENTATION MACPRINTL {$U-} {Turn on/off the Lisa Libraries.} {$X-} {Turn on/off stack expansion.} {$R-} {Turn on/off range checking.} {$D-} {Turn on/off debug symbols.} INTERFACE { ---------------------------------------------------------------------- } USES {$U Obj/MemTypes } MemTypes, &{$U Obj/QuickDraw } QuickDraw, &{$U Obj/OSIntf } OSIntf, &{$U Obj/ToolIntf } ToolIntf; { ---------------------------------------------------------------------- } { This is the Public interface to MacPrint } { ---------------------------------------------------------------------- } CONST #iPrPgFract = 120; {Page scale factor. ptPgSize (below) is in units of 1/iPrPgFract } #iPrPgFst = 1; {Page range constants} #iPrPgMax = 9999; #iPrRelease = 3; {Current version number of the code.} {DC 7/23/84} #iPfMaxPgs = 128; {Max number of pages in a print file.} {Driver constants} #iPrBitsCtl = 4; {The Bitmap Print Proc's ctl number} #lScreenBits= $00000000; {The Bitmap Print Proc's Screen Bitmap param} #lPaintBits = $00000001; {The Bitmap Print Proc's Paint [sq pix] param} #lHiScreenBits= $00000010; {The Bitmap Print Proc's Screen Bitmap param} #lHiPaintBits = $00000011; {The Bitmap Print Proc's Paint [sq pix] param} #iPrIOCtl = 5; {The Raw Byte IO Proc's ctl number} #iPrEvtCtl = 6; {The PrEvent Proc's ctl number} #lPrEvtAll = $0002FFFD; {The PrEvent Proc's CParam for the entire screen} #lPrEvtTop = $0001FFFD; {The PrEvent Proc's CParam for the top folder} #iPrDevCtl = 7; {The PrDevCtl Proc's ctl number} #lPrReset = $00010000; {The PrDevCtl Proc's CParam for reset} #lPrPageEnd = $00020000; {The PrDevCtl Proc's CParam for end page} #lPrLineFeed= $00030000; {The PrDevCtl Proc's CParam for paper advance} #lPrLFSixth = $0003FFFF; {The PrDevCtl Proc's CParam for 1/6 th inch paper advance} #lPrLFEighth= $0003FFFE; {The PrDevCtl Proc's CParam for 1/8 th inch paper advance} #iFMgrCtl = 8; {The FMgr's Tail-hook Proc's ctl number} ;{ [The Pre-Hook is the status call] } {Error Constants:} #iMemFullErr = -108; #iPrAbort = 128; #iIOAbort = -27; {The PrVars lo mem area:} #pPrGlobals = $00000944; #bDraftLoop = 0; #bSpoolLoop = 1; #bUser1Loop = 2; #bUser2Loop = 3; {The Currently supported printers:} #bDevCItoh = 1; iDevCItoh = $0100; {CItoh} #bDevDaisy = 2; iDevDaisy = $0200; {Daisy} #bDevLaser = 3; iDevLaser = $0300; {Laser} { ---------------------------------------------------------------------- } TYPE #TPRect = ^Rect; {A Rect Ptr} #TPBitMap = ^BitMap; {A BitMap Ptr} 5{NOTE: Changes will also affect: PrEqu, TCiVars & TPfVars} #TPrVars = RECORD {4 longs for printing, see SysEqu for location.} &iPrErr: Integer; {Current print error. Set to iPrAbort to abort printing.} &bDocLoop: SignedByte; {The Doc style: Draft, Spool, .., and ..} D{Currently use low 2 bits; the upper 6 are for flags.} &bUser1: SignedByte; {Spares used by the print code} &lUser1: LongInt; &lUser2: LongInt; &lUser3: LongInt; #END; #TPPrVars = ^TPrVars; #TPrInfo = RECORD {Print Info Record: The parameters needed for page composition.} &iDev: Integer; {Font mgr/QuickDraw device code} &iVRes: Integer; {Resolution of device, in device coordinates} &iHRes: Integer; { ..note: V before H => compatable with Point.} &rPage: Rect; {The page (printable) rectangle in device coordinates.} #END; #TPPrInfo = ^TPrInfo; {These are types of paper feeders.} #TFeed = ( feedCut, feedFanfold, feedMechCut, feedOther ); #TPrStl = RECORD {Printer Style: The printer configuration and usage information.} &wDev: Integer; {The device (driver) number. Hi byte=RefNum, Lo byte=variant.} C{f0 = fHiRes, f1 = fPortrait, f2 = fSqPix, f3 = f2xZoom, f4 = fScroll.} &iPageV: Integer; {paper size in units of 1/iPrPgFract} &iPageH: Integer; { ..note: V before H => compatable with Point.} &bPort: SignedByte; {The IO port number. Refnum?} &feed: TFeed; {paper feeder type.} #END; #TPPrStl = ^TPrStl; {Banding data structures. Not of general interest to Apps.} #TScan = {Band Scan direction Top-Bottom, Left-Right, etc.} &( scanTB, scanBT, scanLR, scanRL ); #TPrXInfo = RECORD {The print time eXtra information.} &iRowBytes: Integer; {The Band's rowBytes.} &iBandV: Integer; {Size of band, in device coordinates} &iBandH: Integer; { ..note: V before H => compatable with Point.} &iDevBytes: Integer; {Size for allocation. May be more than rBounds size!} &iBands: Integer; {Number of bands per page.} &bPatScale: SignedByte; {Pattern scaling} &bULThick: SignedByte; {3 Underscoring parameters} &bULOffset: SignedByte; &bULShadow: SignedByte; &scan: TScan; {Band scan direction} &bXInfoX: SignedByte; {An eXtra byte.} #END; #TPPrXInfo = ^TPrXInfo; #TPrJob = RECORD {Print Job: Print "form" for a single print request.} &iFstPage: Integer; {Page Range.} &iLstPage: Integer; &iCopies: Integer; {No. copies.} &bJDocLoop: SignedByte; {The Doc style: Draft, Spool, .., and ..} &fFromUsr: Boolean; {Printing from an User's App (not PrApp) flag} &pIdleProc: ProcPtr; {The Proc called while waiting on IO etc.} &pFileName: StringPtr; {Spool File Name: NIL for default.} &iFileVol: Integer; {Spool File vol, set to 0 initially} &bFileVers: SignedByte; {Spool File version, set to 0 initially} &bJobX: SignedByte; {An eXtra byte.} #END; #TPPrJob = ^TPrJob; #TPrint = RECORD {The universal 120 byte printing record} &iPrVersion: Integer; {2} {Printing software version} &PrInfo: TPrInfo; {14} {the PrInfo data associated with the current style.} &rPaper: Rect; {8} {The paper rectangle [offset from rPage].} &PrStl: TPrStl; {8} {This print request's style.} &PrInfoPT: TPrInfo; {14} {Print Time Imaging metrics} &PrXInfo: TPrXInfo; {16} {Print-time (expanded) Print info record.} &PrJob: TPrJob; {20} {The Print Job request} >{82} {Total of the above; 120-82 = 38 bytes needed to fill 120} &PrintX: Array[1..19]of Integer; {Spare to fill to 120 bytes!} #END; #TPPrint = ^TPrint; #THPrint = ^TPPrint; {Printing Graf Port. All printer imaging, whether spooling, banding, etc, happens "thru" a GrafPort.} #TPrPort = RECORD {This is the "PrPeek" record.} &GPort: GrafPort; {The Printer's graf port.} &GProcs: QDProcs; {..and its procs} &lGParam1: LongInt; {16 bytes for private parameter storage.} &lGParam2: LongInt; &lGParam3: LongInt; &lGParam4: LongInt; &fOurPtr: Boolean; {Whether the PrPort allocation was done by us.} &fOurBits: Boolean; {Whether the BitMap allocation was done by us.} #END; #TPPrPort = ^TPrPort; #TPrStatus = RECORD {Print Status: Print information during printing.} &iTotPages: Integer; {Total pages in Print File.} &iCurPage: Integer; {Current page number} &iTotCopies: Integer; {Total copies requested} &iCurCopy: Integer; {Current copy number} &iTotBands: Integer; {Total bands per page.} &iCurBand: Integer; {Current band number} &fPgDirty: Boolean; {True if current page has been written to.} &fImaging: Boolean; {Set while in band's DrawPic call.} &hPrint: THPrint; {Handle to the active Printer record} &pPrPort: TPPrPort; {Ptr to the active PrPort} &hPic: PicHandle; {Handle to the active Picture} #END; #TPPrStatus = ^TPrStatus; {PicFile = a TPfHeader followed by n QuickDraw Pics (whose PicSize is invalid!)} #TPfPgDir = RECORD &iPages: Integer; &lPgPos: ARRAY [0..iPfMaxPgs] OF LongInt; #END; #TPPfPgDir = ^TPfPgDir; #THPfPgDir = ^TPPfPgDir; #TPfHeader = RECORD {Print File header.} &Print: TPrint; &PfPgDir: TPfPgDir; #END; #TPPfHeader = ^TPfHeader; #THPfHeader = ^TPPfHeader; {Note: Type compatable with an hPrint.} { This is the Printing Dialog Record. Only used by folks appending their own dialogs. } #TPrDlg = RECORD {Print Dialog: The Dialog Stream object.} &Dlg: DialogRecord; {The Dialog window} &pFltrProc: ProcPtr; {The Filter Proc.} &pItemProc: ProcPtr; {The Item evaluating proc.} &hPrintUsr: THPrint; {The user's print record.} &fDoIt: Boolean; &fDone: Boolean; &lUser1: LongInt; {Four longs for user's to hang global data.} &lUser2: LongInt; &lUser3: LongInt; &lUser4: LongInt; #{ ...Plus more stuff needed by the particular printing dialog.} #END; #TPPrDlg = ^TPrDlg; {== a dialog ptr} { ---------------------------------------------------------------------- } { --Init-- } PROCEDURE PrOpen; #{ Open the .Print driver, get the Current Printer's Rsrc file %name from SysRes, open the resource file, and open the .Print driver %living in SysRes. %PrOpen MUST be called during init time. } PROCEDURE PrClose; #{Closes JUST the print rsrc file. Leaves the .Print driver in SysRes open.} { --Print Dialogs & Default-- } PROCEDURE PrintDefault ( hPrint: THPrint ); #{ Defaults a handle to a Default Print record. %Note: You allocate (or fetch from file's resources..) the handle, +I fill it. Also, I may invoke this at odd times whenever +I think you have an invalid Print record! } FUNCTION PrValidate ( hPrint: THPrint ): Boolean; #{ Checks the hPrint. Fixes it if there has been a change in SW %version or in the current printer. Returns fChanged. %Note: Also updates the various parameters within the Print +record to match the current values of the PrStl & PrJob. +It does NOT set the fChanged result if these +parameters changed as a result of this update. } FUNCTION PrStlDialog ( hPrint: THPrint ): Boolean; FUNCTION PrJobDialog ( hPrint: THPrint ): Boolean; #{ The Dialog returns the fDoIt flag: )IF PrJobDialog(..) THEN BEGIN ,PrintMyDoc (..); ,SaveMyStl (..) )END -OR )IF PrStlDialog(..) THEN SaveMyStl (..) &NOTE: These may change the hPrint^^ if the version number ,is old or the printer is not the current one. } PROCEDURE PrJobMerge (hPrintSrc, hPrintDst: THPrint); #{ Merges hPrintSrc's PrJob into hPrintDst [Source/Destination]. %Allows one job dialog being applied to several docs [Finder printing] } { --The Document printing procs: These spool a print file.-- } FUNCTION PrOpenDoc ( hPrint: THPrint; 5pPrPort: TPPrPort; 5pIOBuf: Ptr ): TPPrPort; #{ Set up a graf port for Pic streaming and make it the current port. %Init the print file page directory. %Create and open the print file. %hPrint: The print info. %pPrPort: the storage to use for the TPrPort. If NIL we allocate. %pIOBuf: an IO buf; if NIL, file sys uses volume buf. %returns TPPrPort: The TPPrPort (graf port) used to spool thru. } PROCEDURE PrCloseDoc ( pPrPort: TPPrPort ); #{ Write the print file page directory. %Close the print file. } PROCEDURE PrOpenPage ( pPrPort: TPPrPort; pPageFrame: TPRect ); #{ If current page is in the range of printed pages: 'Open a picture for the page 'Otherwise set a null port for absorbing an image. %pPageFrame := PrInfo.rPage, unless you're scaling. %Set pPageFrame to NIL unless you want to perform PicScaling on the printer. %[The printing procs will call OpenPicture (pPageFrame^) and DrawPicture (hPic, rPage);] %Note: Use of QuickDraw may now cause File IO errors due to our Pic spooling! } PROCEDURE PrClosePage( pPrPort: TPPrPort ); #{ Close & kill the page picture. %Update the file page directory. %If we allocated the TPrPort then de-allocate it. } { --The "Printing Application" proc: Read and band the spooled PicFile.-- } PROCEDURE PrPicFile( hPrint: THPrint; 5pPrPort: TPPrPort; 5pIOBuf: Ptr; 5pDevBuf: Ptr; 5VAR PrStatus: TPrStatus ); #{ Read and print the spooled print file. %The idle proc is run during Imaging and Printing. } { --Get/Set the current Print Error-- } FUNCTION PrError: Integer; PROCEDURE PrSetError ( iErr: Integer ); { --The .Print driver calls.-- } PROCEDURE PrDrvrOpen; PROCEDURE PrDrvrClose; #{ Open/Close the .Print driver in SysRes. Make it purgable or not. %ONLY used by folks doing low level stuff, not full document printing. } PROCEDURE PrCtlCall (iWhichCtl: Integer; lParam1, lParam2, lParam3: LongInt); #{ A generalized Control proc for the Printer driver. %The main use is for bitmap printing: )PrCtlCall (iPrBitsCtl, pBitMap, pPortRect, lControl); )== )PROCEDURE PrBits ( pBitMap: Ptr; --QuickDraw bitmap >pPortRect: TPRect; --a portrect. use bounds for whole bitmap >lControl: LongInt ); --0=>Screen resolution/Portrait %This dumps a bitmap/portrect to the printer. %lControl is a device dep param; use 0 for screen res/portrait/etc. %Each different printer will use lControl parameter differently. %Thus PrCtlCall (iPrBitsCtl, @MyPort^.ScreenBits, @MyPort^.PortRect.Bounds,0) %performs a screen dump of just my port's data. %Two special control calls are included in the driver for Screen printing from the %key board: ,PrCtlCall (iPrEvtCtl, lPrEvtAll, 0, 0); Prints the screen ,PrCtlCall (iPrEvtCtl, lPrEvtTop, 0, 0); Prints the top folder %These are handled by the system for key board access but can be called by anyone %at any time. They can be very cheap printing for ornaments, for example! %Another useful call is used for sending raw data to the printer: )PrCtlCall (iPrIOCtl, pBuf, lBufCount, pIdleProc); } { These .Print driver calls are only available in the PrScreen module. } PROCEDURE PrPurge; PROCEDURE PrNoPurge; FUNCTION PrDrvrDCE: Handle; FUNCTION PrDrvrVers: Integer; { --Semi private stuff-- } FUNCTION PrStlInit ( hPrint: THPrint ): TPPrDlg; FUNCTION PrJobInit ( hPrint: THPrint ): TPPrDlg; FUNCTION PrDlgMain ( hPrint: THPrint; pDlgInit: ProcPtr ): Boolean; PROCEDURE PrCfgDialog; PROCEDURE PrHack ( lParam1, lParam2, lParam3: LongInt ); { ---------------------------------------------------------------------- } { This is the Private interface to MacPrint } { ---------------------------------------------------------------------- } CONST #iIOBufBytes= 522; {Size of file sys buf.} #iIOBlkBytes= 512; {Size of disk block} {The TPrint Resource type & ID's} #lPStrType = $53545220; {"STR ": Res type for the Pr Rsrc file name} #iPStrRFil = $E000; {-8192} {Str $E000 [in SysRes] is the current printer's rsrc file} #iPStrPFil = $E001; {-8191} {Str $E001 is the default print file name} #lPrintType = $50524543; {"PREC": Res type for the hPrint records} #iPrintDef = 0; {Default hPrint } #iPrintLst = 1; {Last used hPrint} #iPrintDrvr= 2; {.Print's parameter record; not a Print rec} #iPrintPSiz= 3; {Paper size button definitions} {DC 7/30/84} #iMyPrDrvr = $E000; {-8192} {My copy of the above.} {PicFile constants} #lPfType = $5046494C; {"PFIL"} #lPfSig = $50535953; {"PSYS"} #iPfIcon = 140; #lPrType = $4150504C; {"APPL"} #lPrSig = $50535953; {"PSYS"} #iPrIcon = 138; {Driver constants} #sPrDrvr = '.Print'; #iPrDrvrID = 2; {Driver's ResID} #iPrDrvrRef = $FFFD; {Driver's RefNum = NOT ResID} #iPrDrvrDev = $FD00; {Driver's QD Dev num = RefNum in Hi Byte, variant in lo} {General Dlg/Alert[=Ax] Constants:} #iOK = 1; iCancel = 2; #iPrStlDlg= $E000; {-8192} #iPrJobDlg= $E001; {-8191} #iPrCfgDlg= $E002; {-8190} #iPgFeedAx= $E00A; {-8182} #iPicSizAx= $E00B; {-8181} #iIOAbrtAx= $E00C; {-8180} {Convenient non-characters; note Etx is Enter key} #bETX = 3; bBS = 8; bHTab = 9; bLF = 10; bCR = 13; bSO = 14; bSI = 15; bESC = 27; (* #iPicLim = 129; #iPicMax = 130; #iPrDeapShit = 29; *) { ---------------------------------------------------------------------- } TYPE #TN = 0..15; {A Nibble} #TWord = PACKED RECORD {General purpose "alias" record for a word & long.} &CASE Integer OF )0: ( c1, c0: Char ); )1: ( b1, b0: SignedByte ); )2: ( usb1, usb0: Byte ); )3: ( n3, n2, n1, n0: TN ); )4: ( f15, f14, f13, f12, f11, f10, f9, f8, f7, f6, f5, f4, f3, f2, f1, f0: Boolean ); )5: ( i0: Integer ); #END; #TLong = RECORD &CASE Integer OF )0: ( w1, w0: TWord ); )1: ( l0: LongInt ); )2: ( p0: Ptr ); )3: ( h0: Handle ); )4: ( pt: Point ); #END; { ---------------------------------------------------------------------- } {File Utilities: IO68K} {FUNCTION PrStr80Ptr (sName:TStr80): TPStr80;} FUNCTION PrCreateFile(pName: StringPtr; iVol: Integer; bVersion: SignedByte): Integer; FUNCTION PrDeleteFile(pName: StringPtr; iVol: Integer; bVersion: SignedByte): Integer; FUNCTION PrOpenFile (pName: StringPtr; iVol: Integer; bVersion: SignedByte; 4fTrunc: Boolean; pBuf: Ptr; VAR iRefNum: Integer): Integer; FUNCTION PrWriteBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer; FUNCTION PrReadBlk (iRefNum, iMode:Integer; lPos:LongInt; p:Ptr; lBytes:LongInt ):Integer; FUNCTION PrCloseFile(iRefNum: Integer): Integer; {Scc utilitys: Scc68k} FUNCTION PrSCCInit (iBaudEtc: Integer; lHndShk: LongInt): Integer; FUNCTION PrBlockOut (pIdleProc: ProcPtr; pData: Ptr; lBytes: LongInt): Integer; (*FUNCTION PrIOCheck (lTimeOut: LongInt; pData: Ptr; lBytes: LongInt): Integer;*) PROCEDURE XPrIdle (pIdleProc: ProcPtr); PROCEDURE PrAbortCheck; {Other Utilities: PrMacMisc} FUNCTION lPrMul (i1, i0: Integer): LongInt; FUNCTION lPrDiv (lTop: LongInt; iBot: Integer): LongInt; {Performance tool} Procedure SpyInit; Procedure SpyClose; Procedure Spy (iBucket: Integer); { ---------------------------------------------------------------------- } IMPLEMENTATION MEMTYPES INTERFACE TYPE SignedByte = -128..127; { any byte in memory } Byte = 0..255; { unsigned byte for fontmgr } Ptr = ^SignedByte; { blind pointer } Handle = ^Ptr; { pointer to a master pointer } ProcPtr = Ptr; { pointer to a procedure } Fixed = LongInt; { fixed point arithmetic type } Str255 = String[255]; { maximum string size } StringPtr = ^Str255; { pointer to maximum string } StringHandle = ^StringPtr; { handle to maximum string } IMPLEMENTATION OSINTF t INTERFACE USES {$U-} %{$U obj/MemTypes } MemTypes, %{$U obj/QuickDraw } QuickDraw; CONST "{for Event Manager} "everyEvent = -1; "NullEvent = 0; "mouseDown = 1; "mouseUp = 2; "keyDown = 3; "keyUp = 4; "autoKey = 5; "updateEvt = 6; "diskEvt = 7; "activateEvt = 8; "networkEvt = 10; "driverEvt = 11; "app1Evt = 12; "app2Evt = 13; "app3Evt = 14; "app4Evt = 15; "{ event mask equates } "mDownMask = 2; "mUpMask = 4; "keyDownMask = 8; "keyUpMask = 16; "autoKeyMask = 32; "updateMask = 64; "diskMask = 128; "activMask = 256; "networkMask = 1024; "driverMask = 2048; "app1Mask = 4096; "app2Mask = 8192; "app3Mask = 16384; "app4Mask = -32768; "{to decipher event message for keyDown events} "charCodeMask = $000000FF; "keyCodeMask = $0000FF00; "{ modifiers } "optionKey= 2048; { Bit 3 of high byte } "alphaLock= 1024; { Bit 2 } "ShiftKey= 512; { Bit 1 } "CmdKey= 256; { Bit 0 } "BtnState= 128; { Bit 7 of low byte is mouse button state } "activeFlag = 1; { bit 0 of modifiers for activate event } "{error for PostEvent} "EvtNotEnb = 1; {for Memory Manager} "MemFullErr = -108; { Not enough room in heap zone } "NilHandleErr = -109; { Master Pointer was NIL in HandleZone or other } "MemWZErr = -111; { WhichZone failed (applied to free block) } "MemPurErr = -112; { trying to purge a locked or non-purgeable block } "MemLockedErr = -117; { Block is locked } "NoErr = 0; { All is well } "{file system error codes} "DirFulErr = -33; { Directory full} "DskFulErr = -34; { disk full} "NSVErr = -35; { no such volume} "IOErr = -36; { I/O error (bummers)} "BdNamErr = -37; { there may be no bad names in the final system!} "FNOpnErr = -38; { File not open} "EOFErr = -39; { End of file} "PosErr = -40; { tried to position to before start of file (r/w)} "MFulErr = -41; { memory full(open) or file won't fit (load)} "TMFOErr = -42; { too many files open} "FNFErr = -43; { File not found} "WPrErr = -44; { diskette is write protected} "FLckdErr = -45; { file is locked} "VLckdErr = -46; { volume is locked} "FBsyErr = -47; { File is busy (delete)} "DupFNErr = -48; { duplicate filename (rename)} "OpWrErr = -49; { file already open with with write permission} "ParamErr = -50; { error in user parameter list} "RFNumErr = -51; { refnum error} "GFPErr = -52; { get file position error} "VolOffLinErr = -53; { volume not on line error (was Ejected)} "PermErr = -54; { permissions error (on file open)} "VolOnLinErr = -55; { drive volume already on-line at MountVol} "NSDrvErr = -56; { no such drive (tried to mount a bad drive num)} "NoMacDskErr = -57; { not a mac diskette (sig bytes are wrong)} "ExtFSErr = -58; { volume in question belongs to an external fs} "FSRnErr = -59; { file system rename error:} >{ during rename the old entry was deleted } >{ but could not be restored . . .} "BadMDBErr = -60; { bad master directory block} "WrPermErr = -61; { write permissions error} "firstDskErr = -84; {first of the range of low-level disk errors} "lastDskErr = -64; {last of the range of low-level disk errors} "MaxSize = $800000; { Max data block size is 512K bytes } "{finder constants} "fHasBundle = 8192; "fInvisible = 16384; "fTrash = -3; "fDesktop = -2; "fDisk = 0; "{io constants} "{ioPosMode values} "fsAtMark = 0; "fsFromStart = 1; "fsFromLEOF = 2; "fsFromMark = 3; "{ioPermission values} "fsCurPerm = 0; "fsRdPerm = 1; "fsWrPerm = 2; "fsRdWrPerm = 3; "{refNums from the serial ports} "AinRefNum = -6; {serial port A input} "AoutRefNum = -7; {serial port A output} "BinRefNum = -8; {serial port B input} "BoutRefNum = -9; {serial port B output} "{baud rate constants} "baud300 = 380; "baud600 = 189; "baud1200 = 94; "baud1800 = 62; "baud2400 = 46; "baud3600 = 30; "baud4800 = 22; "baud7200 = 14; "baud9600 = 10; "baud19200 = 4; "baud57600 = 0; "{SCC channel configuration word} "{driver reset information masks} "stop10 = 16384; "stop15 = -32768; "stop20 = -16384; "noParity = 0; "oddParity = 4096; "evenParity = 12288; "data5 = 0; "data6 = 2048; "data7 = 1024; "data8 = 3072; "{serial driver error masks} "swOverrunErr = 0; "parityErr = 16; "hwOverrunErr = 32; "framingErr = 64; "{serial Port configuration usage constants for Config field of SysParmType} "useFree = 0; "useATalk = 1; "useAsync = 2; "{serial driver message constant} "xOffWasSent = $80; "{for application parameter} "{constants for message returned by the finder on launch} "appOpen = 0; "appPrint = 1; "{for sound driver} "SWmode = -1; "FTmode = 1; "FFmode = 0; "{for the disk driver} "currPos = 0; "absPos = 1; "relPos = 3; "rdVerify = 64; "{for "machine" parameter of Environs} "macXLMachine = 0; "macMachine = 1; TYPE "{for Event Manager} "EventRecord = RECORD 2what: INTEGER; 2message: LongInt; 2when: LongInt; 2where: Point; 2modifiers: INTEGER; 1END; "Zone = Record 2BkLim: Ptr; 2PurgePtr: Ptr; 2HFstFree: Ptr; 2ZCBFree: LongInt; 2GZProc: ProcPtr; 2MoreMast: Integer; 2Flags: Integer; 2CntRel: Integer; 2MaxRel: Integer; 2CntNRel: Integer; 2MaxNRel: Integer; 2CntEmpty: Integer; 2CntHandles: Integer; 2MinCBFree: LongInt; 2PurgeProc: ProcPtr; 2SparePtr: Ptr; { reserved for future } 2AllocPtr: Ptr; 2HeapData: Integer; /End; "THz = ^Zone; { pointer to the start of a heap zone } "Size = LongInt; { size of a block in bytes } "OsErr = Integer; { error code } "QElemPtr = ^QElem; {ptr to generic queue element} {Vertical Blanking Control Block Queue Element} VBLTask = RECORD $qLink: QElemPtr; {link to next element} $qType: INTEGER; {unique ID for validity check} $vblAddr: ProcPtr; {address of service routine} $vblCount: INTEGER; {count field for timeout} $vblPhase: INTEGER; {phase to allow synchronization} "END; {VBLCntrlBlk} {VBLQElPtr = ^VBLTask;} evQEl = RECORD $qLink: QElemPtr; $qType: INTEGER; $evtQwhat: INTEGER; {this part is identical to the EventRecord as...} $evtQmessage:LongInt; {defined in ToolIntf} $evtQwhen: LongInt; $evtQwhere: Point; $evtQmodifiers: INTEGER; "END; "{drive queue elements} DrvQEl = RECORD $qLink: QElemPtr; $qType: INTEGER; $dQDrive: INTEGER; $dQRefNum: INTEGER; {ref num of the drvr which handles this drive} $dQFSID: INTEGER; {id of file system which handles this drive} $dQDrvSize: INTEGER; {size of drive in 512-byte blocks -- not for drvs 1&2} "END; DrvQElPtr = ^DrvQEl; "ParamBlkType = (IOParam,FileParam,VolumeParam,CntrlParam); "OsType = PACKED ARRAY[1..4] OF CHAR; {same as rsrc mgr's Restype} "FInfo = RECORD {record of finder info} ,fdType: OsType; {the type of the file} ,fdCreator: OsType; {file's creator} ,fdFlags: INTEGER; {flags ex. hasbundle,invisible,locked, etc.} ,fdLocation: Point; {file's location in folder} ,fdFldr: INTEGER; {folder containing file} *END; {FInfo} "ParamBlockRec = RECORD ({12 byte header used by the file and IO system} (qLink: QElemPtr; {queue link in header} (qType: INTEGER; {type byte for safety check} (ioTrap: INTEGER; {FS: the Trap} (ioCmdAddr: Ptr; {FS: address to dispatch to} ({common header to all variants} (ioCompletion: ProcPtr; {completion routine addr (0 for synch calls)} (ioResult: OsErr; {result code} (ioNamePtr: StringPtr; {ptr to Vol:FileName string} (ioVRefNum: INTEGER; {volume refnum (DrvNum for Eject and MountVol)} ({different components for the different type of parameter blocks} (CASE ParamBlkType OF (ioParam: *(ioRefNum: INTEGER; {refNum for I/O operation} +ioVersNum: SignedByte; {version number} +ioPermssn: SignedByte; {Open: permissions (byte)} +ioMisc: Ptr; {Rename: new name} D{GetEOF,SetEOF: logical end of file} D{Open: optional ptr to buffer} D{SetFileType: new type} +ioBuffer: Ptr; {data buffer Ptr} +ioReqCount: LongInt; {requested byte count} +ioActCount: LongInt; {actual byte count completed} +ioPosMode: INTEGER; {initial file positioning} +ioPosOffset: LongInt); {file position offset} (FileParam: *(ioFRefNum: INTEGER; {reference number} +ioFVersNum: SignedByte; {version number} +filler1: SignedByte; +ioFDirIndex: INTEGER; {GetFileInfo directory index} +ioFlAttrib: SignedByte; {GetFileInfo: in-use bit=7, lock bit=0} +ioFlVersNum: SignedByte; {file version number} +ioFlFndrInfo: FInfo; {user info} +ioFlNum: LongInt; {GetFileInfo: file number} +ioFlStBlk: INTEGER; {start file block (0 if none)} +ioFlLgLen: LongInt; {logical length (EOF)} +ioFlPyLen: LongInt; {physical lenght} +ioFlRStBlk: INTEGER; {start block rsrc fork} +ioFlRLgLen: LongInt; {file logical length rsrc fork} +ioFlRPyLen: LongInt; {file physical length rsrc fork} +ioFlCrDat: LongInt; {file creation date & time (32 bits in secs)} +ioFlMdDat: LongInt); {last modified date and time} )VolumeParam: +(filler2: LongInt; ,ioVolIndex: INTEGER; {volume index number} ,ioVCrDate: LongInt; {creation date and time} ,ioVLsBkUp: LongInt; {last backup date and time} ,ioVAtrb: INTEGER; {volume attrib} ,ioVNmFls: INTEGER; {number of files in directory} ,ioVDirSt: INTEGER; {start block of file directory} ,ioVBlLn: INTEGER; {GetVolInfo: length of dir in blocks} ,ioVNmAlBlks: INTEGER; {GetVolInfo: num blks (of alloc size)} ,ioVAlBlkSiz: LongInt; {GetVolInfo: alloc blk byte size} ,ioVClpSiz: LongInt; {GetVolInfo: bytes to allocate at a time} ,ioAlBlSt: INTEGER; {starting disk(512-byte) block in block map} ,ioVNxtFNum: LongInt; {GetVolInfo: next free file number} ,ioVFrBlk: INTEGER); {GetVolInfo: # free alloc blks for this vol} *CntrlParam: ,(ioCRefNum: INTEGER; {refNum for I/O operation} -CSCode: INTEGER; {word for control status code} -CSParam: ARRAY[0..10] OF INTEGER); {operation-defined parameters} &END; {ParamBlockRec} "ParmBlkPtr = ^ParamBlockRec; {20 bytes of system parameter area} "SysParmType = PACKED RECORD *Valid: Byte; {validation field ($A7)} *ATalkA: Byte; {AppleTalk node number hint for port A } *ATalkB: Byte; {AppleTalk node number hint for port B } *Config: Byte; {ATalk port configuration A = bits 4-7, B = 0-3} *PortA: INTEGER; {SCC port A configuration} *PortB: INTEGER; {SCC port B configuration} *Alarm: LongInt; {alarm time} *Font: INTEGER; {default font id} *KbdPrint: INTEGER; {high byte = kbd repeat} D{high nibble = thresh in 4/60ths} D{low nibble = rates in 2/60ths} @{low byte = print stuff} *VolClik: INTEGER; {low 3 bits of high byte = volume control} @{high nibble of low byte = double time in 4/60ths} @{low nibble of low byte = caret blink time in 4/60ths} *Misc: INTEGER; {EEEC EEEE PSKB FFHH} D{E = extra} D{P = paranoia level} D{S = mouse scaling} D{K = key click} D{B = boot disk} D{F = menu flash} D{H = help level} %END; {SysParmType} "SysPPtr = ^SysParmType; {volume control block data structure} VCB = RECORD $qLink: QElemPtr; {link to next element} $qType: INTEGER; {not used} $vcbFlags: INTEGER; $vcbSigWord: INTEGER; $vcbCrDate: LongInt; $vcbLsBkUp: LongInt; $vcbAtrb: INTEGER; $vcbNmFls: INTEGER; $vcbDirSt: INTEGER; $vcbBlLn: INTEGER; $vcbNmBlks: INTEGER; $vcbAlBlkSiz: LongInt; $vcbClpSIz: LongInt; $vcbAlBlSt: INTEGER; $vcbNxtFNum: LongInt; $vcbFreeBks: INTEGER; $vcbVN: STRING[27]; $vcbDrvNum: INTEGER; $vcbDRefNum: INTEGER; $vcbFSId: INTEGER; $vcbVRefNum: INTEGER; $vcbMAdr: Ptr; $vcbBufAdr: Ptr; $vcbMLen: INTEGER; $vcbDirIndex: INTEGER; $vcbDirBlk: INTEGER; END; {general queue data structure} QHdr = RECORD $QFlags: INTEGER; {misc flags} $QHead: QElemPtr; {first elem} $QTail: QElemPtr; {last elem} "END; {QHdr} QHdrPtr = ^QHdr; {there are currently 4 types of queues: } { VType - queue of Vertical Blanking Control Blocks } { IOQType - queue of I/0 queue elements } { DrvType - queue of drivers } { EvType - queue of Event Records } { FSQType - queue of VCB elements } { TimerType no longer is used. DrvType replaces it here in enum type} QTypes = (dummyType,vType,ioQType,drvQType,evType,fsQType); QElem = RECORD (CASE QTypes OF (vType: *(vblQelem: VBLTask); {vertical blanking} (ioQType: *(ioQElem: ParamBlockRec); {I/O parameter block} (drvQType: *(drvQElem: DrvQEl); {drive} (evType: *(evQElem: EvQEl); {event} (fsQType: *(vcbQElem: VCB); {volume control block} "END; {QElem} {device control entry} DCtlEntry = RECORD /DCtlDriver: Ptr; {ptr to ROM or handle to RAM driver} /DCtlFlags: INTEGER; {flags} /DCtlQHdr: QHdr; {driver's i/o queue} /DCtlPosition: LongInt; {byte pos used by read and write calls} /DCtlStorage: Handle; {hndl to RAM drivers private storage} /DCtlRefNum: INTEGER; {driver's reference number} /DCtlCurTicks: LongInt; {long counter for timing system task calls} /DCtlWindow: Ptr; {ptr to driver's window if any} /DCtlDelay: INTEGER; {number of ticks btwn sysTask calls} /DCtlEMask: INTEGER; {desk acessory event mask} /DCtlMenu: INTEGER; {menu ID of menu associated with driver} -END; {DCtlEntry} DCtlPtr = ^DCtlEntry; DCtlHandle = ^DCtlPtr; "{for Serial Driver} SerShk = PACKED RECORD {handshake control fields} 2fXOn: Byte; {XON flow control enabled flag} 2fCTS: Byte; {CTS flow control enabled flag} 2xon: Char; {XOn character} 2xoff: Char; {XOff character} 2errs: Byte; {errors mask bits} 2evts: Byte; {event enable mask bits} 2fInX: Byte; {Input flow control enabled flag} 2null: Byte; {unused} 0END; "{parameter block structure for file and IO routines} SerStaRec = PACKED RECORD 5cumErrs: Byte; {cumulative errors report} 5XOFFSent: Byte; {XOff Sent flag} 5rdPend: Byte; {read pending flag} 5wrPend: Byte; {write pending flag} 5ctsHold: Byte; {CTS flow control hold flag} 5XOFFHold: Byte; {XOff flow control hold flag} 3End; "{for Sound Driver} "{for 4-tone sound generation} "Wave = PACKED ARRAY[0..255] OF Byte; "WavePtr = ^Wave; "FTSoundRec = RECORD 2duration: INTEGER; 2sound1Rate: LongInt; 2sound1Phase: LongInt; 2sound2Rate: LongInt; 2sound2Phase: LongInt; 2sound3Rate: LongInt; 2sound3Phase: LongInt; 2sound4Rate: LongInt; 2sound4Phase: LongInt; 2sound1Wave: WavePtr; 2sound2Wave: WavePtr; 2sound3Wave: WavePtr; 2sound4Wave: WavePtr; 0END; "FTSndRecPtr = ^FTSoundRec; "FTSynthRec = RECORD 1mode: INTEGER; 1sndRec: FTSndRecPtr; /END; "FTSynthPtr = ^FTSynthRec; "Tone = RECORD +count: INTEGER; +amplitude: INTEGER; +duration: INTEGER; )END; "Tones = ARRAY[0..5000] OF Tone; "SWSynthRec = RECORD 1mode: INTEGER; 1triplets: Tones; /END; "SWSynthPtr = ^SWSynthRec; "freeWave = PACKED ARRAY[0..30000] OF Byte; "FFSynthRec = RECORD 1mode: INTEGER; 1count: Fixed; 1waveBytes: freeWave; /END; "FFSynthPtr = ^FFSynthRec; {for date and time} DateTimeRec = RECORD 0Year, {1904,1905,...} 0Month, {1,...,12 corresponding to Jan,...,Dec} 0Day, {1,...31} 0Hour, {0,...,23} 0Minute, {0,...,59} 0Second, {0,...,59} 0DayOfWeek: INTEGER; {1,...,7 corresponding to Sun,...,Sat} .END; {DateTimeRec} {for application parameter} appFile = RECORD 1vRefNum: INTEGER; 1ftype: OsType; 1versNum: INTEGER; {versNum in high byte} 1fName: str255; /END; {appFile} {for RAM serial driver} SPortSel = (SPortA,SPortB); {for disk driver} DrvSts = RECORD (track: INTEGER; {current track} (writeProt: SignedByte; {bit 7=1 if volume is locked} (diskInPlace: SignedByte; {disk in place} (installed: SignedByte; {drive installed} (sides: SignedByte; {bit 7=0 if single-sided drive} (qLink: QElemPtr; {next queue entry} (qType: INTEGER; {not used} (dqDrive: INTEGER; {drive number} (dqRefNum: INTEGER; {driver reference number} (dqFSID: INTEGER; {file-system identifier} (twoSideFmt: SignedByte; {-1 if two-sided disk} (needsFlush: SignedByte; {reserved} (diskErrs: INTEGER; {error count} $END; {DrvSts} {for Event Manager} FUNCTION PostEvent(eventNum: INTEGER; eventMsg: LongInt): OsErr; PROCEDURE FlushEvents(whichMask,stopMask: INTEGER); PROCEDURE SetEventMask(theMask: INTEGER); FUNCTION OSEventAvail(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN; FUNCTION GetOSEvent(mask: INTEGER; VAR theEvent: EventRecord): BOOLEAN; {OS utilities} FUNCTION HandToHand(VAR theHndl: Handle): OsErr; FUNCTION PtrToXHand(srcPtr: Ptr; dstHndl: Handle; size: LongInt): OsErr; FUNCTION PtrToHand(srcPtr: Ptr; VAR dstHndl: Handle; size: LongInt): OsErr; FUNCTION HandAndHand(hand1,hand2: Handle): OsErr; FUNCTION PtrAndHand(ptr1: Ptr; hand2: Handle; size: LongInt): OsErr; PROCEDURE SysBeep(duration: INTEGER); INLINE $A9C8; PROCEDURE Environs(VAR rom,machine: INTEGER); PROCEDURE Restart; {routines to set A5 to CurrentA5 and then restore a5 to previous value} {useful for ensuring good world for IOCompletion routines} PROCEDURE SetUpA5; INLINE $2F0D, $2A78, $0904; ${MOVE.L A5,-(SP) ;save old A5 on stack %MOVE.L CurrentA5,A5 ;get the real A5} PROCEDURE RestoreA5; INLINE $2A5F; ${MOVE.L (A7)+,A5 ;restore A5} {from HEAPZONE.TEXT} PROCEDURE SetApplBase(startPtr: Ptr); PROCEDURE InitApplZone; PROCEDURE InitZone(pgrowZone: ProcPtr; 3cmoreMasters: Integer; 3limitPtr,startPtr : Ptr); FUNCTION GetZone: THz; PROCEDURE SetZone(hz: THz); FUNCTION ApplicZone: THz; FUNCTION SystemZone: THz; FUNCTION CompactMem(cbNeeded: Size): Size; PROCEDURE PurgeMem(cbNeeded: Size); FUNCTION FreeMem: LongInt; PROCEDURE ResrvMem(cbNeeded: Size); FUNCTION MaxMem(Var grow: Size): Size; FUNCTION TopMem: Ptr; PROCEDURE SetGrowZone(growZone: ProcPtr); PROCEDURE SetApplLimit(zoneLimit: Ptr); FUNCTION GetApplLimit: Ptr; PROCEDURE MaxApplZone; FUNCTION MoveHHi (h: handle): OsErr; FUNCTION NewPtr(byteCount: Size): Ptr; PROCEDURE DisposPtr(p: Ptr); FUNCTION GetPtrSize(p: Ptr): Size; PROCEDURE SetPtrSize(p: Ptr; newSize: Size); FUNCTION PtrZone(p: Ptr): THz; FUNCTION NewHandle(byteCount: Size): Handle; PROCEDURE DisposHandle(h: Handle); FUNCTION GetHandleSize(h: Handle): Size; PROCEDURE SetHandleSize(h: Handle; newSize: Size); FUNCTION HandleZone(h: Handle): THz; FUNCTION RecoverHandle(p: Ptr): Handle; PROCEDURE EmptyHandle(h: Handle); PROCEDURE ReAllocHandle(h: Handle; byteCount: Size); PROCEDURE HLock(h: Handle); PROCEDURE HUnLock(h: Handle); PROCEDURE HPurge(h: Handle); PROCEDURE HNoPurge(h: Handle); PROCEDURE MoreMasters; PROCEDURE BlockMove(srcPtr, destPtr: Ptr; byteCount: Size); FUNCTION MemError: OsErr; FUNCTION GZCritical: Boolean; FUNCTION GZSaveHnd: Handle; {interface for core routines pertaining to the vertical retrace mgr} {routines defined in VBLCORE.TEXT} FUNCTION VInstall(VBLTaskPtr: QElemPtr): OsErr; FUNCTION VRemove(VBLTaskPtr: QElemPtr): OsErr; {interface for Operating System Dispatcher} {routines defined in DISPATCH.TEXT} FUNCTION GetTrapAddress(trapNum: INTEGER): LongInt; PROCEDURE SetTrapAddress(trapAddr: LongInt; trapNum: INTEGER); {interface for utility core routines (defined in sysutil)} FUNCTION GetSysPPtr: SysPPtr; FUNCTION WriteParam: OsErr; FUNCTION SetDateTime(time: LongInt):OsErr; FUNCTION ReadDateTime(VAR time: LongInt):OsErr; PROCEDURE GetDateTime(VAR secs: LongInt); PROCEDURE SetTime(d: DateTimeRec); PROCEDURE GetTime(VAR d: DateTimeRec); PROCEDURE Date2Secs(d: DateTimeRec; VAR s: LongInt); PROCEDUR Secs2Date(s: LongInt; VAR d: DateTimeRec); PROCEDURE Delay(numTicks: LongInt; VAR finalTicks: LongInt); FUNCTION EqualString(str1,str2: Str255; caseSens,diacSens: BOOLEAN):BOOLEAN; PROCEDURE UprString(VAR theString: Str255; diacSens: BOOLEAN); FUNCTION InitUtil: OsErr; PROCEDURE UnLoadSeg(routineAddr: Ptr); INLINE $A9F1; PROCEDURE ExitToShell; INLINE $A9F4; PROCEDURE GetAppParms(VAR apName: str255; VAR apRefNum: INTEGER; 6VAR apParam: Handle); INLINE $A9F5; PROCEDURE CountAppFiles(VAR message: INTEGER; VAR count: INTEGER); PROCEDURE GetAppFiles(index: INTEGER; VAR theFile: AppFile); PROCEDURE ClrAppFiles(index: INTEGER); {queue routines - part of Macintosh core Utility routines} PROCEDURE FInitQueue; PROCEDURE Enqueue(qElement: QElemPtr; qHeader: QHdrPtr); FUNCTION Dequeue(qElement: QElemPtr; qHeader: QHdrPtr): OsErr; FUNCTION GetFSQHdr: QHdrPtr; FUNCTION GetDrvQHdr: QHdrPtr; FUNCTION GetVCBQHdr: QHdrPtr; FUNCTION GetVBLQHdr: QHdrPtr; FUNCTION GetEvQHdr: QHdrPtr; FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle; {from MACIO.TEXT} FUNCTION PBOpen(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBClose(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRead(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBWrite(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBControl(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBStatus(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBKillIO(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetVInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBFlushVol(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBCreate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBDelete(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBOpenRF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRename(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFInfo(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBRstFLock(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFVers(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBAllocate(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetEOF(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBGetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBSetFPos(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBFlushFile(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OsErr; FUNCTION PBMountVol(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBUnMountVol(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBEject(paramBlock: ParmBlkPtr): OsErr; FUNCTION PBOffLine(paramBlock: ParmBlkPtr): OsErr; PROCEDURE AddDrive(drvrRefNum: INTEGER; drvNum: INTEGER; QEl: drvQElPtr); FUNCTION FSOpen(fileName: Str255; vRefNum: INTEGER; VAR refNum: INTEGER): OsErr; FUNCTION FSClose(refNum: INTEGER): OsErr; FUNCTION FSRead(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr; FUNCTION FSWrite(refNum: INTEGER; VAR count: LongInt; buffPtr: Ptr): OsErr; FUNCTION Control(refNum: INTEGER; csCode: INTEGER; 4csParamPtr: Ptr): OsErr; FUNCTION Status(refNum: INTEGER; csCode: INTEGER; 3csParamPtr: Ptr): OsErr; FUNCTION KillIO(refNum: INTEGER): OsErr; {-volume level calls-} FUNCTION GetVInfo(drvNum: INTEGER; volName: StringPtr; VAR vRefNum: INTEGER; 1VAR FreeBytes: LongInt): OsErr; FUNCTION GetFInfo(fileName: Str255; vRefNum: INTEGER; 2VAR FndrInfo: FInfo):OsErr; FUNCTION GetVol(volName: StringPtr; VAR vRefNum: INTEGER):OsErr; FUNCTION SetVol(volName: StringPtr; vRefNum: INTEGER): OsErr; FUNCTION UnMountVol(volName: StringPtr; vRefNum: INTEGER):OsErr; FUNCTION Eject(volName: StringPtr; vRefNum: INTEGER): OsErr; FUNCTION FlushVol(volName: StringPtr; vRefNum: INTEGER):OsErr; {-file level calls for unopened files-} FUNCTION Create(fileName: Str255; vRefNum: INTEGER; creator: OSType; 0fileType: OSType):OsErr; FUNCTION FSDelete(fileName: Str255; vRefNum: INTEGER):OsErr; FUNCTION OpenRF(fileName: Str255; vRefNum: INTEGER; 0VAR refNum: INTEGER): OsErr; FUNCTION Rename(oldName: Str255; vRefNum: INTEGER; 0newName: Str255):OsErr; FUNCTION SetFInfo(fileName: Str255; vRefNum: INTEGER; 2FndrInfo: FInfo):OsErr; FUNCTION SetFLock(fileName: Str255; vRefNum: INTEGER):OsErr; FUNCTION RstFLock(fileName: Str255; vRefNum: INTEGER):OsErr; {-file level calls for opened files-} FUNCTION Allocate(refNum: INTEGER; VAR count: LongInt):OsErr; FUNCTION GetEOF(refNum: INTEGER; VAR LogEOF: LongInt):OsErr; FUNCTION SetEOF(refNum: INTEGER; LogEOF: LongInt):OsErr; FUNCTION GetFPos(refNum: INTEGER; VAR filePos: LongInt):OsErr; FUNCTION SetFPos(refNum: INTEGER; posMode: INTEGER; posOff: LongInt):OsErr; FUNCTION GetVRefNum(fileRefNum: INTEGER):INTEGER; {Serial Driver Interface} FUNCTION OpenDriver(name: Str255; VAR drvrRefNum: INTEGER): OsErr; FUNCTION CloseDriver(refNum: Integer):OsErr; FUNCTION SerReset(refNum: INTEGER; serConfig: INTEGER): OSErr; FUNCTION SerSetBuf(refNum: INTEGER; serBPtr: Ptr; serBLen: INTEGER): OSErr; FUNCTION SerHShake(refNum: INTEGER; flags: SerShk): OSErr; FUNCTION SerSetBrk(refNum: INTEGER): OSErr; FUNCTION SerClrBrk(refNum: INTEGER): OSErr; FUNCTION SerGetBuf(refNum: INTEGER; VAR count: LongInt): OSErr; FUNCTION SerStatus(refNum: INTEGER; VAR serSta: SerStaRec): OSErr; FUNCTION DiskEject(drvnum: INTEGER): OSErr; FUNCTION SetTagBuffer(buffPtr: Ptr): OSErr; FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr; FUNCTION RamSDOpen(whichPort: SPortSel): OSErr; PROCEDURE RamSDClose(whichPort: SPortSel); {for Sound Driver} PROCEDURE SetSoundVol(level: INTEGER); PROCEDURE GetSoundVol(VAR level: INTEGER); PROCEDURE StartSound(synthRec: Ptr; numBytes: LongInt; CompletionRtn: ProcPtr); PROCEDURE StopSound; FUNCTION SoundDone: BOOLEAN; {for the system error handler} PROCEDURE SysError(errorCode: INTEGER); IMPLEMENTATION {for Event Manager} SETAPPLB SETAPPLBSETAPPLBSAVERETASAVERETA"_ _-N INITAPPL INITAPPLINITAPPLSAVE SAVE ,NINITZONE INITZONEINITZONESAVERETASAVERETA "_ ONGETZONE GETZONE GETZONE SAVE SAVE /HN SETZONE SETZONE SETZONE SAVERETASAVERETA"_ _N APPLICZO APPLICZOAPPLICZOSAVE0 SAVE0 /xN SYSTEMZO SYSTEMZOSYSTEMZOSAVE0 SAVE0 /xN COMPACTM SAVE SAVE SAVE0RETSAVE0RET COMPACTMCOMPACTMSAVERETASAVERETA SAVE0 SAVE0  "_ L.Nqp/ 1 Nup`PURGEMEM PURGEMEMPURGEMEMSAVERETASAVERETA"_ MN FREEMEM FREEMEM FREEMEM SAVE0 SAVE0 /@N RESRVMEM RESRVMEMRESRVMEMSAVERETASAVERETA"_ @N MAXMEM MAXMEM MAXMEM SAVE0RETSAVE0RET"_" _ .NTOPMEM TOPMEM TOPMEM SAVE0 SAVE0 /xN SETGROWZ SETGROWZSETGROWZSAVERETASAVERETA"_ _KN GETAPPLL GETAPPLLGETAPPLLSAVE0 SAVE0 /x0N SETAPPLL SETAPPLLSETAPPLLSAVERETASAVERETA"_ _-N MAXAPPLZ MAXAPPLZMAXAPPLZ2 x0C t e"Q!"B"x" ѩ Nu*MOVEHHI MOVEHHI MOVEHHI L/H> fp`<(Ig0<`,x&V"¸"AQ"¸.Qpd Jgj"iJk" xp$<mB*O/A TQH. /@ TaJf " Qb T"J  . L+`d|aaa" -A"J܀ .Jg: g"Qe T`$L0#N"@/ a~aa<"_H0`QQ g$$I$ L$(pL|?@Nu g  @QH`A4"¸Jg j"hJk $He` cNu -m C TǑ+@". L f+Nu PQHP  Ӯ Nu <LNuހNEWPTR NEWPTR NEWPTR SAVERETASAVERETA "_ .N DISPOSPT DISPOSPTDISPOSPTSAVERETASAVERETA"_ _N GETPTRSI GETPTRSIGETPTRSISAVE0RETSAVE0RETSAVERETASAVERETA"_ _!.jBNNSETPTRSI SETPTRSISETPTRSISAVERETASAVERETA "_  _ N PTRZONE PTRZONE PTRZONE SAVERETASAVERETA "_ _H.N NEWHANDL NEWHANDLNEWHANDLSAVERETASAVERETA "_ ".N DISPOSHA DISPOSHADISPOSHASAVERETASAVERETA"_ _#N GETHANDL GETHANDLGETHANDLSAVE0RETSAVE0RETSAVERETASAVERETA"_ _%.jBNNSETHANDL SETHANDLSETHANDLSAVERETASAVERETA "_  _$N HANDLEZO HANDLEZOHANDLEZOSAVERETASAVERETA "_ _&.N RECOVERH RECOVERHRECOVERHSAVE0RETSAVE0RET "_ _(.N EMPTYHAN EMPTYHANEMPTYHANSAVERETASAVERETA"_ _+N REALLOCH REALLOCHREALLOCHSAVERETASAVERETA "_  _'N HLOCK HLOCK HLOCK SAVERETASAVERETA"_ _)N HUNLOCK HUNLOCK HUNLOCK SAVERETASAVERETA"_ _*N HPURGE HPURGE HPURGE SAVERETASAVERETA"_ _IN HNOPURGE HNOPURGEHNOPURGESAVERETASAVERETA"_ _JN MOREMAST MOREMASTMOREMASTSAVE SAVE 6NBLOCKMOV BLOCKMOVBLOCKMOVSAVERETASAVERETA" "_ _."ANMEMERROR MEMERRORMEMERROR?x NuGZSAVEHN GZSAVEHNGZSAVEHN/x(NuGZCRITIC GZCRITICGZCRITIC"_BW 80g(f>NсVINSTALL VINSTALLVINSTALL"_ _/ 3?@NuVREMOVE VREMOVE VREMOVE "_ _/ 4?@NuOPENDRIV OPENDRIVOPENDRIV8 opBgQ/HB/ O2/2 o0?@ _PONЁ0CLOSEDRI CLOSEDRICLOSEDRI&0/?@ O?@ _TONЁSERRESET SERRESETSERRESET0NVA1n 1|1n=@ N^"_XONс(SERSETBU SERSETBUSERSETBU6NVA1n1| !n 1n =@N^"_PONс.SERHSHAK SERHSHAKSERHSHAK6NVA1n 1| "n!Y!Q =@N^"_\ONс.SERSETBR SERSETBRSERSETBRSETCLR SETCLR ,0< NVA1n1@=@ N^"_TONс$SERCLRBR SERCLRBRSERCLRBRSETCLR SETCLR 0< NSERGETBU SERGETBUSERGETBU2NVA1n 1|=@"n"N^"_\ONс*SERSTATU SERSTATUSERSTATU6NVA1n 1|=@"n"2 N^"_\ONс.DISKEJEC DISKEJECDISKEJEC0NVA1|1|1n=@ N^"_TONс(SETTAGBU SETTAGBUSETTAGBU0NVA1|1|!n=@ N^"_XONс(DRIVESTA DRIVESTADRIVESTA<NVA1|1|1n =@"nAp.N^"_\ONс4RAMSDOPE RAMSDOPERAMSDOPERAMSDCLORAMSDCLOdNVH00Bn pJ.gp x 0g @ g~ @J(ft 8nBr xPH0 gHfXrYO/NсPBCLOSE PBCLOSE PBCLOSE "_0 _f`>NсPBREAD PBREAD PBREAD "_0 _f`>NсPBWRITE PBWRITE PBWRITE "_0 _f`>NсPBCONTRO PBCONTROPBCONTRO"_0 _f`>NсPBSTATUS PBSTATUSPBSTATUS"_0 _f`>NсPBKILLIO PBKILLIOPBKILLIO"_0 _f`>NсPBGETVIN PBGETVINPBGETVIN"_0 _f`>NсPBGETVOL PBGETVOLPBGETVOL"_0 _f`>NсPBSETVOL PBSETVOLPBSETVOL"_0 _f`>NсPBFLUSHV PBFLUSHVPBFLUSHV"_0 _f`>NсPBCREATE PBCREATEPBCREATE"_0 _f`>NсPBDELETE PBDELETEPBDELETE"_0 _f ` >NсPBOPENRF PBOPENRFPBOPENRF"_0 _f ` >NсPBRENAME PBRENAMEPBRENAME"_0 _f ` >NсPBGETFIN PBGETFINPBGETFIN"_0 _f ` >NсPBSETFIN PBSETFINPBSETFIN"_0 _f ` >NсPBSETFLO PBSETFLOPBSETFLO"_0 _fA`A>NсPBRSTFLO PBRSTFLOPBRSTFLO"_0 _fB`B>NсPBSETFVE PBSETFVEPBSETFVE"_0 _fC`C>NсPBALLOCA PBALLOCAPBALLOCA"_0 _f`>NсPBGETEOF PBGETEOFPBGETEOF"_0 _f`>NсPBSETEOF PBSETEOFPBSETEOF"_0 _f`>NсPBGETFPO PBGETFPOPBGETFPO"_0 _f`>NсPBSETFPO PBSETFPOPBSETFPO"_0 _fD`D>NсPBFLUSHF PBFLUSHFPBFLUSHF"_0 _fE`E>NсPBMOUNTV PBMOUNTVPBMOUNTV"_ _>Nс PBUNMOUN PBUNMOUNPBUNMOUN"_ _>Nс PBEJECT PBEJECT PBEJECT "_ _>Nс PBOFFLIN PBOFFLINPBOFFLIN"_ _5>Nс ADDDRIVE ADDDRIVEADDDRIVE"_ _0H@0NNсFSOPEN FSOPEN FSOPEN BNVA!n1n B(B(B"n2=@N^ _ NЁ:FSCLOSE FSCLOSE FSCLOSE $NVA1n=@ N^ _TNЁFSREAD FSREAD FSREAD FSWRITE FSWRITE TQ`PNVA!n 1n"n !Q$Bh,B.Jf`=@"n "(N^"_ NсLCONTROL CONTROL CONTROL @NVA1n1n JgC np.AΠ=@N^"_PNс8STATUS STATUS STATUS 6NVA1n1n =@A"np.N^"_PNс.KILLIO KILLIO KILLIO $NVA1n=@ N^"_TNсGETVINFO GETVINFOGETVINFOPNVA!n1nBh=@"n 2 (0>"n"N^"_NсHGETFINFO GETFINFOGETFINFODNVA!n1n B(Bh =@A "n0<.N^"_ Nс<GETVOL GETVOL GETVOL ,NVA!n =@"n2N^"_PNс$SETVOL SETVOL SETVOL *NVA!n 1n=@N^"_\Nс"UNMOUNTV UNMOUNTVUNMOUNTV*NVA1n!n =@N^"_\Nс"EJECT EJECT EJECT *NVA1n!n =@N^"_\Nс"FLUSHVOL FLUSHVOLFLUSHVOL*NVA1n!n =@N^"_\Nс"CREATE CREATE CREATE LNVA!n1nB(J@fBh C "" =@N^"_NсDFSDELETE FSDELETEFSDELETE.NVA!n 1nB( =@N^"_\Nс&OPENRF OPENRF OPENRF BNVA!n1n B(B(B =@"n2N^"_ Nс:RENAME RENAME RENAME 8NVA!n1n B(!n =@N^"_ Nс0SETFINFO SETFINFOSETFINFOJNVA!n1n B(Bh C n0<.A =@N^"_ NсBSETFLOCK SETFLOCKSETFLOCK.NVA!n 1nB(A=@N^"_\Nс&RSTFLOCK RSTFLOCKRSTFLOCK.NVA!n 1nB(B=@N^"_\Nс&ALLOCATE ALLOCATEALLOCATE0NVA"n!Q$1n =@"(N^"_\Nс(GETEOF GETEOF GETEOF ,NVA1n =@"n"N^"_\Nс$SETEOF SETEOF SETEOF *NVA1n !n=@N^"_\Nс"GETFPOS GETFPOS GETFPOS ,NVA1n =@"n".N^"_\Nс$SETFPOS SETFPOS SETFPOS 0NVA1n1n ,!n.D=@N^"_PNс(GETVREFN GETVREFNGETVREFN4"_B2  xN/ BoHAUAfPd p?hNNu,POSTEVEN POSTEVENPOSTEVEN"_ 0_/ /?@NuFLUSHEVE FLUSHEVEFLUSHEVE"_ / 2Nu SETEVENT SETEVENTSETEVENT"_1DNсOSEVENTA OSEVENTAOSEVENTA$"_ _0/ 0J@gB/`|NuGETOSEVE GETOSEVEGETOSEVE$"_ _0/ 1J@gB/`|NuSETSOUND SETSOUNDSETSOUNDZ _0/ 9@ g$@|9A@`@FNu@`H9݁݁NuRGETSOUND GETSOUNDGETSOUND _"_B`NЁ STARTSOU SNDQUEUESNDQUEUE$MYCOMPLEMYCOMPLESTARTSOUSTARTSOUMYPBLOCKMYPBLOCK0AJhg@"/f0 :f "C"gX z%"@ $J@fF"PAp .`80(n!o$!o 1|B "/g`!AC!I "_ NHAh"(g"ANCJgNER z% P"H%X%X$%X 5|@ g". zZ $` zP#AJBAC!I LNu(SOUNDDON SOUNDDONSOUNDDONMYPBLOCKMYPBLOCKABoJhfR/NuSTOPSOUN STOPSOUNSTOPSOUNSNDQUEUESNDQUEUE(MYPBLOCKMYPBLOCK8NVA1|ABhBx 8g @#ABN^Nu0COUNTAPP COUNTAPPCOUNTAPP*"oBQ x %o P"o2"o2 _PONЁ"GETAPPFI GETAPPFIGETAPPFILH0"o B x %o&$PTJ2/ZnSAm Jp(@P@.SA`L _\ONЁDCLRAPPFI CLRAPPFICLRAPPFI> x %o( PTH2/XnSAmgp(@P@SA`B _TONЁ6SYSERROR SYSERRORSYSERROR _0ɩSAmgp(@P@SA`B _TONЁ6SYSERROR SYSERRORSYSERROR _0ɩPACKINTF$ INTERFACE USES {$U-} {$U obj/MemTypes } MemTypes, {$U obj/QuickDraw } QuickDraw, {$U obj/OsIntf } OsIntf, {$U obj/ToolIntf } ToolIntf; { Package Manager ----------------------------------------------------} { These routines are currently in ToolIntf.text } { Disk Initialization Package ----------------------------------------} PROCEDURE DILoad; PROCEDURE DIUnLoad; FUNCTION DIBadMount(where: Point; evtMessage: LongInt): INTEGER; FUNCTION DIFormat(drvNum: INTEGER): OsErr; FUNCTION DIVerify(drvNum: INTEGER): OsErr; FUNCTION DIZero(drvNum: INTEGER; volName: Str255): OsErr; { Standard File Package ----------------------------------------------} CONST putDlgID = -3999; {SFPutFile dialog template ID} putSave = 1; {save button} putCancel = 2; {cancel button} putEject = 5; {eject button} putDrive = 6; {drive button} putName = 7; {editTExt item for file name} getDlgID = -4000; {SFGetFile dialog template ID} getOpen = 1; {open button} getCancel = 3; {cancel button} getEject = 5; {eject button} getDrive = 6; {drive button} getNmList = 7; {userItem for file name list} getScroll = 8; {userItem for scroll bar} TYPE SFReply = RECORD good: BOOLEAN; {ignore command if FALSE} copy: BOOLEAN; {not used} fType: OsType; {file type or not used} vRefNum: INTEGER; {volume reference number} version: INTEGER; {file's version number} fName: String[63]; {file name} END; {SFReply} SFTypeList = ARRAY[0..3] OF OSType; PROCEDURE SFPutFile(where: Point; prompt: Str255; origName: Str255; dlgHook: ProcPtr; VAR reply: SFReply); PROCEDURE SFPPutFile(where: Point; prompt: Str255; origName: Str255; dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr); PROCEDURE SFGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr; numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr; VAR reply: SFReply); PROCEDURE SFPGetFile(where: Point; prompt: Str255; fileFilter: ProcPtr; numTypes: INTEGER; typeList: SFTypeList; dlgHook: ProcPtr; VAR reply: SFReply; dlgID: INTEGER; filterProc: ProcPtr); { International Utilities Package ------------------------------------} CONST {constants for manipulation of international resources} {masks used for setting and testing currency format flags} currSymLead = 16; {set if currency symbol leads, reset if trails} currNegSym = 32; {set if minus sign for negative num, reset if parentheses} currTrailingZ = 64; {set if trailing zero} currLeadingZ = 128; {set if leading zero} {constants specifying absolute value of short date form} MDY = 0; {month,day,year} DMY = 1; {day,month,year} YMD = 2; {year,month,day} {masks used for date element format flags} dayLdingZ = 32; {set if leading zero for day} mntLdingZ = 64; {set if leading 0 for month} century = 128; {set if century, reset if no century} {masks used for time element format flags} secLeadingZ = 32; {set if leading zero for seconds} minLeadingZ = 64; {set if leading zero for minutes} hrLeadingZ = 128; {set if leading zero for hours} {country codes for version numbers} verUS = 0; verFrance = 1; verBritain = 2; verGermany = 3; verItaly = 4; verNetherlands = 5; verBelgiumLux = 6; verSweden = 7; verSpain = 8; verDenmark = 9; verPortugal = 10; verFrCanada = 11; verNorway = 12; verIsrael = 13; verJapan = 14; verAustralia = 15; verArabia = 16; verFinland = 17; verFrSwiss = 18; verGrSwiss = 19; verGreece = 20; verIceland = 21; verMalta = 22; verCyprus = 23; verTurkey = 24; verYugoslavia = 25; TYPE intl0Hndl = ^intl0Ptr; intl0Ptr = ^intl0REc; intl0Rec = PACKED RECORD decimalPt: char; {ASCII character for decimal point} thousSep: char; {ASCII character for thousand separator} listSep: char; {ASCII character for list separator} currSym1: char; {ASCII for currency symbol (3 bytes long)} currSym2: char; currSym3: char; currFmt: Byte; {currency format flags} dateOrder: Byte; {short date form - DMY,YMD, or MDY} shrtDateFmt: Byte; {date elements format flag} dateSep: char; {ASCII for date separator} timeCycle: Byte; {indicates 12 or 24 hr cycle} timeFmt: Byte; {time elements format flags} mornStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 0:00 to 11:59} eveStr: PACKED ARRAY[1..4] OF char; {ASCII for trailing string from 12:00 to 23:59} timeSep: char; {ASCII for the time separator} time1Suff: char; {suffix string used in 24 hr mode} time2Suff: char; {8 characters long} time3Suff: char; time4Suff: char; time5Suff: char; time6Suff: char; time7Suff: char; time8Suff: char; metricSys: Byte; {indicates metric or English system} intl0Vers: INTEGER; {version: high byte = country, low byte = vers} END; {intl0Rec} intl1Hndl = ^intl1Ptr; intl1Ptr = ^intl1REc; intl1Rec = PACKED RECORD days: ARRAY[1..7] OF String[15]; {length and word for Sunday through Monday} months: ARRAY[1..12] OF String[15]; {length and word for January to December} suppressDay: Byte; {0 for day of week, 255 for no day of week} lngDateFmt: Byte; {expanded date format 0 or 255} dayLeading0: Byte; {255 for leading 0, 0 for no leading 0} abbrLen: Byte; {length of abbreviated names in long form} st0: PACKED ARRAY[1..4] OF char; {the string st0} st1: PACKED ARRAY[1..4] OF char; {the string st1} st2: PACKED ARRAY[1..4] OF char; {the string st2} st3: PACKED ARRAY[1..4] OF char; {the string st3} st4: PACKED ARRAY[1..4] OF char; {the string st4} intl1Vers: INTEGER; {version word} localRtn: INTEGER; {routine for localizing mag comp; } {minimal case is $4E75 for RTS, but } {routine may be longer than one integer.} END; {intl1Rec} DateForm = (shortDate, longDate, abbrevDate); FUNCTION IUGetIntl(theID: INTEGER): Handle; PROCEDURE IUSetIntl(refNum: INTEGER; theID: INTEGER; intlParam: Handle); PROCEDURE IUDateString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255); PROCEDURE IUDatePString(dateTime: LongInt; longFlag: DateForm; VAR result: Str255; intlParam: Handle); PROCEDURE IUTimeString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255); PROCEDURE IUTimePString(dateTime: LongInt; wantSeconds: BOOLEAN; VAR result: Str255; intlParam: Handle); FUNCTION IUMetric: BOOLEAN; FUNCTION IUCompString(aStr,bStr: Str255): INTEGER; FUNCTION IUEqualString(aStr,bStr: Str255): INTEGER; FUNCTION IUMagString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER): INTEGER; FUNCTION IUMagIDString(aPtr,bPtr: Ptr; aLen,bLen: INTEGER):INTEGER; { Binary-Decimal Conversion Package ----------------------------------} PROCEDURE StringToNum(theString: Str255; VAR theNum: LongInt); PROCEDURE NumToString(theNum: LongInt; VAR theString: Str255); IMPLEMENTATION SFPUTFIL GOPACK GOPACK SFPUTFILSFPUTFILt _?/ SFPPUTFI SFPPUTFISFPPUTFIGOPACK GOPACK tNSFGETFIL SFGETFILSFGETFILGOPACK GOPACK tNSFPGETFI SFPGETFISFPGETFIGOPACK GOPACK tNDILOAD GODI GODI DILOAD DILOAD t _?/ DIUNLOAD DIUNLOADDIUNLOADGODI GODI tNDIBADMOU DIBADMOUDIBADMOUGODI GODI tNDIFORMAT DIFORMATDIFORMATGODI GODI tNDIVERIFY DIVERIFYDIVERIFYGODI GODI 4<NDIZERO DIZERO DIZERO GODI GODI 4< NIUGETINT GOINTL GOINTL IUGETINTIUGETINTt _?/ IUSETINT IUSETINTIUSETINTGOINTL GOINTL tNIUDATEST IUDATESTIUDATESTGOINTL GOINTL tNIUDATEPS IUDATEPSIUDATEPSGOINTL GOINTL tNIUTIMEST IUTIMESTIUTIMESTGOINTL GOINTL tNIUTIMEPS IUTIMEPSIUTIMEPSGOINTL GOINTL tNIUMETRIC IUMETRICIUMETRICGOINTL GOINTL tNIUMAGSTR IUMAGSTRIUMAGSTRGOMAG GOMAG 4< NIUMAGIDS IUMAGIDSIUMAGIDSGOMAG GOMAG 4< _?/ IUCOMPST IUCOMPSTIUCOMPSTGOPMAG GOPMAG 4< NIUEQUALS GOPMAG GOPMAG IUEQUALSIUEQUALS04< "o oB@BA/H/I _???/(STRINGTO STRINGTOSTRINGTOEXIT8 EXIT8  o?< o NNUMTOSTR EXIT8 EXIT8 NUMTOSTRNUMTOSTR o /Bg _PONЁ%_BEGIN %_BEGIN %_BEGIN LAUNCHRELAUNCHREBA Nu%_END %_END %_END Nu%_INIT %_INIT %_INIT %INITHEA%INITHEA _N]/NNu %_TERM %_TERM %_TERM  _NUNЁMPASLIB  HINITGRA HINITGRAHINITGRAQUICKDRA"NVA/nN^NuINITGRA%INITHEA %INITHEA%INITHEA$MPASLIB  2NVBB-B-BBBN^NuINITHEA*PLINITHE PLINITHEPLINITHECALLPROCCALLPROCMEMERRORMEMERROR`NEWPTR NEWPTR XTMPASLIB ~vhdTNHB<6& NVH.gA(HA*|`A(HA*|Jf+n+n n nHݭB/-N(BgN;_Jmf8&TB E -g & -P. GB -Q G!@'G` X+@`Jg/-NLN^ _ NLINITHEʀPLSETNON PLSETNONPLSETNONMPASLIB $NVnN^ _TONLSETNONPLSETMER PLSETMERPLSETMERMPASLIB "NV+nN^.NuLSETMERPLSETHEA PLSETHEAPLSETHEAMPASLIB $NVnN^ _TONLSETHEA%_NEW %_NEW %_NEW %_NEWL %_NEWL .NV/. 0.H/NN^ _\ONХ_NEW &GETSPACE $3000000GETSPACEMPASLIB 4NV"n i n (ѭN^.NuETSPACE,%_NEWL %_NEWL %_NEWL %I_MUL4 %I_MUL4 $2000000GETFROMFjNEWPTR NEWPTR MEMERRORMEMERROR҉SETPTRSISETPTRSỈ$3000000GETSPACE<PLINITHEPLINITHETCALLPROCCALLPROC\L.lMPASLIB XRHB6* bXB6*$  NVHBm n B .o;|Jg/-N`:- g"Jf/<BBgBgNJmg` -Q(@-L n(@H//<N n(@@HП n(AHҀ, .Э.m /N`/-/NBgN;_Jmf/N`x-gd n /B/-N  _ BgN;_Jmf. n &PB&m n & n +P n X+@/N`Jg/-N`Jg/-N` /. /.NLN^ _PONХ_NEWL %_MARK %_MARK %_MARK MPASLIB (NVBm n N^.Nu_MARK  %_RELSE %_RELSE %_RELSE %I_MUL4 %I_MUL4 BDISPOSPTDISPOSPTCALLPROCCALLPROC,MPASLIB NVH*.Bm-g(m gd Q&@-K n(@H//<N n(@@HП n(AHҀ, E X_ E" ҆\f(T`;|Jg/-N` +L.B(G g ./ N(G` E+PLN^.Nu_RELSE ΀%_PHEAPR %_PHEAPR%_PHEAPRMPASLIB  NV=mN^Nu_PHEAPRGETFLSPA $4000000GETFLSPAMPASLIB NVH(n)m lX)H l)hJgt l (.JmR ,T l &l n l"l"6`( ,Ь)@ l"l" l!G l BS`,`)l l)P` l)P ,f`;|LN^.NuETFLSPA΀GETFROMF $2000000GETFROMFCALLPROCCALLPROCƉMEMERRORMEMERRORTNEWPTR NEWPTR H$4000000GETFLSPA(PLINITHEPLINITHE"HMPASLIB n\XD4,NVBmTJf/<BBg<N/NJmg-g n /B/-N  _ BgN;_JmfZ n -P n n P-@ nB -Q n!@ n!n-m n "n" n +P/N`Jg/-N`Jg/-NN^ _PONETFROMF%_DISPOS %_DISPOS%_DISPOS%I_MUL4 %I_MUL4 8CALLPROCCALLPROClDISPOSPTDISPOSPT<@MPASLIB hb^T2,("  NVHBm(-(m Q* E-H n(@H//<N n(@@HП n(AHҀ-A n P_ n ".҅\g LX,., n U-@&nྋ^JWg n0HЮT'@& LXV F"(҆Wg F +Ш F!@&F` F +Ћf G& G (Ы'@ -찭g, .QQff+Tf+D D / N`.`, G.`P`( (Tf;|Jg/-NLN^ _PONХ_DISPOS {Mac Paslib in pascal} INTERFACE USES {$U-} #{$U obj/memtypes } memtypes, #{$U Obj/QuickDraw } QuickDraw, #{$U Obj/OSIntf } OSIntf, #{$U Obj/ToolIntf } ToolIntf; $PROCEDURE PLInitHeap (sizepheap : LONGINT; :memerrProc : ProcPtr; :allowNonCont, :forDispose : BOOLEAN); $PROCEDURE PLSetNonCont (allowNonCont : BOOLEAN); $PROCEDURE PLSetMErrProc (memerrProc : ProcPtr); $PROCEDURE PLSetHeapType (forDispose : BOOLEAN); $PROCEDURE %_New (VAR nptr : Ptr; sizeneeded : INTEGER); $PROCEDURE %_NewL (VAR nptr : Ptr; lsizeneeded : LONGINT); $PROCEDURE %_Mark (VAR mptr : Ptr); $PROCEDURE %_RELSE (VAR mptr : Ptr); $PROCEDURE %_DISPOSE (VAR nptr : Ptr; size : LONGINT); $FUNCTION %_PHEAPRES : INTEGER; "{pascal routines needed by assembly part of paslib} $PROCEDURE HInitGraf; $PROCEDURE %InitHeap; {called by %_INIT} IMPLEMENTATION %_REWRT %_RESET %_RESET S.CONSOLS.CONSOL%_REWRT %_REWRT SIOERR SIOERR %_GET %_GET %_MOVEL %_MOVEL L(NV,_"4"_ _/ g ).gz|1BBBh&B(*|+// HhBB@R@?N W T9r :fR(Q _C !I"gR`|"4"_ _/ gn1BBhB(B(B!I"Bh&Bh*/A^pH@< _fB@`2|Bf4(oCH!I2J(f HhNNuA0NuN^Nu%_RESETW.CONSOLE  %_CLOSE %_CLOSE %_CLOSE SIOERR SIOERR NV,_ 2 _/B@ f h(n h(lJ(g Ag AfC2!I g @fC!IC2$ !I f Af !h.P"H OB !BBhBhB( f if !|TEXT `!|BINA Pf* I`$f"JAf ` fC2!I @fp`A0NuN^Nu%_CLOSE %_EOF %_EOF %_EOF CONSFIB CONSFIB @NV,_H瀀 o fAh o/H LTNuN^Nu%_EOF 8%_EOLN %_EOLN %_EOLN CONSFIB CONSFIB @NV,_H瀀 o fAh o/H LTNuN^Nu%_EOLN 8%_BLKRD %_BLKRD %_BLKRD %_BLKWR %_BLKWR SIOERR SIOERR |NV,_|`| BB24"_ _/@1|!B4!I0@g"f"(.g` @f |p`$((A0"g RBRB Bm _?NN^Nu%_BLKRDW%_IORES SIOERR SIOERR %_IORES %_IORES Bg/ //@?z Nu%_SETIOR %_SETIOR%_SETIORSIOERR SIOERR  _0C2NЁ %_GET %_GET %_GET %_PUT %_PUT SIOERR SIOERR NhNV,_B`<  _/p0(!@4B>BhXNV,_"0 _/J@lp`&2(!@>1|<Dg @fpBhA0NuN^Nu%_SEEK P%OUTCHS WRPORTPTWRPORTPTWRPROCPTWRPROCPTCONSFIB CONSFIB %OUTCHS %OUTCHS SIOERR SIOERR ~%OUTCHCO%OUTCHCORNV,_H"f2":f" zN"fAz Aj+H +H`L/ ? AN`B f":Xf zNN`,/ ? AN`"H!@$B.1|,!I A0LNuN^Nu%OUTCHS PLSETWRP PLSETWRPPLSETWRPWRPORTPTWRPORTPT"_A Nс PLSETWPR PLSETWPRPLSETWPRWRPROCPTWRPROCPT"_A Nс %W_LN %W_LN %W_LN %OUTCHS %OUTCHS 0NV,_"_ _/ p< "ONNuN^Nu%W_LN (%OUTSPAC %OUTSPAC%OUTSPAC%OUTCHS %OUTCHS 2H@`$O2H@0< IdRA?SAn"OH@N.JLNu*%W_C %W_C %W_C %OUTSPAC%OUTSPAC%OUTCHS %OUTCHS :NV,_"_0 _/ S@oN"OpNNuN^Nu%W_C 2%W_PAOC %W_PAOC %W_PAOC %OUTSPAC%OUTSPAC %OUTCHS %OUTCHS &>NV,_$02"_ _/AnJ@o`AN0NNuN^Nu%W_PAOC 6%W_I %W_I %W_I %OUTSPAC%OUTSPAC`%OUTCHS %OUTCHS fNV,_"_2  _/ H"O BB,lD&(BDHD *: HD&6HEE0RBJfJlRB<-6Bo0N0N LxNuN^Nu%W_I %W_B %W_B %W_B %W_STR %W_STR @NV,_ _4gHz"`Hz?/NN^Nu%W_B FALSETRUE8%W_STR %W_STR %W_STR %OUTSPAC%OUTSPAC"%OUTCHS %OUTCHS (@NV,_"0"_ _/BAAnJ@o`AN0NNuN^Nu%W_STR 8%_PAGE %_PAGE %_PAGE %OUTCHS %OUTCHS 0NV,_"_ _/ p< "ONNuN^Nu%_PAGE (%INCH %INCH %INCH SIOERR SIOERR rWRPORTPTWRPORTPT6%INCHCON%INCHCON:CONSFIB CONSFIB NV,_H@ fAB(CBQ f" (g(`"H xN I@`8!|4B>BhCONSFIB CONSFIB NV,_H o@BBFB fAN g g +g -fSRFN gP g^0m" nRFHH& HC ԃԀ`JFfC2JgD/B@|LNuJFgpNBFBGB`tJFgnpNSFg&HBH„ HCHB6HC 4`hN^Nu%R_I %ERASETE %ERASETE%ERASETEWRPORTPTWRPORTPTCONSFINFCONSFINF<NV,_Hp"U(Q&x"Av6(?DWBg$O5k20+0AP40+2C5@0+0h5@HR"U"LNuN^Nu%EraseTex%_KEYPRE %_KEYPRE%_KEYPRE:H瀀 Op(0f|`Bo/o LTNu2%_BACKUP %_BACKUP%_BACKUPCONSFIB CONSFIB .NV,_"_ _ fA|NN^Nu%_Backup&%_GOTOXY %_GOTOXY%_GOTOXYWRPORTPTWRPORTPTCONSFINFCONSFINF.NV,_ _42/H8"U(Q&x"xz8:$OAv6(\D0+C@o8RE0+@o:??"U"L8NuN^Nu%_GOTOXYx%_MEMAV %_MEMAV %_MEMAV <NV,_BH瀀 <L o /H/@ LNuN^Nu%_MEMAV 4%_HEAPRE %_HEAPRE%_HEAPRE%_PHEAPR%_PHEAPR:NV,_BgHBgN0"//A?@ LNuN^Nu%_HEAPRE2CALLPROC CALLPROCCALLPROC$NV,_ _"_/NNuN^NuCallProc%_CAT %_CAT %_CAT lNV,_H0/ oC"4JBAR`$aBBB`QQ oC"0/H#//IL._NuN^Nu%_CAT d%_POS %_POS %_POS `NV,_H oB@BA"o BBBlBA`$HR` fQ`RS@`?A"/oL\NuN^Nu%_POS X%_COPY %_COPY %_COPY lNV,_H o0/o@ @n:2/o4 An.SA"o BBA@m`Q/o L NuB`N^Nu%_COPY d%_DEL %_DEL %_DEL `NV,_"_02 _/ / @o0 Ao*BBAm"6@SCBoSA`@"H`RCo&NuN^Nu%_DEL X%_INS %_INS %_INS \NV,_"0"_ _/H S@m*BABB@m6B$I”@`!Q`QLNuN^Nu%_INS T%I_MUL4 %I_MUL4 %I_MUL4 NNV,_//0/2/ AH@B@2/Ё/@" /WXNuN^Nu%I_MUL4 F%I_DIV4 %I_DIV4 %I_DIV4 IDIVMOD IDIVMOD .NV// /"/N/A" N^/WXNu&%I_MOD4 %I_MOD4 %I_MOD4 IDIVMOD IDIVMOD .NV// /"/N/@" N^/WXNu&IDIVMOD IDIVMOD IDIVMOD |NV,_H>*jD,jD$HBJBf6B@H@g4HB04"B@H@`$&BBxԂрҁmRQJjDjDL|NuN^NuIDIVMOD t%I_PWRII %I_PWRII%I_PWRII%I_DIV4 %I_DIV4 L%I_MUL4 %I_MUL4 6$jNVHt /"/jDg&g //N$ o //N f"/l p//N$/BLN^/WXNub%_HALT %_HALT %_HALT LAUNCHRELAUNCHRE NV,_ xNN^Nu%_HALT %_IOERR %_IOERR %_IOERR Nu%_LSTSG %_LSTSG %_LSTSG Nu%_GOTO %_GOTO %_GOTO .Nu%_RCHCK %_RCHCK %_RCHCK 8NV/0. n mno N^/_NuRangeChk0%_SRCHK %_SRCHK %_SRCHK ,NV/p. no N^.NuStrRgChk$%_MOVEL %_MOVEL %_MOVEL V$0 _"_/J@o> @o4$ Tg,2ABAgSBgS@2@ISA QS@kQNuN%_MOVER %_MOVER %_MOVER $"0 _"_/J@o `!QNu%_FILLC %_FILLC %_FILLC "_02 _o`QNс%_SCANE %_SCANE %_SCANE HHBB o0/2/gk gRBSAn` R gSBRAk?B/oL\Nu@%_SCANN %_SCANN %_SCANN HHBB o0/2/gk fRBSAn` R fSBRAk?B/oL\Nu@%S_NE %S_EQ %S_EQ %S_NE %S_NE FHr`HBA o"oB@f`fS@j AA/oL\Nu>%S_GT %S_GT %S_GT STRCOMP STRCOMP H"o ovN%S_LE %S_LE %S_LE STRCOMP STRCOMP H"o oBCN%S_LT %S_LT %S_LT STRCOMP STRCOMP H o "ovN%S_GE %S_GE %S_GE STRCOMP STRCOMP PH o "oBCB@BA@m4`4`fSBj@n C`cC"/oL\NuH%_INTER %_INTER %_INTER DBHA0"H2@l02H`4 aS@j3 o#/IL._Nu<%_SING %_SING %_SING JHA$0BP2I4RB6K"O$O8<4SDf JBZSBf0BB@0LNuB%_UNION %_UNION %_UNION XBHA 0"H26@l6K`4 aSCjAgm @H3 S@n`3 o#/IL._NuP%_DIFF %_DIFF %_DIFF LBHA 0"H26@l6K`4 FBaSCjAn3 o#/IL._NuD%_RDIFF %_RDIFF %_RDIFF TBHA 0"H26@l6K`Fa4 QSCjAo @H3 S@n3 o#/IL._NuL%_RANGE %_RANGE %_RANGE ~H2/$0/&B$A(J@jB@@mH4J6Kg"O$O8<4SDfBZSBfTC?C$46JJDBCBDĉp R@@lLNu o /H"LJ_Nuv%_ADJ %_ADJ %_ADJ <H0/2/A"o@lB`TAk`! /HL._Nu4%_SETNE %_SETEQ %_SETEQ %_SETNE %_SETNE ~BHv`BHBCA$0"H2$I4@l4’J`Hf*SBj@gkIJafSAn`AJ`fRAk CB" o %/JL._Nuv%_SETGE %_SETGE %_SETGE %_SETLE %_SETLE |BHC$2 I0$H`BHA$0"H2$I4@l4J`6 FCafSBj@gk IJaf SAjNqv`BCB" o %/JL._Nut`BHA$0"H2$I4@l4J`6 FCafSBj@gk IJaf SAjNqv`BCB" o %/JL._NutPASLIBIN {Mac Pascal heap management} INTERFACE USES {$U-} #{$U obj/memtypes } memtypes, #{$U Obj/QuickDraw } QuickDraw, #{$U Obj/OSIntf } OSIntf; $PROCEDURE PLInitHeap (sizepheap : LONGINT; :memerrProc : ProcPtr; :allowNonCont, :allowDispose : BOOLEAN); $PROCEDURE PLSetNonCont (allowNonCont : BOOLEAN); $PROCEDURE PLSetMErrProc (memerrProc : ProcPtr); $PROCEDURE PLSetHeapType (forDispose : BOOLEAN); $PROCEDURE PLSetWrPort (portptr : GrafPtr); >{set a grafport (window) for writeln, use 0 if want ?to go back to the console port (the screen)} $PROCEDURE PLSetWProc (wrproc : ProcPtr); >{set a writeln capture proc, use 0 if want to go ?back to the standard one (in paslib). ?The wrproc must be defined as ?procedure wrproc (buf : Ptr; count : integer);} IMPLEMENTATION $PROCEDURE PLInitHeap (sizepheap : LONGINT; UPRLINK PRPICFILPRPICFILPRJOBMERPRJOBMERPRCLOSEPPRCLOSEP.PRHACK PRHACK FUPRLINK UPRLINK PRVALIDAPRVALIDAPRCLOSEDPRCLOSEDPRJOBINIPRJOBINIpPRJOBDIAPRJOBDIA`PRSETERRPRSETERRPROPENPAPROPENPA&PRCLOSE PRCLOSE bPROPENDOPROPENDOPRCFGDIAPRCFGDIA<PRDLGMAIPRDLGMAIxPRSTLDIAPRSTLDIAXPRCTLCALPRCTLCAL.PRDRVROPPRDRVROPPROPEN PROPEN ZPRDRVRCLPRDRVRCLPRERROR PRERROR PRINTDEFPRINTDEFPPRSTLINIPRSTLINIh o Pp(Dr8 F8 F"< `"<`"<`"< p8 F`^"<p`T"< p`J"<`6"<`."<`&"< `"<`"<`"<`"<p`"<pAPH(&_Y/N.Print $"OXIpBgQA/H?| O/Nuaܠr`a1|$("<`YOa _ P(H?@Nua!Y$!Y !Y1Yr`pYO/0 if active} wordBreak: ProcPtr; {Word break routine} clikLoop: ProcPtr; {Click loop routine} clickTime: LONGINT; {Time of first click} clickLoc: INTEGER; {Char. location of click} caretTime: LONGINT; {Time for next caret blink} caretState: INTEGER; {On/active booleans} just: INTEGER; {fill style} TELength: INTEGER; {Length of text below} hText: Handle; {Handle to actual text} recalBack: INTEGER; {<>0 if recal in background} recalLines: INTEGER; {Line being recal'ed} clikStuff: INTEGER; {click stuff (internal)} crOnly: INTEGER; {Set to -1 if CR line breaks only} txFont: INTEGER; {Text Font} txFace: Style; {Text Face} txMode: INTEGER; {Text Mode} txSize: INTEGER; {Text Size} inPort: GrafPtr; {Grafport} highHook: ProcPtr; {Highlighting hook} caretHook: ProcPtr; {Highlighting hook} nLines: INTEGER; {Number of lines} lineStarts: ARRAY [0..16000] OF INTEGER; {Actual line starts themselves} END; {RECORD} TEPtr = ^TERec; TEHandle = ^TEPtr; CharsHandle = ^CharsPtr; CharsPtr = ^Chars; Chars = PACKED ARRAY[0..32000] OF CHAR; {for Resource Manager} ResType=PACKED ARRAY[1..4] OF CHAR; {for Control Manager} ControlPtr = ^ControlRecord; ControlRecord = PACKED RECORD nextControl: ControlHandle; contrlOwner: WindowPtr; contrlRect: Rect; contrlVis: Byte; contrlHilite: Byte; contrlValue: INTEGER; contrlMin: INTEGER; contrlMax: INTEGER; contrlDefProc: Handle; contrlData: Handle; contrlAction: ProcPtr; contrlrfCon: LONGINT; contrlTitle: Str255; END; {ControlRecord} {for Dialog Manager} DialogPtr= WindowPtr; DialogPeek= ^DialogRecord; DialogRecord= Record window: WindowRecord; Items: Handle; textH: TEHandle; EditField: Integer; EditOpen: INTEGER; ADefItem: INTEGER; End; DialogTHndl= ^DialogTPtr; DialogTPtr= ^DialogTemplate; DialogTemplate=RECORD boundsRect: Rect; procID: INTEGER; visible: BOOLEAN; filler1: BOOLEAN; goAwayFlag: BOOLEAN; filler2: BOOLEAN; refCon: LongInt; ItemsID: INTEGER; title: Str255; END; StageList= PACKED ARRAY [1..4] OF RECORD boldItem: 0..1; boxDrawn: BOOLEAN; sound: 0..3; END; AlertTHndl= ^AlertTPtr; AlertTPtr= ^AlertTemplate; AlertTemplate=RECORD boundsRect: Rect; itemsID: INTEGER; stages: StageList; END; {for Menu Manager} MenuPtr = ^MenuInfo; MenuHandle = ^MenuPtr; MenuInfo = RECORD menuId: INTEGER; menuWidth: INTEGER; menuHeight: INTEGER; menuProc: Handle; enableFlags: LongInt; menuData: Str255; END; {for Scrap Manager} ScrapStuff = RECORD scrapSize: LONGINT; scrapHandle: Handle; scrapCount: INTEGER; scrapState: INTEGER; scrapName: StringPtr; END; pScrapStuff = ^ScrapStuff; {General Utilities} FUNCTION BitAnd (long1,long2: LongInt): LongInt; INLINE $A858; FUNCTION BitOr (long1,long2: LongInt): LongInt; INLINE $A85B; FUNCTION BitXor (long1,long2: LongInt): LongInt; INLINE $A859; FUNCTION BitNot (long: LongInt): LongInt; INLINE $A85A; FUNCTION BitShift (long: LongInt; count: INTEGER): LongInt; INLINE $A85C; FUNCTION BitTst (bytePtr: Ptr; bitNum: LongInt): BOOLEAN; INLINE $A85D; PROCEDURE BitSet (bytePtr: Ptr; bitNum: LongInt); INLINE $A85E; PROCEDURE BitClr (bytePtr: Ptr; bitNum: LongInt); INLINE $A85F; PROCEDURE LongMul (a,b: LongInt; VAR dst: Int64Bit); INLINE $A867; FUNCTION FixMul (a,b: Fixed): Fixed; INLINE $A868; FUNCTION FixRatio (numer,denom: INTEGER): Fixed; INLINE $A869; FUNCTION HiWord (x: LongInt): INTEGER; INLINE $A86A; FUNCTION LoWord (x: LongInt): INTEGER; INLINE $A86B; FUNCTION FixRound (x: Fixed): INTEGER; INLINE $A86C; PROCEDURE PackBits (VAR srcPtr,dstPtr: Ptr; srcBytes: INTEGER); INLINE $A8CF; PROCEDURE UnPackBits (VAR srcPtr,dstPtr: Ptr; dstBytes: INTEGER);INLINE $A8D0; FUNCTION SlopeFromAngle(angle: INTEGER): Fixed; INLINE $A8BC; FUNCTION AngleFromSlope(slope: Fixed): INTEGER; INLINE $A8C4; FUNCTION DeltaPoint(ptA,ptB: Point): LongInt; INLINE $A94F; FUNCTION NewString(theString:Str255): StringHandle; INLINE $A906; PROCEDURE SetString(theString:StringHandle; strNew: Str255); INLINE $A907; FUNCTION GetString(stringID: INTEGER): StringHandle; INLINE $A9BA; PROCEDURE GetIndString(VAR theString: str255; strListID: INTEGER; index: INTEGER); FUNCTION Munger(h: Handle; offset: LongInt; ptr1: Ptr; len1: LongInt; ptr2: Ptr; len2: LongInt): LongInt; INLINE $A9E0; FUNCTION GetIcon(iconID: INTEGER): Handle; INLINE $A9BB; PROCEDURE PlotIcon(theRect: Rect; theIcon: Handle); INLINE $A94B; FUNCTION GetCursor (cursorID: INTEGER): CursHandle; INLINE $A9B9; FUNCTION GetPattern(patID: INTEGER): PatHandle; INLINE $A9B8; FUNCTION GetPicture(picID: INTEGER): PicHandle; INLINE $A9BC; PROCEDURE GetIndPattern(VAR thePat: Pattern; patListID: INTEGER; index: INTEGER); PROCEDURE ShieldCursor(shieldRect: Rect; offsetPt: Point); INLINE $A855; {for Font Manager} PROCEDURE InitFonts; INLINE $A8FE; PROCEDURE GetFontName(familyID: INTEGER; VAR theName: Str255); INLINE $A8FF; PROCEDURE GetFNum(theName: Str255; VAR familyID: INTEGER); INLINE $A900; PROCEDURE SetFontLock(lockFlag: BOOLEAN); INLINE $A903; FUNCTION FMSwapFont(inRec: FMInput): FMOutPtr; INLINE $A901; FUNCTION RealFont(famID: INTEGER; size: INTEGER): BOOLEAN; INLINE $A902; {for Event Manager} FUNCTION EventAvail(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN; INLINE $A971; FUNCTION GetNextEvent(mask:INTEGER; VAR theEvent: EventRecord): BOOLEAN; INLINE $A970; FUNCTION StillDown:BOOLEAN; INLINE $A973; FUNCTION WaitMouseUp:BOOLEAN; INLINE $A977; PROCEDURE GetMouse (VAR pt: Point); INLINE $A972; FUNCTION TickCount:LongInt; INLINE $A975; FUNCTION Button: BOOLEAN; INLINE $A974; PROCEDURE GetKeys(VAR k: keyMap); INLINE $A976; FUNCTION GetDblTime: LongInt; FUNCTION GetCaretTime: LongInt; {for Window Manager} PROCEDURE ClipAbove(window: WindowPeek); INLINE $A90B; PROCEDURE PaintOne(window: WindowPeek; clobbered: RgnHandle); INLINE $A90C; PROCEDURE PaintBehind(startWindow: WindowPeek; clobbered: RgnHandle); INLINE $A90D; PROCEDURE SaveOld(window: WindowPeek); INLINE $A90E; PROCEDURE DrawNew(window: WindowPeek; fUpdate: BOOLEAN); INLINE $A90F; PROCEDURE CalcVis(window: WindowPeek); INLINE $A909; PROCEDURE CalcVisBehind(startWindow: WindowPeek; clobbered: RgnHandle); INLINE $A90A; PROCEDURE ShowHide(window: WindowPtr; showFlag: BOOLEAN); INLINE $A908; FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN; INLINE $A911; PROCEDURE GetWMgrPort(VAR wPort: GrafPtr); INLINE $A910; PROCEDURE InitWindows; INLINE $A912; FUNCTION NewWindow(wStorage: Ptr; boundsRect: Rect; title: Str255; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LongInt): WindowPtr; INLINE $A913; PROCEDURE DisposeWindow (theWindow: WindowPtr); INLINE $A914; PROCEDURE CloseWindow (theWindow: WindowPtr); INLINE $A92D; PROCEDURE MoveWindow (theWindow: WindowPtr; h,v: INTEGER; BringToFront:BOOLEAN); INLINE $A91B; PROCEDURE SizeWindow (theWindow: WindowPtr; width,height: INTEGER; fUpdate: BOOLEAN); INLINE $A91D; FUNCTION GrowWindow (theWindow: windowPtr; startPt: Point; bBox: Rect): LongInt; INLINE $A92B; PROCEDURE DragWindow (theWindow: WindowPtr; startPt: Point; boundsRect: Rect); INLINE $A925; PROCEDURE ShowWindow (theWindow: WindowPtr); INLINE $A915; PROCEDURE HideWindow (theWindow: WindowPtr); INLINE $A916; PROCEDURE SetWTitle (theWindow: WindowPtr; title: Str255); INLINE $A91A; PROCEDURE GetWTitle (theWindow: WindowPtr; VAR title: Str255); INLINE $A919; PROCEDURE HiliteWindow (theWindow: WindowPtr; fHiLite: BOOLEAN); INLINE $A91C; PROCEDURE BeginUpdate (theWindow: WindowPtr); INLINE $A922; PROCEDURE EndUpdate (theWindow: WindowPtr); INLINE $A923; PROCEDURE SetWRefCon (theWindow: WindowPtr; data: LongInt); INLINE $A918; FUNCTION GetWRefCon (theWindow: WindowPtr): LongInt; INLINE $A917; PROCEDURE SetWindowPic (theWindow: WindowPtr; thePic: PicHandle); INLINE $A92E; FUNCTION GetWindowPic (theWindow: WindowPtr): PicHandle; INLINE $A92F; PROCEDURE BringToFront (theWindow: WindowPtr); INLINE $A920; PROCEDURE SendBehind (theWindow,behind: WindowPtr); INLINE $A921; FUNCTION FrontWindow: WindowPtr; INLINE $A924; PROCEDURE SelectWindow (theWindow: WindowPtr); INLINE $A91F; FUNCTION TrackGoAway (theWindow: WindowPtr; thePt: Point): BOOLEAN; INLINE $A91E; PROCEDURE DrawGrowIcon (theWindow: WindowPtr); INLINE $A904; PROCEDURE ValidRect (goodRect: Rect); INLINE $A92A; PROCEDURE ValidRgn (goodRgn: RgnHandle); INLINE $A929; PROCEDURE InvalRect (badRect: Rect); INLINE $A928; PROCEDURE InvalRgn (badRgn: RgnHandle); INLINE $A927; FUNCTION FindWindow (thePoint: Point; VAR theWindow: WindowPtr): INTEGER; INLINE $A92C; FUNCTION GetNewWindow (windowID: INTEGER; wStorage: Ptr; behind: WindowPtr): WindowPtr; INLINE $A9BD; FUNCTION PinRect(theRect: Rect; thePt: Point): LongInt; INLINE $A94E; FUNCTION DragGrayRgn(theRgn: RgnHandle; startPt: Point; boundsRect, slopRect: Rect;axis: INTEGER; actionProc: ProcPtr): LongInt; INLINE $A905; {For TextEdit} PROCEDURE TEActivate( h: TEHandle ); INLINE $A9D8; PROCEDURE TECalText( h: TEHandle ); INLINE $A9D0; PROCEDURE TEClick( pt: Point; extend: BOOLEAN; h: TEHandle ); INLINE $A9D4; PROCEDURE TECopy( h: TEHandle ); INLINE $A9D5; PROCEDURE TECut( h: TEHandle ); INLINE $A9D6; PROCEDURE TEDeActivate( h: TEHandle ); INLINE $A9D9; PROCEDURE TEDelete( h: TEHandle ); INLINE $A9D7; PROCEDURE TEDispose( h: TEHandle ); INLINE $A9CD; PROCEDURE TEIdle( h: TEHandle ); INLINE $A9DA; PROCEDURE TEInit; INLINE $A9CC; PROCEDURE TEKey( key: CHAR; h: TEHandle ); INLINE $A9DC; FUNCTION TENew( dest, view: Rect ): TEHandle; INLINE $A9D2; PROCEDURE TEPaste( h: TEHandle ); INLINE $A9DB; PROCEDURE TEScroll( dh, dv: INTEGER; h: TEHandle ); INLINE $A9DD; PROCEDURE TESetSelect( selStart, selEnd: LONGINT; h: TEHandle ); INLINE $A9D1; PROCEDURE TESetText( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9CF; PROCEDURE TEInsert( inText: Ptr; textLength: LONGINT; h: TEHandle ); INLINE $A9DE; PROCEDURE TEUpdate( rUpdate: Rect; h: TEHandle ); INLINE $A9D3; PROCEDURE TESetJust( just: INTEGER; h: TEHandle ); INLINE $A9DF; FUNCTION TEGetText( h: TEHandle ): CharsHandle; INLINE $A9CB; FUNCTION TEScrapHandle: Handle; FUNCTION TEGetScrapLen: LongInt; PROCEDURE TESetScrapLen(length: LongInt); FUNCTION TEFromScrap: OsErr; FUNCTION TEToScrap: OsErr; {routines that call on your own PasWordBreak and PasClikLoop routines} {AsmWordBreak - sets up stack for call to FUNCTION PasWordBreak(text: Ptr; index: INTEGER):BOOLEAN; and then sets conditions codes depending on value returned} PROCEDURE AsmWordBreak; {AsmClikLoop - sets up stack for call to PROCEDURE PasClikLoop and then sets condition codes depending on value returned} PROCEDURE AsmClikLoop; {Box drawing utility} PROCEDURE TextBox( inText: Ptr; textLength: LONGINT; r: Rect; style: INTEGER ); INLINE $A9CE; {for Resource Manager} FUNCTION InitResources: INTEGER; INLINE $A995; PROCEDURE RsrcZoneInit; INLINE $A996; PROCEDURE CreateResFile(fileName: Str255); INLINE $A9B1; FUNCTION OpenResFile(fileName: Str255): INTEGER; INLINE $A997; PROCEDURE UseResFile(refNum: INTEGER); INLINE $A998; FUNCTION GetResFileAttrs(refNum: INTEGER): INTEGER; INLINE $A9F6; PROCEDURE SetResFileAttrs(refNum: INTEGER; attrs: INTEGER); INLINE $A9F7; PROCEDURE UpdateResFile(refNum: INTEGER); INLINE $A999; PROCEDURE CloseResFile(refNum: INTEGER); INLINE $A99A; PROCEDURE SetResPurge(install: Boolean); INLINE $A993; PROCEDURE SetResLoad(AutoLoad: Boolean); INLINE $A99B; FUNCTION CountResources(theType: ResType): INTEGER; INLINE $A99C; FUNCTION GetIndResource(theType: ResType; index: INTEGER): Handle; INLINE $A99D; FUNCTION CountTypes: INTEGER; INLINE $A99E; PROCEDURE GetIndType(VAR theType: ResType; index: INTEGER); INLINE $A99F; FUNCTION UniqueID(theType: ResType): INTEGER; INLINE $A9C1; FUNCTION GetResource(theType: ResType; ID: INTEGER): Handle; INLINE $A9A0; FUNCTION GetNamedResource(theType: ResType; name: Str255): Handle; INLINE $A9A1; PROCEDURE LoadResource(theResource: Handle); INLINE $A9A2; PROCEDURE ReleaseResource(theResource: Handle); INLINE $A9A3; PROCEDURE DetachResource(theResource: Handle); INLINE $A992; PROCEDURE ChangedResource(theResource: Handle); INLINE $A9AA; PROCEDURE WriteResource(theResource: Handle); INLINE $A9B0; FUNCTION HomeResFile(theResource: Handle): INTEGER; INLINE $A9A4; FUNCTION CurResFile: INTEGER; INLINE $A994; FUNCTION GetResAttrs(theResource: Handle): INTEGER; INLINE $A9A6; PROCEDURE SetResAttrs(theResource: Handle; attrs: INTEGER); INLINE $A9A7; PROCEDURE GetResInfo(theResource: Handle; VAR theID: INTEGER; VAR theType: ResType; VAR name: Str255); INLINE $A9A8; PROCEDURE SetResInfo(theResource: Handle; theID: INTEGER; name: Str255); INLINE $A9A9; PROCEDURE AddResource(theResource: Handle; theType: ResType; theID: INTEGER; name: Str255); INLINE $A9AB; PROCEDURE AddReference(theResource: Handle; theID: INTEGER; name: Str255); INLINE $A9AC; PROCEDURE RmveResource(theResource: Handle); INLINE $A9AD; PROCEDURE RmveReference(theResource: Handle); INLINE $A9AE; FUNCTION SizeResource(theResource: Handle): LongInt; INLINE $A9A5; FUNCTION ResError: INTEGER; INLINE $A9AF; {for Control Manager} FUNCTION NewControl(curWindow: windowPtr; boundsRect: Rect; title: Str255; visible: BOOLEAN; value: INTEGER; min: INTEGER; max: INTEGER; contrlProc: INTEGER; refCon: LongInt): ControlHandle; INLINE $A954; PROCEDURE DisposeControl (theControl: ControlHandle); INLINE $A955; PROCEDURE KillControls (theWindow: WindowPtr); INLINE $A956; PROCEDURE MoveControl (theControl: ControlHandle; h,v: INTEGER); INLINE $A959; PROCEDURE SizeControl (theControl: ControlHandle; w,h: INTEGER); INLINE $A95C; PROCEDURE DragControl (theControl: ControlHandle; startPt: Point; bounds: Rect; slopRect: Rect; axis:INTEGER); INLINE $A967; PROCEDURE ShowControl (theControl: ControlHandle); INLINE $A957; PROCEDURE HideControl (theControl: ControlHandle); INLINE $A958; PROCEDURE SetCTitle (theControl: ControlHandle; title: Str255); INLINE $A95F; PROCEDURE GetCTitle (theControl: ControlHandle; VAR title: Str255); INLINE $A95E; PROCEDURE HiliteControl (theControl: ControlHandle; hiliteState: INTEGER); INLINE $A95D; PROCEDURE SetCRefCon (theControl: ControlHandle; data: LongInt); INLINE $A95B; FUNCTION GetCRefCon (theControl: ControlHandle): LongInt; INLINE $A95A; PROCEDURE SetCtlValue (theControl: ControlHandle; theValue: INTEGER); INLINE $A963; FUNCTION GetCtlValue (theControl: ControlHandle): INTEGER; INLINE $A960; FUNCTION GetCtlMin (theControl: ControlHandle): INTEGER; INLINE $A961; FUNCTION GetCtlMax (theControl: ControlHandle): INTEGER; INLINE $A962; PROCEDURE SetCtlMin (theControl: ControlHandle; theValue: INTEGER); INLINE $A964; PROCEDURE SetCtlMax (theControl: ControlHandle; theValue: INTEGER); INLINE $A965; FUNCTION GetCtlAction (theControl: ControlHandle): ProcPtr; INLINE $A96A; PROCEDURE SetCtlAction (theControl: ControlHandle; newProc: ProcPtr); INLINE $A96B; FUNCTION TestControl (theControl: ControlHandle; thePt: Point): INTEGER; INLINE $A966; FUNCTION TrackControl (theControl:ControlHandle; thePt: Point; actionProc:ProcPtr):INTEGER; INLINE $A968; FUNCTION FindControl (thePoint: Point; theWindow: WindowPtr; VAR theControl: ControlHandle): INTEGER; INLINE $A96C; PROCEDURE DrawControls (theWindow: WindowPtr); INLINE $A969; FUNCTION GetNewControl (controlID: INTEGER; owner: WindowPtr): ControlHandle; INLINE $A9BE; {for Dialog Manager} PROCEDURE InitDialogs(resumeProc: ProcPtr); INLINE $A97B; FUNCTION GetNewDialog(dialogID: Integer; wStorage: Ptr; behind: WindowPtr): DialogPtr; INLINE $A97C; FUNCTION NewDialog(wStorage: Ptr; boundsRect: Rect; title: Str255; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LongInt; itmLstHndl: Handle): DialogPtr; INLINE $A97D; FUNCTION IsDialogEvent(event: EventRecord): BOOLEAN; INLINE $A97F; FUNCTION DialogSelect( event: EventRecord; VAR theDialog: DialogPtr; VAR itemHit: INTEGER): BOOLEAN; INLINE $A980; PROCEDURE ModalDialog( filterProc: ProcPtr; VAR itemHit: INTEGER); INLINE $A991; PROCEDURE DrawDialog(dialog: DialogPtr); INLINE $A981; PROCEDURE CloseDialog(dialog: DialogPtr); INLINE $A982; PROCEDURE DisposDialog(dialog: DialogPtr); INLINE $A983; FUNCTION Alert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A985; FUNCTION StopAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A986; FUNCTION NoteAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A987; FUNCTION CautionAlert(alertID: Integer; filterProc: ProcPtr): Integer; INLINE $A988; PROCEDURE CouldAlert(alertID: Integer); INLINE $A989; PROCEDURE FreeAlert(alertID: Integer); INLINE $A98A; PROCEDURE CouldDialog(DlgID: Integer); INLINE $A979; PROCEDURE FreeDialog(DlgID: Integer); INLINE $A97A; PROCEDURE ParamText(cite0, cite1, cite2, cite3: Str255); INLINE $A98B; PROCEDURE ErrorSound(sound: ProcPtr); INLINE $A98C; PROCEDURE GetDItem(dialog: DialogPtr; itemNo: Integer; VAR kind: Integer; VAR item: Handle; VAR box: Rect); INLINE $A98D; PROCEDURE SetDItem(dialog: DialogPtr; itemNo: Integer; kind: Integer; item: Handle; box: Rect); INLINE $A98E; PROCEDURE SetIText(item: Handle; text: Str255); INLINE $A98F; PROCEDURE GetIText(item: Handle; VAR text: Str255); INLINE $A990; PROCEDURE SelIText(dialog: DialogPtr; itemNo: Integer; startSel, endSel: INTEGER ); INLINE $A97E; {routines designed only for use in Pascal} FUNCTION GetAlrtStage: INTEGER; {returns aCount} PROCEDURE ResetAlrtStage; PROCEDURE DlgCut(dialog: DialogPtr); PROCEDURE DlgPaste(dialog: DialogPtr); PROCEDURE DlgCopy(dialog: DialogPtr); PROCEDURE DlgDelete(dialog: DialogPtr); PROCEDURE SetDAFont(fontNum: INTEGER); {for Desk Manager} FUNCTION SystemEvent(myEvent: EventRecord): BOOLEAN; INLINE $A9B2; PROCEDURE SystemClick(theEvent: EventRecord; theWindow: windowPtr); INLINE $A9B3; PROCEDURE SystemTask; INLINE $A9B4; PROCEDURE SystemMenu(menuResult: LongInt); INLINE $A9B5; FUNCTION SystemEdit(editCode: INTEGER): BOOLEAN; INLINE $A9C2; FUNCTION OpenDeskAcc(theAcc: Str255): INTEGER; INLINE $A9B6; PROCEDURE CloseDeskAcc(refNum: INTEGER); INLINE $A9B7; {for Menu Manager} PROCEDURE InitMenus; INLINE $A930; FUNCTION NewMenu(menuID: INTEGER; menuTitle: Str255): menuHandle; INLINE $A931; FUNCTION GetMenu(rsrcID: INTEGER): MenuHandle; INLINE $A9BF; PROCEDURE DisposeMenu(menu: menuHandle); INLINE $A932; PROCEDURE AppendMenu(menu: menuHandle; data: str255); INLINE $A933; PROCEDURE InsertMenu (menu: MenuHandle; beforeId: INTEGER); INLINE $A935; PROCEDURE DeleteMenu (menuId: INTEGER); INLINE $A936; PROCEDURE DrawMenuBar; INLINE $A937; PROCEDURE ClearMenuBar; INLINE $A934; FUNCTION GetMenuBar:Handle; INLINE $A93B; FUNCTION GetNewMBar(menuBarID: INTEGER): Handle; INLINE $A9C0; PROCEDURE SetMenuBar(menuBar: Handle); INLINE $A93C; FUNCTION MenuSelect (startPt: Point): LongInt; INLINE $A93D; FUNCTION MenuKey (ch: CHAR): LongInt; INLINE $A93E; PROCEDURE HiLiteMenu (menuId: INTEGER); INLINE $A938; PROCEDURE SetItem (menu: menuHandle; item: INTEGER; itemString: Str255); INLINE $A947; PROCEDURE GetItem (menu: menuHandle; item: INTEGER; VAR itemString: Str255); INLINE $A946; PROCEDURE EnableItem (menu: menuHandle; item: INTEGER); INLINE $A939; PROCEDURE DisableItem(menu: menuHandle; item: INTEGER); INLINE $A93A; PROCEDURE CheckItem (menu: menuHandle; item: INTEGER; checked: BOOLEAN); INLINE $A945; PROCEDURE SetItemIcon(menu: menuHandle; item: INTEGER; iconNum: Byte); INLINE $A940; PROCEDURE GetItemIcon(menu: menuHandle; item: INTEGER; VAR iconNum: Byte); INLINE $A93F; PROCEDURE SetItemStyle(menu: menuHandle; item: INTEGER; styleVal: Style); INLINE $A942; PROCEDURE GetItemStyle(menu: menuHandle; item: INTEGER; VAR styleVal: Style); INLINE $A941; PROCEDURE SetItemMark(menu: menuHandle; item: INTEGER; markChar: CHAR); INLINE $A944; PROCEDURE GetItemMark(menu: menuHandle; item: INTEGER; VAR markChar: CHAR); INLINE $A943; PROCEDURE SetMenuFlash(flashCount: INTEGER); INLINE $A94A; PROCEDURE FlashMenuBar(menuID: INTEGER); INLINE $A94C; FUNCTION GetMHandle(menuID: INTEGER): menuHandle; INLINE $A949; FUNCTION CountMItems(menu: menuHandle): INTEGER; INLINE $A950; PROCEDURE AddResMenu(menu: menuHandle; theType:ResType); INLINE $A94D; PROCEDURE InsertResMenu(menu: menuHandle; theType:ResType; afterItem: INTEGER); INLINE $A951; PROCEDURE CalcMenuSize(menu:menuHandle); INLINE $A948; {for Scrap Manager} FUNCTION GetScrap( hDest: Handle; what: ResType; VAR offset: LONGINT ): LONGINT; INLINE $A9FD; FUNCTION InfoScrap: pScrapStuff; INLINE $A9F9; FUNCTION LoadScrap: LONGINT; INLINE $A9FB; FUNCTION PutScrap( length: LONGINT; what: ResType; source: Ptr ): LONGINT; ?o.Nu     ?O           '!M2!N1#5#64#75#86#7%;%<:%=;%><%?=%@>%A?%B@%CA% DB% EC% FD% GE% HF%G&K&JMNLOMPNQORPSQTRUS VT WU XV YW X[\Z][^\_]^ab`cadbecfdgefijhkiljmknlompnqo rp sq tr us vtwuxvywzx{y|z}{~|}~ !"#$%&'()*+,-                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E$$$                                                               ! "  #! !$" "%# #&$ $'% %&)*(+),*-+,/0.1/203142536475 86 97 :8 ;9 <:=;><?=@>A?B@CADBECFDGEHFIGJHKILJMKNL OM!PN"QO#RP$SQ%TR&US'VT(WU)XV*YW+ZX,[Y-\Z.][/^\0_]1`^2a_3b`4ca5db6ec7fd8ge9hf:ig;jhmk?nl@omApnBqoCrpDsqEtrFusGvtHwuIxvJywKzxL{yM|zN}{O~|P}Q~RS     #8$$D           !"#$%&         !  "  # $ %&'()*+,-./012345 6!7" 8#!9$":#&'%(&)'*(+),*-+., /- 0. 1/ 20 31425364758697:8;9<:=;><?=@>A?B@CAB$DGHFIGJHKILJMKNLOM PN QO RP SQ TRUSVTWUXVWZ[Y\Z][\`a_b`cadbecfdgehf gjkiljmknlompnqorp sq tr us vt wuxvywzx{y|z}{~|}~       !"#$""!!!!!!!!!! ! ! ! ! !!!!!!!!!!!!!!!!!!! !!!"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E!F!G!H!I!J!K!L&K