DIRECTORY BitBlt, IO, Environment, FileIO, MessageWindow, PDFileFormat, PDInterpBasic, PDInterpInput, PDInterpOutput, PDInterpControl, PDInterpBitmap, UserTerminal; PDInterpStubImpl: PROGRAM IMPORTS IO, FileIO, MessageWindow, PDInterpControl, PDInterpBitmap, UserTerminal EXPORTS PDInterpInput, PDInterpOutput ~ BEGIN Rep: PUBLIC TYPE ~ RECORD[foo: NAT]; stream: IO.STREAM _ FileIO.Open["banded.pd"]; ReOpen: PROC ~ {IO.Close[stream]; stream _ FileIO.Open["banded.pd"]}; aborted: BOOLEAN _ FALSE; GetBlock: PUBLIC PROC [handle: PDInterpInput.Handle, dest: LONG POINTER, sourceIndex: INT, words: INT] RETURNS [wordsRead: INT] ~ { wordsRead _ 0; stream.SetIndex[sourceIndex*2]; WHILE words-wordsRead > 1000 DO wordsThisBlock: INT _ (stream.UnsafeGetBlock[[dest, 0, 1000*2]])/2; wordsRead _ wordsRead + wordsThisBlock; dest _ dest + wordsThisBlock; IF wordsThisBlock < 1000 THEN EXIT; ENDLOOP; wordsRead _ wordsRead + (stream.UnsafeGetBlock[[dest, 0, (words-wordsRead)*2]])/2; }; mess: CARDINAL _ 0; ReportStatus: PUBLIC PROC [handle: PDInterpInput.Handle, status: PDInterpBasic.Status, queueSize: NAT, queuePosition: NAT, page, pass, sourceIndex: INT] RETURNS [abort: BOOLEAN] ~ { s: IO.STREAM _ IO.CreateOutputStreamToRope[]; s.Put[IO.refAny[NEW[PDInterpBasic.Status _ status]]]; s.PutRope[", "]; MessageWindow.Append[IO.GetOutputStreamRope[s], mess MOD 4 = 0]; mess _ mess + 1; s.Close[]; abort _ aborted; }; currentHerald: PDFileFormat.Herald; currentStartImage: PDFileFormat.StartImage; currentBandNumber: NAT _ 0; screen: PDInterpBitmap.BitmapDesc _ ScreenDesc[]; ScreenDesc: PROC RETURNS [display: PDInterpBitmap.BitmapDesc] ~ { bb: BitBlt.BBTable; [] _ UserTerminal.SetState[on]; bb _ UserTerminal.GetBitBltTable[]; display _ [sOrigin: 0, fOrigin: 0, sMin: 0, fMin: 0, sSize: bb.height, fSize: bb.width, pointer: bb.dst.word, rast: bb.width/Environment.bitsPerWord, lines: bb.height ]; display _ display.ShiftMap[-18, -1]; display _ display.Clip[[0, 0, 720, 598]]; PDInterpBitmap.Fill[display, [0,0,10000,10000], 1]; display.sOrigin _ display.sOrigin + 384; display.fOrigin _ display.fOrigin + 384; }; CurrentBandDesc: PROC RETURNS [bitmapDesc: PDInterpBitmap.BitmapDesc] ~ { rectangle: PDInterpBitmap.Rectangle _ [ sMin: currentHerald.bandSSize*(currentBandNumber+currentStartImage.passBands), fMin: currentStartImage.fMinPage, sSize: currentHerald.bandSSize, fSize: currentStartImage.fSizePage ]; bitmapDesc _ screen.Clip[rectangle]; PDInterpBitmap.Fill[bitmapDesc, rectangle, 0]; }; StartImage: PUBLIC PROC [herald: PDFileFormat.Herald, startImage: PDFileFormat.StartImage] RETURNS [PDInterpBitmap.BitmapDesc] ~ { currentHerald _ herald; currentStartImage _ startImage; currentBandNumber _ 0; RETURN [CurrentBandDesc[]] }; EndBand: PUBLIC PROC RETURNS [PDInterpBitmap.BitmapDesc] ~ { currentBandNumber _ currentBandNumber + 1; RETURN [CurrentBandDesc[]] }; EndImage: PUBLIC PROC ~ {MessageWindow.Append["Page Done. ", FALSE]}; DoIt: PROC ~ { pageSpec: PDInterpControl.PageSpec; pageSpec[0] _ [0, LAST[NAT]]; PDInterpControl.RequestService[NIL, pageSpec]; }; END. FPDInterpStubImpl.mesa Michael Plass, November 11, 1983 4:54 pm Ên˜Jšœ™J™(JšÏk œ œ˜¤šÏnœ˜JšœœF˜PJšœ˜%—šœ˜J˜—š œœœœœ˜$J˜—Jšœœœ˜-Jšžœœœ3˜EJšœ œœ˜J˜šžœœœ&œœœ œœ œ˜ƒJšœ˜Jšœ˜šœ˜Jšœœ0˜CJšœ'˜'Jšœ˜Jšœœœ˜#Jšœ˜—JšœR˜RJšœ˜J˜—Jšœœ˜šž œœœIœœœœ œ˜µJšœœœœ˜-Jšœœœ"˜5J˜Jšœœœ˜@Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜—J˜Jšœ#˜#Jšœ+˜+Jšœœ˜Jšœ1˜1šž œœœ)˜AJ˜Jšœ ˜ J˜#šœ4˜4J˜J˜J˜Jšœ'˜'Jšœ˜J˜—Jšœ$˜$Jšœ)˜)Jšœ3˜3Jšœ(˜(Jšœ(˜(Jšœ˜J˜—šžœœœ,˜Išœ'˜'JšœN˜NJšœ!˜!Jšœ˜Jšœ"˜"Jšœ˜—Jšœ$˜$Jšœ.˜.Jšœ˜J˜—šž œœœC˜ZJšœ ˜'Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜J™—šžœœœœ ˜