Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
osxDisplayDevice.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/output/osx/osxDisplayDevice.h --
4  *
5  * Initial software
6  * Authors: Géry Casiez, Nicolas Roussel
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 osxDisplayDevice_h
17 #define osxDisplayDevice_h
18 
19 #include <pointing/output/DisplayDevice.h>
20 
21 #include <ApplicationServices/ApplicationServices.h>
22 
23 namespace pointing {
24 
30 
31  CGDirectDisplayID displayID ;
32 
33  typedef enum {NOTHING=0, BOUNDS=1, SIZE=2, REFRESHRATE=4} cachedinfo ;
34  int cached ;
35 
41  DisplayDevice::Bounds cached_bounds ;
42  DisplayDevice::Size cached_size ;
43  double cached_refreshrate ;
45 
49  void cacheAll(URI &uri);
50 
54  void listDisplays(std::ostream& out) ;
55 
56  public:
57 
58  osxDisplayDevice(void) ;
59  osxDisplayDevice(URI uri) ;
60  osxDisplayDevice(CGDirectDisplayID did) ;
61 
62  Bounds getBounds(Bounds *defval=0) ;
63  Size getSize(Size *defval=0) ;
64  double getRefreshRate(double *defval=0) ;
65 
66  URI getURI(bool expanded=false) const ;
67 
68  } ;
69 
70 }
71 
72 #endif
Display size in mms.
Definition: DisplayDevice.h:51
Display bounds (origin and size) in pixels.
Definition: DisplayDevice.h:60
The osxDisplayDevice class is a platform specific subclass of DisplayDevice which is implemented to w...
Definition: osxDisplayDevice.h:29
Bounds getBounds(Bounds *defval=0)
Definition: osxDisplayDevice.cpp:98
double getRefreshRate(double *defval=0)
Definition: osxDisplayDevice.cpp:129
Definition: DummyPointingDevice.cpp:23
URI getURI(bool expanded=false) const
Definition: osxDisplayDevice.cpp:143
Size getSize(Size *defval=0)
Definition: osxDisplayDevice.cpp:118
DisplayDevice class is used to represent the displays connected to the computer.
Definition: DisplayDevice.h:31