X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.hh;h=e718dd2520cb5d0ce727ef5712e0e6e0035e85e7;hb=7fe3301e7ea905a8a76d54c22751f3d8a346e28b;hp=fe49df15689eae342a8df2684fb93884622c5750;hpb=cdcc526a0274cace9f542960fe4eee4ddcc23d31;p=chaz%2Fopenbox diff --git a/src/openbox.hh b/src/openbox.hh index fe49df15..e718dd25 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -16,9 +16,6 @@ extern "C" { #include "otk/display.hh" #include "otk/screeninfo.hh" -#include "otk/timerqueuemanager.hh" -#include "otk/property.hh" -#include "otk/configuration.hh" #include "otk/eventdispatcher.hh" #include "otk/eventhandler.hh" @@ -75,9 +72,6 @@ public: typedef std::vector ScreenList; private: - //! The display on which Openbox is running - otk::Display _display; - // stuff that can be passed on the command line //! Path to the config file to use/in use /*! @@ -94,8 +88,6 @@ private: Defaults to $(HOME)/.openbox/user.py */ std::string _scriptfilepath; - //! The display requested by the user, or null to use the DISPLAY env var - char *_displayreq; //! The value of argv, i.e. how this application was executed char **_argv; //! Run the application in synchronous mode? (for debugging) @@ -109,21 +101,6 @@ private: //! A list of all the managed screens ScreenList _screens; - //! Manages all timers for the application - /*! - Use of the otk::TimerQueueManager::fire funtion in this object ensures - that all timers fire when their times elapse. - */ - otk::TimerQueueManager _timermanager; - - //! Cached atoms on the display - /*! - This is a pointer because the Property class uses otk::Display::display - in its constructor, so, it needs to be initialized after the display - is initialized in this class' constructor. - */ - otk::Property *_property; - //! The action interface through which all user-available actions occur Actions *_actions; @@ -185,35 +162,23 @@ public: //! Returns the state of the window manager (starting, exiting, etc) inline RunState state() const { return _state; } - //! Returns the otk::TimerQueueManager for the application - /*! - All otk::Timer objects used in the application should be made to use this - otk::TimerQueueManager. - */ - inline otk::TimerQueueManager *timerManager() { return &_timermanager; } - - //! Returns the otk::Property instance for the window manager - inline const otk::Property *property() const { return _property; } - //! Returns the Actions instance for the window manager inline Actions *actions() const { return _actions; } //! 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 >= 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; } @@ -259,8 +224,12 @@ public: _shutdown = true; _restart = true; _restart_prog = bin; } - //! Executes a command on a screen - void execute(int screen, const std::string &bin); + //! True if Openbox should be restarted instead of exiting + inline bool doRestart() const { return _restart; } + + //! The command line requested to be executed in place of restarting + //! Openbox the way it was run previously. + inline const std::string &restartProgram() const { return _restart_prog; } }; }