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