CDSetupPD.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Last Edited by: Ch. Jacobi, May 11, 1984 9:57:55 pm PDT
Last Edited by: Ch. Jacobi, January 18, 1985 12:58:20 pm PST
DIRECTORY
CDProperties, CD, Rope, CDValue;
CDSetupPD: CEDAR PROGRAM
IMPORTS CDProperties, CD, CDValue =
BEGIN
Stipple4: TYPE = ARRAY [0..4) OF [0..16);
Stipple8: TYPE = ARRAY [0..8) OF [0..256);
currentTech: CD.Technology←NIL;
cLev: CD.Layer ← CD.combined;
blackX: REF  ← $CDxVersatecBlack;
cyanX: REF  ← $CDxVersatecCyan;
yellowX: REF ← $CDxVersatecYellow;
magentaX: REF ← $CDxVersatecMagenta;
Technology: PROC[tech: ATOM] =
BEGIN
IF currentTech#NIL THEN ERROR;
currentTech ← CD.FetchTechnology[tech];
END;
Keys: PROC[device, b, c, m, y: ATOM, text: Rope.ROPENIL] =
BEGIN
blackX ← b;
cyanX ← c;
yellowX ← y;
magentaX ← m;
CDValue.Store[currentTech, device, text];
CDProperties.PutPropOnAtom[device, $CDxColorPDPlotBlack, blackX];
CDProperties.PutPropOnAtom[device, $CDxColorPDPlotCyan, cyanX];
CDProperties.PutPropOnAtom[device, $CDxColorPDPlotYellow, yellowX];
CDProperties.PutPropOnAtom[device, $CDxColorPDPlotMagenta, magentaX];
CDProperties.PutPropOnAtom[device, $CDxLastTechnology, currentTech.key];
FOR l: CD.Layer IN CD.Layer DO
Forgett[l]
ENDLOOP;
END;
End: PROC [] =
BEGIN
currentTech ← NIL
END;
LayerModify: PROC[uniqueKey: ATOM] =
BEGIN
cLev ← CD.FetchLayer[t: currentTech, uniqueKey: uniqueKey];
END;
Layer: PROC[uniqueKey: ATOM] =
BEGIN
cLev ← CD.FetchLayer[t: currentTech, uniqueKey: uniqueKey];
Forgett[cLev]
END;
LayerNumber: PROC [lev: NAT] =
BEGIN
cLev ← lev;
Forgett[cLev]
END;
LayerNumberModify: PROC [lev: NAT] =
BEGIN
cLev ← lev
END;
Black8: PROC [stipple: Stipple8] =
BEGIN
IF blackX#NIL THEN
CDProperties.PutPropOnLayer[onto: cLev, prop: blackX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple8 ← stipple]
]
END;
Black4: PROC [stipple: Stipple4] =
BEGIN
IF blackX#NIL THEN
CDProperties.PutPropOnLayer[onto: cLev, prop: blackX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple4 ← stipple]
]
END;
Cyan8: PROC [stipple: Stipple8] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: cyanX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple8 ← stipple]
]
END;
Cyan4: PROC [stipple: Stipple4] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: cyanX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple4 ← stipple]
]
END;
Magenta8: PROC [stipple: Stipple8] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: magentaX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple8 ← stipple]
]
END;
Magenta4: PROC [stipple: Stipple4] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: magentaX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple4 ← stipple]
]
END;
Yellow8: PROC [stipple: Stipple8] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: yellowX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple8 ← stipple]
]
END;
Yellow4: PROC [stipple: Stipple4] =
BEGIN
CDProperties.PutPropOnLayer[onto: cLev, prop: yellowX,
val: IF stipple=ALL[0] THEN NIL ELSE NEW[Stipple4 ← stipple]
]
END;
Forgett: PROC [lev: NAT] =
BEGIN
IF blackX#NIL THEN CDProperties.PutPropOnLayer[onto: lev, prop: blackX, val: NIL];
IF cyanX#NIL THEN CDProperties.PutPropOnLayer[onto: lev, prop: cyanX, val: NIL];
IF magentaX#NIL THEN CDProperties.PutPropOnLayer[onto: lev, prop: magentaX, val: NIL];
IF yellowX#NIL THEN CDProperties.PutPropOnLayer[onto: lev, prop: yellowX, val: NIL];
END;
END.