#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,
IOGPoint * newLoc,
IOGBounds *bounds,
bool proximity,
int pressure,
int stylusAngle,
AbsoluteTime ts);
typedef void (*ScrollWheelEventAction)(OSObject * target,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
typedef void (*RelativePointerEventCallback)(
OSObject * target,
int buttons,
int dx,
int dy,
AbsoluteTime ts,
OSObject * sender,
void * refcon);
typedef void (*AbsolutePointerEventCallback)(
OSObject * target,
int buttons,
IOGPoint * newLoc,
IOGBounds *bounds,
bool proximity,
int pressure,
int stylusAngle,
AbsoluteTime ts,
OSObject * sender,
void * refcon);
typedef void (*ScrollWheelEventCallback)(
OSObject * target,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
IOFixed fixedDelta1,
IOFixed fixedDelta2,
IOFixed fixedDelta3,
SInt32 pointDelta1,
SInt32 pointDelta2,
SInt32 pointDelta3,
SInt32 options,
AbsoluteTime ts,
OSObject * sender,
void * refcon);
#define EV_DEFAULTPOINTERACCELLEVEL 0x0000b000
#define EV_DEFAULTSCROLLACCELLEVEL 0x00005000
class IOHIDPointingDevice;
struct ScrollAccelInfo;
#if defined(KERNEL) && !defined(KERNEL_PRIVATE)
class __deprecated_msg("Use DriverKit") IOHIPointing : public IOHIDevice
#else
class IOHIPointing : public IOHIDevice
#endif
{
OSDeclareDefaultStructors(IOHIPointing);
friend class IOHITablet;
friend class IOHIDPointing;
private:
IOLock * _deviceLock; int _buttonMode; IOFixed _acceleration;
bool _convertAbsoluteToRelative;
bool _contactToMove;
bool _hadContact;
IOGPoint _previousLocation;
UInt8 _pressureThresholdToClick; void * _scaleSegments;
IOItemCount _scaleSegCount;
IOFixed _fractX;
IOFixed _fractY;
OSObject * _relativePointerEventTarget;
RelativePointerEventAction _relativePointerEventAction;
OSObject * _absolutePointerEventTarget;
AbsolutePointerEventAction _absolutePointerEventAction;
OSObject * _scrollWheelEventTarget;
ScrollWheelEventAction _scrollWheelEventAction;
struct ExpansionData;
ExpansionData * _reserved;
void setPointingMode(UInt32 accelerateMode);
UInt32 getPointingMode ();
void setScrollType(UInt32 scrollType);
UInt32 getScrollType();
void dispatchScrollWheelEventWithAccelInfo(
SInt32 deltaAxis1,
SInt32 deltaAxis2,
SInt32 deltaAxis3,
ScrollAccelInfo * info,
AbsoluteTime ts);
protected:
virtual void dispatchRelativePointerEvent(int dx,
int dy,
UInt32 buttonState,
AbsoluteTime ts);
virtual void dispatchAbsolutePointerEvent(IOGPoint * newLoc,
IOGBounds * 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) APPLE_KEXT_OVERRIDE;
virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
virtual void free(void) APPLE_KEXT_OVERRIDE;
virtual bool open(IOService * client,
IOOptionBits options,
RelativePointerEventAction rpeAction,
AbsolutePointerEventAction apeAction,
ScrollWheelEventAction sweAction);
bool open( IOService * client,
IOOptionBits options,
void *,
RelativePointerEventCallback rpeCallback,
AbsolutePointerEventCallback apeCallback,
ScrollWheelEventCallback sweCallback);
virtual void close(IOService * client, IOOptionBits ) APPLE_KEXT_OVERRIDE;
virtual IOReturn message( UInt32 type, IOService * provider,
void * argument = 0 ) APPLE_KEXT_OVERRIDE;
virtual IOHIDKind hidKind(void) APPLE_KEXT_OVERRIDE;
virtual bool updateProperties( void ) APPLE_KEXT_OVERRIDE;
virtual IOReturn setParamProperties( OSDictionary * dict ) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags,
unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE;
virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags powerFlags,
unsigned long newState, IOService * device) APPLE_KEXT_OVERRIDE;
protected: virtual OSData * copyAccelerationTable();
virtual IOItemCount buttonCount();
virtual IOFixed resolution();
OSData * copyScrollAccelerationTable();
private:
virtual bool resetPointer();
virtual void scalePointer(int * dxp, int * dyp);
virtual void setupForAcceleration(IOFixed accl);
bool resetScroll();
void setupScrollForAcceleration(IOFixed accl);
IOFixed scrollResolutionForType(SInt32 type=-1);
IOFixed scrollReportRate();
OSData * copyScrollAccelerationTableForType(SInt32 type=-1);
private:
static void _relativePointerEvent( IOHIPointing * self,
int buttons,
int dx,
int dy,
AbsoluteTime ts);
static void _absolutePointerEvent(IOHIPointing * self,
int buttons,
IOGPoint * newLoc,
IOGBounds *bounds,
bool proximity,
int pressure,
int stylusAngle,
AbsoluteTime ts);
static void _scrollWheelEvent(IOHIPointing *self,
short deltaAxis1,
short deltaAxis2,
short deltaAxis3,
AbsoluteTime ts);
};
#endif