<<>> <> <> <> <> <<>> DIRECTORY InterpressInterpreter, Rope, JaM, Imager, JaMIPrivate; JaMIShowIPImpl: CEDAR PROGRAM IMPORTS InterpressInterpreter, JaM, Imager, JaMIPrivate, Rope EXPORTS JaMIPrivate ~ BEGIN IpOpenFailed: ERROR[msg: Rope.ROPE] = CODE; LogError: InterpressInterpreter.LogProc ~ { ERROR IpOpenFailed[Rope.Concat["Interpress error: ", explanation]]; }; ApplyShowIP: PROC [self: JaM.State] ~ { GetContext: PROC [self: JaM.State] RETURNS [Imager.Context] ~ { info: JaMIPrivate.Info ¬ JaMIPrivate.GetInfo[self]; IF info = NIL THEN ERROR; IF info.ipenabled THEN RETURN [info.ipdc]; RETURN[info.vdc]; }; Action: PROC ~ { Log : InterpressInterpreter.LogProc ~ { <> }; Imager.ScaleT[context, 1.0/Imager.metersPerPoint]; InterpressInterpreter.DoPage[master: master, page: page, context: context, log: Log] }; info: JaMIPrivate.Info ¬ JaMIPrivate.GetInfo[self]; context: Imager.Context ~ GetContext[self]; file: Rope.ROPE ¬ JaM.PopRope[self]; page: INT ¬ JaM.PopInt[self]; master: InterpressInterpreter.Master; master ¬ InterpressInterpreter.Open[file, LogError ! IpOpenFailed => { ERROR JaM.Error[type: OpenFailed, msg: msg] }]; page ¬ MAX[1, MIN[page, master.pages]]; Imager.DoSaveAll[context, Action]; }; RegisterShowIP: PUBLIC PROC [self: JaM.State] ~ { JaM.Register[self, ".showip", ApplyShowIP]; }; END.