DIRECTORY GGCoreTypes, GGInterfaceTypes, GGModelTypes, GGSegmentTypes, Imager; GGRefresh: CEDAR DEFINITIONS = BEGIN BoundBox: TYPE = GGModelTypes.BoundBox; FeatureData: TYPE = GGInterfaceTypes.FeatureData; GGData: TYPE = GGInterfaceTypes.GGData; Sandwich: TYPE = REF SandwichObj; SandwichObj: TYPE; -- opaque so GGRefresh doesn't depend on BufferedRefresh SelectionClass: TYPE = GGSegmentTypes.SelectionClass; Slice: TYPE = GGModelTypes.Slice; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; PaintProc: TYPE = PROC [ggData: GGData, request: REF _ NIL, bounds: BoundBox, clientData: REF _ NIL]; DisableRefresh: PROC [ggData: GGData]; EnableRefresh: PROC [ggData: GGData]; CreateSandwich: PROC [] RETURNS [sandwich: Sandwich]; SetScreen: PROC [ggData: GGData, cw, ch: INTEGER, screen: Imager.Context]; ActionAreaPaint: PROC [screen: Imager.Context, whatHasChanged: ATOM, ggData: GGData, handleViewerAbort: BOOL]; RepaintArea: PROC [screen: Imager.Context, ggData: GGData, whatHasChanged: ATOM, bounds: BoundBox]; SetStartBox: PROC [ggData: GGData, dragInProgress: BOOL, caret, anchor, selectedParts, movingParts, selectedCPs, hotCPs, attractor, alignments: BOOL _ FALSE]; EnlargeStartBox: PROC [ggData: GGData, by, andBy: BoundBox]; NullStartBox: PROC [ggData: GGData]; GetABox: PROC [ggData: GGData, dragInProgress: BOOL, caret, anchor, selectedParts, movingParts, selectedCPs, hotCPs, attractor, alignments: BOOL _ FALSE, into: BoundBox] RETURNS [box: BoundBox]; GetPaintBox: PROC [ggData: GGData, paintAction: ATOM, into: BoundBox]; PaintInParent: PROC [ggData: GGData, paintAction: ATOM]; RegisterPaintProc: PROC [ggData: GGData, paintProc: PaintProc, clientData: REF _ NIL]; MoveToOverlay: PROC [sliceD: SliceDescriptor, ggData: GGData]; MoveToBackground: PROC [sliceD: SliceDescriptor, ggData: GGData]; MoveAllSelectedToOverlay: PROC [ggData: GGData, selectClass: SelectionClass]; MoveOverlayToBackground: PROC [ggData: GGData]; EmptyOverlay: PROC [ggData: GGData] RETURNS [BOOL]; RepairBackgroundInBoundBox: PROC [ggData: GGData, bBox: BoundBox, eraseFirst: BOOL _ TRUE, overObject: Slice _ NIL]; InvalidateBackground: PROC [ggData: GGData]; NoteNewForeground: PROC [ggData: GGData, alignObjects: LIST OF FeatureData]; UpdateForeground: PROC [ggData: GGData, eraseFirst: BOOL _ FALSE]; InvalidateForeground: PROC [ggData: GGData]; SaveForeground: PROC [ggData: GGData]; RestoreForeground: PROC [ggData: GGData]; PaintEntireScene: PROC [screen: Imager.Context, ggData: GGData, buffer: BOOL _ TRUE]; InterpressEntireScene: PROC [dc: Imager.Context, ggData: GGData]; SnapShot: PROC [dc: Imager.Context, ggData: GGData]; END. ζGGRefresh.mesa Copyright Σ 1988 by Xerox Corporation. All rights reserved. Contents: All painting actions in Gargoyle are called thru this interface. Pier, April 14, 1992 4:15 pm PDT Bier, March 19, 1992 12:12 pm PST Doug Wyatt, June 24, 1988 6:01:58 pm PDT Turning Refresh on and off Temporarily disable refresh. Reenable refresh and update those screen areas that have changed since DisableRefresh was called. Building and Updating the Sandwich Build a data structure representing all of the layers used to compose each frame Establish a new screen area. Drawing the Latest Frame whatHasChanged is an atom describing what needs to be repainted ($PaintEntireScene, $SelectionChanged, $FinishedDragging, $CaretMoved, ...). A pointer to the particular object to be repainted will be stored in ggData for now. We envision a scheme where ActionAreaPaint may actually queue up painting jobs and attempt optimizations on the queue. If handleViewerAbort is TRUE, this procedure enables and handles viewer aborts during painting; otherwise, it just paints (presumably SlackProcess will handle the aborts). Like GGRefresh.ActionAreaPaint, but paints all of the area described by bounds, even if some of this area doesn't need to be painted. If bounds.infinite, repaint the whole action area. If bounds.null then repaint just what needs to be repainted. We are beginning an operation that will require refreshing. Be sure to update the screen region inside "box". This call is a prerequisite to GGWindow.RestoreScreenAndInvariants for many operations. Modifies the box set in SetStartBox. Sets the start box to the empty box. if into is NIL, new box is returned ELSE into is filled in and also returned as box Computes a paint bounding box based on the paintAction, places the result in into^. Called by GGWindowImpl.RestoreScreenAndInvariants whenever scene update should be done. Computes a bounding box and then requests the parent to paint it. Associate the given PaintProc and clientData with this GGData. This routine will be called by GGWindow.RestoreScreenAndInvariants The PaintProc will have to call these routines in MMM: ParentPaintRequestProc: TYPE = PROC [parent: Editor, child: Editor, request: REF _ NIL, bounds: BoundRect _ BoxTypes.infiniteRect]; ParentPaintNotifyProc: TYPE = PROC [parent: Editor, requestor: Editor]; For example: paintRequest _ NEW[PaintRequestObj _ [$PaintScene, self, NIL, noAction, otherLocn]]; MMMProtocol.ParentPaintRequest[self.parent, self, paintRequest, Boxes.Intersection[userStatePrivate.dragBounds, self.bounds]]; where MMMProtocol.ParentPaintRequest calls parent.class.paintNotify after putting the request in child.paintRequests. The PaintProc will have to call this routine in Gargoyle: ViewerOps.PaintViewer[ viewer: ggData.controls.actionArea, hint: client, whatChanged: ggData, clearClient: FALSE]; Moving Objects Between Planes During Dragging This entity is now on the overlay plane (for dragging or rubberbanding). If a Traj or Sequence is passed, the whole outline to which they belong will be moved. This entity is now on the background (normal plane), staying put. Updating the Background (stationary objects) Updating the Foreground (alignment objects) Remake the foreground bitmap, but don't draw it onto the screen. Drawing Entities If buffer is FALSE, the scene parts will be drawn on the screen, one by one in back to front order. Otherwise, they are drawn all at once. Like InterpressEntireScene except it only works while a mouse action is in progress. For action shots. Κ1˜code™K™™>——Lšœu™u—™9šœH™HMšœ"žœ™)——J™J™-š œžœ+˜>Jšœ ™ —šœžœ+˜AJšœA™A—Jšœžœ/˜MJšœžœ˜/Jš œžœžœžœ˜3K˜K™,Kš œžœ/žœžœžœ˜uKšœžœ˜,J˜K™+Kšœžœ žœžœ˜Lšœžœžœžœ˜BJ™@—Kšœžœ˜,Kšœžœ˜&Kšœžœ˜)J˜K™šœžœ2žœžœ˜UJšœ‹™‹—JšΠbnœžœ&˜Ašœžœ&˜4K™g—J˜Jšžœ˜—…— Vm