DIRECTORY CD, CDVPrivate, RuntimeError, ViewerClasses; CDVCursorImpl: CEDAR MONITOR IMPORTS CD, CDVPrivate, RuntimeError EXPORTS CDVPrivate = BEGIN VRef: TYPE = CDVPrivate.VRef; CursorRec: TYPE = RECORD [mode: REF, doit: CDVPrivate.CursorModeProc]; CursorList: TYPE = LIST OF CursorRec; cursorList: CursorList _ LIST[CursorRec[mode: NIL, doit: UseDefaultCursor]]; ImplementACursor: PUBLIC ENTRY PROC[mode: ATOM, proc: CDVPrivate.CursorModeProc] = BEGIN IF proc=NIL THEN RETURN WITH ERROR CD.Error[]; FOR list: CursorList _ cursorList, list.rest DO IF list.first.mode=mode THEN {list.first.doit _ proc; EXIT} ELSE IF list.rest=NIL THEN {list.rest _ LIST[CursorRec[mode: mode, doit: proc]]; EXIT} ENDLOOP END; SetCursorMode: PUBLIC PROC[me: VRef, mode: REF] = BEGIN ENABLE RuntimeError.UNCAUGHT => { IF CDVPrivate.ShallContinue[me, TRUE, "CDVCursorImpl.SCM"] THEN GOTO oops; }; FOR list: CursorList _ cursorList, list.rest WHILE list#NIL DO IF list.first.mode=mode THEN { list.first.doit[me, mode]; RETURN } ENDLOOP; cursorList.first.doit[me, NIL]; EXITS oops => NULL; END; DefaultOutLine: PUBLIC PROC[me: VRef] = BEGIN END; UseDefaultCursor: CDVPrivate.CursorModeProc = { me.designRec.outlineProcLC _ DefaultOutLine }; END. ŒCDVCursorImpl.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. by Christian Jacobi, September 6, 1984 9:29:18 am PDT last edited by Christian Jacobi, March 20, 1986 3:31:23 pm PST --never NIL; used by ImplementACursor --invert the order: efficiency hack: the first installed cursor is found the fastest --cursorList is never NIL --error catch; cursorList is never NIL Κy˜codešœ™Kšœ Οmœ1™šžœžœ˜Kšœ˜Kšž˜K˜—Kšžœ˜—Kšœ&™&Kšœžœ˜Kšžœ žœ˜Kšžœ˜—K˜šΟbœžœžœ ˜(Kšž˜Kšžœ˜—K˜š‘œ˜/Kšœ+˜+Kšœ˜—K˜Kšžœ˜K˜—…—Ψέ