DIRECTORY CD USING [Rect, Design]; CDDrawQueue: CEDAR DEFINITIONS = BEGIN DrawQueue: TYPE = REF DrawQueueRep; DrawQueueRep: TYPE; Request: TYPE = RECORD [key: REF, rect: CD.Rect]; queueEmpty: PRIVATE READONLY REF; finishedForEver: PRIVATE READONLY REF; Create: PROC [design: CD.Design, stopFlag: REF BOOL, clip: CD.Rect _ [1,1,0,0] ] RETURNS [DrawQueue]; ChangeClipArea: PROC [dq: DrawQueue, clip: CD.Rect _ [1,1,0,0] ]; Destroy: PROC [dq: DrawQueue]; Flush: PROC [dq: DrawQueue]; QueueInsertDrawCommand: PROC [dq: DrawQueue, req: Request]; InsertDrawCommand: PROC [design: CD.Design, req: Request]; FetchCommand: PROC [dq: DrawQueue] RETURNS [req: Request]; END. VCDDrawQueue.mesa (a ChipNDale module) Copyright c 1983, 1984 by Xerox Corporation. All rights reserved. by Christian Jacobi, May 3, 1983 10:40 am last edited by Christian Jacobi, September 19, 1985 2:58:03 am PDT This module dispatches view refresh requests onto different queues which may be querried by different viewer implementation. --Think a DrawQueue representing a viewer --one DrawQueue is executed (emptied) by max one process --but arbitrary (typically only one) processes may fill the DrawQueue --$redraw: completely redraw this rect --$draw: draw this rect (over what's there) --queueEmpty: generated implicitely; hint that some lower priority stuff might be done; Do not insert this key explicitely. --finishedForEver: generated implicitely; hint that this is the last request for ever in this table; Do not insert this key explicitely. --Creates a DrawQueue --stopFlag^ tells any drawing process to stop volunterly and to fetch the next request. --stopFlag^ must not be modified any more outside this monitor!! until Delete is called --clip: initial clip area. --Users may request a stop by calling Flush. --changes the clipping aera for this DrawQueue --no more calls of QueueInsertDrawCommand on dq allowed!! --redraw process must disapear from itself, --when redraw process dispears and contains nomore --reference of dq, it is subject for garbage collection --The stopFlag is immediately set to TRUE and later --reset to FALSE when the redraw --process stopped the current command, if it then fetches another --command it gets the disapearforever command. --the drawing may stop after some time only, --and NOT immediately with procedure return --insert request into particular DrawQueue --insert request into all DrawQueue's of this design --returns next request --If not available waits until request is available or DrawQueue deleted ΚS˜codešœ'™'Kšœ Οmœ7™BKšœ+™+KšœC™C—K˜šΟk ˜ Kšžœžœ˜—K˜KšΠbl œžœž œ˜!Kšž˜K˜K™Ošœ.™.K˜—K˜šœ žœžœ˜$Kšœ)™)Kšœ8™8KšœE™EK˜Kšœžœ˜K˜K™—š œ žœžœžœžœ˜1K™K™'K™,Kšœ{™{Kšœˆ™ˆK˜Kšœ žœž œ˜!Kšœžœž œ˜&K˜—K˜šΟnœžœ žœžœžœžœžœ ˜eK™KšœX™XKšœW™WKšœ™Kšœ,™,K˜—š œžœžœ˜AKšœ.™.K˜—š œžœ˜Kšœ9™9Kšœ+™+Kšœ2™2Kšœ8™8Kšœ3™3Kšœ!™!KšœB™BKšœ.™.K˜—š œžœ˜Kšœ,™,Kšœ+™+K˜—š œžœ˜;Kšœ*™*K˜—š œžœ žœ˜:Kšœ4™4K˜—š  œžœžœ˜:Kšœ™KšœH™H—K˜Kšžœ˜K˜K˜K˜K˜K˜—…—² [