X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.hh;h=bdd4272d0b10446bb3312510ae7d5ad5ba28269c;hb=b9ac2d30cf65fc3147f23d023942b3e6f8a4f29c;hp=2b8e8b07f5b1aab3ff0e120063baf19656409731;hpb=084d6f4e42396a5d2baf72877b5abf3ae6fef7be;p=chaz%2Fopenbox diff --git a/src/openbox.hh b/src/openbox.hh index 2b8e8b07..bdd4272d 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -16,7 +16,6 @@ extern "C" { #include "otk/display.hh" #include "otk/screeninfo.hh" -#include "otk/configuration.hh" #include "otk/eventdispatcher.hh" #include "otk/eventhandler.hh" @@ -174,19 +173,17 @@ public: //! Returns the Bindings instance for the window manager inline Bindings *bindings() const { return _bindings; } - //! Returns a managed screen + //! Returns a managed screen or a null pointer + /*! + ALWAYS check the return value for a non-null, as any unmanaged screens + will return one. This includes screen(0) if the first managed screen is 1. + */ inline Screen *screen(int num) { - assert(num >= 0); assert(num < (signed)_screens.size()); - if (num < 0 || num >= screenCount()) - return NULL; + assert(num >= 0); assert(num < (signed)ScreenCount(**otk::display)); + if (num >= (signed)_screens.size()) return 0; return _screens[num]; } - //! Returns the number of managed screens - inline int screenCount() const { - return (signed)_screens.size(); - } - //! Returns the mouse cursors used throughout Openbox inline const Cursors &cursors() const { return _cursors; } @@ -231,9 +228,6 @@ public: inline void restart(const std::string &bin = "") { _shutdown = true; _restart = true; _restart_prog = bin; } - - //! Executes a command on a screen - void execute(int screen, const std::string &bin); }; }