DIRECTORY Menus, Process, Scratchpad2d, Scratchpad2dUser, SV2d, SVInputMonitor, SVScratchpadMonitor, SVViewerTool; SVScratchpadMonitorImpl: MONITOR IMPORTS Process, Scratchpad2d EXPORTS SVScratchpadMonitor = BEGIN MouseButton: TYPE = Menus.MouseButton; Point2d: TYPE = SV2d.Point2d; ScratchpadData: TYPE = Scratchpad2dUser.ScratchpadData; globalProcess: PROCESS _ NIL; screenCoords: Point2d; clickAtom: ATOM; spData: ScratchpadData _ NIL; globalNew: BOOL _ FALSE; NewMotion: PUBLIC ENTRY PROC [pt: Point2d, atom: ATOM, scratchpadData: ScratchpadData] = { globalNew _ TRUE; screenCoords _ pt; spData _ scratchpadData; clickAtom _ atom; IF globalProcess = NIL THEN Process.Detach[globalProcess _ FORK Painter]; }; Painter: PROC = { WHILE New[] DO Dispatch[screenCoords, clickAtom, spData]; ENDLOOP; }; New: PUBLIC ENTRY PROC RETURNS [x: BOOL] = { x _ globalNew; globalNew _ FALSE; IF NOT x THEN globalProcess _ NIL; -- no mouse action. Let process die. }; Dispatch: PROC [controlPoint: Point2d, atom: ATOM, scratchpadData: ScratchpadData] = { SELECT atom FROM $MOVE => { IF scratchpadData.mode = drawLin THEN Scratchpad2d.MoveLinPoint[controlPoint, scratchpadData] ELSE Scratchpad2d.MoveRevoPoint[controlPoint, scratchpadData]; }; $MOVESTART => { IF scratchpadData.mode = drawLin THEN Scratchpad2d.MoveLinStart[controlPoint, scratchpadData] ELSE Scratchpad2d.MoveRevoStart[controlPoint, scratchpadData]; }; ENDCASE; }; END. pSVScratchpadMonitorImpl.mesa Last edited by Bier on July 2, 1983 2:29 pm Contents: A flexible setup, suggested by Scott McGregor, for processing mouse input as fast as you can (but no faster). I will use it to synchronize my mouse point processing with the mousepoint. If the processing algorithms become faster, this procedure will still do the right thing. Κj˜Iheadšœ™Jšœ+™+JšœŸ™ŸJ˜šΟk ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ ˜ —J˜šœ˜ Jšœ˜Jšœ˜—Jš˜˜Jšœ œ˜&Jšœ œ˜Jšœœ#˜7J˜Jšœœœ˜Jšœ˜Jšœ œ˜Jšœœ˜Jšœ œœ˜J˜š Οn œœœœœ%˜ZJšœ œ˜Jšœ˜Jšœ˜Jšœ˜Jšœœœ œ ˜IJšœ˜—J˜šžœœ˜šœ˜Jšœ*˜*—Jšœ˜Jšœ˜—J˜š žœœœœœœ˜,Jšœ˜Jšœ œ˜Jš œœœœΟc%˜HJšœ˜—J˜šžœœœ%˜Všœ˜šœ ˜ Jšœœ8˜]Jšœ:˜>J˜—šœ˜Jšœœ8˜]Jšœ:˜>J˜—Jšœ˜—Jšœ˜——J˜Jšœ˜J˜J˜J˜—…—ž x