<> <> <> <> <<>> <> <<>> DIRECTORY IO, Menus, Rope, SoftcardFSAccess, SoftcardMonitor, SoftcardTool, ViewerClasses, ViewerIO; SoftcardToolImpl: CEDAR PROGRAM IMPORTS IO, Menus, SoftcardFSAccess, SoftcardMonitor, ViewerIO EXPORTS SoftcardTool ~ BEGIN translateStreamProcs: REF IO.StreamProcs _ IO.CreateStreamProcs[ variety: $input, class: $CRToLFTranslator, getChar: MyGetChar ]; MyGetChar: PROC [self: IO.STREAM] RETURNS [ch: CHAR] = { in: IO.STREAM _ NARROW[self.streamData]; ch _ IO.GetChar[in]; IF ch='\n THEN ch _ '\l; }; CreateCmdStreams: PUBLIC PROC [name: Rope.ROPE] RETURNS [in, out, err: IO.STREAM] ~ { [in, out] _ ViewerIO.CreateViewerStreams[name: IF name=NIL THEN "Puff Console" ELSE name]; in _ IO.CreateStream[translateStreamProcs, in, in]; err _ out; }; BreakSparc: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: Menus.MouseButton, shift, control: BOOL] ~ { <> SoftcardMonitor.Break[] }; CreateTool: PUBLIC PROC[name: Rope.ROPE _ NIL] ~ { <<Description of the procedure.>> breakEntry: Menus.MenuEntry _ Menus.CreateEntry[ name: "BREAK!", proc: BreakSparc, clientData: NIL, documentation: "Interrupts the Sparc", guarded: FALSE ]; v: ViewerClasses.Viewer; in, out: IO.STREAM; [in, out] _ ViewerIO.CreateViewerStreams[name: IF name=NIL THEN "Puff Console" ELSE name]; in _ IO.CreateStream[translateStreamProcs, in, in]; SoftcardFSAccess.RegisterConsoleStreams[in, out, out]; v _ ViewerIO.GetViewerFromStream[out]; Menus.AppendMenuEntry[menu: v.menu, entry: breakEntry]; }; <<>> CreateTool[]; END.