]> Dogcows Code - chaz/openbox/blob - openbox/prop.h
add support for _NET_WM_SYNC_REQUEST
[chaz/openbox] / openbox / prop.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3 prop.h for the Openbox window manager
4 Copyright (c) 2006 Mikael Magnusson
5 Copyright (c) 2003-2007 Dana Jansens
6
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.
11
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.
16
17 See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 #ifndef __atoms_h
21 #define __atoms_h
22
23 #include <X11/Xlib.h>
24 #include <glib.h>
25 #ifdef HAVE_STRING_H
26 # include <string.h>
27 #endif
28
29 /*! The atoms on the X server which this class will cache */
30 typedef struct Atoms {
31 /* types */
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 */
38
39 /* selection stuff */
40 Atom manager;
41
42 /* window hints */
43 Atom wm_colormap_windows;
44 Atom wm_protocols;
45 Atom wm_state;
46 Atom wm_delete_window;
47 Atom wm_take_focus;
48 Atom wm_change_state;
49 Atom wm_name;
50 Atom wm_icon_name;
51 Atom wm_class;
52 Atom wm_window_role;
53 Atom wm_client_machine;
54 Atom motif_wm_hints;
55
56 /* SM atoms */
57 Atom sm_client_id;
58
59 /* NETWM atoms */
60
61 Atom net_wm_full_placement;
62
63 /* root window properties */
64 Atom net_supported;
65 Atom net_client_list;
66 Atom net_client_list_stacking;
67 Atom net_number_of_desktops;
68 Atom net_desktop_geometry;
69 Atom net_desktop_viewport;
70 Atom net_current_desktop;
71 Atom net_desktop_names;
72 Atom net_active_window;
73 Atom net_workarea;
74 Atom net_supporting_wm_check;
75 Atom net_desktop_layout;
76 Atom net_showing_desktop;
77 /* root window messages */
78 Atom net_close_window;
79 Atom net_wm_moveresize;
80 Atom net_moveresize_window;
81
82 /* startup-notification extension */
83 Atom net_startup_id;
84
85 /* application window properties */
86 Atom net_wm_name;
87 Atom net_wm_visible_name;
88 Atom net_wm_icon_name;
89 Atom net_wm_visible_icon_name;
90 Atom net_wm_desktop;
91 Atom net_wm_window_type;
92 Atom net_wm_state;
93 Atom net_wm_strut;
94 Atom net_wm_strut_partial;
95 Atom net_wm_icon;
96 /* Atom net_wm_pid; */
97 Atom net_wm_allowed_actions;
98 Atom net_wm_user_time;
99 Atom net_frame_extents;
100
101 /* application protocols */
102 /* Atom net_wm_ping; */
103 #ifdef SYNC
104 Atom net_wm_sync_request;
105 Atom net_wm_sync_request_counter;
106 #endif
107
108 Atom net_wm_window_type_desktop;
109 Atom net_wm_window_type_dock;
110 Atom net_wm_window_type_toolbar;
111 Atom net_wm_window_type_menu;
112 Atom net_wm_window_type_utility;
113 Atom net_wm_window_type_splash;
114 Atom net_wm_window_type_dialog;
115 Atom net_wm_window_type_normal;
116
117 Atom net_wm_moveresize_size_topleft;
118 Atom net_wm_moveresize_size_top;
119 Atom net_wm_moveresize_size_topright;
120 Atom net_wm_moveresize_size_right;
121 Atom net_wm_moveresize_size_bottomright;
122 Atom net_wm_moveresize_size_bottom;
123 Atom net_wm_moveresize_size_bottomleft;
124 Atom net_wm_moveresize_size_left;
125 Atom net_wm_moveresize_move;
126 Atom net_wm_moveresize_size_keyboard;
127 Atom net_wm_moveresize_move_keyboard;
128 Atom net_wm_moveresize_cancel;
129
130 Atom net_wm_action_move;
131 Atom net_wm_action_resize;
132 Atom net_wm_action_minimize;
133 Atom net_wm_action_shade;
134 Atom net_wm_action_stick;
135 Atom net_wm_action_maximize_horz;
136 Atom net_wm_action_maximize_vert;
137 Atom net_wm_action_fullscreen;
138 Atom net_wm_action_change_desktop;
139 Atom net_wm_action_close;
140
141 Atom net_wm_state_modal;
142 Atom net_wm_state_sticky;
143 Atom net_wm_state_maximized_vert;
144 Atom net_wm_state_maximized_horz;
145 Atom net_wm_state_shaded;
146 Atom net_wm_state_skip_taskbar;
147 Atom net_wm_state_skip_pager;
148 Atom net_wm_state_hidden;
149 Atom net_wm_state_fullscreen;
150 Atom net_wm_state_above;
151 Atom net_wm_state_below;
152 Atom net_wm_state_demands_attention;
153
154 Atom net_wm_state_add;
155 Atom net_wm_state_remove;
156 Atom net_wm_state_toggle;
157
158 Atom net_wm_orientation_horz;
159 Atom net_wm_orientation_vert;
160 Atom net_wm_topleft;
161 Atom net_wm_topright;
162 Atom net_wm_bottomright;
163 Atom net_wm_bottomleft;
164
165 /* Extra atoms */
166
167 Atom kde_wm_change_state;
168 Atom kde_net_wm_window_type_override;
169
170 Atom rootpmapid;
171 Atom esetrootid;
172
173 /* Openbox specific atoms */
174
175 Atom openbox_pid;
176 Atom openbox_rc;
177 Atom ob_wm_state_undecorated;
178 Atom ob_control;
179 } Atoms;
180 Atoms prop_atoms;
181
182 void prop_startup();
183
184 gboolean prop_get32(Window win, Atom prop, Atom type, guint32 *ret);
185 gboolean prop_get_array32(Window win, Atom prop, Atom type, guint32 **ret,
186 guint *nret);
187 gboolean prop_get_string_locale(Window win, Atom prop, gchar **ret);
188 gboolean prop_get_string_utf8(Window win, Atom prop, gchar **ret);
189 gboolean prop_get_strings_locale(Window win, Atom prop, gchar ***ret);
190 gboolean prop_get_strings_utf8(Window win, Atom prop, gchar ***ret);
191
192 void prop_set32(Window win, Atom prop, Atom type, gulong val);
193 void prop_set_array32(Window win, Atom prop, Atom type, gulong *val,
194 guint num);
195 void prop_set_string_utf8(Window win, Atom prop, const gchar *val);
196 void prop_set_strings_utf8(Window win, Atom prop, gchar **strs);
197
198 void prop_erase(Window win, Atom prop);
199
200 void prop_message(Window about, Atom messagetype, glong data0, glong data1,
201 glong data2, glong data3, glong mask);
202
203 #define PROP_GET32(win, prop, type, ret) \
204 (prop_get32(win, prop_atoms.prop, prop_atoms.type, ret))
205 #define PROP_GETA32(win, prop, type, ret, nret) \
206 (prop_get_array32(win, prop_atoms.prop, prop_atoms.type, ret, \
207 nret))
208 #define PROP_GETS(win, prop, type, ret) \
209 (prop_get_string_##type(win, prop_atoms.prop, ret))
210 #define PROP_GETSS(win, prop, type, ret) \
211 (prop_get_strings_##type(win, prop_atoms.prop, ret))
212
213 #define PROP_SET32(win, prop, type, val) \
214 prop_set32(win, prop_atoms.prop, prop_atoms.type, val)
215 #define PROP_SETA32(win, prop, type, val, num) \
216 prop_set_array32(win, prop_atoms.prop, prop_atoms.type, val, num)
217 #define PROP_SETS(win, prop, val) \
218 prop_set_string_utf8(win, prop_atoms.prop, val)
219 #define PROP_SETSS(win, prop, strs) \
220 prop_set_strings_utf8(win, prop_atoms.prop, strs)
221
222 #define PROP_ERASE(win, prop) prop_erase(win, prop_atoms.prop)
223
224 #define PROP_MSG(about, msgtype, data0, data1, data2, data3) \
225 (prop_message(about, prop_atoms.msgtype, data0, data1, data2, data3, \
226 SubstructureNotifyMask | SubstructureRedirectMask))
227
228 #endif
This page took 0.047132 seconds and 5 git commands to generate.