2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #ifndef _IOHIPOINTING_H
23 #define _IOHIPOINTING_H
25 #include <IOKit/hidsystem/IOHIPointing.h>
26 #include <IOKit/hidsystem/IOHIDevice.h>
27 #include <IOKit/hidsystem/IOHIDTypes.h>
29 /* Start Action Definitions */
33 * The following entry points were part of the IOHIPointingEvents
36 typedef void (*RelativePointerEventAction
)(OSObject
* target
,
37 /* buttons */ int buttons
,
40 /* atTime */ AbsoluteTime ts
);
42 typedef void (*AbsolutePointerEventAction
)(OSObject
* target
,
43 /* buttons */ int buttons
,
44 /* at */ Point
* newLoc
,
45 /* withBounds */ Bounds
* bounds
,
46 /* inProximity */ bool proximity
,
47 /* withPressure */ int pressure
,
48 /* withAngle */ int stylusAngle
,
49 /* atTime */ AbsoluteTime ts
);
51 typedef void (*ScrollWheelEventAction
)(OSObject
* target
,
57 /* End Action Definitions */
59 class IOHIPointing
: public IOHIDevice
61 OSDeclareDefaultStructors(IOHIPointing
);
64 IOLock
* _deviceLock
; // Lock for all device access
65 int _buttonMode
; // The "handedness" of the pointer
66 IOFixed _acceleration
;
67 bool _convertAbsoluteToRelative
;
70 Point _previousLocation
;
71 UInt8 _pressureThresholdToClick
; // A scale factor of 0 to 255 to determine how much pressure is necessary to generate a primary mouse click - a value of 255 means no click will be generated
72 void * _scaleSegments
;
73 IOItemCount _scaleSegCount
;
77 OSObject
* _relativePointerEventTarget
;
78 RelativePointerEventAction _relativePointerEventAction
;
79 OSObject
* _absolutePointerEventTarget
;
80 AbsolutePointerEventAction _absolutePointerEventAction
;
81 OSObject
* _scrollWheelEventTarget
;
82 ScrollWheelEventAction _scrollWheelEventAction
;
86 virtual void dispatchRelativePointerEvent(int dx
,
91 virtual void dispatchAbsolutePointerEvent(Point
* newLoc
,
101 virtual void dispatchScrollWheelEvent(short deltaAxis1
,
107 virtual bool init(OSDictionary
* properties
= 0);
108 virtual bool start(IOService
* provider
);
111 virtual bool open(IOService
* client
,
112 IOOptionBits options
,
113 RelativePointerEventAction rpeAction
,
114 AbsolutePointerEventAction apeAction
,
115 ScrollWheelEventAction sweAction
);
116 virtual void close(IOService
* client
, IOOptionBits
);
118 virtual IOHIDKind
hidKind();
119 virtual bool updateProperties( void );
120 virtual IOReturn
setParamProperties(OSDictionary
* dict
);
121 IOReturn
powerStateWillChangeTo ( IOPMPowerFlags
, unsigned long, IOService
*);
122 IOReturn
powerStateDidChangeTo ( IOPMPowerFlags
, unsigned long, IOService
*);
123 IOService
* _rootDomain
; //Needs to be public for C function use
126 protected: // for subclasses to implement
127 virtual OSData
* copyAccelerationTable();
128 virtual IOItemCount
buttonCount();
129 virtual IOFixed
resolution();
132 virtual bool resetPointer();
133 virtual void scalePointer(int * dxp
, int * dyp
);
134 virtual void setupForAcceleration(IOFixed accl
);
137 #endif /* !_IOHIPOINTING_H */