DIRECTORY Convert, JaM, JaMIPrivate, Imager, ImagerInterpress, Rope ; JaMIInterpressImpl: CEDAR PROGRAM IMPORTS Convert, Imager, JaM, JaMIPrivate, ImagerInterpress, Rope EXPORTS JaMIPrivate ~ BEGIN ROPE: TYPE ~ Rope.ROPE; ApplyDoPage: PUBLIC PROC [self: JaM.State] ~ { OPEN JaM; info: JaMIPrivate.Info ¬ JaMIPrivate.GetInfo[self]; rope: ROPE ~ PopRope[self]; x: Any ~ Pop[self]; action: PROC [dc: Imager.Context] ~ { Imager.ScaleT[dc, 0.0254/72]; info.ipenabled¬ TRUE; info.ipdc¬ dc; Execute[self, x]; info.ipenabled¬ FALSE; }; ref: ImagerInterpress.Ref = ImagerInterpress.Create[rope]; IF info = NIL THEN ERROR; ImagerInterpress.DoPage[ref, action ! UNWIND => info.ipenabled¬ FALSE]; ImagerInterpress.Close[ref]; }; ApplyWriteInterpress: PUBLIC PROC [self: JaM.State] ~ { OPEN JaM; info: JaMIPrivate.Info ¬ JaMIPrivate.GetInfo[self]; x: Any ¬ Pop[self]; decl: Array ~ PopArray[self]; rope: ROPE ~ PopRope[self]; quit: INT ¬ 0; pageNumber: INT ¬ 1; action: PROC [dc: Imager.Context] ~ { Imager.ScaleT[dc, 0.0254/72]; info.ipenabled¬ TRUE; info.ipdc¬ dc; JaM.PushInt[self, pageNumber]; Execute[self, x]; quit ¬ JaM.PopInt[self]; info.ipenabled¬ FALSE; }; ref: ImagerInterpress.Ref = ImagerInterpress.Create[rope]; IF info = NIL THEN ERROR; FOR i: NAT IN [decl.start..decl.start+decl.length) DO d: Any ¬ JaM.AGet[decl, i]; WITH d SELECT FROM font: Imager.Font => ImagerInterpress.DeclareFont[ref, font]; color: Imager.Color => ImagerInterpress.DeclareColor[ref, color]; pixelArray: Imager.PixelArray => ImagerInterpress.DeclarePixelArray[ref, pixelArray]; colorOperator: Imager.ColorOperator => ImagerInterpress.DeclareColorOperator[ref, colorOperator]; ENDCASE => ERROR JaM.Error[WrongType, Rope.Cat["wrong type: element ", Convert.RopeFromInt[i], " of declaration"]]; ENDLOOP; UNTIL quit # 0 DO ImagerInterpress.DoPage[ref, action ! UNWIND => info.ipenabled ¬ FALSE]; pageNumber ¬ pageNumber + 1; ENDLOOP; ImagerInterpress.Close[ref]; }; RegisterInterpress: PUBLIC PROC [self: JaM.State] ~ { JaM.Register[self, ".makeinterpress", ApplyDoPage]; JaM.Register[self, ".writeinterpress", ApplyWriteInterpress]; }; END. Ί JaMIInterpressImpl.mesa Copyright Σ 1985, 1992 by Xerox Corporation. All rights reserved. Tim Diebert: July 23, 1985 5:02:46 pm PDT Michael Plass, March 13, 1986 11:24:24 am PST ΚΡ•NewlineDelimiter –"cedarcode" style™™Icodešœ Οeœ6™BK™)K™-—K˜šΟk ˜ K˜Kšœ˜K˜ Kšœ˜Kšœ˜Kšœ˜Kšœ˜—K˜K˜šΠlnœž ˜!Kšžœ:˜AKšžœ ˜šœž˜K˜Kšžœžœžœ˜K˜šΟn œžœžœžœ˜8K˜3Kšœžœ˜K˜šœžœ˜%Kšœ˜Kšœžœ˜K˜Kšœ˜Kšœžœ˜Kšœ˜—Kšœ:˜:Kšžœžœžœžœ˜Kšœ&žœžœ˜GKšœ˜K˜—K˜š œžœžœžœ˜AK˜3K˜K˜Kšœžœ˜Kšœžœ˜Kšœ žœ˜šœžœ˜%Kšœ˜Kšœžœ˜K˜Kšœ˜Kšœ˜K˜Kšœžœ˜Kšœ˜—Kšœ:˜:Kšžœžœžœžœ˜šžœžœžœ&ž˜5K˜šžœžœž˜Kšœ=˜=KšœA˜AKšœU˜UKšœa˜aKšžœžœc˜s—Kšžœ˜—šžœ ž˜Kšœ&žœžœ˜HK˜Kšžœ˜—Kšœ˜K˜K˜—š œžœžœ˜5Kšœ3˜3Kšœ=˜=K˜K˜—K˜—Kšžœ˜——…—L Χ