6 @brief Provides access to atoms on the display
11 #include <X11/Xatom.h>
19 #include "otk/screeninfo.hh"
50 blackbox_change_attributes,
53 // blackbox-protocol atoms (wm -> client)
54 blackbox_structure_messages,
55 blackbox_notify_startup,
56 blackbox_notify_window_add,
57 blackbox_notify_window_del,
58 blackbox_notify_window_focus,
59 blackbox_notify_current_workspace,
60 blackbox_notify_workspace_count,
61 blackbox_notify_window_raise,
62 blackbox_notify_window_lower,
63 // blackbox-protocol atoms (client -> wm)
64 blackbox_change_workspace,
65 blackbox_change_window_focus,
66 blackbox_cycle_window_focus,
68 openbox_show_root_menu,
69 openbox_show_workspace_menu,
72 // root window properties
75 net_client_list_stacking,
76 net_number_of_desktops,
83 net_supporting_wm_check,
85 // root window messages
88 // application window properties
93 net_wm_visible_icon_name,
98 // net_wm_icon_geometry,
101 // net_wm_handled_icons,
102 net_wm_allowed_actions,
103 // application protocols
106 net_wm_window_type_desktop,
107 net_wm_window_type_dock,
108 net_wm_window_type_toolbar,
109 net_wm_window_type_menu,
110 net_wm_window_type_utility,
111 net_wm_window_type_splash,
112 net_wm_window_type_dialog,
113 net_wm_window_type_normal,
115 net_wm_moveresize_size_topleft,
116 net_wm_moveresize_size_topright,
117 net_wm_moveresize_size_bottomleft,
118 net_wm_moveresize_size_bottomright,
119 net_wm_moveresize_move,
122 net_wm_action_resize,
124 net_wm_action_maximize_horz,
125 net_wm_action_maximize_vert,
126 net_wm_action_change_desktop,
130 net_wm_state_maximized_vert,
131 net_wm_state_maximized_horz,
133 net_wm_state_skip_taskbar,
134 net_wm_state_skip_pager,
136 net_wm_state_fullscreen,
138 kde_net_system_tray_windows,
139 kde_net_wm_system_tray_window_for,
140 kde_net_wm_window_type_override,
142 // constant for how many atoms exist in the enumerator
153 typedef std::vector<Window> SupportWindows;
156 // windows used to specify support for NETWM
157 SupportWindows _support_windows;
158 Atom _atoms[NUM_ATOMS];
160 Atom create(const char *name) const;
162 void setValue(Window win, Atom atom, Atom type, unsigned char *data,
163 int size, int nelements, bool append) const;
164 bool getValue(Window win, Atom atom, Atom type,
165 unsigned long &nelements, unsigned char **value,
169 XAtom(const XAtom &);
170 XAtom& operator=(const XAtom&);
173 typedef std::vector<std::string> StringVect;
178 // setup support on a screen, each screen should call this once in its
180 void setSupported(const otk::ScreenInfo *screen);
182 void setValue(Window win, Atoms atom, Atoms type, unsigned long value) const;
183 void setValue(Window win, Atoms atom, Atoms type,
184 unsigned long value[], int elements) const;
185 void setValue(Window win, Atoms atom, StringType type,
186 const std::string &value) const;
187 void setValue(Window win, Atoms atom, StringType type,
188 const StringVect &strings) const;
190 // the 'value' is allocated inside the function and
191 // delete [] value needs to be called when you are done with it.
192 // the 'value' array returned is null terminated, and has 'nelements'
193 // elements in it plus the null.
194 // nelements must be set to the maximum number of elements to read from
196 bool getValue(Window win, Atoms atom, Atoms type,
197 unsigned long &nelements, unsigned long **value) const;
198 bool getValue(Window win, Atoms atom, Atoms type, unsigned long &value) const;
199 bool getValue(Window win, Atoms atom, StringType type,
200 std::string &value) const;
201 bool getValue(Window win, Atoms atom, StringType type,
202 unsigned long &nelements, StringVect &strings) const;
204 void eraseValue(Window win, Atoms atom) const;
206 // sends a client message a window
207 void sendClientMessage(Window target, Atoms type, Window about,
208 long data = 0, long data1 = 0, long data2 = 0,
209 long data3 = 0, long data4 = 0) const;
211 // temporary function!! remove when not used in blackbox.hh anymore!!
212 inline Atom getAtom(Atoms a)
213 { assert(a >= 0 && a < NUM_ATOMS); Atom ret = _atoms[a];
214 assert(ret != 0); return ret; }