]> git.saurik.com Git - apple/xnu.git/blob - iokit/Drivers/hidsystem/drvAppleADBDevices/AppleADBMouse.h
668aadf6df4dda4a475b6ac035963a89bac19b97
[apple/xnu.git] / iokit / Drivers / hidsystem / drvAppleADBDevices / AppleADBMouse.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * 18 June 1998 sdouglas Start IOKit version.
24 * 18 Nov 1998 suurballe port to C++
25 * 4 Oct 1999 decesare Revised for Type 4 support and sub-classed drivers.
26 */
27
28 #include <IOKit/adb/IOADBDevice.h>
29 #include <IOKit/hidsystem/IOHIPointing.h>
30
31 #define TRUE 1
32 #define FALSE 0
33
34 class AppleADBMouse: public IOHIPointing
35 {
36 OSDeclareDefaultStructors(AppleADBMouse);
37
38 protected:
39 IOADBDevice * adbDevice;
40 IOFixed _resolution;
41 IOItemCount _buttonCount;
42
43 public:
44 virtual IOService * probe(IOService * provider, SInt32 * score);
45 virtual bool start(IOService * provider);
46 virtual UInt32 interfaceID(void);
47 virtual UInt32 deviceType(void);
48 virtual IOFixed resolution(void);
49 virtual IOItemCount buttonCount(void);
50 virtual void packet(UInt8 adbCommand, IOByteCount length, UInt8 * data);
51 };
52
53
54 class AppleADBMouseType1 : public AppleADBMouse
55 {
56 OSDeclareDefaultStructors(AppleADBMouseType1);
57
58 public:
59 virtual IOService * probe(IOService * provider, SInt32 * score);
60 virtual bool start(IOService * provider);
61 };
62
63
64 class AppleADBMouseType2 : public AppleADBMouse
65 {
66 OSDeclareDefaultStructors(AppleADBMouseType2);
67
68 public:
69 virtual IOService * probe(IOService * provider, SInt32 * score);
70 virtual bool start(IOService * provider);
71 };
72
73
74 class AppleADBMouseType4 : public AppleADBMouse
75 {
76 OSDeclareDefaultStructors(AppleADBMouseType4);
77
78 private:
79 bool Clicking, Dragging, DragLock, typeTrackpad;
80 virtual IOReturn setParamProperties( OSDictionary * dict );
81 bool enableEnhancedMode();
82
83 protected:
84 UInt32 deviceSignature;
85 UInt16 deviceResolution;
86 UInt8 deviceClass;
87 UInt8 deviceNumButtons;
88
89 public:
90 virtual IOService * probe(IOService * provider, SInt32 * score);
91 virtual bool start(IOService * provider);
92 virtual void packet(UInt8 adbCommand, IOByteCount length, UInt8 * data);
93 virtual OSData * copyAccelerationTable();
94 };