DIRECTORY GriffinDefs: FROM "GriffinDefs", ObjectDefs: FROM "ObjectDefs", GriffinDisplay: FROM "GriffinDisplay", PointDefs: FROM "PointDefs", RefreshDefs: FROM "RefreshDefs", GriffinViewer USING [PaintProc, DoPaint], GriffinMemoryDefs USING [CZone]; Refresh: CEDAR PROGRAM IMPORTS ObjectDefs,GriffinDisplay,GriffinMemoryDefs, GriffinViewer EXPORTS RefreshDefs = BEGIN OPEN ObjectDefs,PointDefs,GriffinMemoryDefs; Frame: TYPE = REF FrameType; FrameType: TYPE = RECORD [ tl,br: ScrPt, obj: ObjectHandle]; FrameList: LIST OF Frame _ NIL; EraseAndSave: PUBLIC PROCEDURE[obj: ObjectHandle]= BEGIN tl,br: ScrPt; IF obj=NIL THEN RETURN; [tl,br] _ BoxFromObject[obj]; EraseAndSaveBox[tl,br]; END; EraseAndSaveBox: PUBLIC PROCEDURE[tl,br: ScrPt]= BEGIN paint: GriffinViewer.PaintProc = { GriffinDisplay.EraseBox[tl,br, dc]; }; AddFrame[tl,br, NIL]; GriffinViewer.DoPaint[paint]; --do it in a paint proc END; MarkObject: PUBLIC PROCEDURE[obj: ObjectHandle]= BEGIN newframe: Frame _ NIL; tl, br: ScrPt; IF obj=NIL THEN RETURN; [tl,br] _ BoxFromObject[obj]; AddFrame[tl,br,obj]; END; MarkBox: PUBLIC PROCEDURE[tl,br: ScrPt]= BEGIN AddFrame[tl,br, NIL]; END; BoxFromObject: PROCEDURE[obj: ObjectHandle] RETURNS[tl, br: ScrPt]= BEGIN IF obj=NIL THEN ERROR; tl _ obj.tl; br _ obj.br; RETURN[tl,br]; END; EraseAndSaveAllCPs: PUBLIC PROCEDURE= BEGIN EraseCPs: ObjectDefs.ObjectProc = TRUSTED BEGIN WITH token: obj SELECT FROM token=> IF token.tokenType=CP OR token.tokenType=open THEN EraseAndSave[obj]; ENDCASE; END; ObjectDefs.ForAllVisibleObjects[EraseCPs]; END; AddFrame: PROCEDURE[tl,br: ScrPt, obj: ObjectHandle]= BEGIN newframe: Frame _ CZone.NEW[FrameType _ [tl, br, obj]]; FrameList _ CONS[newframe, FrameList]; END; RestoreScreen: PUBLIC PROCEDURE= BEGIN new: LIST OF Frame _ NIL; paint: GriffinViewer.PaintProc = { FOR f: LIST OF Frame _ new, f.rest UNTIL f=NIL DO frame: Frame _ f.first; IF frame.obj=NIL THEN ReplotBox[frame.tl,frame.br, dc] ELSE ReplotBoxFromObject[frame.tl,frame.br,frame.obj, dc]; ENDLOOP; }; IF FrameList=NIL THEN RETURN; FOR f: LIST OF Frame _ FrameList, f.rest UNTIL f=NIL DO new _ CONS[f.first, new]; ENDLOOP; GriffinViewer.DoPaint[paint]; --do it in a paint proc FrameList _ NIL; END; END. €Compiler Refresh/n m.stone January 29, 1981 4:45 PM Last Edited by: Stone, July 5, 1985 1:54:31 pm PDT Reverse the list Êâ˜J˜Jšœ™Jšœ!™!Jšœ2™2J˜šÏk ˜ Jšœ œ˜ Jšœ œ˜Jšœœ˜&Jšœ œ ˜Jšœ œ˜ Jšœœ˜)Jšœœ ˜ —J˜šœ ˜Jšœ=˜DJšœ˜—Jšœœ(˜2Jšœœœ ˜šœ œ˜J˜ Jšœ˜—J˜Jšœ œœ ˜J˜JšÏn œœ œ˜3š˜J˜ Jšœœœœ˜J˜J˜Jšœ˜—J˜Jšžœœ œ˜0š˜˜"Jšœ#˜#J˜—Jšœœ˜JšœÏc˜5Jšœ˜—J˜Jšž œœ œ˜0šœ˜Jšœœ˜Jšœ˜Jšœœœœ˜J˜Jšœ˜Jšœ˜—J˜Jšžœœ œ˜(š˜Jšœ˜Jšœ˜—J˜Jšž œ œœ˜Cš˜Jšœœœœ˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ˜—J˜Jšžœœ œ˜%š˜šœ" ˜/Jšœ œ˜Jš œœœœœ˜MJšœ˜Jšœ˜—J˜*Jšœ˜—J˜Jšžœ œ"˜5š˜Jšœœ˜7Jšœ œ˜&Jšœ˜—J˜Jšž œœ œ˜ š˜Jšœœœ œ˜˜"š œœœœœ˜1J˜Jšœ œœ!˜6Jšœ6˜:Jšœ˜—J˜—Jšœ œœœ˜J™š œœœœœ˜7Jšœœ˜Jšœ˜—JšœŸ˜5Jšœ œ˜Jšœ˜—J˜J˜Jšœ˜J˜—…—º