1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 prop.h for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003-2007 Dana Jansens
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 See the COPYING file for a copy of the GNU General Public License.
29 /*! The atoms on the X server which this class will cache */
30 typedef struct Atoms {
32 Atom cardinal; /*!< The atom which represents the Cardinal data type */
33 Atom window; /*!< The atom which represents window ids */
34 Atom pixmap; /*!< The atom which represents pixmap ids */
35 Atom atom; /*!< The atom which represents atom values */
36 Atom string; /*!< The atom which represents ascii strings */
37 Atom utf8; /*!< The atom which represents utf8-encoded strings */
43 Atom wm_colormap_windows;
46 Atom wm_delete_window;
53 Atom wm_client_machine;
55 Atom wm_client_leader;
63 /* Atoms that are used inside messages - these don't go in net_supported */
65 Atom net_wm_moveresize_size_topleft;
66 Atom net_wm_moveresize_size_top;
67 Atom net_wm_moveresize_size_topright;
68 Atom net_wm_moveresize_size_right;
69 Atom net_wm_moveresize_size_bottomright;
70 Atom net_wm_moveresize_size_bottom;
71 Atom net_wm_moveresize_size_bottomleft;
72 Atom net_wm_moveresize_size_left;
73 Atom net_wm_moveresize_move;
74 Atom net_wm_moveresize_size_keyboard;
75 Atom net_wm_moveresize_move_keyboard;
76 Atom net_wm_moveresize_cancel;
78 Atom net_wm_state_add;
79 Atom net_wm_state_remove;
80 Atom net_wm_state_toggle;
82 Atom net_wm_orientation_horz;
83 Atom net_wm_orientation_vert;
86 Atom net_wm_bottomright;
87 Atom net_wm_bottomleft;
89 /* types that we use but don't support */
91 Atom net_wm_window_type_popup_menu;
93 /* Everything below here must go in net_supported on the root window */
95 /* root window properties */
98 Atom net_client_list_stacking;
99 Atom net_number_of_desktops;
100 Atom net_desktop_geometry;
101 Atom net_desktop_viewport;
102 Atom net_current_desktop;
103 Atom net_desktop_names;
104 Atom net_active_window;
105 /* Atom net_restack_window;*/
107 Atom net_supporting_wm_check;
108 Atom net_desktop_layout;
109 Atom net_showing_desktop;
111 /* root window messages */
112 Atom net_close_window;
113 Atom net_wm_moveresize;
114 Atom net_moveresize_window;
115 Atom net_request_frame_extents;
116 Atom net_restack_window;
118 /* helpful hints to apps that aren't used for anything */
119 Atom net_wm_full_placement;
121 /* startup-notification extension */
124 /* application window properties */
126 Atom net_wm_visible_name;
127 Atom net_wm_icon_name;
128 Atom net_wm_visible_icon_name;
130 Atom net_wm_window_type;
133 Atom net_wm_strut_partial;
135 Atom net_wm_icon_geometry;
137 Atom net_wm_allowed_actions;
138 Atom net_wm_user_time;
139 /* Atom net_wm_user_time_window; */
140 Atom net_frame_extents;
142 /* application protocols */
145 Atom net_wm_sync_request;
146 Atom net_wm_sync_request_counter;
149 Atom net_wm_window_type_desktop;
150 Atom net_wm_window_type_dock;
151 Atom net_wm_window_type_toolbar;
152 Atom net_wm_window_type_menu;
153 Atom net_wm_window_type_utility;
154 Atom net_wm_window_type_splash;
155 Atom net_wm_window_type_dialog;
156 Atom net_wm_window_type_normal;
158 Atom net_wm_action_move;
159 Atom net_wm_action_resize;
160 Atom net_wm_action_minimize;
161 Atom net_wm_action_shade;
162 /* Atom net_wm_action_stick;*/
163 Atom net_wm_action_maximize_horz;
164 Atom net_wm_action_maximize_vert;
165 Atom net_wm_action_fullscreen;
166 Atom net_wm_action_change_desktop;
167 Atom net_wm_action_close;
168 Atom net_wm_action_above;
169 Atom net_wm_action_below;
171 Atom net_wm_state_modal;
172 /* Atom net_wm_state_sticky;*/
173 Atom net_wm_state_maximized_vert;
174 Atom net_wm_state_maximized_horz;
175 Atom net_wm_state_shaded;
176 Atom net_wm_state_skip_taskbar;
177 Atom net_wm_state_skip_pager;
178 Atom net_wm_state_hidden;
179 Atom net_wm_state_fullscreen;
180 Atom net_wm_state_above;
181 Atom net_wm_state_below;
182 Atom net_wm_state_demands_attention;
186 Atom kde_wm_change_state;
187 Atom kde_net_wm_frame_strut;
188 Atom kde_net_wm_window_type_override;
195 /* Openbox specific atoms */
197 Atom ob_wm_action_undecorate;
198 Atom ob_wm_state_undecorated;
199 Atom openbox_pid; /* this is depreecated in favour of ob_control */
204 extern Atoms prop_atoms;
206 void prop_startup(void);
208 gboolean prop_get32(Window win, Atom prop, Atom type, guint32 *ret);
209 gboolean prop_get_array32(Window win, Atom prop, Atom type, guint32 **ret,
211 gboolean prop_get_string_locale(Window win, Atom prop, gchar **ret);
212 gboolean prop_get_string_utf8(Window win, Atom prop, gchar **ret);
213 gboolean prop_get_strings_locale(Window win, Atom prop, gchar ***ret);
214 gboolean prop_get_strings_utf8(Window win, Atom prop, gchar ***ret);
216 void prop_set32(Window win, Atom prop, Atom type, gulong val);
217 void prop_set_array32(Window win, Atom prop, Atom type, gulong *val,
219 void prop_set_string_utf8(Window win, Atom prop, const gchar *val);
220 void prop_set_strings_utf8(Window win, Atom prop, gchar **strs);
222 void prop_erase(Window win, Atom prop);
224 void prop_message(Window about, Atom messagetype, glong data0, glong data1,
225 glong data2, glong data3, glong mask);
226 void prop_message_to(Window to, Window about, Atom messagetype,
227 glong data0, glong data1, glong data2,
228 glong data3, glong data4, glong mask);
230 #define PROP_GET32(win, prop, type, ret) \
231 (prop_get32(win, prop_atoms.prop, prop_atoms.type, ret))
232 #define PROP_GETA32(win, prop, type, ret, nret) \
233 (prop_get_array32(win, prop_atoms.prop, prop_atoms.type, ret, \
235 #define PROP_GETS(win, prop, type, ret) \
236 (prop_get_string_##type(win, prop_atoms.prop, ret))
237 #define PROP_GETSS(win, prop, type, ret) \
238 (prop_get_strings_##type(win, prop_atoms.prop, ret))
240 #define PROP_SET32(win, prop, type, val) \
241 prop_set32(win, prop_atoms.prop, prop_atoms.type, val)
242 #define PROP_SETA32(win, prop, type, val, num) \
243 prop_set_array32(win, prop_atoms.prop, prop_atoms.type, val, num)
244 #define PROP_SETS(win, prop, val) \
245 prop_set_string_utf8(win, prop_atoms.prop, val)
246 #define PROP_SETSS(win, prop, strs) \
247 prop_set_strings_utf8(win, prop_atoms.prop, strs)
249 #define PROP_ERASE(win, prop) prop_erase(win, prop_atoms.prop)
251 #define PROP_MSG(about, msgtype, data0, data1, data2, data3) \
252 (prop_message(about, prop_atoms.msgtype, data0, data1, data2, data3, \
253 SubstructureNotifyMask | SubstructureRedirectMask))
255 #define PROP_MSG_TO(to, about, msgtype, data0, data1, data2, data3, data4, \
257 (prop_message_to(to, about, prop_atoms.msgtype, \
258 data0, data1, data2, data3, data4, mask))