-- PDInterpOutputRavenImpl.mesa -- Copyright (C) 1984, Xerox Corporation. All rights reserved. -- Michael Plass, September 14, 1984 9:13:47 am PDT -- DIRECTORY Environment, PDFileFormat, PDInterpBasic, PDInterpOutput, PDInterpBitmap, RavenSlotDriver, PDInterpSysCalls, PDQueue; PDInterpOutputRavenImpl: PROGRAM IMPORTS PDInterpBitmap, RavenSlotDriver, PDInterpSysCalls, PDQueue EXPORTS PDInterpOutput = BEGIN bitsPerWord: NAT = Environment.bitsPerWord; currentHerald: PDFileFormat.Herald; currentStartImage: PDFileFormat.StartImage; currentBandNumber: NAT _ 0; bandWords: INT _ 0; band: PDInterpBitmap.BitmapDesc _ [sOrigin: 0, fOrigin: 0, sMin: 0, fMin: 0, sSize: 0, fSize: 0, pointer: NIL, rast: 0, lines: 0]; bandWordsAllocated: INT _ 0; CurrentBandDesc: PROC RETURNS [PDInterpBitmap.BitmapDesc] = { band.sOrigin _ currentHerald.bandSSize*(currentBandNumber+currentStartImage.passBands); PDInterpBitmap.Clear[band]; RETURN [band] }; StartImage: PUBLIC PROC [herald: PDFileFormat.Herald, startImage: PDFileFormat.StartImage] RETURNS [PDInterpBitmap.BitmapDesc] = { rast: NAT = (startImage.fSizePage+bitsPerWord-1)/bitsPerWord; lines: INT = herald.bandSSize; words: INT = rast*lines; currentHerald _ herald; currentStartImage _ startImage; currentBandNumber _ 0; IF words > bandWordsAllocated THEN { IF band.pointer # NIL THEN PDInterpSysCalls.FreeSpace[band.pointer]; band.pointer _ PDInterpSysCalls.AllocateSpace[words]; bandWordsAllocated _ words; }; band.sOrigin _ 0; band.fOrigin _ startImage.fMinPage; band.sMin _ 0; band.fMin _ 0; band.sSize _ herald.bandSSize; band.fSize _ rast*bitsPerWord; band.rast _ rast; band.lines _ herald.bandSSize; bandWords _ words; RETURN [CurrentBandDesc[]] }; -- EndBand: PUBLIC PROC RETURNS [PDInterpBitmap.BitmapDesc] = { RavenSlotDriver.HyperStore[ sourcePtr: band.pointer, destOffset: bandWords*currentBandNumber, wordCount: bandWords ]; currentBandNumber _ currentBandNumber + 1; RETURN [CurrentBandDesc[]] }; EndImage: PUBLIC PROC = { successCode: RavenSlotDriver.SuccessCode; slowMargin: CARDINAL _ currentHerald.bandSSize*currentStartImage.passBands; fastMargin: CARDINAL _ band.fOrigin; numberOfLines: CARDINAL _ currentHerald.bandSSize*currentStartImage.nBands; scanLineLength: CARDINAL _ band.fSize; FOR copyNum: CARDINAL IN [0..currentHerald.copies) DO DO s:RavenSlotDriver.PrinterStatus; successCode _ RavenSlotDriver.PrintPage[ slowMargin: slowMargin, fastMargin: fastMargin, numberOfLines: numberOfLines, scanLineLength: scanLineLength, paperSource: top, paperStacking: aligned ]; SELECT successCode FROM warning => EXIT; error => { WHILE (s_RavenSlotDriver.GetStatus[])#standBy DO RavenSlotDriver.DisplayBadStatusInMP[s]; SELECT s FROM registrationJam => PDQueue.LogMessage[" - Registration jam"]; fuserJam => PDQueue.LogMessage[" - Fuser jam"]; warming => PDQueue.LogMessage[" - Warming up"]; feederFault => PDQueue.LogMessage[" - Out of paper"]; interlockOpen => PDQueue.LogMessage[" - Door open"]; fuserCold => PDQueue.LogMessage[" - Fuser cold"]; parityError => PDQueue.LogMessage[" - Parity Error"]; offLine => PDQueue.LogMessage[" - Offline"]; ENDCASE => PDQueue.LogMessage[" - Can't feed page"]; ENDLOOP }; ENDCASE => EXIT; -- ok ENDLOOP; ENDLOOP; }; ReprintLastPage: PUBLIC PROC [copies: CARDINAL] ~ { IF currentHerald.password # PDFileFormat.passwordValue THEN RETURN; currentHerald.copies _ copies; EndImage[]; }; currentHerald.password _ 0; END.