ReadGriffin.mesa
Read Griffin files and convert to Tioga Artwork files
Maureen Stone December 9, 1982 4:55 pm
Rick Beach, February 29, 1984 8:45:36 pm PST
DIRECTORY
GFileFormatDefs USING [GFileFont, GFileStyle, GFileObject],
NameSymbolTable USING [Name],
PairList USING [Relation],
Real USING [RoundI],
Rope USING [ROPE],
Graphics USING [Path],
GraphicsBasic USING [Vec];
ReadGriffin:
CEDAR DEFINITIONS
IMPORTS Real = {
ROPE: TYPE = Rope.ROPE;
GriffinFileError: SIGNAL[why: ROPE];
ViewType: TYPE = {main, alternate, both};
FontRef: TYPE = REF GFileFormatDefs.GFileFont;
StyleRef: TYPE = REF GFileFormatDefs.GFileStyle;
ObjectRef: TYPE = REF GFileFormatDefs.GFileObject;
PathRef: TYPE = Graphics.Path;
CaptionRef: TYPE = REF CaptionRec;
CaptionRec:
TYPE =
RECORD [
position: GraphicsBasic.Vec,
text: ROPE];
ColorRef: TYPE = REF ColorRec;
ColorRec:
TYPE =
RECORD [
next: ColorRef,
name: ROPE,
h, s, b: REAL];
PathStyleRef: TYPE = REF PathStyleRec;
PathStyleRec:
TYPE =
RECORD [
-- empty fields are NIL or 0
next: PathStyleRef,
name: NameSymbolTable.Name,
areaColor: ColorRef,
outlineColor: ColorRef,
pathType: ROPE,
lineWeight: REAL];
CaptionStyleRef: TYPE = REF CaptionStyleRec;
CaptionStyleRec:
TYPE =
RECORD [
-- empty fields are NIL or 0
next: CaptionStyleRef,
name: NameSymbolTable.Name,
family: ROPE,
size: REAL,
face: ROPE,
charRotation: ROPE,
lineFormatting: ROPE,
textColor: ColorRef];
fontMap: PairList.Relation; -- <fontNumber, FontRef>
styleMap: PairList.Relation; -- <styleNumber, StyleRef>
objectMap: PairList.Relation; -- <objectNumber, ObjectRef>
pathMap: PairList.Relation; -- <objectNumber, PathRef>
captionMap: PairList.Relation; -- <objectNumber, CaptionRef>
clusterMap: PairList.Relation; -- <clusterNumber, objectNumber>
firstCluster, lastCluster: CARDINAL;
colors: ColorRef;
colorNumber: CARDINAL;
pathStyles: PathStyleRef;
pathStyleNumber: CARDINAL;
captionStyles: CaptionStyleRef;
captionStyleNumber: CARDINAL;
ConvertFile: PROCEDURE [fileName: ROPE, view: ViewType ← main];
FixFileName: PROCEDURE [oldname, extension: ROPE] RETURNS [newname:ROPE];
ScalePressToScreenCoord:
PROCEDURE [a:
REAL]
RETURNS [
INTEGER] =
INLINE {
RETURN[Real.RoundI[a*0.03125]]};
}.