X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fdisplay.hh;h=db9834d9d4c500569b3287da019c960d9cbb63ce;hb=df0447ce6d57c6ece97e69fc0874595e4ac0ae75;hp=0dc59481d3d5bd6898a634265fa9d3d7338b03b4;hpb=c97915f445017d36667a6ad32767fa41d14d23b1;p=chaz%2Fopenbox diff --git a/otk/display.hh b/otk/display.hh index 0dc59481..db9834d9 100644 --- a/otk/display.hh +++ b/otk/display.hh @@ -6,12 +6,10 @@ extern "C" { #include } -#include - namespace otk { class ScreenInfo; -class GCCache; +class RenderControl; class Display; @@ -19,17 +17,8 @@ class Display; extern Display *display; //! Manages a single X11 display. -/*! - This class is static, and cannot be instantiated. - Use the initialize() method to open the display and ready it for use. - Use the destroy() method to close it and clean up the class' data. -*/ class Display { -public: - //! A List of ScreenInfo instances - typedef std::vector ScreenInfoList; - private: //! The X display ::Display *_display; @@ -58,27 +47,21 @@ private: //! The value of the mask for the ScrollLock modifier unsigned int _scroll_lock_mask; + //! The key codes for the modifier keys + XModifierKeymap *_modmap; + //! The number of requested grabs on the display int _grab_count; - //! A list of information for all screens on the display - ScreenInfoList _screenInfoList; + //! When true, X errors will be ignored. Use with care. + bool _ignore_errors; - //! A cache for re-using GCs, used by the drawing objects - /*! - @see Pen - @see Font - @see Image - @see ImageControl - @see Texture - */ - GCCache *_gccache; + //! A list of information for all screens on the display + ScreenInfo** _screeninfo_list; - // Handles X errors on the display - /* - Displays the error if compiled for debugging. - */ - //int xerrorHandler(::Display *d, XErrorEvent *e); + //! A list of RenderControl objects, which are used for all graphics on a + //! screen + RenderControl** _rendercontrol_list; public: //! Initializes the class, opens the X display @@ -90,9 +73,6 @@ public: //! Destroys the class, closes the X display ~Display(); - //! Returns the GC cache for the application - inline GCCache *gcCache() const { return _gccache; } - //! Gets information on a specific screen /*! Returns a ScreenInfo class, which contains information for a screen on the @@ -100,10 +80,13 @@ public: @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 ScreenInfo* screenInfo(int snum) const; //! Find a ScreenInfo based on a root window - const ScreenInfo* findScreen(Window root); + 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; } @@ -119,9 +102,15 @@ public: inline unsigned int numLockMask() const { return _num_lock_mask; } inline unsigned int scrollLockMask() const { return _scroll_lock_mask; } + const XModifierKeymap *modifierMap() const { return _modmap; } 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();