1 // -*- mode: C++; indent-tabs-mode: nil; -*-
19 static Display *display; // the X display
21 typedef std::vector<ScreenInfo> ScreenInfoList;
24 static bool _shape; // does the display have the shape extention?
25 static int _shape_event_basep; // base for shape events
27 static bool _xinerama; // does the display have the xinerama extention?
28 static int _xinerama_event_basep;// base for xinerama events
30 static unsigned int _mask_list[8];// a list of all combinations of lock masks
32 static ScreenInfoList _screenInfoList; // info for all screens on the display
34 static BGCCache *_gccache;
36 static int xerrorHandler(Display *d, XErrorEvent *e); // handles X errors duh
38 OBDisplay(); // this class cannot be instantiated
41 static void initialize(char *name);
42 static void destroy();
44 //! Returns the GC cache for the application
45 inline static BGCCache *gcCache() { return _gccache; }
48 Returns a ScreenInfo class, which gives information on a screen on the
50 \param snum The screen number of the screen to retrieve info on
51 \return Info on the requested screen, in a ScreenInfo class
53 inline static const ScreenInfo* screenInfo(int snum) {
55 assert(snum < static_cast<int>(_screenInfoList.size()));
56 return &_screenInfoList[snum];
59 //! Returns if the display has the shape extention available
60 inline static bool shape() { return _shape; }
61 //! Returns the shape extension's event base
62 inline static int shapeEventBase() { return _shape_event_basep; }
63 //! Returns if the display has the xinerama extention available
64 inline static bool xinerama() { return _xinerama; }
69 #endif // __display_hh