X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fdisplay.hh;h=25c1b45af074efe32341d7a58025466204f526a9;hb=f8a47de5ec444c452093371e3db16857eb39a490;hp=e8613a04bf928273badc3699b8c1dc87da5f450e;hpb=91c7e5c378b1a639c6f5383915ed68b36b7735d4;p=chaz%2Fopenbox diff --git a/otk/display.hh b/otk/display.hh index e8613a04..25c1b45a 100644 --- a/otk/display.hh +++ b/otk/display.hh @@ -8,7 +8,6 @@ extern "C" { namespace otk { -class ScreenInfo; class RenderControl; class Display; @@ -53,44 +52,27 @@ private: //! The number of requested grabs on the display int _grab_count; - //! A list of information for all screens on the display - ScreenInfo** _screeninfo_list; + //! When true, X errors will be ignored. Use with care. + bool _ignore_errors; - //! A list of RenderControl objects, which are used for all graphics on a - //! screen - RenderControl** _rendercontrol_list; + //! The optimal visual for the display + Visual *_visual; - // Handles X errors on the display - /* - Displays the error if compiled for debugging. - */ - //int xerrorHandler(::Display *d, XErrorEvent *e); + //! Our colormap built for the optimal visual + Colormap _colormap; + //! The depth of our optimal visual + int _depth; + public: - //! Initializes the class, opens the X display + //! Wraps an open Display connection /*! - The DISPLAY environment variable is used to choose the display. - @see Display::display + @param d An open Display connection. */ - Display(); + Display(::Display *d); //! Destroys the class, closes the X display ~Display(); - //! Gets information on a specific screen - /*! - Returns a ScreenInfo class, which contains information for a screen on the - display. - @param snum The screen number of the screen to retrieve info on - @return Info on the requested screen, in a ScreenInfo class - */ - const ScreenInfo* screenInfo(int snum) const; - - //! Find a ScreenInfo based on a root window - const ScreenInfo* findScreen(Window root) const; - - //! Gets the RenderControl for a screen - const RenderControl *renderControl(int snum) const; - //! Returns if the display has the xkb extension available inline bool xkb() const { return _xkb; } //! Returns the xkb extension's event base @@ -109,6 +91,11 @@ public: inline ::Display* operator*() const { return _display; } + //! When true, X errors will be ignored. + inline bool ignoreErrors() const { return _ignore_errors; } + //! Set whether X errors should be ignored. Use with care. + void setIgnoreErrors(bool t); + //! Grabs the display void grab(); @@ -131,6 +118,7 @@ public: bool allow_scroll_lock) const; void ungrabKey(unsigned int keycode, unsigned int modifiers, Window grab_window) const; + void ungrabAllKeys(Window grab_window) const; }; }