-- File JaMDrc.mesa
-- Written by Dan Fitzpatrick and Martin Newell, August 1980
-- Last updated: August 13, 1980 1:45 PM

DIRECTORY

CIFDrcErrorDefs: FROM "CIFDrcErrorDefs" USING [ToggleConnectivity],
CIFDrcUtilsDefs: FROM "CIFDrcUtilsDefs" USING [PrintAlloc, Visible, InVisible],
CIFDrcScanDefs: FROM "CIFDrcScanDefs" USING [SetLambda],
IODefs: FROM "IODefs" USING [WriteLine],
JaMDrcDefs: FROM "JaMDrcDefs",
JaMFnsDefs: FROM "JaMFnsDefs" USING [Register, PopInteger, JaMExec];

JaMDrc: PROGRAM
IMPORTS CIFDrcErrorDefs, CIFDrcUtilsDefs, CIFDrcScanDefs, IODefs, JaMFnsDefs
EXPORTS JaMDrcDefs =

BEGIN

JaMPrintAlloc: PROCEDURE =
BEGIN
CIFDrcUtilsDefs.PrintAlloc[];
END;

JaMVisible: PROCEDURE =
BEGIN
CIFDrcUtilsDefs.Visible[];
END;

JaMInVisible: PROCEDURE =
BEGIN
i: INTEGER ← JaMFnsDefs.PopInteger[];
IF i < 0 OR 9 < i THEN IODefs.WriteLine["That stipple layer is already invisible!"]
ELSE CIFDrcUtilsDefs.InVisible[i];
END;

JaMSetLambda: PROCEDURE =
BEGIN
CIFDrcScanDefs.SetLambda[JaMFnsDefs.PopInteger[]];
END;

JaMConnect: PROCEDURE =
BEGIN
IF CIFDrcErrorDefs.ToggleConnectivity[] THEN JaMFnsDefs.JaMExec["(Connectivity On ).print"]
ELSE JaMFnsDefs.JaMExec["(Connectivity Off ).print"];
END;

JaMDrcStartUp
: PUBLIC PROCEDURE =
BEGIN
-- Dummy to start module
END;


JaMFnsDefs.Register["DrcAlloc",JaMPrintAlloc];
JaMFnsDefs.Register["visible",JaMVisible];
JaMFnsDefs.Register["invisible",JaMInVisible];
JaMFnsDefs.Register["SetLambda",JaMSetLambda];
JaMFnsDefs.Register["ToggleConnect",JaMConnect];

JaMFnsDefs.JaMExec["(DrcAlloc, SetLambda, ToggleConnect, visible and invisible loaded ).print"];

END.