ViewerPrivate.mesa
Copyright Ó 1985, 1986, 1987, 1989, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, September 29, 1989 2:36:45 pm PDT
Doug Wyatt, January 19, 1987 10:56:17 pm PST
Bier, December 1, 1988 10:51:31 pm PST
Willie-s, October 8, 1991 1:38 pm PDT
Christian Jacobi, February 20, 1992 2:36 pm PST
DIRECTORY
Imager, Menus, Process, Rope, ScreenCoordsTypes, TIPFriendsTypes, TIPTypes, ViewerClasses, ViewerScreenTypes;
ViewerPrivate: CEDAR DEFINITIONS
~ BEGIN
Viewer: TYPE ~ ViewerClasses.Viewer;
Column: TYPE ~ ViewerClasses.Column;
Menu: TYPE ~ Menus.Menu;
MouseButton: TYPE ~ ViewerClasses.MouseButton;
ROPE: TYPE ~ Rope.ROPE;
HourGlass
InitializeHourglass: PROC [ticks: CARDINAL];
TickHourglass: PROC;
EndOps
ProcessEndOpsRegistry: PROC;
IconManager
Events directed to icons are intercepted by the input focus machinery and redirected to the icon manager via the following.
IconNotify: ViewerClasses.NotifyProc;
IconModify: ViewerClasses.ModifyProc;
iconTIP: TIPTypes.TIPTable;
selectedIcon: Viewer;
IconNotifyMouse: PROC [self: Viewer, input: LIST OF REF ANY, device: REF ¬ NIL,
user: REF ¬ NIL, display: REF ¬ NIL];
MessageWindow
messageWindow: Viewer;
The system message viewer.
MenusPrivate
menuHLeading: INTEGER = 5; -- white space before first entry
menuHSpace: INTEGER = 12; -- white space between entries
MarkMenu: PROC [menu: Menu, parent: Viewer, mousePos: ScreenCoordsTypes.TIPScreenCoords];
HitMenu: PROC [menu: Menu, parent: Viewer, mousePos: ScreenCoordsTypes.TIPScreenCoords,
button: MouseButton, shift, control: BOOL ¬ FALSE];
ClearMenu: PROC [menu: Menu, parent: Viewer, paint: BOOL ¬ TRUE];
DrawMenu: PROC [menu: Menu, context: Imager.Context,
x, y: INTEGER, whatChanged: REF ANY ¬ NIL];
Document: PROC [info: REF ANY, parent: Viewer, clientData: REF ANY ¬ NIL,
mouseButton: MouseButton ¬ red, shift, control: BOOL ¬ FALSE];
WindowManagerPrivate
RootViewerTreeRep: TYPE ~ RECORD [SEQUENCE c: Column OF Viewer];
rootViewerTree: REF RootViewerTreeRep;
the current displayed tree, duplicated for each virtual desktop
VMgrPriority: Process.Priority; -- "priorityForeground" in PrincOps, "priorityUserForeground" in PCedar
ProcessWindowManagerInput: PROC [self: Viewer, input: LIST OF REF ANY,
device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL];
Replaces ViewerPrivate.ProcessWindowResults.
DrawCaptionMenu: PROC [v: Viewer, guard: BOOL];
windowMenu: Menu;
ViewerLocks
The operations below are the basic locking operations and require considerably more sophistication to use than those in the ViewerLocks interface, because of a number of special arrangements with the Cedar debugger. Please use the call-back operations in ViewerLocks unless you are a window manager wizard.
AcquireWriteLock: PROC [viewer: Viewer];
Grant write (exclusive) access to a particular viewer; also acquires a read lock for the viewer column.
ReleaseWriteLock: PROC [viewer: Viewer];
Release write access to viewer and read access to corresponding column.
AcquireWriteLocks: PROC [v0, v1, v2: Viewer ¬ NIL];
Grant write (exclusive) access to a set of viewers, sorting them in correct locking order.
ReleaseWriteLocks: PROC [v0, v1, v2: Viewer ¬ NIL];
Release write access to a set of viewers. Provided for convenience.
AcquireReadLock: PROC [viewer: Viewer];
Grant read (shared) access to a particular viewer; also acquires a read lock for the viewer column.
ReleaseReadLock: PROC [viewer: Viewer];
Release read access to viewer and read access to corresponding column.
AcquireReadLocks: PROC [v0, v1, v2: Viewer ¬ NIL];
Grant read (shared) access to a set of viewers, sorting them in correct locking order.
ReleaseReadLocks: PROC [v0, v1, v2: Viewer ¬ NIL];
Release read access to a set of viewers. Provided for convenience.
AcquireColumnWriteLock: PROC [column: Column];
Grant write (exclusive) access to a particular column. Logically equivalent to (but not implemented as) acquiring a write lock for all viewers in that column.
ReleaseColumnWriteLock: PROC [column: Column];
Release write access to column.
ColumnWedged: PROC[column: Column] RETURNS[wedged, write: BOOLEAN];
MarkColumnWedged: PROC [column: Column];
The debugger will raise the information signal AMEvents.Debugging when a process takes a breakpoint or gets and uncaught signal. Any client that locks a viewer or column must catch this signal and call MarkColumnWedged, marking the set of columns they have currently locked. Failure to do so may result in deadlock in the event that an uncaught signal or breakpoint is encountered.
MarkColumnUnWedged: PRIVATE PROC [column: Column];
The debugger will raise the information signal AMEvents.Debugged when a process is aborted from the debugger or when it has proceeded. Any client that locks a viewer or column must catch this signal and call MarkColumnUnWedged, marking the set of columns they have currently locked. Failure to do so may result in deadlock in the event that an uncaught signal or breakpoint is encountered.
LockViewerTree: PROC;
Grant write (exclusive) access to all viewers and root of viewer tree. Logically equivalent to acquiring a write lock for all columns. Note that the signal ColumnWedged may be raised when this operation is attempted, and the comments above on MarkColumnWedged and MarkColumnUnWedged apply.
ReleaseViewerTree: PROC;
Release access to viewer tree.
ViewerSpecs
SetOpenLeftWidth: PROC [leftColumnWidth: NAT, screen: Screen ¬ main];
Sets the vertical boundary between left and right columns.
SetOpenBottomY: PROC [bottomY: NAT, screen: Screen ¬ main];
Sets the bottom boundary of the left and right columns.
SetMenuHeight: PROC [height: NAT, screen: Screen ¬ main];
Sets the height of a menu line (and the caption height).
SetScrollBarWidth: PROC [width: NAT, screen: Screen ¬ main];
Sets the width of scrollbars.
SetWindowBorderSize: PROC [border: NAT, screen: Screen ¬ main];
Sets the thickness of borders.
SetScreenSize: PROC [w, h: NAT, screen: Screen ¬ main];
Sets the dimensions of the specified screen.
SetBWScreenSize: PROC [w, h: NAT];
Sets the dimensions of the black and white screen.
SetColorScreenSize: PROC [w, h: NAT];
Sets the dimensions of the color screen.
ImplErrors
Severity: TYPE ~ {fatal, severe, warning, ignorable};
Error: SIGNAL [severity: Severity ¬ fatal, msg: ROPE ¬ NIL];
UserErrorQuery: PROC RETURNS [continue: BOOL];
InputFocus
WindowManagerTIPTable: TIPTypes.TIPTable;
MasterButtonProc: TIPFriendsTypes.TIPButtonProc;
Translates user mouse actions, deciding which TIP table to translate them with. This enables viewers to capture the input focus.
MasterNotifyProc: TIPFriendsTypes.TIPNotifyProc;
Handles all actions once they have been translated by a TIP table.
CreateDebugButton: PROC [];
Let the user see the state of the world.
Painting
Screen: TYPE ~ ViewerScreenTypes.Screen;
ContextCreatorProc: TYPE ~ ViewerScreenTypes.ContextCreatorProc;
CreateContext: PROC [screen: Screen] RETURNS [Imager.Context];
Returns a Context for the given screen on the Viewers terminal
SetCreator: PROC [creator: ContextCreatorProc ¬ NIL, screen: Screen ¬ main]
RETURNS [old: ContextCreatorProc];
Forces use of contexts made with the new context creator.
GetCreatorScreen: PROC [screen: Screen] RETURNS [old: ContextCreatorProc];
Returns the current context creator that is being used for the named screen.
ViewerScreen: PROC [viewer: Viewer] RETURNS [Screen];
Which screen is the viewer currently on?
DisablePainting: PROC [wait: BOOL ¬ TRUE];
Blocks further painting attempts and returns when all is quiet.
EnablePainting: PROC;
Enables painting to begin again.
WaitForPaintingToFinish: PROC;
Returns when all is quiet.
EnableColor: PROC [bitsPerPixel: NAT] RETURNS [BOOL];
Enables the color display.
DisableColor: PROC;
Disables the color display.
EnableScreen: PROC [screen: Screen] RETURNS [ok: BOOL];
Enable the color display. Returns TRUE if the enable operation succeeded.
DisableScreen: PROC [screen: Screen];
Disable the given screen.
InvertForMenus: PROC [viewer: Viewer, x, y: INTEGER, w, h: INTEGER];
Back door for menus to invert screen areas faster than normal paint mechanism
PaintScreen: PROC [screen: Screen, action: PROC[Imager.Context],
suspendCarets: BOOL ¬ TRUE];
Call action with a context for the entire black-and-white or color screen.
PaintWindow: PROC [viewer: Viewer, action: PROC[Imager.Context]];
Call action with a context for the viewer's window area.
PaintClient: PROC [viewer: Viewer, action: PROC[Imager.Context]];
Call action with a context for the viewer's client area.
GreyScreen: PROC [screen: Screen, x, y, w, h: INTEGER];
Grey the given rectangle on the screen.
ColorScreen: PROC [screen: Screen, color: Imager.Color];
Color the entire screen with the given color.
GreyWindow: PROC [viewer: Viewer];
Grey the viewer's window area.
DoWithoutCarets: PROC [sx, sy, w, h: INTEGER, screen: Screen, action: PROC];
Calls action, ensuring that no carets are visible in the designated screen rectangle.
EmergencySaveAllEdits
CheckForEmergencySaveAllEdits: PROC [];
END.