Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
osxPointingDeviceManager.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/input/osx/osxPointingDeviceManager.h --
4  *
5  * Initial software
6  * Authors: Izzatbek Mukhanov
7  * Copyright © Inria
8  *
9  * http://libpointing.org/
10  *
11  * This software may be used and distributed according to the terms of
12  * the GNU General Public License version 2 or any later version.
13  *
14  */
15 #ifndef osxPointingDeviceManager_h
16 #define osxPointingDeviceManager_h
17 
18 #include <iostream>
19 #include <map>
20 #include <list>
21 #include <pointing/input/PointingDeviceManager.h>
22 #include <IOKit/hid/IOHIDManager.h>
23 #include <pointing/input/osx/osxPointingDevice.h>
24 #include <pointing/utils/HIDReportParser.h>
25 
26 #include <iomanip>
27 
28 namespace pointing
29 {
38  {
39  friend class PointingDeviceManager;
40  friend class osxPointingDevice;
41 
42  // Add osx-specific data
43  struct osxPointingDeviceData : PointingDeviceData
44  {
45  HIDReportParser parser;
46  uint8_t report[64];
47  IOHIDDeviceRef devRef;
48  };
49 
50  void processMatching(PointingDeviceData *pdd, SystemPointingDevice *device);
51 
52  IOHIDManagerRef manager;
53  static void AddDevice(void *context, IOReturn /*result*/, void *sender, IOHIDDeviceRef devRef);
54  static void RemoveDevice(void *context, IOReturn /*result*/, void *sender, IOHIDDeviceRef devRef);
55 
58 
59  static void hidReportCallback(void *context, IOReturn result, void *sender,
60  IOHIDReportType type, uint32_t reportID,
61  uint8_t *report, CFIndex reportLength) ;
62  };
63 }
64 
65 
66 #endif
The osxPointingDeviceManager class is the platform-specific subclass of the PointingDeviceManager cla...
Definition: osxPointingDeviceManager.h:37
The PointingDeviceManager class is a helper class which enumerates the list of existing pointing devi...
Definition: PointingDeviceManager.h:86
Definition: PointingDeviceManager.h:96
Definition: DummyPointingDevice.cpp:23
The SystemPointingDevice class is used to represent Pointing Devices connected to the computer...
Definition: SystemPointingDevice.h:28
Definition: osxPointingDevice.h:23