diff options
author | fluxgen <fluxgen> | 2003-05-15 11:17:29 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-05-15 11:17:29 (GMT) |
commit | cbce8634dde14fd7000fde92e86f4bd4bf3525c2 (patch) | |
tree | b3be6c129906ecb67114616d761184cf3375c891 /src/Window.hh | |
parent | 93220b5f1abee3057b292abb958a437ebbc707b4 (diff) | |
download | fluxbox-cbce8634dde14fd7000fde92e86f4bd4bf3525c2.zip fluxbox-cbce8634dde14fd7000fde92e86f4bd4bf3525c2.tar.bz2 |
cleaning in FluxboxWindow interface
Diffstat (limited to 'src/Window.hh')
-rw-r--r-- | src/Window.hh | 75 |
1 files changed, 30 insertions, 45 deletions
diff --git a/src/Window.hh b/src/Window.hh index 7285acf..9b99f0f 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -1,5 +1,5 @@ | |||
1 | // Window.hh for Fluxbox Window Manager | 1 | // Window.hh for Fluxbox Window Manager |
2 | // Copyright (c) 2001-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) | 2 | // Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Window.hh for Blackbox - an X11 Window manager | 4 | // Window.hh for Blackbox - an X11 Window manager |
5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) | 5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) |
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.hh,v 1.72 2003/05/14 14:43:06 fluxgen Exp $ | 25 | // $Id: Window.hh,v 1.73 2003/05/15 11:17:27 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef WINDOW_HH | 27 | #ifndef WINDOW_HH |
28 | #define WINDOW_HH | 28 | #define WINDOW_HH |
@@ -30,29 +30,22 @@ | |||
30 | #include "Timer.hh" | 30 | #include "Timer.hh" |
31 | #include "Menu.hh" | 31 | #include "Menu.hh" |
32 | #include "Subject.hh" | 32 | #include "Subject.hh" |
33 | #include "FbWinFrame.hh" | ||
34 | #include "EventHandler.hh" | 33 | #include "EventHandler.hh" |
35 | #include "XLayerItem.hh" | 34 | #include "XLayerItem.hh" |
36 | #include "LayerMenu.hh" | ||
37 | 35 | ||
38 | #include <X11/Xlib.h> | 36 | #include <X11/Xlib.h> |
39 | #include <X11/Xutil.h> | 37 | #include <X11/Xutil.h> |
40 | 38 | ||
41 | #ifdef SHAPE | ||
42 | #include <X11/extensions/shape.h> | ||
43 | #endif // SHAPE | ||
44 | |||
45 | #include <vector> | 39 | #include <vector> |
46 | #include <string> | 40 | #include <string> |
47 | #include <memory> | 41 | #include <memory> |
48 | #include <map> | 42 | #include <map> |
49 | 43 | ||
50 | #define PropMwmHintsElements 3 | ||
51 | |||
52 | class WinClient; | 44 | class WinClient; |
53 | class FbWinFrameTheme; | 45 | class FbWinFrameTheme; |
54 | class BScreen; | 46 | class BScreen; |
55 | class TextButton; | 47 | class TextButton; |
48 | class FbWinFrame; | ||
56 | 49 | ||
57 | namespace FbTk { | 50 | namespace FbTk { |
58 | class MenuTheme; | 51 | class MenuTheme; |
@@ -60,7 +53,6 @@ class ImageControl; | |||
60 | class XLayer; | 53 | class XLayer; |
61 | }; | 54 | }; |
62 | 55 | ||
63 | |||
64 | /// Creates the window frame and handles any window event for it | 56 | /// Creates the window frame and handles any window event for it |
65 | class FluxboxWindow : public FbTk::TimeoutHandler, public FbTk::EventHandler { | 57 | class FluxboxWindow : public FbTk::TimeoutHandler, public FbTk::EventHandler { |
66 | public: | 58 | public: |
@@ -112,6 +104,7 @@ public: | |||
112 | 104 | ||
113 | static const int PropBlackboxHintsElements = 5; | 105 | static const int PropBlackboxHintsElements = 5; |
114 | static const int PropBlackboxAttributesElements = 8; | 106 | static const int PropBlackboxAttributesElements = 8; |
107 | static const int PropMwmHintsElements = 3; | ||
115 | 108 | ||
116 | typedef struct _blackbox_hints { | 109 | typedef struct _blackbox_hints { |
117 | unsigned long flags, attrib, workspace, stack; | 110 | unsigned long flags, attrib, workspace, stack; |
@@ -249,13 +242,9 @@ public: | |||
249 | DECORM_LAST = (1<<11) // useful for getting "All" | 242 | DECORM_LAST = (1<<11) // useful for getting "All" |
250 | }; | 243 | }; |
251 | 244 | ||
252 | unsigned int getDecorationMask() const; | 245 | unsigned int decorationMask() const; |
253 | void setDecorationMask(unsigned int mask); | 246 | void setDecorationMask(unsigned int mask); |
254 | 247 | ||
255 | #ifdef SHAPE | ||
256 | void shapeEvent(XShapeEvent *event); | ||
257 | #endif // SHAPE | ||
258 | |||
259 | virtual void timeout(); | 248 | virtual void timeout(); |
260 | 249 | ||
261 | /** | 250 | /** |
@@ -264,7 +253,7 @@ public: | |||
264 | //@{ | 253 | //@{ |
265 | inline bool isManaged() const { return m_managed; } | 254 | inline bool isManaged() const { return m_managed; } |
266 | inline bool isFocused() const { return focused; } | 255 | inline bool isFocused() const { return focused; } |
267 | inline bool isVisible() const { return m_frame.isVisible(); } | 256 | bool isVisible() const; |
268 | inline bool isIconic() const { return iconic; } | 257 | inline bool isIconic() const { return iconic; } |
269 | inline bool isShaded() const { return shaded; } | 258 | inline bool isShaded() const { return shaded; } |
270 | inline bool isMaximized() const { return maximized; } | 259 | inline bool isMaximized() const { return maximized; } |
@@ -286,46 +275,42 @@ public: | |||
286 | inline const BScreen &screen() const { return m_screen; } | 275 | inline const BScreen &screen() const { return m_screen; } |
287 | inline BScreen &screen() { return m_screen; } | 276 | inline BScreen &screen() { return m_screen; } |
288 | 277 | ||
289 | inline const FbTk::XLayerItem &getLayerItem() const { return m_layeritem; } | 278 | inline const FbTk::XLayerItem &layerItem() const { return m_layeritem; } |
290 | inline FbTk::XLayerItem &getLayerItem() { return m_layeritem; } | 279 | inline FbTk::XLayerItem &layerItem() { return m_layeritem; } |
291 | 280 | ||
292 | Window getClientWindow() const; | 281 | Window clientWindow() const; |
293 | 282 | ||
294 | FbTk::FbWindow &getFbWindow() { return m_frame.window(); } | 283 | FbTk::FbWindow &fbWindow(); |
295 | const FbTk::FbWindow &getFbWindow() const { return m_frame.window(); } | 284 | const FbTk::FbWindow &fbWindow() const; |
296 | 285 | ||
297 | FbTk::Menu &getWindowmenu() { return m_windowmenu; } | 286 | FbTk::Menu &menu() { return m_windowmenu; } |
298 | const FbTk::Menu &getWindowmenu() const { return m_windowmenu; } | 287 | const FbTk::Menu &menu() const { return m_windowmenu; } |
299 | 288 | ||
300 | FbTk::Menu &getLayermenu() { return m_layermenu; } | 289 | FbTk::Menu &layermenu() { return *m_layermenu.get(); } |
301 | const FbTk::Menu &getLayermenu() const { return m_layermenu; } | 290 | const FbTk::Menu &layermenu() const { return *m_layermenu.get(); } |
302 | 291 | ||
303 | const FbTk::FbWindow &parent() const { return m_parent; } | 292 | const FbTk::FbWindow &parent() const { return m_parent; } |
304 | FbTk::FbWindow &parent() { return m_parent; } | 293 | FbTk::FbWindow &parent() { return m_parent; } |
305 | 294 | ||
306 | const std::string &getTitle() const; | 295 | const std::string &title() const; |
307 | const std::string &getIconTitle() const; | 296 | const std::string &iconTitle() const; |
308 | int getXFrame() const { return m_frame.x(); } | 297 | int x() const; |
309 | int getYFrame() const { return m_frame.y(); } | 298 | int y() const; |
310 | int getXClient() const; | 299 | unsigned int workspaceNumber() const { return m_workspace_number; } |
311 | int getYClient() const; | 300 | int windowNumber() const { return m_window_number; } |
312 | unsigned int getWorkspaceNumber() const { return m_workspace_number; } | 301 | int layerNum() const { return m_layernum; } |
313 | int getWindowNumber() const { return m_window_number; } | ||
314 | int getLayerNum() const { return m_layernum; } | ||
315 | void setLayerNum(int layernum); | 302 | void setLayerNum(int layernum); |
316 | 303 | ||
317 | unsigned int width() const { return m_frame.width(); } | 304 | unsigned int width() const; |
318 | unsigned int height() const { return m_frame.height(); } | 305 | unsigned int height() const; |
319 | unsigned int getClientHeight() const; | 306 | unsigned int titleHeight() const; |
320 | unsigned int getClientWidth() const; | ||
321 | unsigned int getTitleHeight() const { return m_frame.titleHeight(); } | ||
322 | const std::string &className() const { return m_class_name; } | 307 | const std::string &className() const { return m_class_name; } |
323 | const std::string &instanceName() const { return m_instance_name; } | 308 | const std::string &instanceName() const { return m_instance_name; } |
324 | bool isLowerTab() const; | 309 | bool isLowerTab() const; |
325 | int initialState() const; | 310 | int initialState() const; |
326 | 311 | ||
327 | FbWinFrame &frame() { return m_frame; } | 312 | FbWinFrame &frame() { return *m_frame.get(); } |
328 | const FbWinFrame &frame() const { return m_frame; } | 313 | const FbWinFrame &frame() const { return *m_frame.get(); } |
329 | 314 | ||
330 | /** | 315 | /** |
331 | @name signals | 316 | @name signals |
@@ -343,7 +328,7 @@ public: | |||
343 | const FbTk::Subject &dieSig() const { return m_diesig; } | 328 | const FbTk::Subject &dieSig() const { return m_diesig; } |
344 | /** @} */ // end group signals | 329 | /** @} */ // end group signals |
345 | 330 | ||
346 | const timeval &getLastFocusTime() const { return m_last_focus_time;} | 331 | const timeval &lastFocusTime() const { return m_last_focus_time;} |
347 | 332 | ||
348 | //@} | 333 | //@} |
349 | 334 | ||
@@ -420,7 +405,7 @@ private: | |||
420 | BlackboxAttributes m_blackbox_attrib; | 405 | BlackboxAttributes m_blackbox_attrib; |
421 | 406 | ||
422 | FbTk::Menu m_windowmenu; | 407 | FbTk::Menu m_windowmenu; |
423 | LayerMenu<FluxboxWindow> m_layermenu; | 408 | std::auto_ptr<FbTk::Menu> m_layermenu; |
424 | 409 | ||
425 | timeval m_last_focus_time; | 410 | timeval m_last_focus_time; |
426 | 411 | ||
@@ -458,7 +443,7 @@ private: | |||
458 | unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state | 443 | unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state |
459 | int m_last_button_x, ///< last known x position of the mouse button | 444 | int m_last_button_x, ///< last known x position of the mouse button |
460 | m_last_button_y; ///< last known y position of the mouse button | 445 | m_last_button_y; ///< last known y position of the mouse button |
461 | FbWinFrame m_frame; | 446 | std::auto_ptr<FbWinFrame> m_frame; |
462 | 447 | ||
463 | FbTk::XLayerItem m_layeritem; | 448 | FbTk::XLayerItem m_layeritem; |
464 | int m_layernum; | 449 | int m_layernum; |