IPEnvironmentImpl.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Doug Wyatt, August 16, 1984 2:22:52 pm PDT
DIRECTORY
IPInterpreter USING [Any, Identifier, Integer, MasterError, Vector, VectorClass, VectorClassRep, VectorRep, VectorShape];
IPEnvironmentImpl: CEDAR PROGRAM
IMPORTS IPInterpreter
EXPORTS IPInterpreter
= BEGIN OPEN IPInterpreter;
envClass: VectorClass ~ NEW[VectorClassRep ← [type: $Env,
shape: EnvShape, get: EnvGet, getProp: EnvGetProp]];
EnvShape: PROC[v: Vector] RETURNS[VectorShape] ~ {
MasterError[$undefinedOperation, "SHAPE is undefined for the external environment."];
RETURN[[0, 0]];
};
EnvGet: PROC[v: Vector, j: Integer] RETURNS[Any] ~ {
MasterError[$undefinedOperation, "GET is undefined for the external environment."];
RETURN[NIL];
};
fonts, decompressionOps, colors, colorOps, colorModelOps: Vector ← NIL;
EnvGetProp: PROC[v: Vector, propName: Any] RETURNS[value: Any, found: BOOL] ~ {
WITH propName SELECT FROM
id: Identifier => SELECT id.atom FROM
$fonts => RETURN[fonts, TRUE];
$decompressionOps => RETURN[decompressionOps, TRUE];
$colors => RETURN[colors, TRUE];
$colorOps => RETURN[colorOps, TRUE];
$colorModelOps => RETURN[colorModelOps, TRUE];
ENDCASE;
ENDCASE;
RETURN[NIL, FALSE];
};
externalEnvironment: Vector ~ NEW[VectorRep ← [class: envClass, data: NIL]];
GetExternalEnvironment: PUBLIC PROC RETURNS[Vector] ~ { RETURN[externalEnvironment] };
END.