GGWindow.mesa
Copyright Ó 1985, 1986, 1987, 1991, 1992 by Xerox Corporation. All rights reserved.
Contents: Code to create a gargoyle tool. Also provides access to the state of a particular gargoyle viewer.
Last edited by Bier on June 17, 1987 9:58:15 pm PDT
Pier, November 3, 1988 5:02:44 pm PST
Bier, June 23, 1993 9:33 pm PDT
Doug Wyatt, April 16, 1992 1:25 pm PDT
DIRECTORY
Icons, Imager, Rope, GGBasicTypes, GGInterfaceTypes, GGModelTypes, ViewerClasses;
GGWindow: CEDAR DEFINITIONS = BEGIN
Point: TYPE = GGBasicTypes.Point;
Scene: TYPE = GGModelTypes.Scene;
Viewer: TYPE = ViewerClasses.Viewer;
GGData: TYPE = GGInterfaceTypes.GGData;
EditedProc: TYPE = PROC [ggData: GGData, clientData: REF ANY];
Gargoyle Viewer State
ForegroundParts: TYPE = {triggerBag, triggerBagNotSceneBag, alignBag, bitMap, none, sceneBag};
RestoreScreenAndInvariants: PROC [paintAction: ATOM, ggData: GGData, remake: ForegroundParts ¬ triggerBag, edited: BOOL ¬ TRUE, selectionChanged: BOOL ¬ FALSE, okToSkipCapture: BOOL];
This procedure is called from about 100 places in GGEventImpl*, and GGMouseEventImpl*. Some change has been made to the scene or to the alignment lines. Inform GGRefresh, GGMultiGravity, GGAlign and other interested parties.
paintAction is an ATOM which will be passed to GGRefreshImpl.ActionAreaPaint.
remake tells how much of the triggerBag => alignBag => foreground bitMap chain must be remade. A value of triggerBag means the whole chain will be remade. A value of none, means it is all OK. sceneBag is a special value which means that only the sceneTriggerBag needs to be remade. The values triggerBag and sceneBag cause the sceneBag to be rebuilt.
bkgndOK should be TRUE only of the caller has made sure the background is up to date. It is always safe (but not always efficient) to set bkgndOK to FALSE.
SaveCaretPos: PROC [ggData: GGData];
NewCaretPos: PROC [ggData: GGData];
GargoyleData Class Procedures
RegisterEditedProc: PROC [ggData: GGData, editedProc: EditedProc, clientData: REF ANY];
The caller (represented by ggData) wishes to be notified whenever his Gargoyle viewer is edited.
The Gargoyle Viewer
CreateWindow: PROC [scene: Scene, iconic: BOOL, paint: BOOL, workingDirectory: Rope.ROPE] RETURNS [ggData: GGData];
CreateChildViewer: PROC [
scene: Scene,
wx, wy: INTEGER ¬ 0,
ww, wh: INTEGER ¬ 0,
cx, cy: INTEGER ¬ 0,
cw, ch: INTEGER ¬ 0,
parent: Viewer,
workingDirectory: Rope.ROPE,
clientData: REF ANY ¬ NIL,
paint: BOOL ¬ TRUE] RETURNS [viewer: Viewer, ggData: GGData];
CreateGGData: PROC [scene: Scene, workingDirectory: Rope.ROPE] RETURNS [ggData: GGData];
For embedding Gargoyle in settings other than a ViewerClasses.Viewer.
InitIcons: PROC; -- called by UserProfileProc
GetIcons: PROC RETURNS [panelIcon, noNameIcon, dirtyNoNameIcon, cleanIcon, dirtyIcon: Icons.IconFlavor];
Cooperation with Biscrollers
ViewerToWorld: PROC [viewerPoint: Point, ggData: GGData] RETURNS [worldPoint: Point];
WorldToViewer: PROC [worldPoint: Point, ggData: GGData] RETURNS [viewerPoint: Point];
Cursors
SetCursorLooks: PROC [type: GGInterfaceTypes.GravityType, ggData: GGData, off: BOOL ¬ FALSE];
Change the appearance of the cursor on the screen. The cursor shape indicates the gravity state: off, pointsPreferred, strictDistance
END.
Pier, December 5, 1985 10:29:19 am PST
changes to: remove all references to camera. Add Viewer <=> World procs.