]> icculus.org git repositories - mikachu/openbox.git/blob - src/rootwindow.hh
add a skeletal OBActions class for user actions
[mikachu/openbox.git] / src / rootwindow.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef   __rootwindow_hh
3 #define   __rootwindow_hh
4
5 /*! @file client.hh
6   @brief The OBClient class maintains the state of a client window by handling
7   property changes on the window and some client messages
8 */
9
10 extern "C" {
11 #include <X11/Xlib.h>
12
13 #ifdef    SHAPE
14 #include <X11/extensions/shape.h>
15 #endif // SHAPE
16 }
17
18 #include <string>
19 #include <vector>
20
21 #include "otk/screeninfo.hh"
22 #include "otk/eventhandler.hh"
23 #include "otk/property.hh"
24
25 namespace ob {
26
27 //! Maintains the state of a root window's properties.
28 /*!
29   OBRootWindow maintains the state of a root window. The state consists of the
30   hints that the wm sets on the window, such as the number of desktops,
31   gravity.
32   <p>
33   OBRootWindow also manages client messages for the root window.
34 */
35 class OBRootWindow : public otk::OtkEventHandler {
36 private:
37   //! Information about this screen
38   const otk::ScreenInfo *_info;
39
40   //! The names of all desktops
41   otk::OBProperty::StringVect _names;
42
43   //! Get desktop names from the 
44   void updateDesktopNames();
45
46 public:
47   //! Constructs a new OBRootWindow for a screen
48   /*!
49     @param screen The screen whose root window to wrap
50   */
51   OBRootWindow(int screen);
52   //! Destroys the OBRootWindow object
53   virtual ~OBRootWindow();
54
55   //! Sets the name of a desktop
56   /*!
57     @param i The index of the desktop to set the name for (base 0)
58     @param name The name to set for the desktop
59   */
60   void setDesktopName(int i, const std::string &name);
61
62   virtual void propertyHandler(const XPropertyEvent &e);
63   virtual void clientMessageHandler(const XClientMessageEvent &e);
64   virtual void mapRequestHandler(const XMapRequestEvent &);
65   virtual void configureRequestHandler(const XConfigureRequestEvent &e);
66 };
67
68 }
69
70 #endif // __client_hh