2 // Copyright (c) 2002 - 2002 Ben Janens (ben at orodu.net)
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:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
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.
26 #include <X11/Xatom.h>
63 blackbox_change_attributes,
66 // blackbox-protocol atoms (wm -> client)
67 blackbox_structure_messages,
68 blackbox_notify_startup,
69 blackbox_notify_window_add,
70 blackbox_notify_window_del,
71 blackbox_notify_window_focus,
72 blackbox_notify_current_workspace,
73 blackbox_notify_workspace_count,
74 blackbox_notify_window_raise,
75 blackbox_notify_window_lower,
76 // blackbox-protocol atoms (client -> wm)
77 blackbox_change_workspace,
78 blackbox_change_window_focus,
79 blackbox_cycle_window_focus,
82 // root window properties
85 net_client_list_stacking,
86 net_number_of_desktops,
93 net_supporting_wm_check,
95 // root window messages
98 // application window properties
103 net_wm_visible_icon_name,
108 // net_wm_icon_geometry,
111 // net_wm_handled_icons,
112 net_wm_allowed_actions,
113 // application protocols
116 net_wm_window_type_desktop,
117 net_wm_window_type_dock,
118 net_wm_window_type_toolbar,
119 net_wm_window_type_menu,
120 net_wm_window_type_utility,
121 net_wm_window_type_splash,
122 net_wm_window_type_dialog,
123 net_wm_window_type_normal,
125 net_wm_moveresize_size_topleft,
126 net_wm_moveresize_size_topright,
127 net_wm_moveresize_size_bottomleft,
128 net_wm_moveresize_size_bottomright,
129 net_wm_moveresize_move,
132 net_wm_action_resize,
134 net_wm_action_maximize_horz,
135 net_wm_action_maximize_vert,
136 net_wm_action_change_desktop,
140 net_wm_state_maximized_vert,
141 net_wm_state_maximized_horz,
143 net_wm_state_skip_taskbar,
144 net_wm_state_skip_pager,
146 net_wm_state_fullscreen,
148 kde_net_system_tray_windows,
149 kde_net_wm_system_tray_window_for,
150 kde_net_wm_window_type_override,
152 // constant for how many atoms exist in the enumerator
163 typedef std::vector<Window> SupportWindows;
166 // windows used to specify support for NETWM
167 SupportWindows _support_windows;
168 Atom _atoms[NUM_ATOMS];
170 Atom create(const char *name) const;
172 void setValue(Window win, Atom atom, Atom type, unsigned char *data,
173 int size, int nelements, bool append) const;
174 bool getValue(Window win, Atom atom, Atom type,
175 unsigned long &nelements, unsigned char **value,
179 XAtom(const XAtom &);
180 XAtom& operator=(const XAtom&);
183 typedef std::vector<std::string> StringVect;
188 // setup support on a screen, each screen should call this once in its
190 void setSupported(const ScreenInfo *screen);
192 void setValue(Window win, Atoms atom, Atoms type, unsigned long value) const;
193 void setValue(Window win, Atoms atom, Atoms type,
194 unsigned long value[], int elements) const;
195 void setValue(Window win, Atoms atom, StringType type,
196 const std::string &value) const;
197 void setValue(Window win, Atoms atom, StringType type,
198 const StringVect &strings) const;
200 // the 'value' is allocated inside the function and
201 // delete [] value needs to be called when you are done with it.
202 // the 'value' array returned is null terminated, and has 'nelements'
203 // elements in it plus the null.
204 // nelements must be set to the maximum number of elements to read from
206 bool getValue(Window win, Atoms atom, Atoms type,
207 unsigned long &nelements, unsigned long **value) const;
208 bool getValue(Window win, Atoms atom, Atoms type, unsigned long &value) const;
209 bool getValue(Window win, Atoms atom, StringType type,
210 std::string &value) const;
211 bool getValue(Window win, Atoms atom, StringType type,
212 unsigned long &nelements, StringVect &strings) const;
214 void eraseValue(Window win, Atoms atom) const;
216 // sends a client message a window
217 void sendClientMessage(Window target, Atoms type, Window about,
218 long data = 0, long data1 = 0, long data2 = 0,
219 long data3 = 0) const;
221 // temporary function!! remove when not used in blackbox.hh anymore!!
222 inline Atom getAtom(Atoms a)
223 { assert(a >= 0 && a < NUM_ATOMS); Atom ret = _atoms[a];
224 assert(ret != 0); return ret; }