ViewersWorld.mesa
Copyright Ó 1988, 1991, 1992 by Xerox Corporation. All rights reserved.
Bier, August 13, 1990 3:50 pm PDT
Willie-s, October 29, 1991 4:07 pm PST
Christian Jacobi, March 4, 1992 5:01 pm PST
Michael Plass, February 25, 1992 1:35 pm PST
A big switch which allows separate implementation of viewer worlds.
DIRECTORY
CursorTypes, Imager, Rope, UserInput, ViewersWorldRefType;
ViewersWorld: CEDAR DEFINITIONS =
BEGIN
CursorArray: TYPE = CursorTypes.CursorArray;
Cursor32ArrayRef: TYPE ~ CursorTypes.Cursor32ArrayRef;
Ref: TYPE = ViewersWorldRefType.Ref;
Input
GetInputHandle: PROC [viewersWorld: Ref] RETURNS [handle: UserInput.Handle];
RestartInput:
PROC [viewersWorld: Ref];
The process that takes actions from the input queue has died. Create a new one.
Cursors
SetCursorPattern:
PROC [viewersWorld: Ref, deltaX, deltaY:
INTEGER, cursorPattern: CursorArray, patternName:
ATOM ¬ $Unnamed, cursor:
REF ¬
NIL];
"cursor" will be a description of which cursor's pattern to change. If cursor = NIL, the default mouse cursor is intended. [deltaX, deltaY] is the vector displacement of the lower left hand corner to the pattern from the true mouse position. Usually, these numbers will be zero or negative (see global.info in CursorsImpl.SetCursor for examples). patternName is a hint to the class implementor. It should either be $Unnamed, or it should be a distinct name for each distinct pattern -- this allows the server to tell that it has seen this pattern before without actually looking at the bits.
GetCursorPattern:
PROC [viewersWorld: Ref, cursor:
REF ¬
NIL]
RETURNS [deltaX, deltaY:
INTEGER, cursorPattern: CursorArray, patternName:
ATOM];
"cursor" will be a description of which cursor's pattern to get. If cursor = NIL, the default mouse cursor is intended. [deltaX, deltaY] is the vector displacement of the lower left hand corner to the pattern from the true mouse position. Usually, these numbers will be zero or negative (see global.info in CursorsImpl.SetCursor for examples). patternName should be the same name provided to the SetCursorPatternProc or $Unnamed if the pattern did not originate from a ViewersWorld (or if the name has been forgotten).
SetBigCursorPattern:
PROC [viewersWorld: Ref, deltaX, deltaY:
INTEGER, cursorPattern: Cursor32ArrayRef, patternName:
ATOM ¬ $Unnamed, cursor:
REF ¬
NIL];
Like SetCursorPattern but sets a 32 by 32 bit cursor.
GetBigCursorPattern:
PROC [viewersWorld: Ref, cursor:
REF ¬
NIL]
RETURNS [deltaX, deltaY:
INTEGER, cursorPattern: Cursor32ArrayRef, patternName:
ATOM];
Like GetCursorPattern but gets a 32 by 32 bit cursor.
IsBigCursorPattern:
PROC [viewersWorld: Ref, cursor:
REF ¬
NIL]
RETURNS [
BOOL];
Returns TRUE if cursor is currently a 32 by 32 bit (instead of 16 by 16 bit) pattern.
BigCursorsSupported:
PROC [viewersWorld: Ref]
RETURNS [
BOOL];
Returns TRUE is 32 by 32 bit cursors are supported by viewersWorld's class.
SetCursorColor:
PROC [viewersWorld: Ref, color: Imager.Color, cursor:
REF ¬
NIL];
The 1-bits of the cursor will take on the new color. The 0-bits are transparent. For now, color should be a constant color. "cursor" describes which cursor to recolor. If cursor = NIL, the default mouse cursor is intended.
GetCursorColor:
PROC [viewersWorld: Ref, cursor:
REF ¬
NIL]
RETURNS [color: Imager.Color];
"cursor" describes which cursor's color to return. If cursor = NIL, the default mouse cursor is intended.
SetMousePosition:
PROC [viewersWorld: Ref, x, y:
INTEGER, display:
REF ¬
NIL, device:
REF ¬
NIL];
Changes the hardware interpretation of the given device's position. "display" describes which display it is on. The pointing device may be a mouse, a pen, or something else. If device = NIL, the default mouse is intended.
GetMousePosition:
PROC [viewersWorld: Ref, device:
REF ¬
NIL]
RETURNS [x, y:
INTEGER, display:
REF ¬
NIL];
Returns the screen and coordinates on that screen of the given pointing device. "device" describes which pointing device's position to return. In fact, the pointing device may be a mouse, a pen, or something else. If device = NIL, the default mouse cursor is intended.
SetCutBuffer: PROC [viewersWorld: Ref, buffer: ATOM, data: Rope.ROPE];
GetCutBuffer: PROC [viewersWorld: Ref, buffer: ATOM] RETURNS [data: Rope.ROPE];
BlinkViewersWorld:
PROC [viewersWorld: Ref, display:
REF ¬
NIL, frequency:
CARDINAL ¬ 750, duration:
CARDINAL ¬ 500];
Get user's attention. Might flash "screen" or beep. If the beep technique is used, frequency (in Hz.) and duration (in milliseconds) are proposed. If no feedback is available, does nothing.
SetSize:
PROC [viewersWorld: Ref, width, height:
NAT, display:
REF ¬
NIL];
Informs ViewersWorld that it should take up the given amount of space on the named screen.
GetSize:
PROC [viewersWorld: Ref, display:
REF ¬
NIL]
RETURNS [width, height:
NAT];
Gets the values previously set by SetSize.
GetDeviceSize:
PROC [viewersWorld: Ref, display:
REF ¬
NIL]
RETURNS [w, h:
NAT];
Gets from the ViewersWorld class the width and height of the named screen. Screens are refered to by number. The main screen is screen 0.
I don't know the difference between GetSize and GetDeviceSize. Ch.J.
GetWorldProp: PROC [viewersWorld: Ref, prop: REF] RETURNS [val: REF];
PutWorldProp: PROC [viewersWorld: Ref, prop: REF, val: REF];
RemWorldProp: PROC [viewersWorld: Ref, prop: REF];
Color map stuff
RevokeColorMapIndexProc:
TYPE =
PROC [viewersWorld: Ref, index:
CARDINAL, clientData:
REF];
Called by the screen server when it can no longer guarantee that this color map index won't be mapped by other applications. clientData is the same value that was passed as clientData to AllocateColorMapIndex.
outOfColormapEntries:
ERROR;
raised by AllocateColorMapIndex
AllocateColorMapIndex:
PROC [viewersWorld: Ref, display:
REF ¬
NIL, revokeIndex: RevokeColorMapIndexProc, clientData:
REF ¬
NIL]
RETURNS [index:
CARDINAL];
Returns a colormap index (e.g. a number from 0 to 255 for 8-bit color maps) that the ViewersWorld can use to do color map animation. Any object drawn by placing this index in the frame buffer can be color changed by modifying the color map for that index. This index can be revoked by class implementor (e.g., if an X window is moved to a different display with a different color map). If this occurs, RevokeColorMapIndex will be called.
FreeColorMapIndex:
PROC [viewersWorld: Ref, index:
CARDINAL, display:
REF ¬
NIL];
Gives up the right to draw objects with this index. It can then be allocated to other applications.
SetColorMapEntry:
PROC [viewersWorld: Ref, index:
CARDINAL, display:
REF ¬
NIL, red, green, blue:
INTEGER];
red, green, blue should be between 0 and 255. They should not be gamma-corrected.
GetColorMapEntry:
PROC [viewersWorld: Ref, index:
CARDINAL, display:
REF ¬
NIL]
RETURNS [red, green, blue:
INTEGER];
red, green, blue should be between 0 and 255. They should not be gamma-corrected.
END.