CDMarkImpl.mesa (part of Chipndale)
by Christian Jacobi November 17, 1983 1:45 pm
last edited by Christian Jacobi December 7, 1983 10:14 am
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