]> Dogcows Code - chaz/openbox/blob - otk/display.hh
13ceaa3628d04bdfe3cc94b8c6adca8f7754541b
[chaz/openbox] / otk / display.hh
1 // -*- mode: C++; indent-tabs-mode: nil; -*-
2 #ifndef __display_hh
3 #define __display_hh
4
5 extern "C" {
6 #include <X11/Xlib.h>
7 }
8
9 #include <vector>
10
11 namespace otk {
12
13 class ScreenInfo;
14 class BGCCache;
15
16 class OBDisplay
17 {
18 public:
19 static Display *display; // the X display
20
21 typedef std::vector<ScreenInfo> ScreenInfoList;
22
23 private:
24 static bool _shape; // does the display have the shape extention?
25 static int _shape_event_basep; // base for shape events
26
27 static bool _xinerama; // does the display have the xinerama extention?
28 static int _xinerama_event_basep;// base for xinerama events
29
30 static unsigned int _mask_list[8];// a list of all combinations of lock masks
31
32 static ScreenInfoList _screenInfoList; // info for all screens on the display
33
34 static BGCCache *_gccache;
35
36 static int xerrorHandler(Display *d, XErrorEvent *e); // handles X errors duh
37
38 OBDisplay(); // this class cannot be instantiated
39
40 public:
41 static void initialize(char *name);
42 static void destroy();
43
44 //! Returns the GC cache for the application
45 inline static BGCCache *gcCache() { return _gccache; }
46
47 /*!
48 Returns a ScreenInfo class, which gives information on a screen on the
49 display.
50 \param snum The screen number of the screen to retrieve info on
51 \return Info on the requested screen, in a ScreenInfo class
52 */
53 static const ScreenInfo* screenInfo(int snum);
54
55 //! Returns if the display has the shape extention available
56 inline static bool shape() { return _shape; }
57 //! Returns the shape extension's event base
58 inline static int shapeEventBase() { return _shape_event_basep; }
59 //! Returns if the display has the xinerama extention available
60 inline static bool xinerama() { return _xinerama; }
61
62
63
64
65
66 /* TEMPORARY */
67 static void grabButton(unsigned int button, unsigned int modifiers,
68 Window grab_window, bool owner_events,
69 unsigned int event_mask, int pointer_mode,
70 int keyboard_mode, Window confine_to, Cursor cursor,
71 bool allow_scroll_lock);
72 static void ungrabButton(unsigned int button, unsigned int modifiers,
73 Window grab_window);
74 };
75
76 }
77
78 #endif // __display_hh
This page took 0.037099 seconds and 3 git commands to generate.