1/* 2 * @APPLE_LICENSE_HEADER_START@ 3 * 4 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23#ifndef _IOHIDPOINTING_H 24#define _IOHIDPOINTING_H 25 26#include <IOKit/hidsystem/IOHIDTypes.h> 27#include "IOHITablet.h" 28#include "IOHIDEventService.h" 29#include "IOHIDevicePrivateKeys.h" 30 31class IOHIDPointing : public IOHITablet 32{ 33 OSDeclareDefaultStructors(IOHIDPointing); 34 35private: 36 IOHIDEventService * _provider; 37 38 IOItemCount _numButtons; 39 IOFixed _resolution; 40 IOFixed _scrollResolution; 41 bool _isDispatcher; 42 43public: 44 static UInt16 generateDeviceID(); 45 46 // Allocator 47 static IOHIDPointing * Pointing( 48 UInt32 buttonCount, 49 IOFixed pointerResolution, 50 IOFixed scrollResolution, 51 bool isDispatcher); 52 53 virtual bool initWithMouseProperties( 54 UInt32 buttonCount, 55 IOFixed pointerResolution, 56 IOFixed scrollResolution, 57 bool isDispatcher); 58 59 virtual bool start(IOService * provider); 60 virtual void stop(IOService * provider); 61 62 63 virtual void dispatchAbsolutePointerEvent( 64 AbsoluteTime timeStamp, 65 IOGPoint * newLoc, 66 IOGBounds * bounds, 67 UInt32 buttonState, 68 bool inRange, 69 SInt32 tipPressure, 70 SInt32 tipPressureMin, 71 SInt32 tipPressureMax, 72 IOOptionBits options = 0); 73 74 virtual void dispatchRelativePointerEvent( 75 AbsoluteTime timeStamp, 76 SInt32 dx, 77 SInt32 dy, 78 UInt32 buttonState, 79 IOOptionBits options = 0); 80 81 virtual void dispatchScrollWheelEvent( 82 AbsoluteTime timeStamp, 83 SInt32 deltaAxis1, 84 SInt32 deltaAxis2, 85 UInt32 deltaAxis3, 86 IOOptionBits options = 0); 87 88 virtual void dispatchTabletEvent( 89 NXEventData * tabletEvent, 90 AbsoluteTime ts); 91 92 virtual void dispatchProximityEvent( 93 NXEventData * proximityEvent, 94 AbsoluteTime ts); 95 96protected: 97 virtual IOItemCount buttonCount(); 98 virtual IOFixed resolution(); 99 100private: 101 // This is needed to pass properties defined 102 // in IOHIDDevice to the nub layer 103 void setupProperties(); 104 105}; 106 107#endif /* !_IOHIDPOINTING_H */ 108