Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
 All Classes Functions Variables Typedefs Enumerator Pages
xorgDisplayDevice.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/output/linux/xorgDisplayDevice.h --
4  *
5  * Initial software
6  * Authors: 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 xorgDisplayDevice_h
17 #define xorgDisplayDevice_h
18 
19 #include <pointing/output/DisplayDevice.h>
20 
21 #include <X11/extensions/Xrandr.h>
22 #include <X11/Xlib.h>
23 
24 namespace pointing {
25 
27 
28  Display *dpy ;
29  int screen;
30  Window root;
31  XRRScreenResources *res;
32  XRROutputInfo* output_info;
33 
34  int displayID;
35 
36  typedef enum {NOTHING=0, BOUNDS=1, SIZE=2, REFRESHRATE=4} cachedinfo ;
37  int cached ;
38  DisplayDevice::Bounds cached_bounds ;
39  DisplayDevice::Size cached_size ;
40  double cached_refreshrate ;
41 
42  XRRModeInfo* get_mode_info(RRMode mode);
43  bool get_bounds(int* width, int* height, int* x, int* y);
44  int get_any_display_id();
45  void initialize();
46 
47  public:
48 
49  xorgDisplayDevice(void) ;
50  xorgDisplayDevice(URI uri) ;
51 
52  Bounds getBounds(Bounds *defval=0) ;
53  Size getSize(Size *defval=0) ;
54  double getRefreshRate(double *defval=0) ;
55 
56  URI getURI(bool expanded=false) const ;
57 
58  ~xorgDisplayDevice(void) ;
59 
60  } ;
61 
62 }
63 
64 #endif
Size getSize(Size *defval=0)
Definition: xorgDisplayDevice.cpp:149
Display bounds (origin and size) in pixels.
Definition: DisplayDevice.h:60
URI getURI(bool expanded=false) const
Definition: xorgDisplayDevice.cpp:170
DisplayDevice class is used to represent the displays connected to the computer.
Definition: DisplayDevice.h:31
Display size in mms.
Definition: DisplayDevice.h:51
Definition: xorgDisplayDevice.h:26
double getRefreshRate(double *defval=0)
Definition: xorgDisplayDevice.cpp:159
Bounds getBounds(Bounds *defval=0)
Definition: xorgDisplayDevice.cpp:132