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. Ί WacomDevice.mesa Copyright Σ 1992 by Xerox Corporation. All rights reserved. Kenneth A. Pier, January 10, 1992 11:04 am PST Contents: Routines for creating instances of the Wacom pressure-sensitive tablet and representing the state of such a device. Class Routines Create a data structure representing a particular physical Wacom. Calls class.create[class]. Allocates storage representing the state of this device at [0, 0] with minimum pressure. Each DeviceState is immutable, so they may be freely stored in long-term storage. Representing Wacom State Changes Convenience State Changes Inspecting State returns TRUE if both x and y coordinates in this state are valid coordinates Κ7–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ Οeœ1™