]> Dogcows Code - chaz/openbox/blob - openbox/prop.h
remove debug prints
[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) 2003 Ben Jansens
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #ifndef __atoms_h
20 #define __atoms_h
21
22 #include <X11/Xlib.h>
23 #include <glib.h>
24 #ifdef HAVE_STRING_H
25 # include <string.h>
26 #endif
27
28 /*! The atoms on the X server which this class will cache */
29 typedef struct Atoms {
30 /* types */
31 Atom cardinal; /*!< The atom which represents the Cardinal data type */
32 Atom window; /*!< The atom which represents window ids */
33 Atom pixmap; /*!< The atom which represents pixmap ids */
34 Atom atom; /*!< The atom which represents atom values */
35 Atom string; /*!< The atom which represents ascii strings */
36 Atom utf8; /*!< The atom which represents utf8-encoded strings */
37
38 /* selection stuff */
39 Atom manager;
40
41 /* window hints */
42 Atom wm_colormap_windows;
43 Atom wm_protocols;
44 Atom wm_state;
45 Atom wm_delete_window;
46 Atom wm_take_focus;
47 Atom wm_change_state;
48 Atom wm_name;
49 Atom wm_icon_name;
50 Atom wm_class;
51 Atom wm_window_role;
52 Atom motif_wm_hints;
53
54 /* SM atoms */
55 Atom sm_client_id;
56
57 /* NETWM atoms */
58
59 /* root window properties */
60 Atom net_supported;
61 Atom net_client_list;
62 Atom net_client_list_stacking;
63 Atom net_number_of_desktops;
64 Atom net_desktop_geometry;
65 Atom net_desktop_viewport;
66 Atom net_current_desktop;
67 Atom net_desktop_names;
68 Atom net_active_window;
69 Atom net_workarea;
70 Atom net_supporting_wm_check;
71 Atom net_desktop_layout;
72 Atom net_showing_desktop;
73 /* root window messages */
74 Atom net_close_window;
75 Atom net_wm_moveresize;
76 Atom net_moveresize_window;
77
78 /* startup-notification extension */
79 Atom net_startup_id;
80
81 /* application window properties */
82 Atom net_wm_name;
83 Atom net_wm_visible_name;
84 Atom net_wm_icon_name;
85 Atom net_wm_visible_icon_name;
86 Atom net_wm_desktop;
87 Atom net_wm_window_type;
88 Atom net_wm_state;
89 Atom net_wm_strut;
90 Atom net_wm_strut_partial;
91 Atom net_wm_icon;
92 /* Atom net_wm_pid; */
93 Atom net_wm_allowed_actions;
94 /* application protocols */
95 /* Atom Atom net_wm_ping; */
96
97 Atom net_wm_window_type_desktop;
98 Atom net_wm_window_type_dock;
99 Atom net_wm_window_type_toolbar;
100 Atom net_wm_window_type_menu;
101 Atom net_wm_window_type_utility;
102 Atom net_wm_window_type_splash;
103 Atom net_wm_window_type_dialog;
104 Atom net_wm_window_type_normal;
105
106 Atom net_wm_moveresize_size_topleft;
107 Atom net_wm_moveresize_size_top;
108 Atom net_wm_moveresize_size_topright;
109 Atom net_wm_moveresize_size_right;
110 Atom net_wm_moveresize_size_bottomright;
111 Atom net_wm_moveresize_size_bottom;
112 Atom net_wm_moveresize_size_bottomleft;
113 Atom net_wm_moveresize_size_left;
114 Atom net_wm_moveresize_move;
115 Atom net_wm_moveresize_size_keyboard;
116 Atom net_wm_moveresize_move_keyboard;
117
118 Atom net_wm_action_move;
119 Atom net_wm_action_resize;
120 Atom net_wm_action_minimize;
121 Atom net_wm_action_shade;
122 Atom net_wm_action_stick;
123 Atom net_wm_action_maximize_horz;
124 Atom net_wm_action_maximize_vert;
125 Atom net_wm_action_fullscreen;
126 Atom net_wm_action_change_desktop;
127 Atom net_wm_action_close;
128
129 Atom net_wm_state_modal;
130 Atom net_wm_state_sticky;
131 Atom net_wm_state_maximized_vert;
132 Atom net_wm_state_maximized_horz;
133 Atom net_wm_state_shaded;
134 Atom net_wm_state_skip_taskbar;
135 Atom net_wm_state_skip_pager;
136 Atom net_wm_state_hidden;
137 Atom net_wm_state_fullscreen;
138 Atom net_wm_state_above;
139 Atom net_wm_state_below;
140
141 Atom net_wm_state_add;
142 Atom net_wm_state_remove;
143 Atom net_wm_state_toggle;
144
145 Atom net_wm_orientation_horz;
146 Atom net_wm_orientation_vert;
147 Atom net_wm_topleft;
148 Atom net_wm_topright;
149 Atom net_wm_bottomright;
150 Atom net_wm_bottomleft;
151
152 /* Extra atoms */
153
154 Atom kde_net_wm_frame_strut;
155 Atom kde_wm_change_state;
156 Atom kde_net_wm_window_type_override;
157
158 Atom kwm_win_icon;
159
160 Atom rootpmapid;
161 Atom esetrootid;
162
163 /* Openbox specific atoms */
164
165 Atom openbox_pid;
166 Atom ob_wm_state_undecorated;
167 } Atoms;
168 Atoms prop_atoms;
169
170 void prop_startup();
171
172 gboolean prop_get32(Window win, Atom prop, Atom type, guint32 *ret);
173 gboolean prop_get_array32(Window win, Atom prop, Atom type, guint32 **ret,
174 guint *nret);
175 gboolean prop_get_string_locale(Window win, Atom prop, char **ret);
176 gboolean prop_get_string_utf8(Window win, Atom prop, char **ret);
177 gboolean prop_get_strings_locale(Window win, Atom prop, char ***ret);
178 gboolean prop_get_strings_utf8(Window win, Atom prop, char ***ret);
179
180 void prop_set32(Window win, Atom prop, Atom type, guint32 val);
181 void prop_set_array32(Window win, Atom prop, Atom type, guint32 *val,
182 guint num);
183 void prop_set_string_utf8(Window win, Atom prop, char *val);
184 void prop_set_strings_utf8(Window win, Atom prop, char **strs);
185
186 void prop_erase(Window win, Atom prop);
187
188 void prop_message(Window about, Atom messagetype, long data0, long data1,
189 long data2, long data3, long mask);
190
191 #define PROP_GET32(win, prop, type, ret) \
192 (prop_get32(win, prop_atoms.prop, prop_atoms.type, ret))
193 #define PROP_GETA32(win, prop, type, ret, nret) \
194 (prop_get_array32(win, prop_atoms.prop, prop_atoms.type, ret, \
195 nret))
196 #define PROP_GETS(win, prop, type, ret) \
197 (prop_get_string_##type(win, prop_atoms.prop, ret))
198 #define PROP_GETSS(win, prop, type, ret) \
199 (prop_get_strings_##type(win, prop_atoms.prop, ret))
200
201 #define PROP_SET32(win, prop, type, val) \
202 prop_set32(win, prop_atoms.prop, prop_atoms.type, val)
203 #define PROP_SETA32(win, prop, type, val, num) \
204 prop_set_array32(win, prop_atoms.prop, prop_atoms.type, val, num)
205 #define PROP_SETS(win, prop, val) \
206 prop_set_string_utf8(win, prop_atoms.prop, val)
207 #define PROP_SETSS(win, prop, strs) \
208 prop_set_strings_utf8(win, prop_atoms.prop, strs)
209
210 #define PROP_ERASE(win, prop) prop_erase(win, prop_atoms.prop)
211
212 #define PROP_MSG(about, msgtype, data0, data1, data2, data3) \
213 (prop_message(about, prop_atoms.msgtype, data0, data1, data2, data3, \
214 SubstructureNotifyMask | SubstructureRedirectMask))
215
216 #endif
This page took 0.047984 seconds and 4 git commands to generate.