DIRECTORY Menus USING [Menu], Rope USING [ROPE], TIPUser USING [TIPScreenCoords], ViewerClasses USING [Viewer, ViewerClass, ViewerFlavor, ViewerRec, Column]; ViewerOps: CEDAR DEFINITIONS SHARES ViewerClasses ~ BEGIN OPEN ViewerClasses; RegisterViewerClass: PROC [flavor: ViewerFlavor, class: ViewerClass]; FetchViewerClass: PROC [flavor: ViewerFlavor] RETURNS [ViewerClass]; CreateViewer: PROC [flavor: ViewerFlavor, info: ViewerRec _ [], paint: BOOL _ TRUE] RETURNS [new: Viewer]; OpenIcon: PROC [icon: Viewer, closeOthers: BOOL _ FALSE, bottom: BOOL _ TRUE, paint: BOOL _ TRUE]; CloseViewer: PROC [viewer: Viewer, paint: BOOL _ TRUE]; GrowViewer: PROC [viewer: Viewer, paint: BOOL _ TRUE]; TopViewer: PROC [viewer: Viewer, paint: BOOL _ TRUE]; BottomViewer: PROC [viewer: Viewer, paint: BOOL _ TRUE]; MoveAboveViewer: PROC [altered, static: Viewer, paint: BOOL _ TRUE]; MoveBelowViewer: PROC [altered, static: Viewer, paint: BOOL _ TRUE]; MoveViewer: PROC [viewer: Viewer, x, y: INTEGER, w, h: INTEGER, paint: BOOL _ TRUE]; DestroyViewer: PROC [viewer: Viewer, paint: BOOL _ TRUE]; PaintHint: TYPE = { all, client, menu, caption }; PaintViewer: PROC [viewer: Viewer, hint: PaintHint, clearClient: BOOL _ TRUE, whatChanged: REF ANY _ NIL]; NotifyViewer: PROC [viewer: Viewer, input: LIST OF REF ANY] = INLINE {IF viewer.class.notify#NIL THEN viewer.class.notify[viewer, input]}; SetViewer: PROC [viewer: Viewer, data: REF ANY, finalise: BOOL _ TRUE, op: ATOM _ NIL] = INLINE {IF viewer.class.set#NIL THEN viewer.class.set[viewer, data, finalise, op]}; GetViewer: PROC [viewer: Viewer, op: ATOM _ NIL] RETURNS [data: REF ANY] = INLINE {RETURN[IF viewer.class.get#NIL THEN viewer.class.get[viewer, op] ELSE NIL]}; SaveViewer: PROC [viewer: Viewer]; RestoreViewer: PROC [viewer: Viewer]; ReplaceViewer: PROC [new, old: Viewer]; SwapIconAndViewer: PROC [icon, openViewer: Viewer, paint: BOOL _ TRUE]; ChangeColumn: PROC [viewer: Viewer, newColumn: Column]; EnumProc: TYPE = PROC [v: Viewer] RETURNS [BOOL _ TRUE]; EnumerateViewers: PROC [enum: EnumProc]; EnumerateChildren: PROC [viewer: Viewer, enum: EnumProc]; FindViewer: PROC [name: Rope.ROPE] RETURNS [viewer: Viewer]; AddProp: PROC [viewer: Viewer, prop: ATOM, val: REF ANY]; FetchProp: PROC [viewer: Viewer, prop: ATOM] RETURNS [val: REF ANY]; UserToScreenCoords: PROC [self: Viewer, vx, vy: INTEGER _ 0] RETURNS [sx, sy: INTEGER]; MouseInViewer: PROC [tsc: TIPUser.TIPScreenCoords] RETURNS [viewer: Viewer, client: BOOL]; SetMenu: PROC [viewer: Viewer, menu: Menus.Menu _ NIL, paint: BOOL _ TRUE]; IndicateNewVersion: PRIVATE PROC [viewer: Viewer]; SetNewVersion: PROC [viewer: Viewer] ~ INLINE {IF ~(viewer.newVersion OR viewer.newFile) THEN IndicateNewVersion[viewer]}; SetNewFile: PROC [viewer: Viewer]; SetOpenHeight: PROC [viewer: Viewer, clientHeight: INTEGER]; EstablishViewerPosition: PROC [viewer: Viewer, x, y, w, h: INTEGER]; ComputeColumn: PROC [column: Column, paint: BOOL _ TRUE]; ViewerColumn: PROC [viewer: Viewer] RETURNS [column: Column] = INLINE {RETURN[IF viewer.iconic THEN static ELSE viewer.column]}; SaveAllEdits: PROC; MoveBoundary: PROC [newLeftWidth: INTEGER, newBottomY: INTEGER]; Adjust: PROC [viewer: Viewer, sticky: BOOL _ TRUE]; PaintEverything: PROC; BlinkViewer: PROC [viewer: Viewer, milliseconds: NAT _ 400]; BlinkIcon: PROC [viewer: Viewer, count: INT _ 1, secondsBetweenBlinks: NAT _ 2, millisecondsPerBlink: NAT _ 400]; BlinkDisplay: PROC; END. ˆViewerOps.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Edited by McGregor on October 22, 1982 4:18 pm Last Edited by: Maxwell, January 13, 1983 2:46 pm Doug Wyatt, April 15, 1985 0:07:18 am PST Let the Viewers package know about a new class of viewer. Class information from an existing viewer class. Create a new viewer instance. Caller may set selected fields in info. If parent # NIL then the new viewer will be recursively embedded in the parent. Do not directly set the following ViewerRec fields (they are either computed or private): cx, cy, cw, ch, visible, destroyed, unUsed, link, position, sibling, child, props Open an icon. If closeOthers then other viewers in that column will first be closed. If bottom then the newly opened icon will be placed at the bottom of the column, otherwise at the top. If paint is FALSE then the caller has the responsibility to repaint the column via ComputeColumn. Make iconic. Close all other viewers in the column. Assumes viewer is not iconic. Move viewer to top of column. Move viewer to bottom of column. Move the altered viewer above the static viewer in the column. Move the altered viewer below the static viewer in the column. Only meaningful on static or embedded viewers. Destroy viewer and subordinate children chain. an accelerator that enables repaint of selective regions of a viewer, as follows all: client & menu & caption & borders & children client: client (& children if clearClient) menu: menu portion of header (clearClient ignored) caption: caption portion of header (clearClient ignored) Suggests that the window package repaint the contents of a viewer. The whatChanged field is simply passed through to the client. Note that there is no guarantee that the client's paintProc will actually be called; the viewer could be iconic or currently invisible. Mouse and keyboard TIP notifications. Set the contents of a viewer. Get the contents of a viewer. Save viewer data to file. Restore viewer data from original file. Replace a current viewer with a new one. (This proc is intended for wizards). The old viewer is destroyed. The new one should not yet be painted. Swap positions of an icon and an open viewer. Move viewer to another column. Return false to terminate enumeration. Enumerate all top level viewers. Enumerate all children bottom up. Locate an instance of a named viewer. Associate a property with a viewer Get back a property associated with a viewer Maps viewer-relative coords to screen-relative coords. Maps screen-relative coords to viewer and viewer-relative coords. Note: modifies tsc^. Change a viewer menu. Marks a viewer as a new version of the file Marks a viewer as a new file Set a hint for the WMgr. Should be called from InitProc or when viewer is iconic, otherwise call ComputeColumn to reflect new size on the screen. Recomputes client info when changing "scrollable", menu, size, etc. This proc is intended for wizards. Recompute viewer sizes in a column. Useful after calling SetOpenHeight[] on an open viewer. Call this from the debugger if you crash and want a "poor man's" crash recovery. Calls the SaveProc of all viewers that have the newVersion bit set. Catches all signals and attempts to press on. Change the position of the vertical separator bar that controls the width of the right and left documents. This interface is intended for wizards. interactively adjust the viewer boundaries Repaint the entire screen. Blinks a viewer; the viewer remains inverted for the specified number of milliseconds. Forks a process to blink an icon count times (0 means forever). The process stops blinking if the icon is opened or selected. Blinks the black-and-white display. Κλ– "Mesa" style˜codešΟc™Kšœ Οmœ1™™>K˜—š‘œŸœ"ŸœŸœ˜DKš>™>K˜—š ‘ œŸœŸœŸœ ŸœŸœ˜TKš.™.K˜—š‘ œŸœŸœŸœ˜9Kš.™.K˜—šœ Ÿœ"˜1šP™PKš1™1Kš*™*Kš2™2Kš8™8—K™—š‘ œŸœ1ŸœŸœŸœŸœŸœ˜kKšŠ™ŠK˜—š ‘ œŸœŸœŸœŸœŸœŸ˜DKšœŸœŸœŸœ%˜EKš%™%K˜—š‘ œŸœŸœŸœ ŸœŸœŸœŸœ˜XKšŸœŸœŸœŸœ/˜SKš™K˜—š‘ œŸœŸœŸœŸœŸœŸœŸ˜QKš œŸœŸœŸœŸœŸœŸœ˜MKš™K˜—š‘ œŸœ˜"Kš™K˜—š‘ œŸœ˜%Kš'™'K˜—š‘ œŸœ˜'Kš”™”K˜—š‘œŸœ#ŸœŸœ˜GKš-™-K˜—š‘ œŸœ%˜7Kš™K˜—š œ ŸœŸœ ŸœŸœŸœ˜8Kš&™&K˜—š‘œŸœ˜(Kš ™ K˜—š‘œŸœ"˜9Kš!™!K˜—š‘ œŸœ ŸœŸœ˜