12 /*! The atoms on the X server which this class will cache */
13 typedef struct Atoms
{
15 Atom cardinal
; /*!< The atom which represents the Cardinal data type */
16 Atom window
; /*!< The atom which represents window ids */
17 Atom pixmap
; /*!< The atom which represents pixmap ids */
18 Atom atom
; /*!< The atom which represents atom values */
19 Atom string
; /*!< The atom which represents ascii strings */
20 Atom utf8
; /*!< The atom which represents utf8-encoded strings */
23 Atom wm_colormap_windows
;
26 Atom wm_delete_window
;
37 /* root window properties */
40 Atom net_client_list_stacking
;
41 Atom net_number_of_desktops
;
42 Atom net_desktop_geometry
;
43 Atom net_desktop_viewport
;
44 Atom net_current_desktop
;
45 Atom net_desktop_names
;
46 Atom net_active_window
;
48 Atom net_supporting_wm_check
;
49 /* Atom net_virtual_roots; */
50 Atom net_desktop_layout
;
51 Atom net_showing_desktop
;
52 /* root window messages */
53 Atom net_close_window
;
54 Atom net_wm_moveresize
;
55 /* application window properties */
56 /* Atom net_properties; */
58 Atom net_wm_visible_name
;
59 Atom net_wm_icon_name
;
60 Atom net_wm_visible_icon_name
;
62 Atom net_wm_window_type
;
65 /* Atom net_wm_icon_geometry; */
67 /* Atom net_wm_pid; */
68 /* Atom net_wm_handled_icons; */
69 Atom net_wm_allowed_actions
;
70 /* application protocols */
71 /* Atom Atom net_wm_ping; */
73 Atom net_wm_window_type_desktop
;
74 Atom net_wm_window_type_dock
;
75 Atom net_wm_window_type_toolbar
;
76 Atom net_wm_window_type_menu
;
77 Atom net_wm_window_type_utility
;
78 Atom net_wm_window_type_splash
;
79 Atom net_wm_window_type_dialog
;
80 Atom net_wm_window_type_normal
;
82 Atom net_wm_moveresize_size_topleft
;
83 Atom net_wm_moveresize_size_topright
;
84 Atom net_wm_moveresize_size_bottomleft
;
85 Atom net_wm_moveresize_size_bottomright
;
86 Atom net_wm_moveresize_move
;
88 Atom net_wm_action_move
;
89 Atom net_wm_action_resize
;
90 Atom net_wm_action_minimize
;
91 Atom net_wm_action_shade
;
92 Atom net_wm_action_stick
;
93 Atom net_wm_action_maximize_horz
;
94 Atom net_wm_action_maximize_vert
;
95 Atom net_wm_action_fullscreen
;
96 Atom net_wm_action_change_desktop
;
97 Atom net_wm_action_close
;
99 Atom net_wm_state_modal
;
100 Atom net_wm_state_sticky
;
101 Atom net_wm_state_maximized_vert
;
102 Atom net_wm_state_maximized_horz
;
103 Atom net_wm_state_shaded
;
104 Atom net_wm_state_skip_taskbar
;
105 Atom net_wm_state_skip_pager
;
106 Atom net_wm_state_hidden
;
107 Atom net_wm_state_fullscreen
;
108 Atom net_wm_state_above
;
109 Atom net_wm_state_below
;
111 Atom net_wm_state_add
;
112 Atom net_wm_state_remove
;
113 Atom net_wm_state_toggle
;
115 Atom net_wm_orientation_horz
;
116 Atom net_wm_orientation_vert
;
118 Atom net_wm_topright
;
119 Atom net_wm_bottomright
;
120 Atom net_wm_bottomleft
;
124 Atom kde_net_system_tray_windows
;
125 Atom kde_net_wm_system_tray_window_for
;
126 Atom kde_net_wm_window_type_override
;
133 /* Openbox specific atoms */
142 gboolean
prop_get(Window win
, Atom prop
, Atom type
, int size
,
143 guchar
**data
, gulong num
);
145 gboolean
prop_get_prealloc(Window win
, Atom prop
, Atom type
, int size
,
146 guchar
*data
, gulong num
);
148 gboolean
prop_get_all(Window win
, Atom prop
, Atom type
, int size
,
149 guchar
**data
, gulong
*num
);
151 gboolean
prop_get_string(Window win
, Atom prop
, Atom type
, guchar
**data
);
152 gboolean
prop_get_strings(Window win
, Atom prop
, Atom type
,
155 void prop_set_strings(Window win
, Atom prop
, Atom type
, GPtrArray
*data
);
157 void prop_erase(Window win
, Atom prop
);
159 void prop_message(Window about
, Atom messagetype
, long data0
, long data1
,
160 long data2
, long data3
);
162 #define PROP_MSG(about, msgtype, data0, data1, data2, data3) \
163 (prop_message(about, prop_atoms.msgtype, data0, data1, data2, data3))
165 /* Set an 8-bit property from a string */
166 #define PROP_SETS(win, prop, type, value) \
167 (XChangeProperty(ob_display, win, prop_atoms.prop, prop_atoms.type, 8, \
168 PropModeReplace, (guchar*)value, strlen(value)))
169 /* Set an 8-bit property array from a GPtrArray of strings */
170 #define PROP_SETSA(win, prop, type, value) \
171 (prop_set_strings(win, prop_atoms.prop, prop_atoms.type, value))
173 /* Set a 32-bit property from a single value */
174 #define PROP_SET32(win, prop, type, value) \
175 (XChangeProperty(ob_display, win, prop_atoms.prop, prop_atoms.type, 32, \
176 PropModeReplace, (guchar*)&value, 1))
177 /* Set a 32-bit property from an array */
178 #define PROP_SET32A(win, prop, type, value, num) \
179 (XChangeProperty(ob_display, win, prop_atoms.prop, prop_atoms.type, 32, \
180 PropModeReplace, (guchar*)value, num))
182 /* Get an 8-bit property into a string */
183 #define PROP_GETS(win, prop, type, value) \
184 (prop_get_string(win, prop_atoms.prop, prop_atoms.type, \
186 /* Get an 8-bit property into a GPtrArray of strings
187 (The strings must be freed, the GPtrArray must already be created.) */
188 #define PROP_GETSA(win, prop, type, value) \
189 (prop_get_strings(win, prop_atoms.prop, prop_atoms.type, \
192 /* Get an entire 8-bit property into an array (which must be freed) */
193 #define PROP_GET8U(win, prop, type, value, num) \
194 (prop_get_all(win, prop_atoms.prop, prop_atoms.type, 8, \
195 (guchar**)&value, &num))
197 /* Get 1 element of a 32-bit property into a given variable */
198 #define PROP_GET32(win, prop, type, value) \
199 (prop_get_prealloc(win, prop_atoms.prop, prop_atoms.type, 32, \
202 /* Get an amount of a 32-bit property into an array (which must be freed) */
203 #define PROP_GET32A(win, prop, type, value, num) \
204 (prop_get(win, prop_atoms.prop, prop_atoms.type, 32, \
205 (guchar**)&value, num))
207 /* Get an entire 32-bit property into an array (which must be freed) */
208 #define PROP_GET32U(win, prop, type, value, num) \
209 (prop_get_all(win, prop_atoms.prop, prop_atoms.type, 32, \
210 (guchar**)&value, &num))
212 #define PROP_ERASE(win, prop) (prop_erase(win, prop_atoms.prop))