CDEnvironment.mesa (part of ChipNDale)
Copyright © 1983, 1984 by Xerox Corporation. All rights reserved.
by Christian Jacobi, August 11, 1983 11:32 am
Last Edited by: Christian Jacobi, August 4, 1986 7:38:12 pm PDT
DIRECTORY
CD USING [Technology],
Icons USING [IconFlavor],
Rope USING [ROPE],
TIPUser USING [TIPTable];
CDEnvironment: CEDAR DEFINITIONS =
BEGIN
Implementation of Cedar user interface features
-- Tip tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetTipTable:
PROC [for:
REF, tipTable: Rope.
ROPE←NIL];
--verbose on TerminalIO
--for: Design, Technology or global
--tipTable: NIL for standard lookup (user profile)
GetTipTable:
PROC [for:
REF]
RETURNS [TIPUser.TIPTable];
--for: Design, Technology or global
-- Icons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetIcon:
PROC [for:
REF, file: Rope.
ROPE, n:
NAT];
--for: Design, Technology or global
--only new viewers might get the new icon
GetIcon:
PROC [for:
REF]
RETURNS [Icons.IconFlavor];
--for: Design, Technology or global
SetPanelIcon:
PROC [for:
REF, file: Rope.
ROPE, n:
NAT];
--for: Design, Technology or global
--only new viewers might get the new icon
GetPanelIcon:
PROC [for:
REF]
RETURNS [Icons.IconFlavor];
--for: Design, Technology or global
-- Working Directories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetWorkingDirectory:
PROC [for:
REF, wDir: Rope.
ROPE←
NIL];
--Sets the working directory of ChipNDale feature (not process)
--for: Design, Technology, NIL for ChipNDale itself (dangerous)
--wDir: if NIL: takes wDir from profile or process
GetWorkingDirectory:
PROC [for:
REF←
NIL]
RETURNS [wDir: Rope.
ROPE];
--Gets the working directory for a ChipNDale feature (not process)
--design: Design, Technology or ChipNDale's global directory
DoWithWDir:
PROC [wDir: Rope.
ROPE, proc:
PROC];
--executes proc with wDir as current working directory for process
-- Names ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MakeName:
PROC [base: Rope.
ROPE, ext: Rope.
ROPE←
NIL, wDir: Rope.
ROPE←
NIL, modifier: Rope.
ROPE←
NIL]
RETURNS [Rope.
ROPE];
--makes a full path filename: adds extension ext if base does not have an extension;
--adds working directory wDir if base is not a full path name
--adds modifier if not NIL
-- Loader ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SplitLine:
PROC [line: Rope.
ROPE]
RETURNS [key, rest: Rope.
ROPE←
NIL];
--splits a line into a keyword and the rest
--returns
-- key: keyword at beginning of line;
-- (leading spaces and trailing separator [space or colon] removed)
-- rest: rest of line (after separator)
-- (leading spaces removed)
FetchKeyLine:
PROC [fileName: Rope.
ROPE, key: Rope.
ROPE]
RETURNS [entry: Rope.
ROPE];
--Searches for a line starting with key in file
--Returns the rest of the line found or NIL if not found
StuffToCommandTool:
PROC [r: Rope.
ROPE, wDir: Rope.
ROPE←
NIL, searchPath:
LIST
OF Rope.
ROPE←
NIL]
RETURNS [result:
REF←
NIL];
--Executes r with a commandtool
ExecFileEntry:
PROC [key: Rope.
ROPE, technology:
CD.Technology←
NIL, modifier: Rope.
ROPE←
NIL];
--checks whether a particular key is mentioned in a .CDLoadList file
--if particular key is found, executes the rest of the line with a command tool
--technology and modifier are used to make the name of the used .CDLoadList file
--(using modifier .CDLoadList files for particular feature classes can be distinguished)
--building of name for the .CDLoadList files:
-- ChipNDale-CD.CDLoadList if {technology=NIL, modifier=NIL}
-- ChipNDale-CD-modifier.CDLoadList if {technology=NIL, modifier#NIL}
-- ChipNDale-technologyName.CDLoadList if {technology#NIL, modifier=NIL}
-- ChipNDale-technologyName-modifier.CDLoadList if {technology#NIL, modifier#NIL}
LoadTechnology:
PROC [key:
ATOM, name: Rope.
ROPE]
RETURNS [
CD.Technology];
--makes all the necessary messages if not loaded
END.