ImagerDisplayCharactersImpl.mesa
Last Edited by: Crow, August 5, 1983 8:20 pm
DIRECTORY
Real USING [FixI, Float],
UnifiedFonts USING [FONT],
ImagerBasic USING [Pair, IntPair],
ImagerTransform USING [IntTransform, InverseIntTransform, Transform,
InverseTransform],
ImagerDisplay USING [ContextData],
Imager USING [Context];
ImagerDisplayCharactersImpl:
CEDAR PROGRAM
IMPORTS ImagerTransform, Real
EXPORTS Imager
= BEGIN
NotImplementedYet: PUBLIC SIGNAL = CODE;
Client Procedures (exported to Imager)
Affect current position.
SetCP:
PUBLIC PROC [context: Imager.Context, cp: ImagerBasic.Pair] = {
displayContext: ImagerDisplay.ContextData = NARROW[context.data];
cp ← ImagerTransform.Transform[cp, displayContext.transform];
displayContext.currentPosition ← [ Real.FixI[cp.x], Real.FixI[cp.y] ];
};
GetCP:
PUBLIC PROC [context: Imager.Context]
RETURNS [cp: ImagerBasic.Pair] = {
displayContext: ImagerDisplay.ContextData = NARROW[context.data];
cp ← [ Real.Float[displayContext.currentPosition.x],
Real.Float[displayContext.currentPosition.y] ];
cp ← ImagerTransform.InverseTransform[cp, displayContext.transform];
};
Fast Track
SetIntCP:
PUBLIC PROC [context: Imager.Context, cp: ImagerBasic.IntPair] = {
displayContext: ImagerDisplay.ContextData = NARROW[context.data];
displayContext.currentPosition ← ImagerTransform.IntTransform[
cp, displayContext.transform];
};
GetIntCP:
PUBLIC PROC [context: Imager.Context]
RETURNS [cp: ImagerBasic.IntPair] = {
displayContext: ImagerDisplay.ContextData = NARROW[context.data];
cp ← ImagerTransform.InverseIntTransform[
displayContext.currentPosition, displayContext.transform];
};
Put characters on the display
MaskChar:
PUBLIC PROC [context: Imager.Context, font: UnifiedFonts.
FONT, char:
CHAR] = {
};
MaskCharacters:
PUBLIC PROC [
context: Imager.Context,
font: UnifiedFonts.FONT,
characters: REF, -- may be a Rope.ROPE or a REF TEXT
start: INT ← 0,
length: INT ← LAST[INT]
] = {};
Uses the DeviceWidth of each character for positioning.