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 Ben 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
;
60 /* root window properties */
63 Atom net_client_list_stacking
;
64 Atom net_number_of_desktops
;
65 Atom net_desktop_geometry
;
66 Atom net_desktop_viewport
;
67 Atom net_current_desktop
;
68 Atom net_desktop_names
;
69 Atom net_active_window
;
71 Atom net_supporting_wm_check
;
72 Atom net_desktop_layout
;
73 Atom net_showing_desktop
;
74 /* root window messages */
75 Atom net_close_window
;
76 Atom net_wm_moveresize
;
77 Atom net_moveresize_window
;
79 /* startup-notification extension */
82 /* application window properties */
84 Atom net_wm_visible_name
;
85 Atom net_wm_icon_name
;
86 Atom net_wm_visible_icon_name
;
88 Atom net_wm_window_type
;
91 Atom net_wm_strut_partial
;
93 /* Atom net_wm_pid; */
94 Atom net_wm_allowed_actions
;
95 /* application protocols */
96 /* Atom Atom net_wm_ping; */
98 Atom net_wm_window_type_desktop
;
99 Atom net_wm_window_type_dock
;
100 Atom net_wm_window_type_toolbar
;
101 Atom net_wm_window_type_menu
;
102 Atom net_wm_window_type_utility
;
103 Atom net_wm_window_type_splash
;
104 Atom net_wm_window_type_dialog
;
105 Atom net_wm_window_type_normal
;
107 Atom net_wm_moveresize_size_topleft
;
108 Atom net_wm_moveresize_size_top
;
109 Atom net_wm_moveresize_size_topright
;
110 Atom net_wm_moveresize_size_right
;
111 Atom net_wm_moveresize_size_bottomright
;
112 Atom net_wm_moveresize_size_bottom
;
113 Atom net_wm_moveresize_size_bottomleft
;
114 Atom net_wm_moveresize_size_left
;
115 Atom net_wm_moveresize_move
;
116 Atom net_wm_moveresize_size_keyboard
;
117 Atom net_wm_moveresize_move_keyboard
;
119 Atom net_wm_action_move
;
120 Atom net_wm_action_resize
;
121 Atom net_wm_action_minimize
;
122 Atom net_wm_action_shade
;
123 Atom net_wm_action_stick
;
124 Atom net_wm_action_maximize_horz
;
125 Atom net_wm_action_maximize_vert
;
126 Atom net_wm_action_fullscreen
;
127 Atom net_wm_action_change_desktop
;
128 Atom net_wm_action_close
;
130 Atom net_wm_state_modal
;
131 Atom net_wm_state_sticky
;
132 Atom net_wm_state_maximized_vert
;
133 Atom net_wm_state_maximized_horz
;
134 Atom net_wm_state_shaded
;
135 Atom net_wm_state_skip_taskbar
;
136 Atom net_wm_state_skip_pager
;
137 Atom net_wm_state_hidden
;
138 Atom net_wm_state_fullscreen
;
139 Atom net_wm_state_above
;
140 Atom net_wm_state_below
;
142 Atom net_wm_state_add
;
143 Atom net_wm_state_remove
;
144 Atom net_wm_state_toggle
;
146 Atom net_wm_orientation_horz
;
147 Atom net_wm_orientation_vert
;
149 Atom net_wm_topright
;
150 Atom net_wm_bottomright
;
151 Atom net_wm_bottomleft
;
155 Atom kde_net_wm_frame_strut
;
156 Atom kde_wm_change_state
;
157 Atom kde_net_wm_window_type_override
;
164 /* Openbox specific atoms */
167 Atom ob_wm_state_undecorated
;
173 gboolean
prop_get32(Window win
, Atom prop
, Atom type
, guint32
*ret
);
174 gboolean
prop_get_array32(Window win
, Atom prop
, Atom type
, guint32
**ret
,
176 gboolean
prop_get_string_locale(Window win
, Atom prop
, gchar
**ret
);
177 gboolean
prop_get_string_utf8(Window win
, Atom prop
, gchar
**ret
);
178 gboolean
prop_get_strings_locale(Window win
, Atom prop
, gchar
***ret
);
179 gboolean
prop_get_strings_utf8(Window win
, Atom prop
, gchar
***ret
);
181 void prop_set32(Window win
, Atom prop
, Atom type
, gulong val
);
182 void prop_set_array32(Window win
, Atom prop
, Atom type
, gulong
*val
,
184 void prop_set_string_utf8(Window win
, Atom prop
, gchar
*val
);
185 void prop_set_strings_utf8(Window win
, Atom prop
, gchar
**strs
);
187 void prop_erase(Window win
, Atom prop
);
189 void prop_message(Window about
, Atom messagetype
, glong data0
, glong data1
,
190 glong data2
, glong data3
, glong mask
);
192 #define PROP_GET32(win, prop, type, ret) \
193 (prop_get32(win, prop_atoms.prop, prop_atoms.type, ret))
194 #define PROP_GETA32(win, prop, type, ret, nret) \
195 (prop_get_array32(win, prop_atoms.prop, prop_atoms.type, ret, \
197 #define PROP_GETS(win, prop, type, ret) \
198 (prop_get_string_##type(win, prop_atoms.prop, ret))
199 #define PROP_GETSS(win, prop, type, ret) \
200 (prop_get_strings_##type(win, prop_atoms.prop, ret))
202 #define PROP_SET32(win, prop, type, val) \
203 prop_set32(win, prop_atoms.prop, prop_atoms.type, val)
204 #define PROP_SETA32(win, prop, type, val, num) \
205 prop_set_array32(win, prop_atoms.prop, prop_atoms.type, val, num)
206 #define PROP_SETS(win, prop, val) \
207 prop_set_string_utf8(win, prop_atoms.prop, val)
208 #define PROP_SETSS(win, prop, strs) \
209 prop_set_strings_utf8(win, prop_atoms.prop, strs)
211 #define PROP_ERASE(win, prop) prop_erase(win, prop_atoms.prop)
213 #define PROP_MSG(about, msgtype, data0, data1, data2, data3) \
214 (prop_message(about, prop_atoms.msgtype, data0, data1, data2, data3, \
215 SubstructureNotifyMask | SubstructureRedirectMask))