X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.hh;h=460caa0cee00c09d5353fecb35800caf9517309c;hb=49a70012642a6d18529dc2efedc6e9c604c0a0b2;hp=eb3914aaa6206ddcf2454a59441c79ce1ac6df3b;hpb=d647de97bec82fa6c229a4801908b847f631f031;p=chaz%2Fopenbox diff --git a/src/openbox.hh b/src/openbox.hh index eb3914aa..460caa0c 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -102,6 +102,9 @@ private: //! A list of all the managed screens ScreenList _screens; + + //! The number of managed screens + int _managed_count; //! The action interface through which all user-available actions occur Actions *_actions; @@ -175,10 +178,22 @@ public: */ inline Screen *screen(int num) { assert(num >= 0); assert(num < (signed)ScreenCount(**otk::display)); - if (num >= (signed)_screens.size()) return 0; + if (num < 0 || num >= (signed)_screens.size()) return 0; return _screens[num]; } + inline int managedScreenCount() const { return _managed_count; } + + inline Screen *managedScreen(int num) { + assert(num >= 0); assert(num < _managed_count); + if (num < 0 || num >= _managed_count) return 0; + ScreenList::iterator it, end = _screens.end(); + int i = -1; + for (it = _screens.begin(); it != end; ++it) + if (*it && ++i == num) + return *it; + } + //! Returns the mouse cursors used throughout Openbox inline const Cursors &cursors() const { return _cursors; }