-- TexMathOpDefs.mesa

-- last written by Doug Wyatt, November 5, 1979  3:22 AM

DIRECTORY
	TexDefs: FROM "TexDefs",
	TexFontDefs: FROM "TexFontDefs",
	TexMathDefs: FROM "TexMathDefs",
	TexNoadDefs: FROM "TexNoadDefs",
	TexNodeDefs: FROM "TexNodeDefs";

TexMathOpDefs: DEFINITIONS =
BEGIN OPEN TexDefs,TexNodeDefs,TexMathDefs;

FontSize: PROCEDURE[s: MathStyle] RETURNS[MathSize];

ScrStyle: PROCEDURE[s: MathStyle] RETURNS[MathStyle];
UndStyle: PROCEDURE[s: MathStyle] RETURNS[MathStyle];
NumStyle: PROCEDURE[s: MathStyle] RETURNS[MathStyle];
DenomStyle: PROCEDURE[s: MathStyle] RETURNS[MathStyle];

MathFontTable: PROCEDURE[s: MathSize, t: MFont]
	RETURNS[Font];

MathParType: TYPE = TexFontDefs.SyParType;

MathPar: PROCEDURE[par: MathParType, size: MathSize]
	RETURNS[Dimn];
MathFontPar: PROCEDURE[par: TexFontDefs.FontParType, size: MathSize]
	RETURNS[Dimn];
MathExPar: PROCEDURE[par: TexFontDefs.ExParType]
	RETURNS[Dimn];

BoxChar: PROCEDURE[c: MChar, style: MathStyle, corr: BOOLEAN]
	RETURNS[box: BoxNodePtr, fount: Font];

MakeCharBox: PROCEDURE[c: FChar] RETURNS[BoxNodePtr];

SingleCharBox: PROCEDURE[b: BoxNodePtr] RETURNS[CharNodePtr];

CompactBox: PROCEDURE[p: BoxNodePtr] RETURNS[NodePtr];
CompactList: PROCEDURE[NodeListPtr];

MathGlueSpec: TYPE = RECORD[x,y,z: [0..7], d: [0..177B]];

thinGlue: MathGlueSpec=[1,0,0,6];
thickGlue: MathGlueSpec=[5,5,0,18];
quadGlue: MathGlueSpec=[1,0,0,1];
opGlue: MathGlueSpec=[2,1,2,9];

MathGlue: PROCEDURE[spec: MathGlueSpec, quad: Dimn] RETURNS[GlueNodePtr];
MakeMathGlue: PROCEDURE[sp: MathSpace, size: MathSize] RETURNS[GlueNodePtr];

VarSymbol: PROCEDURE[delim: Delimiter, style: MathStyle, size: Dimn]
	RETURNS[BoxNodePtr];

FractionRule: PROCEDURE[desiredthickness: Dimn] RETURNS[NodePtr];

OverBar: PROCEDURE[p: NodePtr, desiredheight, desiredthickness, clr: Dimn]
	RETURNS[BoxNodePtr];

ReBox: PROCEDURE[p: BoxNodePtr, desiredwidth, offset: Dimn]
	RETURNS[BoxNodePtr];

CleanBox: PROCEDURE[p: BoxNodePtr] RETURNS[BoxNodePtr];

EvalMlist: PROCEDURE[p: TexNoadDefs.NoadPtr,
	style: MathStyle, penalties: BOOLEAN] RETURNS[NodePtr];

TexMathA: PROGRAM;
TexMathB: PROGRAM;

END.