-- GriffinFig.mesa, Cedar version
-- Last changed by Maureen Stone 9-Sep-81 17:33:10
DIRECTORY
Rope USING[Ref],
Vector USING [Vec],
Cubic USING [Bezier];
GriffinFig: DEFINITIONS = { OPEN Cubic, Vector;
-- Vector.Vec: TYPE = RECORD[x,y: REAL];
-- Cubic.Bezier: TYPE = RECORD[b0,b1,b2,b3: Vec];
-- The Bezier control points for a parametric cubic
-- x = c3.x*t↑3 + c2.x*t↑2 + c1.x*t + c0.x
-- y = c3.y*t↑3 + c2.y*t↑2 + c1.y*t + c0.y
-- b0=c0, b3=c0+c1+c2+b3
PathID: TYPE = CARDINAL;
LineStyleID: TYPE =CARDINAL ;
TextStyleID: TYPE = CARDINAL;
FillStyleID: TYPE = CARDINAL;
ColorID: TYPE = CARDINAL;
FontID: TYPE = CARDINAL;
ObjectID: TYPE = CARDINAL;
ClusterID: TYPE = CARDINAL;
StyleType: TYPE = {line,fill,text};
AnchorType: TYPE = {left,right,center};
NullStyle: CARDINAL = 0;
--files
NewFile: PROC[name: Rope.Ref];
CloseFile: PROC;
PressController: PROC[scale,trans: Vec];--object to press
DisplayController: PROC[scale,trans: Vec];--object to alto display
Comment: PROC[string: Rope.Ref];
--style information
Color: PROC[h,s,b: [0..255], texture: CARDINAL] RETURNS [ColorID];
Font: PROC[name: Rope.Ref, charOrientation: REAL] RETURNS [FontID];
LineStyle: PROC[colorID: ColorID, width: REAL] RETURNS [LineStyleID];
FillStyle: PROC[colorID: ColorID] RETURNS [FillStyleID];
TextStyle: PROC[colorID: ColorID, fontID: FontID] RETURNS [TextStyleID];
--paths
StartPath: PROC;
EnterPoint: PROC[p: Vec];
EnterCubic: PROC[c: Bezier];
NewBoundary: PROC;
EndPath: PROC RETURNS [PathID];--finishes current path
--objects
LineObject: PROC[lineStyleID: LineStyleID, pathID: PathID] RETURNS [ObjectID];
AreaObject: PROC[fillStyleID: FillStyleID, lineStyleID: LineStyleID, pathID: PathID] RETURNS [ObjectID];
TextObject: PROC[styleID: TextStyleID, text: Rope.Ref, anchorType: AnchorType, anchor: Vec, rot: REAL] RETURNS [ObjectID];
--clusters
StartCluster: PROC;
EnterObject: PROC[objectID: ObjectID];
EnterCluster: PROC[clusterID: ClusterID];
Cluster: PROC RETURNS [ClusterID];--finishes current cluster
FileNotOpen: SIGNAL;
FileNotClosed: SIGNAL[name: Rope.Ref];
NotAValidColorID: SIGNAL;
NotAValidFontID: SIGNAL;
NotAValidStyleID: SIGNAL[type: StyleType];
NotAValidObjectID: SIGNAL;
NotAValidClusterID: SIGNAL;
NotAValidPathID: SIGNAL;
NoCurrentPath: SIGNAL;
PathAlreadyStarted: SIGNAL;
NoCurrentCluster: SIGNAL;
ClusterAlreadyStarted: SIGNAL;
}.