<> <> <> <> DIRECTORY CDProperties, CDViewerBase, ViewerClasses; CDViewerBaseImpl: CEDAR PROGRAM IMPORTS CDProperties EXPORTS CDViewerBase = BEGIN getList: CDProperties.PropRef _ CDProperties.InitPropRef[]; setList: CDProperties.PropRef _ CDProperties.InitPropRef[]; ImplementGetProc: PUBLIC PROC [op: ATOM, proc: ViewerClasses.GetProc] = { ENABLE UNWIND => NULL; val: REF = IF proc=NIL THEN NIL ELSE NEW[ViewerClasses.GetProc_proc]; IF proc=GetProc THEN ERROR; --don't do that, it causes infinite recursion CDProperties.PutProp[getList, op, val] }; ImplementSetProc: PUBLIC PROC [op: ATOM, proc: ViewerClasses.SetProc] = { ENABLE UNWIND => NULL; val: REF = IF proc=NIL THEN NIL ELSE NEW[ViewerClasses.SetProc_proc]; IF proc=SetProc THEN ERROR; --don't do that, it causes infinite recursion CDProperties.PutProp[setList, op, val] }; GetProc: PUBLIC ViewerClasses.GetProc = { WITH CDProperties.GetListProp[getList^, op] SELECT FROM gp: REF ViewerClasses.GetProc => RETURN [gp[self, op]]; ENDCASE => RETURN [NIL]; }; SetProc: PUBLIC ViewerClasses.SetProc = { WITH CDProperties.GetListProp[setList^, op] SELECT FROM sp: REF ViewerClasses.SetProc => sp[self, data, finalise, op]; ENDCASE => NULL; }; END.