<<>> <> <> <> <> <<>> <> DIRECTORY IO USING [STREAM], Rope USING [ROPE]; SchemeEvents: CEDAR DEFINITIONS ~ BEGIN InputQueue: TYPE ~ REF InputQueueRep; -- private rep below. InputEvent: TYPE ~ REF; -- one of the following: MouseEvent: TYPE ~ REF MouseEventRep; ReadyStreamEvent: TYPE ~ IO.STREAM; -- A stream that has chars available StreamErrorEvent: TYPE ~ REF StreamErrorEventRep; -- an error occured on this stream CharEvent: TYPE ~ REF CHAR; -- immutable! <<... or anything else the consumer and producer can agree on.>> MakeInputQueue: PROC RETURNS [InputQueue]; Reset: PROC [queue: InputQueue]; <> <> Enqueue: PROC [queue: InputQueue, a: InputEvent]; <> EnqueueMouse: PROC [queue: InputQueue, me: MouseEventRep]; <> EnqueueStream: PROC [queue: InputQueue, stream: IO.STREAM]; <> FlushAvailableWhitespace: PROC [stream: IO.STREAM] RETURNS [newlineRead: BOOL]; <> Notify: PROC [queue: InputQueue, input: LIST OF REF ANY]; <> <> InputAvailable: PROC [queue: InputQueue] RETURNS [BOOL]; <> Dequeue: PROC [queue: InputQueue] RETURNS [a: InputEvent]; <> MouseEventRep: TYPE ~ RECORD [action: ATOM ¬ NIL, button: ATOM ¬ NIL, mx, my: INT ¬ 0, args: REF ¬ NIL]; StreamErrorEventRep: TYPE ~ RECORD [stream: IO.STREAM, object: REF, msg: Rope.ROPE]; InputQueueRep: TYPE ~ PRIVATE MONITORED RECORD [ ready: CONDITION, count: CARD, head: LIST OF InputEvent, last: LIST OF InputEvent, impl: REF ¬ NIL ]; END.