IPEnvironmentImpl.mesa
Last edited by:
Doug Wyatt, February 25, 1984 8:06:15 pm PST
DIRECTORY
IP USING [Any, Identifier, Integer, MasterError, Vector, VectorRep, VectorShape];
IPEnvironmentImpl: CEDAR PROGRAM
IMPORTS IP
EXPORTS IP
= BEGIN OPEN IP;
EnvShape: PROC[data: REF] RETURNS[VectorShape] ~ {
MasterError[$undefinedOperation, "SHAPE is undefined for the external environment."];
RETURN[[0, 0]];
};
EnvGet: PROC[data: REF, j: Integer] RETURNS[Any] ~ {
MasterError[$undefinedOperation, "GET is undefined for the external environment."];
RETURN[NIL];
};
fonts, decompressionOps, colors, colorOps, colorModelOps: Vector ← NIL;
EnvGetProp: PROC[data: REF, propName: Any] RETURNS[value: Any, found: BOOL] ~ {
WITH propName SELECT FROM
id: Identifier => SELECT id 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: $ExternalEnvironment,
shape: EnvShape, get: EnvGet, getProp: EnvGetProp, data: NIL]];
GetExternalEnvironment: PUBLIC PROC RETURNS[Vector] ~ { RETURN[externalEnvironment] };
END.