X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FXDisplay.h;h=3c4230bdc78f8b8075d094f4126ccab577ffc4ab;hb=20d7381ffb3b7b918c0f6120cce8c0343a50ce83;hp=3b58003f5522c8df032d7341d1db832bde1b99bd;hpb=91a7ca7d206f2ce09a0eb1229db57b67d9bafc67;p=chaz%2Fopenbox diff --git a/src/XDisplay.h b/src/XDisplay.h index 3b58003f..3c4230bd 100644 --- a/src/XDisplay.h +++ b/src/XDisplay.h @@ -39,10 +39,19 @@ private: bool _hasshape; int _shape_event_base; - typedef std::vector XScreenList; - XScreenList _screens; - - static int XErrorHandler(Display *d, XErrorEvent *e); +#ifndef NOCLOBBER + // the server's values for the lock key modifiers + void getLockModifiers(); + unsigned int MaskList[8]; + // the masks of the modifiers which are ignored in button events. + int NumLockMask, ScrollLockMask; +#endif // NOCLOBBER + + + // X error handling + static int errorHandler(Display *d, XErrorEvent *e); + static std::string _app_name; + static Window _last_bad_window; // no copying!! XDisplay(const XDisplay &); @@ -52,28 +61,37 @@ protected: virtual void process_event(XEvent *) = 0; public: - XDisplay(const char *dpyname = 0); + XDisplay(const std::string &application_name, const char *dpyname = 0); virtual ~XDisplay(); - XScreen *screen(unsigned int s) const; - inline unsigned int screenCount() const { return _screens.size(); } + inline virtual unsigned int screenCount() const + { return ScreenCount(_display); } inline bool hasShape() const { return _hasshape; } inline int shapeEventBase() const { return _shape_event_base; } //inline Display *display() const { return _display; } + inline std::string applicationName() const { return _app_name; } inline std::string name() const { return _name; } - - // these belong in Xwindow - //const bool validateWindow(Window); - //void grabButton(unsigned int, unsigned int, Window, Bool, unsigned int, int, - // int, Window, Cursor) const; - //void ungrabButton(unsigned int button, unsigned int modifiers, - // Window grab_window) const; void grab(); void ungrab(); + + bool nextEvent(XEvent &e); + + int connectionNumber() const; + + Cursor createCursor(unsigned int shape) const; + + unsigned int stripModifiers(const unsigned int state) const; + + // these belong in Xwindow + const bool validateWindow(Window); + void grabButton(unsigned int, unsigned int, Window, Bool, unsigned int, int, + int, Window, Cursor) const; + void ungrabButton(unsigned int button, unsigned int modifiers, + Window grab_window) const; }; #endif // _XDisplay_h