#ifndef _IOHIPOINTING_H
#define _IOHIPOINTING_H
#include <IOKit/hidsystem/IOHIPointing.h>
#include <IOKit/hidsystem/IOHIDevice.h>
#include <IOKit/hidsystem/IOHIDTypes.h>
typedef void (*RelativePointerEventAction)(OSObject * target,
int buttons,
int dx,
int dy,
AbsoluteTime ts);
typedef void (*AbsolutePointerEventAction)(OSObject * target,
int buttons,
Point * newLoc,
Bounds * bounds,
bool proximity,
int pressure,
int stylusAngle,
AbsoluteTime ts);
typedef void (*ScrollWheelEventAction)(OSObject * target,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
class IOHIPointing : public IOHIDevice
{
OSDeclareDefaultStructors(IOHIPointing);
private:
IOLock * _deviceLock; int _buttonMode; IOFixed _acceleration;
bool _convertAbsoluteToRelative;
bool _contactToMove;
bool _hadContact;
Point _previousLocation;
UInt8 _pressureThresholdToClick; void * _scaleSegments;
IOItemCount _scaleSegCount;
IOFixed _fractX;
IOFixed _fractY;
OSObject * _relativePointerEventTarget;
RelativePointerEventAction _relativePointerEventAction;
OSObject * _absolutePointerEventTarget;
AbsolutePointerEventAction _absolutePointerEventAction;
OSObject * _scrollWheelEventTarget;
ScrollWheelEventAction _scrollWheelEventAction;
protected:
virtual void dispatchRelativePointerEvent(int dx,
int dy,
UInt32 buttonState,
AbsoluteTime ts);
virtual void dispatchAbsolutePointerEvent(Point * newLoc,
Bounds * bounds,
UInt32 buttonState,
bool proximity,
int pressure,
int pressureMin,
int pressureMax,
int stylusAngle,
AbsoluteTime ts);
virtual void dispatchScrollWheelEvent(short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
public:
virtual bool init(OSDictionary * properties = 0);
virtual bool start(IOService * provider);
virtual void free();
virtual bool open(IOService * client,
IOOptionBits options,
RelativePointerEventAction rpeAction,
AbsolutePointerEventAction apeAction,
ScrollWheelEventAction sweAction);
virtual void close(IOService * client, IOOptionBits );
virtual IOHIDKind hidKind();
virtual bool updateProperties( void );
virtual IOReturn setParamProperties(OSDictionary * dict);
IOReturn powerStateWillChangeTo ( IOPMPowerFlags, unsigned long, IOService*);
IOReturn powerStateDidChangeTo ( IOPMPowerFlags, unsigned long, IOService*);
IOService * _rootDomain;
protected: virtual OSData * copyAccelerationTable();
virtual IOItemCount buttonCount();
virtual IOFixed resolution();
private:
virtual bool resetPointer();
virtual void scalePointer(int * dxp, int * dyp);
virtual void setupForAcceleration(IOFixed accl);
};
#endif