]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.hh
pretty sure all frame elements are placed correctly now
[chaz/openbox] / src / openbox.hh
index f49f711d2be0a36bb0f200f8a30b463a4aa868aa..bb05fae81f8f4b544a14a076d4bbd3ec8e1f68e9 100644 (file)
@@ -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 <X11/Xlib.h>
 }
 
 #include <string>
 #include <vector>
+#include <map>
 
 #include "otk/screeninfo.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<Window, OBClient *> 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 <b>after</b> 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
   /*!
This page took 0.022928 seconds and 4 git commands to generate.