<> <> <> <> DIRECTORY CD, CDViewer, CDMark, CDValue, CDSequencer; CDMarkImpl: CEDAR MONITOR IMPORTS CDValue, CDViewer, CDSequencer EXPORTS CDMark = BEGIN GetMark: PUBLIC PROC [design: CD.Design] RETURNS [pos: CD.DesignPosition_ [0, 0]] = <<--returns always some position, even if there is no mark>> BEGIN x: REF = CDValue.Fetch[boundTo: design, key: $Mark, propagation: design]; IF x#NIL THEN pos _ NARROW[x, REF CD.DesignPosition]^ END; SetMark: PUBLIC PROC [design: CD.Design, pos: CD.DesignPosition] = BEGIN p: REF CD.DesignPosition _ NEW[CD.DesignPosition_pos]; CDValue.Store[boundTo: design, key: $Mark, value: p]; CDViewer.ShowArrow[design, pos] END; <<>> SetMarkComm: PROC [comm: CDSequencer.Command] = BEGIN SetMark[comm.design, comm.pos] END; RemoveMarkComm: PROC [comm: CDSequencer.Command] = BEGIN CDViewer.RemoveArrow[comm.design] END; CDValue.EnregisterKey[$Mark]; CDSequencer.ImplementCommand[$ShowMark, SetMarkComm]; CDSequencer.ImplementCommand[$RemoveMark, RemoveMarkComm]; END. <<--This Module is temporary; if Marks will work properly and integrated,>> <<--Mark will be exported elsewhere>>