ViewerPrivate.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, April 21, 1985 3:48:40 pm PST
Michael Plass, June 3, 1985 9:44:19 am PDT
DIRECTORY
Imager USING [Context],
Menus USING [Menu, MouseButton],
Process USING [Priority, priorityForeground],
Rope USING [ROPE],
TIPPrivate USING [TIPClient],
TIPUser USING [TIPScreenCoords, TIPTable],
ViewerClasses USING [Column, ModifyProc, NotifyProc, Viewer];
ViewerPrivate: CEDAR DEFINITIONS
~ BEGIN
Viewer: TYPE ~ ViewerClasses.Viewer;
Column: TYPE ~ ViewerClasses.Column;
Menu: TYPE ~ Menus.Menu;
MouseButton: TYPE ~ Menus.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: TIPUser.TIPTable;
selectedIcon: Viewer;
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: TIPUser.TIPScreenCoords];
HitMenu: PROC [menu: Menu, parent: Viewer, mousePos: TIPUser.TIPScreenCoords,
button: MouseButton, shift, control: BOOLFALSE];
ClearMenu: PROC [menu: Menu, parent: Viewer, paint: BOOLTRUE];
DrawMenu: PROC [menu: Menu, context: Imager.Context,
x, y: INTEGER, whatChanged: REF ANYNIL];
Document: PROC [info: REF ANY, parent: REF ANY, clientData: REF ANYNIL,
mouseButton: MouseButton ← red, shift, control: BOOLFALSE];
WindowManagerPrivate
rootViewerTree: ARRAY Column OF Viewer;
the current displayed tree, duplicated for each virtual desktop
VMgrPriority: Process.Priority = Process.priorityForeground;
ProcessWindowResults: ViewerClasses.NotifyProc;
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 [NAT];
Sets the vertical boundary between left and right columns.
SetOpenBottomY: PROC [NAT];
Sets the bottom boundary of the left and right columns.
SetMenuHeight: PROC [NAT];
Sets the height of a menu line (and the caption height).
SetScrollBarWidth: PROC [NAT];
Sets the width of scrollbars.
SetWindowBorderSize: PROC [NAT];
Sets the thickness of borders.
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: ROPENIL];
UserErrorQuery: PROC RETURNS [continue: BOOL];
InputFocus
EnableInput: PROC;
Call at init to enable input from TIP. Type-ahead lost up to this point.
Wizards only, please.
inputEnabled: READONLY BOOL;
keyboard input enable flag
focusTIP: TIPPrivate.TIPClient;
InputFocus TIP Client.
WindowManagerTIPTable: TIPUser.TIPTable;
Painting
Screen: TYPE ~ {bw, color};
a terminal may have both black-and-white and color screens
ContextCreatorProc: TYPE ~ PROC [screen: Screen] RETURNS [Imager.Context];
CreateContext: ContextCreatorProc;
Returns a Context for the given screen on the Viewers terminal
SetCreator: PROC [creator: ContextCreatorProc ← NIL] RETURNS [old: ContextCreatorProc];
Forces use of contexts made with the new context creator.
ViewerScreen: PROC [viewer: Viewer] RETURNS [Screen]
~ INLINE { RETURN[IF viewer.column=color AND NOT viewer.iconic THEN color ELSE bw] };
Which screen is the viewer currently on?
DisablePainting: PROC [wait: BOOLTRUE];
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.
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: BOOLTRUE];
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.
GreyWindow: PROC [viewer: Viewer];
Grey the viewer's window area.
END.