1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
6 @brief OBScreen manages a single screen
13 #include "otk/image.hh"
14 #include "otk/strut.hh"
15 #include "otk/rect.hh"
16 #include "otk/style.hh"
17 #include "otk/configuration.hh" // TEMPORARY
25 //! Manages a single screen
30 //! Holds a list of OBClient objects
31 typedef std::list<OBClient*> ClientList;
32 //! Holds a list of otk::Strut objects
33 typedef std::list<otk::Strut*> StrutList;
35 static const unsigned long event_mask = ColormapChangeMask |
39 SubstructureNotifyMask |
40 SubstructureRedirectMask |
45 //! Was %Openbox able to manage the screen?
48 //! The number of the screen on the X server
51 //! Information about this screen
52 const otk::ScreenInfo *_info;
54 //! The Image Control used for rendering on the screen
55 otk::BImageControl *_image_control;
57 //! The style with which to render on the screen
60 //! Is the root colormap currently installed?
61 bool _root_cmap_installed;
63 //! All managed clients on the screen
66 //! Area usable for placement etc (total - struts)
69 //! Areas of the screen reserved by applications
73 //! Calculate the OBScreen::_area member
75 //! Set the client list on the root window
77 Sets the _NET_CLIENT_LIST root window property.<br>
78 Also calls OBScreen::updateStackingList.
81 //! Set the client stacking list on the root window
83 Set the _NET_CLIENT_LIST_STACKING root window property.
85 void setStackingList();
86 //! Set the work area hint on the root window
88 Set the _NET_WORKAREA root window property.
93 //! Constructs a new OBScreen object
94 OBScreen(int screen, const otk::Configuration &config);
95 //! Destroys the OBScreen object
98 //! Returns if the screen was successfully managed
100 If this is false, then the screen should be deleted and should NOT be
103 inline bool managed() const { return _managed; }
104 //! Returns the Image Control used for rendering on the screen
105 inline otk::BImageControl *imageControl() { return _image_control; }
106 //! Returns the area of the screen not reserved by applications' Struts
107 inline const otk::Rect &area() const { return _area; }
108 //! Returns the style in use on the screen
109 inline const otk::Style *style() const { return &_style; }
112 //! Adds a window's strut to the screen's list of reserved spaces
113 void addStrut(otk::Strut *strut);
114 //! Removes a window's strut from the screen's list of reserved spaces
115 void removeStrut(otk::Strut *strut);
117 //! Loads a new style on the screen
118 void loadStyle(const otk::Configuration &config);
120 //! Manage any pre-existing windows on the screen
121 void manageExisting();
122 //! Manage a client window
124 This gives the window a frame, reparents it, selects events on it, etc.
126 void manageWindow(Window window);
127 //! Unmanage a client
129 This removes the window's frame, reparents it to root, unselects events on
132 void unmanageWindow(OBClient *client);