CDVMarksAndModes.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, September 7, 1984 3:31:25 pm PDT
Last edited by: Christian Jacobi, October 22, 1986 11:05:11 am PDT
DIRECTORY
CD,
CDSequencer,
CDVPrivate,
Process,
RuntimeError,
TIPUser;
CDVMarksAndModes: CEDAR PROGRAM
IMPORTS CDSequencer, CDVPrivate, Process, RuntimeError, TIPUser =
BEGIN
SetXModeOn: CDVPrivate.CursorModeProc = {
me.designRec.xMode ← TRUE
};
SetXModeOff: CDVPrivate.CursorModeProc = {
me.designRec.xMode ← FALSE
};
SetMarkOnStart: CDVPrivate.CursorModeProc = {
me.designRec.mark ← me.designRec.startLC
};
SetMarkOnStop: CDVPrivate.CursorModeProc = {
me.designRec.mark ← me.designRec.stopLC
};
SetStartOnMark: CDVPrivate.CursorModeProc = {
me.designRec.startLC ← me.designRec.startLC;
me.designRec.startLCValid ← TRUE;
};
ShowMark: CDVPrivate.CursorModeProc = {
--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]
]}
};
CursoredDesignXMode: PROC [] RETURNS [xmode: BOOLFALSE] = {
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
};
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.