aboutsummaryrefslogtreecommitdiff
path: root/src/FbAtoms.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbAtoms.hh')
-rw-r--r--src/FbAtoms.hh102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh
new file mode 100644
index 0000000..13b943b
--- /dev/null
+++ b/src/FbAtoms.hh
@@ -0,0 +1,102 @@
1// FbAtom.hh
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.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: FbAtoms.hh,v 1.8 2002/12/01 13:41:56 rathnor Exp $
23#ifndef FBATOMS_HH
24#define FBATOMS_HH
25
26#include <X11/Xlib.h>
27#include <X11/Xatom.h>
28
29/**
30 atom handler for base atoms
31*/
32class FbAtoms {
33public:
34 explicit FbAtoms(Display *display);
35 virtual ~FbAtoms();
36 static FbAtoms *instance();
37
38
39 inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; }
40 inline Atom getWMStateAtom() const { return xa_wm_state; }
41 inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; }
42 inline Atom getWMProtocolsAtom() const { return xa_wm_protocols; }
43 inline Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; }
44 inline Atom getWMColormapAtom() const { return xa_wm_colormap_windows; }
45 inline Atom getMotifWMHintsAtom() const { return motif_wm_hints; }
46
47 // this atom is for normal app->WM hints about decorations, stacking,
48 // starting workspace etc...
49 inline Atom getFluxboxHintsAtom() const { return blackbox_hints;}
50
51 // these atoms are for normal app->WM interaction beyond the scope of the
52 // ICCCM...
53 inline Atom getFluxboxAttributesAtom() const { return blackbox_attributes; }
54 inline Atom getFluxboxChangeAttributesAtom() const { return blackbox_change_attributes; }
55
56 // these atoms are for window->WM interaction, with more control and
57 // information on window "structure"... common examples are
58 // notifying apps when windows are raised/lowered... when the user changes
59 // workspaces... i.e. "pager talk"
60 inline Atom getFluxboxStructureMessagesAtom() const{ return blackbox_structure_messages; }
61
62 // *Notify* portions of the NETStructureMessages protocol
63 inline Atom getFluxboxNotifyStartupAtom() const { return blackbox_notify_startup; }
64 inline Atom getFluxboxNotifyWindowAddAtom() const { return blackbox_notify_window_add; }
65 inline Atom getFluxboxNotifyWindowDelAtom() const { return blackbox_notify_window_del; }
66 inline Atom getFluxboxNotifyWindowFocusAtom() const { return blackbox_notify_window_focus; }
67 inline Atom getFluxboxNotifyCurrentWorkspaceAtom() const { return blackbox_notify_current_workspace; }
68 inline Atom getFluxboxNotifyWorkspaceCountAtom() const { return blackbox_notify_workspace_count; }
69 inline Atom getFluxboxNotifyWindowRaiseAtom() const { return blackbox_notify_window_raise; }
70 inline Atom getFluxboxNotifyWindowLowerAtom() const { return blackbox_notify_window_lower; }
71
72 // atoms to change that request changes to the desktop environment during
73 // runtime... these messages can be sent by any client... as the sending
74 // client window id is not included in the ClientMessage event...
75 inline Atom getFluxboxChangeWorkspaceAtom() const { return blackbox_change_workspace; }
76 inline Atom getFluxboxChangeWindowFocusAtom() const { return blackbox_change_window_focus; }
77 inline Atom getFluxboxCycleWindowFocusAtom() const { return blackbox_cycle_window_focus; }
78
79private:
80 void initAtoms(Display *disp);
81// NETAttributes
82 Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints;
83
84 // NETStructureMessages
85 Atom blackbox_structure_messages, blackbox_notify_startup,
86 blackbox_notify_window_add, blackbox_notify_window_del,
87 blackbox_notify_window_focus, blackbox_notify_current_workspace,
88 blackbox_notify_workspace_count, blackbox_notify_window_raise,
89 blackbox_notify_window_lower;
90
91 // message_types for client -> wm messages
92 Atom blackbox_change_workspace, blackbox_change_window_focus,
93 blackbox_cycle_window_focus;
94
95 Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state,
96 xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state,
97 motif_wm_hints;
98 bool m_init;
99 static FbAtoms *s_singleton;
100};
101
102#endif //FBATOMS_HH