X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.hh;h=bb05fae81f8f4b544a14a076d4bbd3ec8e1f68e9;hb=3762f3c88f4d84697df37c0a3bdc733e7bee6e45;hp=e1837218c9e520b762111140a2c2075c6638c646;hpb=6bba50ef344168e3c6fdec4d349e090d408b4ebd;p=chaz%2Fopenbox diff --git a/src/openbox.hh b/src/openbox.hh index e1837218..bb05fae8 100644 --- a/src/openbox.hh +++ b/src/openbox.hh @@ -2,15 +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/timermanager.hh" +#include "otk/timerqueuemanager.hh" +#include "otk/property.hh" +#include "xeventhandler.hh" +#include "client.hh" namespace ob { @@ -36,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 @@ -61,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 @@ -68,6 +79,17 @@ private: */ otk::OBTimerQueueManager _timermanager; + //! 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; @@ -104,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 /*!