Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
Classes | Public Member Functions | List of all members
pointing::osxHIDPointingDevice Class Reference
Inheritance diagram for pointing::osxHIDPointingDevice:
pointing::PointingDevice

Public Member Functions

 osxHIDPointingDevice (URI uri)
 
bool isActive (void) const
 Indicates whether the current device is active. More...
 
int getVendorID (void) const
 Vendor identifier number. More...
 
std::string getVendor (void) const
 Readable vendor name. More...
 
int getProductID (void) const
 Product identifier number. More...
 
std::string getProduct (void) const
 Readable product name. More...
 
double getResolution (double *defval=0) const
 Resolution of the mouse in CPI (counts per inch). More...
 
double getUpdateFrequency (double *defval=0) const
 Update frequency of the mouse in Hz. More...
 
URI getURI (bool expanded=false, bool crossplatform=false) const
 Constructs the URI according to the parameters of the device. More...
 
void setPointingCallback (PointingCallback callback, void *context=0)
 Sets the callback function which is called when device events occur. More...
 
void setDebugLevel (int level)
 Sets the level of information for debugging purposes (default = 0).
 
- Public Member Functions inherited from pointing::PointingDevice
virtual void debug (std::ostream &) const
 Outputs the debug information to the given output stream.
 
int mm2counts (double millimeters) const
 
double counts2mm (int counts) const
 
int in2counts (double inches) const
 
double counts2in (int counts) const
 

Additional Inherited Members

- Public Types inherited from pointing::PointingDevice
enum  { BUTTON_1 =1, BUTTON_2 =2, BUTTON_3 =4 }
 
typedef void(* PointingCallback )(void *context, TimeStamp::inttime timestamp, int dx, int dy, int buttons)
 
- Static Public Member Functions inherited from pointing::PointingDevice
static void idle (int milliseconds)
 The function is used to sleep the current thread. More...
 
static PointingDevicecreate (const char *device_uri=0)
 This static function is used to instantiate a platform-specific object of the class. More...
 
static PointingDevicecreate (std::string device_uri)
 This static function is used to instantiate a platform-specific object of the class. More...
 
- Protected Member Functions inherited from pointing::PointingDevice
void registerTimestamp (TimeStamp::inttime timestamp)
 registerTimestamp Registers the current timestamp to calculate frequency of the device More...
 
double estimatedUpdateFrequency () const
 estimatedUpdateFrequency Estimates the frequency depending on the input timestamps More...
 
- Protected Attributes inherited from pointing::PointingDevice
unsigned long buckets [BUCKETS_SIZE]
 
TimeStamp::inttime lastTime
 
- Static Protected Attributes inherited from pointing::PointingDevice
static const int BUCKETS_SIZE = 5
 

Member Function Documentation

std::string pointing::osxHIDPointingDevice::getProduct ( void  ) const
virtual

Readable product name.

Returns
Product name

Reimplemented from pointing::PointingDevice.

int pointing::osxHIDPointingDevice::getProductID ( void  ) const
virtual

Product identifier number.

Returns
Product number associated with the device

Reimplemented from pointing::PointingDevice.

double pointing::osxHIDPointingDevice::getResolution ( double *  defval = 0) const
virtual

Resolution of the mouse in CPI (counts per inch).

Parameters
defvalis input variable to define explicitly the resolution.
Returns
Resolution in CPI (if not available 400 cpi).

Implements pointing::PointingDevice.

double pointing::osxHIDPointingDevice::getUpdateFrequency ( double *  defval = 0) const
virtual

Update frequency of the mouse in Hz.

Parameters
defvalis input variable to define explicitly the update frequency.
Returns
Update frequency in Hz (if not available 125 Hz).

Implements pointing::PointingDevice.

URI pointing::osxHIDPointingDevice::getURI ( bool  expanded = false,
bool  crossplatform = false 
) const
virtual

Constructs the URI according to the parameters of the device.

Parameters
expandedspecifies if additional parameters must be displayed.
crossplatformdefines whether the URI should be crossplatform. if True vendorId and productId are included in the URI
Returns
The corresponding URI of the device.

Implements pointing::PointingDevice.

std::string pointing::osxHIDPointingDevice::getVendor ( void  ) const
virtual

Readable vendor name.

Returns
Vendor name

Reimplemented from pointing::PointingDevice.

int pointing::osxHIDPointingDevice::getVendorID ( void  ) const
virtual

Vendor identifier number.

Returns
integer number associated with vendor of the device

Reimplemented from pointing::PointingDevice.

bool pointing::osxHIDPointingDevice::isActive ( void  ) const
virtual

Indicates whether the current device is active.

Returns
true if active

Reimplemented from pointing::PointingDevice.

void pointing::osxHIDPointingDevice::setPointingCallback ( PointingCallback  callback,
void *  context = 0 
)
virtual

Sets the callback function which is called when device events occur.

Parameters
callbackThe pointer to the callback function.
contextThe pointer to anything that can be used in the callback function.

Implements pointing::PointingDevice.


The documentation for this class was generated from the following files: