CDVMarksAndModes.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
by Christian Jacobi, September 7, 1984 3:31:25 pm PDT
last edited by Christian Jacobi, March 14, 1986 10:26:04 am PST
DIRECTORY
CD,
CDSequencer,
CDVPrivate,
Process,
RuntimeError,
TIPUser;
CDVMarksAndModes:
CEDAR
PROGRAM
IMPORTS CDSequencer, CDVPrivate, Process, RuntimeError, TIPUser =
BEGIN
SetXModeOn: CDVPrivate.CursorModeProc =
BEGIN
me.designRec.xMode ← TRUE
END;
SetXModeOff: CDVPrivate.CursorModeProc =
BEGIN
me.designRec.xMode ← FALSE
END;
SetMarkOnStart: CDVPrivate.CursorModeProc =
BEGIN
me.designRec.mark ← me.designRec.startLC
END;
SetMarkOnStop: CDVPrivate.CursorModeProc =
BEGIN
me.designRec.mark ← me.designRec.stopLC
END;
SetStartOnMark: CDVPrivate.CursorModeProc =
BEGIN
me.designRec.startLC ← me.designRec.startLC;
me.designRec.startLCValid ← TRUE;
END;
ShowMark: CDVPrivate.CursorModeProc =
BEGIN
--handled specially because we do not call stoptrack
comm: CDSequencer.Command =
NEW[CDSequencer.CommandRec ←
CDSequencer.CommandRec[
design: me.actualDesign,
key: $ShowMark,
pos: me.designRec.mark,
sPos: me.designRec.mark,
l: me.designRec.currentLayer,
ref: me,
n: me.defaultWidthVC,
b: me.designRec.firstHLC
]
];
TRUSTED {Process.Detach[
FORK
CDSequencer.ExecuteCommand[design: me.actualDesign, comm: comm]
]}
END;
CursoredDesignXMode:
PROC []
RETURNS [xmode:
BOOL←
FALSE] =
BEGIN
ENABLE RuntimeError.UNCAUGHT => {--not yet initialized-- GOTO skip};
IF CDVPrivate.cursoredCDViewer#
NIL
THEN
WITH CDVPrivate.cursoredCDViewer.data
SELECT
FROM
gr: CDVPrivate.VRef => xmode ← gr.designRec.xMode
ENDCASE => NULL;
EXITS skip => NULL
END;
IsXMode: PROC RETURNS [xMode: BOOL] = {xMode ← CursoredDesignXMode[]};
IsNotXMode:
PROC
RETURNS [notXMode:
BOOL] = {notXMode ← ~ CursoredDesignXMode[]};
CDVPrivate.ImplementACursor[$SetXModeOn, SetXModeOn];
CDVPrivate.ImplementACursor[$SetXModeOff, SetXModeOff];
CDVPrivate.ImplementACursor[$SetMarkOnStart, SetMarkOnStart];
CDVPrivate.ImplementACursor[$SetMarkOnStop, SetMarkOnStop];
CDVPrivate.ImplementACursor[$SetStartOnMark, SetStartOnMark];
CDVPrivate.ImplementACursor[$ShowMark, ShowMark];
TIPUser.RegisterTIPPredicate[key: $ChipndaleXMode, p: IsXMode];
TIPUser.RegisterTIPPredicate[key: $ChipndaleNXMode, p: IsNotXMode];
END.