DIRECTORY Imager, ImagerBackdoor; BufferedRefresh: CEDAR DEFINITIONS = BEGIN Rectangle: TYPE = Imager.Rectangle; RefreshProc: TYPE = PROC [dc: Imager.Context, boundRect: Rectangle, clientData: REF ANY]; Layer: TYPE = RECORD [name: ATOM, backingMap: BOOL, refreshProc: RefreshProc]; Sandwich: TYPE = REF SandwichObj; SandwichObj: TYPE = RECORD [ layers: LIST OF LayerData, chunkingBitmap: Imager.SampleMap _ NIL, chunkingContext: Imager.Context _ NIL -- derived from chunking map ]; LayerData: TYPE = REF LayerDataObj; LayerDataObj: TYPE = RECORD [ name: ATOM, refreshProc: RefreshProc, hasMap: BOOL, backingMap: Imager.SampleMap _ NIL, backingContext: Imager.Context _ NIL, -- derived from backingMap mapOK: BOOL _ FALSE ]; CreateSandwich: PROC [layers: LIST OF Layer] RETURNS [sandwich: Sandwich]; FitSandwichToScreen: PROC [sandwich: Sandwich, cw, ch: INTEGER, clientToViewer: Imager.Transformation _ NIL]; DrawSandwich: PROC [sandwich: Sandwich, screen: Imager.Context, boundRect: Imager.Rectangle, viewerToClient: Imager.Transformation, clientData: REF ANY, ignoreBackingMap: BOOL _ FALSE]; SetLayerOK: PROC [sandwich: Sandwich, layerName: ATOM, ok: BOOL]; GetLayerOK: PROC [sandwich: Sandwich, layerName: ATOM] RETURNS [ok: BOOL]; GetLayerContext: PROC [sandwich: Sandwich, layerName: ATOM] RETURNS [backingContext: Imager.Context]; END. BufferedRefresh.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last edited by Bier on February 3, 1987 Contents: Builds up an abstraction of transparent layers onto which shapes can be drawn. Each layer may have a backing pixel map, in which case it need not be redrawn when other layers change. This scheme is used by Gargoyle and Solidviews. Layers should be specified in back to front order. Draw the picture, derivable from the sandwich, on the screen. For backed layers that are OK, this will just dump the backing map on the screen. For backed layers that are not OK, this will remake the backing map by calling the refreshProc and dump the backing map on the screen. For unbacked layers, this will call the RefreshProc for that layer. Layers will be drawn in back-to-front order. If ignoreBackingMap is TRUE, all layers will be drawn by calling their refresh proc. Since, we currently use 1 bit per pixel backing maps, this must be done to show colors. All layers are initially NOT OK. viewerToClient is your way to tell BufferedRefresh what your BiScrollers are doing (if you use them). Gargoyle uses the incantation: viewerToClient _ BiScrollers.GetStyle[].GetTransforms[BiScrollers.QuaBiScroller[gargoyleData.actionArea]].viewerToClient; Κ%˜J˜Icodešœ™Kšœ Οmœ1™