ImagerDisplay.mesa
Michael Plass, March 14, 1984 1:06:59 pm PST
DIRECTORY Atom, ImagerBasic, ImagerManhattan, ImagerMasks, ImagerPixelMaps, ImagerPrivate;
ImagerDisplay:
CEDAR
DEFINITIONS ~
BEGIN
DeviceRectangle: TYPE ~ ImagerBasic.DeviceRectangle;
Mask: TYPE ~ ImagerMasks.Mask;
Color: TYPE ~ ImagerBasic.Color;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
ClientClipper: TYPE ~ ImagerBasic.ClientClipper;
DisplayClass: TYPE ~ REF DisplayClassRep;
DisplayClassRep:
TYPE ~
RECORD [
displayType: ATOM,
viewUnitsPerPixel:
NAT,
Multi-level antialiased displays may have a higher spatial resolution than pixel resolution. This number is of interest to window managers, since windows should fall on pixel boundaries.
Create:
PROC [displayClass: DisplayClass, creationData:
REF]
RETURNS [displayData: DisplayData],
Called when a new DisplayData instance is created.
ApplyMask:
PROC [displayData: DisplayData, color: Color, mask: Mask, sTranslate, fTranslate:
INTEGER],
The mask is given in device-spatial coordinates.
DoUnderLock:
PROC [displayData: DisplayData, action:
PROC, rectangle: DeviceRectangle]
The rectangle is given in device-spatial coordinates.
];
DisplayData: TYPE ~ REF DisplayDataRep;
DisplayDataRep:
TYPE ~
RECORD [
displayClass: DisplayClass,
Clipper info:
viewClipper: ManhattanPolygon ← NIL, -- in device-spatial coords
clientClipper: ClientClipper ← NIL, -- for noticing client clipper changes
compositeClipper: ManhattanPolygon ← NIL, -- in device-spatial coords; invalid if NIL or clientClipper#state.clipper
View-to-surface info
viewOrigin: ImagerBasic.IntPair ← [0, 0],
In surface coordinates
Device resolution info
xRes, yRes:
REAL,
in device-spatial units per inch.
Surface-to-device-spatial info
rotate: BOOLEAN ← TRUE,
surfaceWidth, surfaceHeight:
NAT,
in device-spatial units
s = IF rotate THEN surfaceHeight-y ELSE x;
f = IF rotate THEN x ELSE y;
Cached color info
cachedColor: ImagerBasic.Color ← NIL,
cachedColorData: REF,
Property list
props: Atom.PropList,
The pixels
pix: SEQUENCE numberOfSeparations: NAT OF ImagerPixelMaps.PixelMap
];
CreateImagerClass:
PROC [displayClass: DisplayClass]
RETURNS [ImagerPrivate.Class];
Creates, but does not register, a pre-initialized Imager class record. A display implementation may alter the class record (to special-case rectangles, for example) before registering it.
END.