#ifndef _IOHIDPOINTING_H
#define _IOHIDPOINTING_H
#include <IOKit/hidsystem/IOHIDTypes.h>
#include <IOKit/hidsystem/IOHIPointing.h>
#include "IOHIDDevice.h"
enum IOHIDPointingButtonType{
kIOHIDPointingButtonGeneric = 0,
kIOHIDPointingButtonAbsolute,
kIOHIDPointingButtonRelative
};
typedef enum IOHIDPointingButtonType IOHIDPointingButtonType;
class IOHIDPointing : public IOHIPointing
{
OSDeclareDefaultStructors(IOHIDPointing);
private:
HIDPreparsedDataRef _preparsedReportDescriptorData;
Bounds _bounds;
IOItemCount _numButtons;
IOFixed _resolution;
IOFixed _scrollResolution;
IOHIDPointingButtonType _buttonType;
SInt32 _buttonCollection;
SInt32 _xRelativeCollection;
SInt32 _yRelativeCollection;
SInt32 _xAbsoluteCollection;
SInt32 _yAbsoluteCollection;
SInt32 _tipPressureCollection;
SInt32 _digitizerButtonCollection;
SInt32 _scrollWheelCollection;
SInt32 _horzScrollCollection;
int _tipPressureMin;
SInt16 _tipPressureMax;
bool _absoluteCoordinates;
bool _hasInRangeReport;
bool _bootProtocol;
UInt32 _reportCount;
UInt32 _cachedButtonState;
IOHIDDevice * _provider;
public:
static IOHIDPointing * Pointing(OSArray * elements, IOHIDDevice * owner);
virtual bool init(OSDictionary * properties = 0);
virtual bool start(IOService * provider);
virtual void free();
virtual IOReturn parseReportDescriptor(
IOMemoryDescriptor * report,
IOOptionBits options = 0 );
virtual IOReturn handleReport(
IOMemoryDescriptor * report,
IOOptionBits options = 0 );
protected:
virtual IOItemCount buttonCount();
virtual IOFixed resolution();
private:
void propagateProperties();
bool findDesiredElements(OSArray *elements);
};
#endif