<<>> <> <> <> <<>> <> <<>> DIRECTORY DeviceClassTypes, DeviceTypes, Rope; WacomDevice: CEDAR DEFINITIONS = BEGIN Device: TYPE = DeviceTypes.Device; DeviceClass: TYPE = DeviceClassTypes.DeviceClass; DeviceState: TYPE = DeviceTypes.DeviceState; DeviceStateChange: TYPE = DeviceTypes.DeviceStateChange; <> CreateWacom: PROC [name: Rope.ROPE] RETURNS [device: Device]; <> AllocateState: PROC [device: Device] RETURNS [deviceState: DeviceState]; <> <<>> <> PenXChange: PROC [x: INTEGER] RETURNS [change: DeviceStateChange]; PenYChange: PROC [y: INTEGER] RETURNS [change: DeviceStateChange]; PressureChange: PROC [p: INTEGER] RETURNS [change: DeviceStateChange]; StateAfterChange: PROC [deviceState: DeviceState, change: DeviceStateChange] RETURNS [newDeviceState: DeviceState]; ChangeKind: TYPE = {penX, penY, pressure}; ExpandedChange: TYPE = RECORD [ contents: SELECT kind: ChangeKind FROM penX => [x: INTEGER], penY => [y: INTEGER], pressure => [p: INTEGER] ENDCASE ]; UnpackChange: PROC [change: DeviceStateChange] RETURNS [expanded: ExpandedChange]; <> <<>> PenNewState: PROC [deviceState: DeviceState, x, y, p: INTEGER] RETURNS [newDeviceState: DeviceState]; <> <<>> GetPen: PROC [deviceState: DeviceState] RETURNS [x, y, p: INTEGER]; IsComplete: PROC [deviceState: DeviceState] RETURNS [BOOL]; <> END.