diff options
Diffstat (limited to 'src/FbAtoms.hh')
-rw-r--r-- | src/FbAtoms.hh | 184 |
1 files changed, 184 insertions, 0 deletions
diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh new file mode 100644 index 0000000..3fb8b2b --- /dev/null +++ b/src/FbAtoms.hh | |||
@@ -0,0 +1,184 @@ | |||
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.6 2002/08/14 21:53:07 fluxgen 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, should probably be a singleton | ||
31 | */ | ||
32 | class FbAtoms { | ||
33 | public: | ||
34 | explicit FbAtoms(Display *display); | ||
35 | virtual ~FbAtoms(); | ||
36 | static FbAtoms *instance(); | ||
37 | |||
38 | #ifdef GNOME | ||
39 | inline Atom getGnomeProtAtom() const { return gnome_wm_prot; } | ||
40 | inline Atom getGnomeClientListAtom() const { return gnome_wm_win_client_list; } | ||
41 | inline Atom getGnomeSupportingWMCheckAtom() const { return gnome_wm_supporting_wm_check; } | ||
42 | inline Atom getGnomeWorkspaceAtom() const { return gnome_wm_win_workspace; } | ||
43 | inline Atom getGnomeWorkspaceCountAtom() const { return gnome_wm_win_workspace_count; } | ||
44 | inline Atom getGnomeWorkspaceNamesAtom() const { return gnome_wm_win_workspace_names; } | ||
45 | inline Atom getGnomeStateAtom() const { return gnome_wm_win_state; } | ||
46 | inline Atom getGnomeHintsAtom() const { return gnome_wm_win_hints; } | ||
47 | inline Atom getGnomeLayerAtom() const { return gnome_wm_win_layer; } | ||
48 | #endif //GNOME | ||
49 | |||
50 | inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; } | ||
51 | inline Atom getWMStateAtom() const { return xa_wm_state; } | ||
52 | inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; } | ||
53 | inline Atom getWMProtocolsAtom() const { return xa_wm_protocols; } | ||
54 | inline Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; } | ||
55 | inline Atom getWMColormapAtom() const { return xa_wm_colormap_windows; } | ||
56 | inline Atom getMotifWMHintsAtom() const { return motif_wm_hints; } | ||
57 | |||
58 | // this atom is for normal app->WM hints about decorations, stacking, | ||
59 | // starting workspace etc... | ||
60 | inline Atom getFluxboxHintsAtom() const { return blackbox_hints;} | ||
61 | |||
62 | // these atoms are for normal app->WM interaction beyond the scope of the | ||
63 | // ICCCM... | ||
64 | inline Atom getFluxboxAttributesAtom() const { return blackbox_attributes; } | ||
65 | inline Atom getFluxboxChangeAttributesAtom() const { return blackbox_change_attributes; } | ||
66 | |||
67 | // these atoms are for window->WM interaction, with more control and | ||
68 | // information on window "structure"... common examples are | ||
69 | // notifying apps when windows are raised/lowered... when the user changes | ||
70 | // workspaces... i.e. "pager talk" | ||
71 | inline Atom getFluxboxStructureMessagesAtom() const{ return blackbox_structure_messages; } | ||
72 | |||
73 | // *Notify* portions of the NETStructureMessages protocol | ||
74 | inline Atom getFluxboxNotifyStartupAtom() const { return blackbox_notify_startup; } | ||
75 | inline Atom getFluxboxNotifyWindowAddAtom() const { return blackbox_notify_window_add; } | ||
76 | inline Atom getFluxboxNotifyWindowDelAtom() const { return blackbox_notify_window_del; } | ||
77 | inline Atom getFluxboxNotifyWindowFocusAtom() const { return blackbox_notify_window_focus; } | ||
78 | inline Atom getFluxboxNotifyCurrentWorkspaceAtom() const { return blackbox_notify_current_workspace; } | ||
79 | inline Atom getFluxboxNotifyWorkspaceCountAtom() const { return blackbox_notify_workspace_count; } | ||
80 | inline Atom getFluxboxNotifyWindowRaiseAtom() const { return blackbox_notify_window_raise; } | ||
81 | inline Atom getFluxboxNotifyWindowLowerAtom() const { return blackbox_notify_window_lower; } | ||
82 | |||
83 | // atoms to change that request changes to the desktop environment during | ||
84 | // runtime... these messages can be sent by any client... as the sending | ||
85 | // client window id is not included in the ClientMessage event... | ||
86 | inline Atom getFluxboxChangeWorkspaceAtom() const { return blackbox_change_workspace; } | ||
87 | inline Atom getFluxboxChangeWindowFocusAtom() const { return blackbox_change_window_focus; } | ||
88 | inline Atom getFluxboxCycleWindowFocusAtom() const { return blackbox_cycle_window_focus; } | ||
89 | |||
90 | #ifdef NEWWMSPEC | ||
91 | |||
92 | // root window properties | ||
93 | inline Atom getNETSupportedAtom() const { return net_supported; } | ||
94 | inline Atom getNETClientListAtom() const { return net_client_list; } | ||
95 | inline Atom getNETClientListStackingAtom() const { return net_client_list_stacking; } | ||
96 | inline Atom getNETNumberOfDesktopsAtom() const { return net_number_of_desktops; } | ||
97 | inline Atom getNETDesktopGeometryAtom() const { return net_desktop_geometry; } | ||
98 | inline Atom getNETDesktopViewportAtom() const { return net_desktop_viewport; } | ||
99 | inline Atom getNETCurrentDesktopAtom() const { return net_current_desktop; } | ||
100 | inline Atom getNETDesktopNamesAtom() const { return net_desktop_names; } | ||
101 | inline Atom getNETActiveWindowAtom() const { return net_active_window; } | ||
102 | inline Atom getNETWorkareaAtom() const { return net_workarea; } | ||
103 | inline Atom getNETSupportingWMCheckAtom() const { return net_supporting_wm_check; } | ||
104 | inline Atom getNETVirtualRootsAtom() const { return net_virtual_roots; } | ||
105 | |||
106 | // root window messages | ||
107 | inline Atom getNETCloseWindowAtom() const { return net_close_window; } | ||
108 | inline Atom getNETWMMoveResizeAtom() const { return net_wm_moveresize; } | ||
109 | |||
110 | // application window properties | ||
111 | inline Atom getNETPropertiesAtom() const { return net_properties; } | ||
112 | inline Atom getNETWMNameAtom() const { return net_wm_name; } | ||
113 | inline Atom getNETWMDesktopAtom() const { return net_wm_desktop; } | ||
114 | inline Atom getNETWMWindowTypeAtom() const { return net_wm_window_type; } | ||
115 | inline Atom getNETWMStateAtom() const { return net_wm_state; } | ||
116 | inline Atom getNETWMStrutAtom() const { return net_wm_strut; } | ||
117 | inline Atom getNETWMIconGeometryAtom() const { return net_wm_icon_geometry; } | ||
118 | inline Atom getNETWMIconAtom() const { return net_wm_icon; } | ||
119 | inline Atom getNETWMPidAtom() const { return net_wm_pid; } | ||
120 | inline Atom getNETWMHandledIconsAtom() const { return net_wm_handled_icons; } | ||
121 | |||
122 | // application protocols | ||
123 | inline Atom getNETWMPingAtom() const { return net_wm_ping; } | ||
124 | |||
125 | #endif // NEWWMSPEC | ||
126 | |||
127 | private: | ||
128 | void initAtoms(Display *disp); | ||
129 | // NETAttributes | ||
130 | Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; | ||
131 | |||
132 | // NETStructureMessages | ||
133 | Atom blackbox_structure_messages, blackbox_notify_startup, | ||
134 | blackbox_notify_window_add, blackbox_notify_window_del, | ||
135 | blackbox_notify_window_focus, blackbox_notify_current_workspace, | ||
136 | blackbox_notify_workspace_count, blackbox_notify_window_raise, | ||
137 | blackbox_notify_window_lower; | ||
138 | |||
139 | // message_types for client -> wm messages | ||
140 | Atom blackbox_change_workspace, blackbox_change_window_focus, | ||
141 | blackbox_cycle_window_focus; | ||
142 | |||
143 | #ifdef NEWWMSPEC | ||
144 | |||
145 | // root window properties | ||
146 | Atom net_supported, net_client_list, net_client_list_stacking, | ||
147 | net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, | ||
148 | net_current_desktop, net_desktop_names, net_active_window, net_workarea, | ||
149 | net_supporting_wm_check, net_virtual_roots; | ||
150 | |||
151 | // root window messages | ||
152 | Atom net_close_window, net_wm_moveresize; | ||
153 | |||
154 | // application window properties | ||
155 | Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, | ||
156 | net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, | ||
157 | net_wm_handled_icons; | ||
158 | |||
159 | |||
160 | // application protocols | ||
161 | Atom net_wm_ping; | ||
162 | |||
163 | #endif // NEWWMSPEC | ||
164 | |||
165 | #ifdef GNOME | ||
166 | // union { | ||
167 | Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints, | ||
168 | gnome_wm_win_app_state, gnome_wm_win_expanded_size, | ||
169 | gnome_wm_win_icons, gnome_wm_win_workspace, | ||
170 | gnome_wm_win_workspace_count, gnome_wm_win_workspace_names, | ||
171 | gnome_wm_win_client_list; | ||
172 | // Atom gnome_atom_list[10]; | ||
173 | // }; | ||
174 | Atom gnome_wm_prot; | ||
175 | Atom gnome_wm_supporting_wm_check; | ||
176 | #endif // GNOME | ||
177 | Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, | ||
178 | xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, | ||
179 | motif_wm_hints; | ||
180 | bool m_init; | ||
181 | static FbAtoms *s_singleton; | ||
182 | }; | ||
183 | |||
184 | #endif //FBATOMS_HH | ||