<> <> <> DIRECTORY Imager, IO, Rope, ViewerClasses; SlackProcess: CEDAR DEFINITIONS = BEGIN <> <<>> <> <<>> <> Point: TYPE = Imager.VEC; -- RECORD [x, y: REAL] EventProc: TYPE = PROC [event: LIST OF REF ANY, clientData: REF ANY]; MouseEventProc: TYPE = PROC [event: LIST OF REF ANY, point: Point, clientData: REF ANY]; LoggingProc: TYPE = PROC [point: Point, action: LIST OF REF ANY, mouseEvent: BOOL, clientData: REF ANY]; AbortProc: TYPE = PROC [data: REF ANY]; SlackHandle: TYPE = REF SlackData; <> SlackData: TYPE = MONITORED RECORD [ slackProcess: PROCESS, queue: Queue, log: Log, abort: Abort ]; -- eventually should be opaque ?? defaultSize: NAT = 50; Queue: TYPE = REF QueueData; <> QueueData: TYPE = RECORD [ notFull: CONDITION, head: NAT _ 0, tail: NAT _ 0, size: NAT _ 0, clientDatas: ClientDatas _ NIL, actions: Actions _ NIL, points: Points _ NIL, mouseProcs: MouseProcs _ NIL, eventProcs: EventProcs _ NIL ]; ClientDatas: TYPE = REF ClientDatasData; ClientDatasData: TYPE = RECORD[SEQUENCE len: NAT OF REF ANY]; Actions: TYPE = REF ActionsData; ActionsData: TYPE = RECORD[SEQUENCE len: NAT OF LIST OF REF ANY]; Points: TYPE = REF PointsData; PointsData: TYPE = RECORD[SEQUENCE len: NAT OF Point]; MouseProcs: TYPE = REF MouseProcsData; MouseProcsData: TYPE = RECORD[SEQUENCE len: NAT OF MouseEventProc]; EventProcs: TYPE = REF EventProcsData; EventProcsData: TYPE = RECORD[SEQUENCE len: NAT OF EventProc]; Log: TYPE = REF LogData; <> LogData: TYPE = RECORD[ head: NAT _ 0, size: NAT _ 0, loggerEnabled: BOOL _ FALSE, logger: LoggingProc _ NIL, received: Received, -- received an action versus performed an action. bashed: Bashed, -- bashed an action versus performed an action. events: Events, points: Points ]; Received: TYPE = REF ReceivedData; ReceivedData: TYPE = RECORD[SEQUENCE len: NAT OF BOOL]; Bashed: TYPE = REF BashedData; BashedData: TYPE = RECORD[SEQUENCE len: NAT OF BOOL]; Events: TYPE = REF EventsData; EventsData: TYPE = RECORD[SEQUENCE len: NAT OF REF ANY]; Abort: TYPE = REF AbortData; AbortData: TYPE = RECORD [ enabled: BOOL _ FALSE, proc: AbortProc, viewer: ViewerClasses.Viewer, data: REF ]; Create: PROC [queueSize: NAT _ 50, logSize: NAT _ 50, loggingProc: LoggingProc _ NIL, abortProc: AbortProc _ NIL, abortData: REF ANY _ NIL, abortViewer: ViewerClasses.Viewer _ NIL] RETURNS[handle: SlackHandle]; FlushQueue: PROC [handle: SlackHandle]; <> Restart: PROC [handle: SlackHandle]; <> QueueInputAction: PROC [handle: SlackHandle, callBack: MouseEventProc, inputAction: LIST OF REF ANY, point: Point, clientData: REF ANY]; <> QueueOrBashInputAction: PROC [handle: SlackHandle, callBack: MouseEventProc, inputAction: LIST OF REF ANY, bashable: LIST OF ATOM, point: Point, clientData: REF ANY]; <> QueueInputActionNoPoint: PROC [handle: SlackHandle, callBack: EventProc, inputAction: LIST OF REF ANY, clientData: REF ANY]; <> QueueOrBashInputActionNoPoint: PROC [handle: SlackHandle, callBack: EventProc, inputAction: LIST OF REF ANY, bashable: LIST OF ATOM, clientData: REF ANY]; <> QueueInputActionAndWait: PROC [handle: SlackHandle, callBack: MouseEventProc, inputAction: LIST OF REF ANY, point: Point, clientData: REF ANY ]; <> <<>> <> LogRawMouse: PROC [handle: SlackHandle, point: Point]; <> OutputLog: PROC [handle: SlackHandle, stream: IO.STREAM]; <> <> EnableSessionLogging: PROC [handle: SlackHandle]; DisableSessionLogging: PROC [handle: SlackHandle]; RegisterLogger: PROC [handle: SlackHandle, loggingProc: LoggingProc]; EnableAborts: PROC [handle: SlackHandle]; DisableAborts: PROC [handle: SlackHandle]; RegisterAbortProc: PROC [handle: SlackHandle, abortProc: AbortProc _ NIL, abortData: REF ANY _ NIL, abortViewer: ViewerClasses.Viewer _ NIL]; <> END.