Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
SystemPointingDevice.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/input/SystemPointingDevice.h --
4  *
5  * Initial software
6  * Authors: Izzat 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 
16 #ifndef SystemPointingDevice_h
17 #define SystemPointingDevice_h
18 
19 #include <pointing/input/PointingDevice.h>
20 
21 namespace pointing {
22 
29  {
30  protected:
31  friend class PointingDeviceManager;
32 
33  URI uri, anyURI;
34 
35  double forced_cpi = -1., forced_hz = -1.;
36 
37  int vendorID = 0, productID = 0;
38 
39  int debugLevel = 0;
40 
41  PointingCallback callback = NULL;
42  void *callback_context = NULL;
43 
44  std::string vendor, product;
45  bool active = false;
46 
47  public:
48 
49  SystemPointingDevice(URI uri) ;
50 
51  bool isActive(void) const;
52 
53  int getVendorID(void) const;
54  std::string getVendor(void) const;
55  int getProductID(void) const;
56  std::string getProduct(void) const;
57 
58  double getResolution(double *defval=0) const;
59  double getUpdateFrequency(double *defval=0) const;
60 
61  URI getURI(bool expanded=false, bool crossplatform=false) const;
62 
63  void setPointingCallback(PointingCallback callback, void *context=0);
64 
65  void setDebugLevel(int level);
66 
67  virtual ~SystemPointingDevice();
68 
69  } ;
70 
71 }
72 
73 #endif
double getResolution(double *defval=0) const
Resolution of the mouse in CPI (counts per inch).
Definition: SystemPointingDevice.cpp:67
The PointingDeviceManager class is a helper class which enumerates the list of existing pointing devi...
Definition: PointingDeviceManager.h:86
std::string getVendor(void) const
Readable vendor name.
Definition: SystemPointingDevice.cpp:52
bool isActive(void) const
Indicates whether the current device is active.
Definition: SystemPointingDevice.cpp:42
int getProductID(void) const
Product identifier number.
Definition: SystemPointingDevice.cpp:57
Definition: DummyPointingDevice.cpp:23
The PointingDevice class is used to represent Pointing Devices connected to the computer or pseudo-de...
Definition: PointingDevice.h:35
The SystemPointingDevice class is used to represent Pointing Devices connected to the computer...
Definition: SystemPointingDevice.h:28
std::string getProduct(void) const
Readable product name.
Definition: SystemPointingDevice.cpp:62
URI getURI(bool expanded=false, bool crossplatform=false) const
Constructs the URI according to the parameters of the device.
Definition: SystemPointingDevice.cpp:82
void setDebugLevel(int level)
Sets the level of information for debugging purposes (default = 0).
Definition: SystemPointingDevice.cpp:117
void setPointingCallback(PointingCallback callback, void *context=0)
Sets the callback function which is called when device events occur.
Definition: SystemPointingDevice.cpp:111
void(* PointingCallback)(void *context, TimeStamp::inttime timestamp, int dx, int dy, int buttons)
Definition: PointingDevice.h:76
double getUpdateFrequency(double *defval=0) const
Update frequency of the mouse in Hz.
Definition: SystemPointingDevice.cpp:73
int getVendorID(void) const
Vendor identifier number.
Definition: SystemPointingDevice.cpp:47