diff options
Diffstat (limited to 'src/Ewmh.hh')
-rw-r--r-- | src/Ewmh.hh | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/Ewmh.hh b/src/Ewmh.hh new file mode 100644 index 0000000..b21e4a4 --- /dev/null +++ b/src/Ewmh.hh | |||
@@ -0,0 +1,81 @@ | |||
1 | // Ewmh.hh for fluxbox | ||
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@fluxbox.org) | ||
3 | // | ||
4 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | // copy of this software and associated documentation files (the "Software"), | ||
6 | // to deal in the Software without restriction, including without limitation | ||
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | // and/or sell copies of the Software, and to permit persons to whom the | ||
9 | // Software is furnished to do so, subject to the following conditions: | ||
10 | // | ||
11 | // The above copyright notice and this permission notice shall be included in | ||
12 | // all copies or substantial portions of the Software. | ||
13 | // | ||
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | // DEALINGS IN THE SOFTWARE. | ||
21 | |||
22 | // $Id: Ewmh.hh,v 1.6 2003/03/03 21:51:00 rathnor Exp $ | ||
23 | |||
24 | #include "AtomHandler.hh" | ||
25 | |||
26 | #include <X11/Xatom.h> | ||
27 | #include <vector> | ||
28 | |||
29 | class Ewmh:public AtomHandler { | ||
30 | public: | ||
31 | |||
32 | Ewmh(); | ||
33 | ~Ewmh(); | ||
34 | void initForScreen(BScreen &screen); | ||
35 | void setupWindow(FluxboxWindow &win); | ||
36 | |||
37 | void updateClientList(BScreen &screen); | ||
38 | void updateWorkspaceNames(BScreen &screen); | ||
39 | void updateCurrentWorkspace(BScreen &screen); | ||
40 | void updateWorkspaceCount(BScreen &screen); | ||
41 | |||
42 | void updateState(FluxboxWindow &win); | ||
43 | void updateLayer(FluxboxWindow &win); | ||
44 | void updateHints(FluxboxWindow &win); | ||
45 | void updateWorkspace(FluxboxWindow &win); | ||
46 | |||
47 | |||
48 | bool checkClientMessage(const XClientMessageEvent &ce, | ||
49 | BScreen * screen, FluxboxWindow * const win); | ||
50 | |||
51 | //ignore these ones | ||
52 | void updateWindowClose(FluxboxWindow &win) {} | ||
53 | |||
54 | private: | ||
55 | |||
56 | enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2}; | ||
57 | |||
58 | void setState(FluxboxWindow &win, Atom state, bool value) const; | ||
59 | void toggleState(FluxboxWindow &win, Atom state) const; | ||
60 | void createAtoms(); | ||
61 | |||
62 | // root window properties | ||
63 | Atom m_net_supported, m_net_client_list, m_net_client_list_stacking, | ||
64 | m_net_number_of_desktops, m_net_desktop_geometry, m_net_desktop_viewport, | ||
65 | m_net_current_desktop, m_net_desktop_names, m_net_active_window, m_net_workarea, | ||
66 | m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window; | ||
67 | |||
68 | // root window messages | ||
69 | Atom m_net_close_window, m_net_wm_moveresize; | ||
70 | |||
71 | // application window properties | ||
72 | Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, m_net_wm_window_type, | ||
73 | m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, | ||
74 | m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, | ||
75 | m_net_wm_handled_icons; | ||
76 | |||
77 | // application protocols | ||
78 | Atom m_net_wm_ping; | ||
79 | |||
80 | std::vector<Window> m_windows; | ||
81 | }; | ||