Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
Classes | Public Member Functions | Static Public Member Functions | List of all members
pointing::DisplayDevice Class Referenceabstract

DisplayDevice class is used to represent the displays connected to the computer. More...

#include <DisplayDevice.h>

Inheritance diagram for pointing::DisplayDevice:
pointing::DummyDisplayDevice pointing::osxDisplayDevice pointing::winDisplayDevice pointing::xorgDisplayDevice

Classes

struct  Bounds
 Display bounds (origin and size) in pixels. More...
 
struct  Point
 A structure to maintain coordinates of a pixel. More...
 
struct  Size
 Display size in mms. More...
 

Public Member Functions

virtual Bounds getBounds (Bounds *defval=0)=0
 
virtual Size getSize (Size *defval=0)=0
 
virtual double getResolution (double *hppi, double *vppi, double *defval=0)
 Computes the pixel density (resolution) of the display device. More...
 
double getResolution (double *defval=0)
 
virtual double getRefreshRate (double *defval=0)=0
 
virtual URI getURI (bool expanded=false) const =0
 
virtual void setDebugLevel (int)
 Sets the level of information for debugging purposes (default = 0).
 
virtual void debug (std::ostream &) const
 

Static Public Member Functions

static DisplayDevicecreate (const char *device_uri=0)
 Static create method is used to instantiate an object of the class.
 
static DisplayDevicecreate (std::string device_uri)
 

Detailed Description

DisplayDevice class is used to represent the displays connected to the computer.

It is an abstract class which creates an instance of its platform-specific subclass.

Member Function Documentation

virtual Bounds pointing::DisplayDevice::getBounds ( Bounds defval = 0)
pure virtual
virtual double pointing::DisplayDevice::getRefreshRate ( double *  defval = 0)
pure virtual
Returns
The refresh rate of the device in Hz.

Implemented in pointing::DummyDisplayDevice, pointing::osxDisplayDevice, pointing::xorgDisplayDevice, and pointing::winDisplayDevice.

double pointing::DisplayDevice::getResolution ( double *  hppi,
double *  vppi,
double *  defval = 0 
)
virtual

Computes the pixel density (resolution) of the display device.

It is computed by calculating the diagonal size of the display in pixels and inches and then calculating PPI (Pixels per inch).

Parameters
hppiHorizontal resolution (OUT)
vppiVertical resolution (OUT)
defvalDefault value
Returns
PPI resolution

Reimplemented in pointing::DummyDisplayDevice.

virtual Size pointing::DisplayDevice::getSize ( Size defval = 0)
pure virtual
Returns
The size of the device (width and height) in mm.

Implemented in pointing::DummyDisplayDevice, pointing::osxDisplayDevice, pointing::xorgDisplayDevice, and pointing::winDisplayDevice.

virtual URI pointing::DisplayDevice::getURI ( bool  expanded = false) const
pure virtual
Returns
The corresponding URI of the device.
Parameters
expandedspecifies if additional parameters must be displayed

Implemented in pointing::DummyDisplayDevice, pointing::osxDisplayDevice, pointing::xorgDisplayDevice, and pointing::winDisplayDevice.


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