X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.hh;h=bb05fae81f8f4b544a14a076d4bbd3ec8e1f68e9;hb=00b96c7846e715698d0f635887a3eff009deb0c8;hp=4eef803e5d5ba85a03362027676d5a8d788d7cc0;hpb=45c2589ef6e6576604543229dfa1582d471e6a94;p=chaz%2Fopenbox diff --git a/src/openbox.hh b/src/openbox.hh index 4eef803e..bb05fae8 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -2,16 +2,23 @@ #ifndef __openbox_hh #define __openbox_hh +/*! @file openbox.hh + @brief The main class for the Openbox window manager +*/ + extern "C" { #include } #include #include +#include #include "otk/screeninfo.hh" #include "otk/timerqueuemanager.hh" +#include "otk/property.hh" #include "xeventhandler.hh" +#include "client.hh" namespace ob { @@ -37,13 +44,13 @@ public: //! The posible running states of the window manager enum RunState { - //! The window manager is starting up (being created) - State_Starting, - //! The window manager is running in its normal state - State_Normal, - //! The window manager is exiting (being destroyed) - State_Exiting + State_Starting, //!< The window manager is starting up (being created) + State_Normal, //!< The window manager is running in its normal state + State_Exiting //!< The window manager is exiting (being destroyed) }; + + //! A map for looking up a specific client class from the window id + typedef std::map ClientMap; private: // stuff that can be passed on the command line @@ -62,6 +69,9 @@ private: //! The value of argv[0], i.e. how this application was executed char *_argv0; + //! A list of all managed clients + ClientMap _clients; + //! Manages all timers for the application /*! Use of the otk::OBTimerQueueManager::fire funtion in this object ensures @@ -72,6 +82,14 @@ private: //! The class which will handle raw XEvents OBXEventHandler _xeventhandler; + //! Cached atoms on the display + /*! + This is a pointer because the OBProperty class uses otk::OBDisplay::display + in its constructor, so, it needs to be initialized after the display + is initialized in this class' constructor. + */ + otk::OBProperty *_property; + //! The running state of the window manager RunState _state; @@ -108,16 +126,24 @@ public: */ inline otk::OBTimerQueueManager *timerManager() { return &_timermanager; } + inline const otk::OBProperty *property() const { return _property; } + //! The main function of the Openbox class /*! This function should be called after instantiating the Openbox class. - Loops indefinately while handling all events in the application. + It loops indefinately while handling all events for the application. The Openbox::shutdown method will cause this function to exit. */ void eventLoop(); - // XXX: TEMPORARY!#!@%*!^#*!#!#! - virtual void process_event(XEvent *) = 0; + //! Adds an OBClient to the client list for lookups + void addClient(Window window, OBClient *client); + + //! Removes an OBClient from the client list for lookups + void removeClient(Window window); + + //! Finds an OBClient based on its window id + OBClient *findClient(Window window); //! Requests that the window manager exit /*!