Scheme>SchemeEditing.Mesa
Last Edited by: Spreitzer, February 12, 1984 10:19 pm
DIRECTORY BiScrollers, OrderedSymbolTableRef, SchemeRep, ViewerClasses, ViewRec;
SchemeEditing: CEDAR DEFINITIONS =
BEGIN OPEN SchemeRep;
Viewer: TYPE = ViewerClasses.Viewer;
RecordViewer: TYPE = ViewRec.RecordViewer;
BiScroller: TYPE = BiScrollers.BiScroller;
Session:
TYPE =
REF SessionRep; SessionRep:
TYPE =
RECORD [
name: ROPE,
typesMenu: Viewer,
ctlRV: RecordViewer,
ctlPanel: CtlPanel,
editors: LIST OF Editor ← NIL,
mostRecentEditor: Editor ← NIL,
typesTable: Table,
picsTable: Table
];
Editor:
TYPE =
REF EditorRep; EditorRep:
TYPE =
RECORD [
session: Session,
bs: BiScroller,
v: Viewer,
subjectPic: PictureDef,
subjectCell: CellType,
subjectClass: SubjectClass,
oldHor: BOOLEAN ← TRUE,
primary, secondary: PointBack,
moveSubject: Vertex ← [NIL, NIL],
strandGoal: Point ← NIL];
SubjectClass: TYPE = {icon, expansion};
PointBack:
TYPE =
REF PointBackRep; PointBackRep:
TYPE =
RECORD [
x, y: REAL ← 0,
sx, sy: REAL ← 1,
primary: BOOLEAN,
cx, cy: Coord ← NIL,
point: Point ← NIL];
CtlPanel:
TYPE =
REF CtlPanelRep; CtlPanelRep:
TYPE =
RECORD [
Clear: PROC [session: Session],
ReadFile: PROC [session: Session, file: ROPE, additively: BOOLEAN ← TRUE],
WriteFile: PROC [session: Session, file: ROPE],
CreateCellType: PROC [session: Session, name: ROPE],
CreateIcon: PROC [session: Session, cellTypeName, iconName: ROPE],
EditType: PROC [session: Session, cellTypeName, iconName: ROPE, part: SubjectClass],
Export: PROC [session: Session, export: BOOLEAN],
action: Action ← create,
iconAction: IconWhat ← line,
expansionAction: ExpansionAction ← strand,
cellType, icon, name: ROPE ← NIL];
Action: TYPE = {create, delete};
IconWhat: TYPE = {line, text, instance};
ExpansionAction: TYPE = {component, port, strand};
editorClasses: ARRAY SubjectClass OF BiScrollers.BiScrollerClass;
axisNames: ARRAY Axis OF ROPE;
CompareNames: OrderedSymbolTableRef.CompareProc;
Filter: PROC [list: LORA, elt: REF ANY] RETURNS [filtered: LORA];
Complain: PROC [editor: Editor, complaint: ROPE];
DestroyEditor: ViewerClasses.DestroyProc;
Picture Create Procs:
NewPicture: PROC [session: Session, name: ROPE] RETURNS [pic: PictureDef];
NewCoord: PROC [axis: Axis, at: REAL, pic: PictureDef, parent: REF ANY ← NIL, name: ROPE ← NIL] RETURNS [new: Coord];
EntableCoord: PROC [table: Table, coord: Coord];
Scavengeable: PROC [coord: Coord] RETURNS [s: BOOLEAN];
DeleteCoord: PROC [coord: Coord];
MakePoint: PROC [pic: PictureDef, vertex: Vertex, name: ROPE ← NIL] RETURNS [point: Point];
NewPoint: PROC [pic: PictureDef, name: ROPE, vertex: Vertex] RETURNS [point: Point];
DeletePoint: PROC [from: PictureDef, point: Point];
NewLine: PROC [pic: PictureDef, a, b: Point] RETURNS [line: Line];
DeleteLine: PROC [pic: PictureDef, a, b: Point, line: Line ← NIL];
NewText: PROC [pic: PictureDef, p: Point, rope: ROPE];
DeleteText: PROC [pic: PictureDef, at: Point, text: Text ← NIL];
NewInstance: PROC [pic: PictureDef, p: Point, className, iconName: ROPE];
CreateInstance: PROC [in, of: PictureDef, org: Point] RETURNS [pi: PictureInstance];
DeleteInstance: PROC [pic: PictureDef, at: Point, pi: PictureInstance ← NIL];
EnsureCoord: PROC [pic: PictureDef, name: ROPE] RETURNS [coord: Coord];
EnsurePictureInstance: PROC [pic: PictureDef, name: ROPE] RETURNS [pi: PictureInstance];
PIPointName: PROC [piName, pointName: ROPE] RETURNS [piPointName: ROPE];
NewName: PROC [for: Table] RETURNS [name: ROPE];
Cell Create Procs:
NewCellType: PROC [session: Session, name: ROPE, skeletal: BOOLEAN] RETURNS [cellType: CellType];
CreatePort: PROC [cellType: CellType, name: ROPE, point: Point] RETURNS [port: Port];
CreateComponent: PROC [in, of: CellType, name: ROPE, inst: PictureInstance] RETURNS [comp: Component];
File IO & Such:
Clear: PROC [session: Session];
ReadFile: PROC [session: Session, file: ROPE, additively: BOOLEAN ← TRUE];
WriteFile: PROC [session: Session, file: ROPE];
Cell Operations:
CreateCellType: PROC [session: Session, name: ROPE];
CreateIcon: PROC [session: Session, cellTypeName, iconName: ROPE];
EditType: PROC [session: Session, cellTypeName, iconName: ROPE, part: SubjectClass];
NewComponent: PROC [editor: Editor];
NewPort: PROC [editor: Editor];
NewStrand: PROC [editor: Editor, final: BOOLEAN];
DeleteComponent: PROC [editor: Editor];
DeletePort: PROC [editor: Editor];
DeleteStrand: PROC [editor: Editor];
BreakWire: PROC [editor: Editor, input: LORA] RETURNS [output: LORA];
JoinWire: PROC [editor: Editor, input: LORA] RETURNS [output: LORA];
Picture Operations:
FindPI: PROC [at: Point] RETURNS [pi: PictureInstance];
FindLine: PROC [a, b: Point] RETURNS [line: Line];
NotifyCoord: PROC [coord: Coord, editor: Editor];
NotifyLabels: PROC [labels: LORA, editor: Editor];
SetBackToPoint: PROC [editor: Editor, pb: PointBack, p: Point];
END.