diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-19 19:28:11 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-19 19:28:11 +0000 |
| commit | feaf3ac4e5847d27e3747b09e7443915afa97b0b (patch) | |
| tree | 6548af5ed3f15b15b2d3e4a66a2b9795b0a4e18b /src/openbox.hh | |
| parent | 1dac42d9ed074bcd44f9d1016b0971ae473cc2eb (diff) | |
time to refactor shit hard
Diffstat (limited to 'src/openbox.hh')
| -rw-r--r-- | src/openbox.hh | 17 |
1 files changed, 16 insertions, 1 deletions
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; } |
