aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c424
1 files changed, 213 insertions, 211 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 1a6fc9a..9fc428a 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -4,8 +4,9 @@
4 4
5#ifdef HAVE_CONFIG_H 5#ifdef HAVE_CONFIG_H
6# include <config.h> 6# include <config.h>
7#endif /* ifdef HAVE_CONFIG_H */ 7#endif
8 8
9#include <stdlib.h>
9#include <stdio.h> 10#include <stdio.h>
10#include <string.h> 11#include <string.h>
11 12
@@ -39,17 +40,17 @@ struct _Ecore_X_Startup_Info
39 int silent; 40 int silent;
40}; 41};
41 42
42static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, 43static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
43 Ecore_X_Atom atom, 44 Ecore_X_Atom atom,
44 const char *str); 45 const char *str);
45static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, 46static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
46 Ecore_X_Atom atom); 47 Ecore_X_Atom atom);
47#if 0 /* Unused */ 48#if 0 /* Unused */
48static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info); 49static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info);
49static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, 50static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
50 char *data); 51 char *data);
51#endif /* if 0 */ 52#endif /* if 0 */
52static void _ecore_x_netwm_startup_info_free(void *data); 53static void _ecore_x_netwm_startup_info_free(void *data);
53 54
54/* 55/*
55 * Convenience macros 56 * Convenience macros
@@ -76,7 +77,7 @@ ecore_x_netwm_init(void)
76 LOGFN(__FILE__, __LINE__, __FUNCTION__); 77 LOGFN(__FILE__, __LINE__, __FUNCTION__);
77 startup_info = eina_hash_string_superfast_new( 78 startup_info = eina_hash_string_superfast_new(
78 _ecore_x_netwm_startup_info_free); 79 _ecore_x_netwm_startup_info_free);
79} /* ecore_x_netwm_init */ 80}
80 81
81EAPI void 82EAPI void
82ecore_x_netwm_shutdown(void) 83ecore_x_netwm_shutdown(void)
@@ -86,7 +87,7 @@ ecore_x_netwm_shutdown(void)
86 eina_hash_free(startup_info); 87 eina_hash_free(startup_info);
87 88
88 startup_info = NULL; 89 startup_info = NULL;
89} /* ecore_x_netwm_shutdown */ 90}
90 91
91/* 92/*
92 * WM identification 93 * WM identification
@@ -94,7 +95,7 @@ ecore_x_netwm_shutdown(void)
94EAPI void 95EAPI void
95ecore_x_netwm_wm_identify(Ecore_X_Window root, 96ecore_x_netwm_wm_identify(Ecore_X_Window root,
96 Ecore_X_Window check, 97 Ecore_X_Window check,
97 const char *wm_name) 98 const char *wm_name)
98{ 99{
99 LOGFN(__FILE__, __LINE__, __FUNCTION__); 100 LOGFN(__FILE__, __LINE__, __FUNCTION__);
100 ecore_x_window_prop_window_set(root, 101 ecore_x_window_prop_window_set(root,
@@ -112,27 +113,27 @@ ecore_x_netwm_wm_identify(Ecore_X_Window root,
112 _ecore_x_window_prop_string_utf8_set(root, 113 _ecore_x_window_prop_string_utf8_set(root,
113 ECORE_X_ATOM_NET_WM_NAME, 114 ECORE_X_ATOM_NET_WM_NAME,
114 wm_name); 115 wm_name);
115} /* ecore_x_netwm_wm_identify */ 116}
116 117
117/* 118/*
118 * Set supported atoms 119 * Set supported atoms
119 */ 120 */
120EAPI void 121EAPI void
121ecore_x_netwm_supported_set(Ecore_X_Window root, 122ecore_x_netwm_supported_set(Ecore_X_Window root,
122 Ecore_X_Atom *supported, 123 Ecore_X_Atom *supported,
123 int num) 124 int num)
124{ 125{
125 LOGFN(__FILE__, __LINE__, __FUNCTION__); 126 LOGFN(__FILE__, __LINE__, __FUNCTION__);
126 ecore_x_window_prop_atom_set(root, 127 ecore_x_window_prop_atom_set(root,
127 ECORE_X_ATOM_NET_SUPPORTED, 128 ECORE_X_ATOM_NET_SUPPORTED,
128 supported, 129 supported,
129 num); 130 num);
130} /* ecore_x_netwm_supported_set */ 131}
131 132
132EAPI Eina_Bool 133EAPI Eina_Bool
133ecore_x_netwm_supported_get(Ecore_X_Window root, 134ecore_x_netwm_supported_get(Ecore_X_Window root,
134 Ecore_X_Atom **supported, 135 Ecore_X_Atom **supported,
135 int *num) 136 int *num)
136{ 137{
137 int num_ret; 138 int num_ret;
138 139
@@ -152,36 +153,36 @@ ecore_x_netwm_supported_get(Ecore_X_Window root,
152 *num = num_ret; 153 *num = num_ret;
153 154
154 return EINA_TRUE; 155 return EINA_TRUE;
155} /* ecore_x_netwm_supported_get */ 156}
156 157
157/* 158/*
158 * Desktop configuration and status 159 * Desktop configuration and status
159 */ 160 */
160EAPI void 161EAPI void
161ecore_x_netwm_desk_count_set(Ecore_X_Window root, 162ecore_x_netwm_desk_count_set(Ecore_X_Window root,
162 unsigned int n_desks) 163 unsigned int n_desks)
163{ 164{
164 LOGFN(__FILE__, __LINE__, __FUNCTION__); 165 LOGFN(__FILE__, __LINE__, __FUNCTION__);
165 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS, 166 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
166 &n_desks, 1); 167 &n_desks, 1);
167} /* ecore_x_netwm_desk_count_set */ 168}
168 169
169EAPI void 170EAPI void
170ecore_x_netwm_desk_roots_set(Ecore_X_Window root, 171ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
171 Ecore_X_Window *vroots, 172 Ecore_X_Window *vroots,
172 unsigned int n_desks) 173 unsigned int n_desks)
173{ 174{
174 LOGFN(__FILE__, __LINE__, __FUNCTION__); 175 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175 ecore_x_window_prop_window_set(root, 176 ecore_x_window_prop_window_set(root,
176 ECORE_X_ATOM_NET_VIRTUAL_ROOTS, 177 ECORE_X_ATOM_NET_VIRTUAL_ROOTS,
177 vroots, 178 vroots,
178 n_desks); 179 n_desks);
179} /* ecore_x_netwm_desk_roots_set */ 180}
180 181
181EAPI void 182EAPI void
182ecore_x_netwm_desk_names_set(Ecore_X_Window root, 183ecore_x_netwm_desk_names_set(Ecore_X_Window root,
183 const char **names, 184 const char **names,
184 unsigned int n_desks) 185 unsigned int n_desks)
185{ 186{
186 char ss[32], *buf, *t; 187 char ss[32], *buf, *t;
187 const char *s; 188 const char *s;
@@ -198,8 +199,8 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
198 if (!s) 199 if (!s)
199 { 200 {
200 /* Default to "Desk-<number>" */ 201 /* Default to "Desk-<number>" */
201 sprintf(ss, "Desk-%d", i); 202 sprintf(ss, "Desk-%d", i);
202 s = ss; 203 s = ss;
203 } 204 }
204 205
205 l = strlen(s) + 1; 206 l = strlen(s) + 1;
@@ -215,12 +216,12 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
215 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len); 216 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len);
216 217
217 free(buf); 218 free(buf);
218} /* ecore_x_netwm_desk_names_set */ 219}
219 220
220EAPI void 221EAPI void
221ecore_x_netwm_desk_size_set(Ecore_X_Window root, 222ecore_x_netwm_desk_size_set(Ecore_X_Window root,
222 unsigned int width, 223 unsigned int width,
223 unsigned int height) 224 unsigned int height)
224{ 225{
225 unsigned int size[2]; 226 unsigned int size[2];
226 227
@@ -229,24 +230,24 @@ ecore_x_netwm_desk_size_set(Ecore_X_Window root,
229 size[1] = height; 230 size[1] = height;
230 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, size, 231 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, size,
231 2); 232 2);
232} /* ecore_x_netwm_desk_size_set */ 233}
233 234
234EAPI void 235EAPI void
235ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, 236ecore_x_netwm_desk_viewports_set(Ecore_X_Window root,
236 unsigned int *origins, 237 unsigned int *origins,
237 unsigned int n_desks) 238 unsigned int n_desks)
238{ 239{
239 LOGFN(__FILE__, __LINE__, __FUNCTION__); 240 LOGFN(__FILE__, __LINE__, __FUNCTION__);
240 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT, 241 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
241 origins, 2 * n_desks); 242 origins, 2 * n_desks);
242} /* ecore_x_netwm_desk_viewports_set */ 243}
243 244
244EAPI void 245EAPI void
245ecore_x_netwm_desk_layout_set(Ecore_X_Window root, 246ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
246 int orientation, 247 int orientation,
247 int columns, 248 int columns,
248 int rows, 249 int rows,
249 int starting_corner) 250 int starting_corner)
250{ 251{
251 unsigned int layout[4]; 252 unsigned int layout[4];
252 253
@@ -257,26 +258,26 @@ ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
257 layout[3] = starting_corner; 258 layout[3] = starting_corner;
258 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT, 259 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_LAYOUT,
259 layout, 4); 260 layout, 4);
260} /* ecore_x_netwm_desk_layout_set */ 261}
261 262
262EAPI void 263EAPI void
263ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, 264ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
264 unsigned int *areas, 265 unsigned int *areas,
265 unsigned int n_desks) 266 unsigned int n_desks)
266{ 267{
267 LOGFN(__FILE__, __LINE__, __FUNCTION__); 268 LOGFN(__FILE__, __LINE__, __FUNCTION__);
268 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas, 269 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
269 4 * n_desks); 270 4 * n_desks);
270} /* ecore_x_netwm_desk_workareas_set */ 271}
271 272
272EAPI unsigned int * 273EAPI unsigned int *
273ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks) 274ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
274{ 275{
275 int ret; 276 int ret;
276 unsigned int *areas = NULL; 277 unsigned int *areas = NULL;
277 278
278 if (!root) root = DefaultRootWindow(_ecore_x_disp); 279 if (!root) root = DefaultRootWindow(_ecore_x_disp);
279 280
280 ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA, 281 ret = ecore_x_window_prop_card32_list_get(root, ECORE_X_ATOM_NET_WORKAREA,
281 &areas); 282 &areas);
282 if (!areas) 283 if (!areas)
@@ -290,16 +291,16 @@ ecore_x_netwm_desk_workareas_get(Ecore_X_Window root, unsigned int *n_desks)
290 291
291EAPI void 292EAPI void
292ecore_x_netwm_desk_current_set(Ecore_X_Window root, 293ecore_x_netwm_desk_current_set(Ecore_X_Window root,
293 unsigned int desk) 294 unsigned int desk)
294{ 295{
295 LOGFN(__FILE__, __LINE__, __FUNCTION__); 296 LOGFN(__FILE__, __LINE__, __FUNCTION__);
296 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk, 297 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk,
297 1); 298 1);
298} /* ecore_x_netwm_desk_current_set */ 299}
299 300
300EAPI void 301EAPI void
301ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, 302ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
302 Eina_Bool on) 303 Eina_Bool on)
303{ 304{
304 unsigned int val; 305 unsigned int val;
305 306
@@ -307,7 +308,7 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
307 val = (on) ? 1 : 0; 308 val = (on) ? 1 : 0;
308 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP, &val, 309 ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_SHOWING_DESKTOP, &val,
309 1); 310 1);
310} /* ecore_x_netwm_showing_desktop_set */ 311}
311 312
312/* 313/*
313 * Client status 314 * Client status
@@ -315,25 +316,25 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
315 316
316/* Mapping order */ 317/* Mapping order */
317EAPI void 318EAPI void
318ecore_x_netwm_client_list_set(Ecore_X_Window root, 319ecore_x_netwm_client_list_set(Ecore_X_Window root,
319 Ecore_X_Window *p_clients, 320 Ecore_X_Window *p_clients,
320 unsigned int n_clients) 321 unsigned int n_clients)
321{ 322{
322 LOGFN(__FILE__, __LINE__, __FUNCTION__); 323 LOGFN(__FILE__, __LINE__, __FUNCTION__);
323 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST, 324 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST,
324 p_clients, n_clients); 325 p_clients, n_clients);
325} /* ecore_x_netwm_client_list_set */ 326}
326 327
327/* Stacking order */ 328/* Stacking order */
328EAPI void 329EAPI void
329ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, 330ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root,
330 Ecore_X_Window *p_clients, 331 Ecore_X_Window *p_clients,
331 unsigned int n_clients) 332 unsigned int n_clients)
332{ 333{
333 LOGFN(__FILE__, __LINE__, __FUNCTION__); 334 LOGFN(__FILE__, __LINE__, __FUNCTION__);
334 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING, 335 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST_STACKING,
335 p_clients, n_clients); 336 p_clients, n_clients);
336} /* ecore_x_netwm_client_list_stacking_set */ 337}
337 338
338EAPI void 339EAPI void
339ecore_x_netwm_client_active_set(Ecore_X_Window root, 340ecore_x_netwm_client_active_set(Ecore_X_Window root,
@@ -342,12 +343,12 @@ ecore_x_netwm_client_active_set(Ecore_X_Window root,
342 LOGFN(__FILE__, __LINE__, __FUNCTION__); 343 LOGFN(__FILE__, __LINE__, __FUNCTION__);
343 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW, 344 ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW,
344 &win, 1); 345 &win, 1);
345} /* ecore_x_netwm_client_active_set */ 346}
346 347
347EAPI void 348EAPI void
348ecore_x_netwm_client_active_request(Ecore_X_Window root, 349ecore_x_netwm_client_active_request(Ecore_X_Window root,
349 Ecore_X_Window win, 350 Ecore_X_Window win,
350 int type, 351 int type,
351 Ecore_X_Window current_win) 352 Ecore_X_Window current_win)
352{ 353{
353 XEvent xev; 354 XEvent xev;
@@ -369,19 +370,19 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
369 370
370 XSendEvent(_ecore_x_disp, root, False, 371 XSendEvent(_ecore_x_disp, root, False,
371 SubstructureRedirectMask | SubstructureNotifyMask, &xev); 372 SubstructureRedirectMask | SubstructureNotifyMask, &xev);
372} /* ecore_x_netwm_client_active_request */ 373}
373 374
374EAPI void 375EAPI void
375ecore_x_netwm_name_set(Ecore_X_Window win, 376ecore_x_netwm_name_set(Ecore_X_Window win,
376 const char *name) 377 const char *name)
377{ 378{
378 LOGFN(__FILE__, __LINE__, __FUNCTION__); 379 LOGFN(__FILE__, __LINE__, __FUNCTION__);
379 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name); 380 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name);
380} /* ecore_x_netwm_name_set */ 381}
381 382
382EAPI int 383EAPI int
383ecore_x_netwm_name_get(Ecore_X_Window win, 384ecore_x_netwm_name_get(Ecore_X_Window win,
384 char **name) 385 char **name)
385{ 386{
386 LOGFN(__FILE__, __LINE__, __FUNCTION__); 387 LOGFN(__FILE__, __LINE__, __FUNCTION__);
387 if (name) 388 if (name)
@@ -389,19 +390,19 @@ ecore_x_netwm_name_get(Ecore_X_Window win,
389 ECORE_X_ATOM_NET_WM_NAME); 390 ECORE_X_ATOM_NET_WM_NAME);
390 391
391 return 1; 392 return 1;
392} /* ecore_x_netwm_name_get */ 393}
393 394
394EAPI void 395EAPI void
395ecore_x_netwm_startup_id_set(Ecore_X_Window win, 396ecore_x_netwm_startup_id_set(Ecore_X_Window win,
396 const char *id) 397 const char *id)
397{ 398{
398 LOGFN(__FILE__, __LINE__, __FUNCTION__); 399 LOGFN(__FILE__, __LINE__, __FUNCTION__);
399 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id); 400 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id);
400} /* ecore_x_netwm_startup_id_set */ 401}
401 402
402EAPI int 403EAPI int
403ecore_x_netwm_startup_id_get(Ecore_X_Window win, 404ecore_x_netwm_startup_id_get(Ecore_X_Window win,
404 char **id) 405 char **id)
405{ 406{
406 LOGFN(__FILE__, __LINE__, __FUNCTION__); 407 LOGFN(__FILE__, __LINE__, __FUNCTION__);
407 if (id) 408 if (id)
@@ -409,20 +410,20 @@ ecore_x_netwm_startup_id_get(Ecore_X_Window win,
409 ECORE_X_ATOM_NET_STARTUP_ID); 410 ECORE_X_ATOM_NET_STARTUP_ID);
410 411
411 return 1; 412 return 1;
412} /* ecore_x_netwm_startup_id_get */ 413}
413 414
414EAPI void 415EAPI void
415ecore_x_netwm_visible_name_set(Ecore_X_Window win, 416ecore_x_netwm_visible_name_set(Ecore_X_Window win,
416 const char *name) 417 const char *name)
417{ 418{
418 LOGFN(__FILE__, __LINE__, __FUNCTION__); 419 LOGFN(__FILE__, __LINE__, __FUNCTION__);
419 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME, 420 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
420 name); 421 name);
421} /* ecore_x_netwm_visible_name_set */ 422}
422 423
423EAPI int 424EAPI int
424ecore_x_netwm_visible_name_get(Ecore_X_Window win, 425ecore_x_netwm_visible_name_get(Ecore_X_Window win,
425 char **name) 426 char **name)
426{ 427{
427 LOGFN(__FILE__, __LINE__, __FUNCTION__); 428 LOGFN(__FILE__, __LINE__, __FUNCTION__);
428 if (name) 429 if (name)
@@ -431,20 +432,20 @@ ecore_x_netwm_visible_name_get(Ecore_X_Window win,
431 ECORE_X_ATOM_NET_WM_VISIBLE_NAME); 432 ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
432 433
433 return 1; 434 return 1;
434} /* ecore_x_netwm_visible_name_get */ 435}
435 436
436EAPI void 437EAPI void
437ecore_x_netwm_icon_name_set(Ecore_X_Window win, 438ecore_x_netwm_icon_name_set(Ecore_X_Window win,
438 const char *name) 439 const char *name)
439{ 440{
440 LOGFN(__FILE__, __LINE__, __FUNCTION__); 441 LOGFN(__FILE__, __LINE__, __FUNCTION__);
441 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, 442 _ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
442 name); 443 name);
443} /* ecore_x_netwm_icon_name_set */ 444}
444 445
445EAPI int 446EAPI int
446ecore_x_netwm_icon_name_get(Ecore_X_Window win, 447ecore_x_netwm_icon_name_get(Ecore_X_Window win,
447 char **name) 448 char **name)
448{ 449{
449 LOGFN(__FILE__, __LINE__, __FUNCTION__); 450 LOGFN(__FILE__, __LINE__, __FUNCTION__);
450 if (name) 451 if (name)
@@ -453,21 +454,21 @@ ecore_x_netwm_icon_name_get(Ecore_X_Window win,
453 ECORE_X_ATOM_NET_WM_ICON_NAME); 454 ECORE_X_ATOM_NET_WM_ICON_NAME);
454 455
455 return 1; 456 return 1;
456} /* ecore_x_netwm_icon_name_get */ 457}
457 458
458EAPI void 459EAPI void
459ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, 460ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win,
460 const char *name) 461 const char *name)
461{ 462{
462 LOGFN(__FILE__, __LINE__, __FUNCTION__); 463 LOGFN(__FILE__, __LINE__, __FUNCTION__);
463 _ecore_x_window_prop_string_utf8_set(win, 464 _ecore_x_window_prop_string_utf8_set(win,
464 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME, 465 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
465 name); 466 name);
466} /* ecore_x_netwm_visible_icon_name_set */ 467}
467 468
468EAPI int 469EAPI int
469ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, 470ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
470 char **name) 471 char **name)
471{ 472{
472 LOGFN(__FILE__, __LINE__, __FUNCTION__); 473 LOGFN(__FILE__, __LINE__, __FUNCTION__);
473 if (name) 474 if (name)
@@ -476,19 +477,19 @@ ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
476 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME); 477 ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
477 478
478 return 1; 479 return 1;
479} /* ecore_x_netwm_visible_icon_name_get */ 480}
480 481
481EAPI void 482EAPI void
482ecore_x_netwm_desktop_set(Ecore_X_Window win, 483ecore_x_netwm_desktop_set(Ecore_X_Window win,
483 unsigned int desk) 484 unsigned int desk)
484{ 485{
485 LOGFN(__FILE__, __LINE__, __FUNCTION__); 486 LOGFN(__FILE__, __LINE__, __FUNCTION__);
486 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1); 487 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1);
487} /* ecore_x_netwm_desktop_set */ 488}
488 489
489EAPI Eina_Bool 490EAPI Eina_Bool
490ecore_x_netwm_desktop_get(Ecore_X_Window win, 491ecore_x_netwm_desktop_get(Ecore_X_Window win,
491 unsigned int *desk) 492 unsigned int *desk)
492{ 493{
493 int ret; 494 int ret;
494 unsigned int tmp; 495 unsigned int tmp;
@@ -501,17 +502,17 @@ ecore_x_netwm_desktop_get(Ecore_X_Window win,
501 *desk = tmp; 502 *desk = tmp;
502 503
503 return ret == 1 ? EINA_TRUE : EINA_FALSE; 504 return ret == 1 ? EINA_TRUE : EINA_FALSE;
504} /* ecore_x_netwm_desktop_get */ 505}
505 506
506/* 507/*
507 * _NET_WM_STRUT is deprecated 508 * _NET_WM_STRUT is deprecated
508 */ 509 */
509EAPI void 510EAPI void
510ecore_x_netwm_strut_set(Ecore_X_Window win, 511ecore_x_netwm_strut_set(Ecore_X_Window win,
511 int left, 512 int left,
512 int right, 513 int right,
513 int top, 514 int top,
514 int bottom) 515 int bottom)
515{ 516{
516 unsigned int strut[4]; 517 unsigned int strut[4];
517 518
@@ -521,17 +522,17 @@ ecore_x_netwm_strut_set(Ecore_X_Window win,
521 strut[2] = top; 522 strut[2] = top;
522 strut[3] = bottom; 523 strut[3] = bottom;
523 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4); 524 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_STRUT, strut, 4);
524} /* ecore_x_netwm_strut_set */ 525}
525 526
526/* 527/*
527 * _NET_WM_STRUT is deprecated 528 * _NET_WM_STRUT is deprecated
528 */ 529 */
529EAPI Eina_Bool 530EAPI Eina_Bool
530ecore_x_netwm_strut_get(Ecore_X_Window win, 531ecore_x_netwm_strut_get(Ecore_X_Window win,
531 int *left, 532 int *left,
532 int *right, 533 int *right,
533 int *top, 534 int *top,
534 int *bottom) 535 int *bottom)
535{ 536{
536 int ret = 0; 537 int ret = 0;
537 unsigned int strut[4]; 538 unsigned int strut[4];
@@ -557,22 +558,22 @@ ecore_x_netwm_strut_get(Ecore_X_Window win,
557 *bottom = strut[3]; 558 *bottom = strut[3];
558 559
559 return EINA_TRUE; 560 return EINA_TRUE;
560} /* ecore_x_netwm_strut_get */ 561}
561 562
562EAPI void 563EAPI void
563ecore_x_netwm_strut_partial_set(Ecore_X_Window win, 564ecore_x_netwm_strut_partial_set(Ecore_X_Window win,
564 int left, 565 int left,
565 int right, 566 int right,
566 int top, 567 int top,
567 int bottom, 568 int bottom,
568 int left_start_y, 569 int left_start_y,
569 int left_end_y, 570 int left_end_y,
570 int right_start_y, 571 int right_start_y,
571 int right_end_y, 572 int right_end_y,
572 int top_start_x, 573 int top_start_x,
573 int top_end_x, 574 int top_end_x,
574 int bottom_start_x, 575 int bottom_start_x,
575 int bottom_end_x) 576 int bottom_end_x)
576{ 577{
577 unsigned int strut[12]; 578 unsigned int strut[12];
578 579
@@ -593,22 +594,22 @@ ecore_x_netwm_strut_partial_set(Ecore_X_Window win,
593 ECORE_X_ATOM_NET_WM_STRUT_PARTIAL, 594 ECORE_X_ATOM_NET_WM_STRUT_PARTIAL,
594 strut, 595 strut,
595 12); 596 12);
596} /* ecore_x_netwm_strut_partial_set */ 597}
597 598
598EAPI Eina_Bool 599EAPI Eina_Bool
599ecore_x_netwm_strut_partial_get(Ecore_X_Window win, 600ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
600 int *left, 601 int *left,
601 int *right, 602 int *right,
602 int *top, 603 int *top,
603 int *bottom, 604 int *bottom,
604 int *left_start_y, 605 int *left_start_y,
605 int *left_end_y, 606 int *left_end_y,
606 int *right_start_y, 607 int *right_start_y,
607 int *right_end_y, 608 int *right_end_y,
608 int *top_start_x, 609 int *top_start_x,
609 int *top_end_x, 610 int *top_end_x,
610 int *bottom_start_x, 611 int *bottom_start_x,
611 int *bottom_end_x) 612 int *bottom_end_x)
612{ 613{
613 int ret = 0; 614 int ret = 0;
614 unsigned int strut[12]; 615 unsigned int strut[12];
@@ -658,12 +659,12 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
658 *bottom_end_x = strut[11]; 659 *bottom_end_x = strut[11];
659 660
660 return EINA_TRUE; 661 return EINA_TRUE;
661} /* ecore_x_netwm_strut_partial_get */ 662}
662 663
663EAPI Eina_Bool 664EAPI Eina_Bool
664ecore_x_netwm_icons_get(Ecore_X_Window win, 665ecore_x_netwm_icons_get(Ecore_X_Window win,
665 Ecore_X_Icon **icon, 666 Ecore_X_Icon **icon,
666 int *num) 667 int *num)
667{ 668{
668 unsigned int *data, *p; 669 unsigned int *data, *p;
669 unsigned int *src; 670 unsigned int *src;
@@ -767,14 +768,14 @@ ecore_x_netwm_icons_get(Ecore_X_Window win,
767 free(data); 768 free(data);
768 769
769 return EINA_TRUE; 770 return EINA_TRUE;
770} /* ecore_x_netwm_icons_get */ 771}
771 772
772EAPI void 773EAPI void
773ecore_x_netwm_icon_geometry_set(Ecore_X_Window win, 774ecore_x_netwm_icon_geometry_set(Ecore_X_Window win,
774 int x, 775 int x,
775 int y, 776 int y,
776 int width, 777 int width,
777 int height) 778 int height)
778{ 779{
779 unsigned int geometry[4]; 780 unsigned int geometry[4];
780 781
@@ -787,14 +788,14 @@ ecore_x_netwm_icon_geometry_set(Ecore_X_Window win,
787 ECORE_X_ATOM_NET_WM_ICON_GEOMETRY, 788 ECORE_X_ATOM_NET_WM_ICON_GEOMETRY,
788 geometry, 789 geometry,
789 4); 790 4);
790} /* ecore_x_netwm_icon_geometry_set */ 791}
791 792
792EAPI Eina_Bool 793EAPI Eina_Bool
793ecore_x_netwm_icon_geometry_get(Ecore_X_Window win, 794ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
794 int *x, 795 int *x,
795 int *y, 796 int *y,
796 int *width, 797 int *width,
797 int *height) 798 int *height)
798{ 799{
799 int ret; 800 int ret;
800 unsigned int geometry[4]; 801 unsigned int geometry[4];
@@ -820,11 +821,11 @@ ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
820 *height = geometry[3]; 821 *height = geometry[3];
821 822
822 return EINA_TRUE; 823 return EINA_TRUE;
823} /* ecore_x_netwm_icon_geometry_get */ 824}
824 825
825EAPI void 826EAPI void
826ecore_x_netwm_pid_set(Ecore_X_Window win, 827ecore_x_netwm_pid_set(Ecore_X_Window win,
827 int pid) 828 int pid)
828{ 829{
829 unsigned int tmp; 830 unsigned int tmp;
830 831
@@ -832,11 +833,11 @@ ecore_x_netwm_pid_set(Ecore_X_Window win,
832 tmp = pid; 833 tmp = pid;
833 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_PID, 834 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_PID,
834 &tmp, 1); 835 &tmp, 1);
835} /* ecore_x_netwm_pid_set */ 836}
836 837
837EAPI Eina_Bool 838EAPI Eina_Bool
838ecore_x_netwm_pid_get(Ecore_X_Window win, 839ecore_x_netwm_pid_get(Ecore_X_Window win,
839 int *pid) 840 int *pid)
840{ 841{
841 int ret; 842 int ret;
842 unsigned int tmp; 843 unsigned int tmp;
@@ -848,7 +849,7 @@ ecore_x_netwm_pid_get(Ecore_X_Window win,
848 *pid = tmp; 849 *pid = tmp;
849 850
850 return ret == 1 ? EINA_TRUE : EINA_FALSE; 851 return ret == 1 ? EINA_TRUE : EINA_FALSE;
851} /* ecore_x_netwm_pid_get */ 852}
852 853
853EAPI void 854EAPI void
854ecore_x_netwm_handled_icons_set(Ecore_X_Window win) 855ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
@@ -856,7 +857,7 @@ ecore_x_netwm_handled_icons_set(Ecore_X_Window win)
856 LOGFN(__FILE__, __LINE__, __FUNCTION__); 857 LOGFN(__FILE__, __LINE__, __FUNCTION__);
857 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS, 858 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
858 NULL, 0); 859 NULL, 0);
859} /* ecore_x_netwm_handled_icons_set */ 860}
860 861
861EAPI Eina_Bool 862EAPI Eina_Bool
862ecore_x_netwm_handled_icons_get(Ecore_X_Window win) 863ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
@@ -866,20 +867,20 @@ ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
866 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS, 867 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_HANDLED_ICONS,
867 NULL, 0); 868 NULL, 0);
868 return ret == 0 ? EINA_TRUE : EINA_FALSE; 869 return ret == 0 ? EINA_TRUE : EINA_FALSE;
869} /* ecore_x_netwm_handled_icons_get */ 870}
870 871
871EAPI void 872EAPI void
872ecore_x_netwm_user_time_set(Ecore_X_Window win, 873ecore_x_netwm_user_time_set(Ecore_X_Window win,
873 unsigned int tim) 874 unsigned int tim)
874{ 875{
875 LOGFN(__FILE__, __LINE__, __FUNCTION__); 876 LOGFN(__FILE__, __LINE__, __FUNCTION__);
876 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME, 877 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME,
877 &tim, 1); 878 &tim, 1);
878} /* ecore_x_netwm_user_time_set */ 879}
879 880
880EAPI Eina_Bool 881EAPI Eina_Bool
881ecore_x_netwm_user_time_get(Ecore_X_Window win, 882ecore_x_netwm_user_time_get(Ecore_X_Window win,
882 unsigned int *tim) 883 unsigned int *tim)
883{ 884{
884 int ret; 885 int ret;
885 unsigned int tmp; 886 unsigned int tmp;
@@ -891,7 +892,7 @@ ecore_x_netwm_user_time_get(Ecore_X_Window win,
891 *tim = tmp; 892 *tim = tmp;
892 893
893 return ret == 1 ? EINA_TRUE : EINA_FALSE; 894 return ret == 1 ? EINA_TRUE : EINA_FALSE;
894} /* ecore_x_netwm_user_time_get */ 895}
895 896
896Ecore_X_Window_State 897Ecore_X_Window_State
897_ecore_x_netwm_state_get(Ecore_X_Atom a) 898_ecore_x_netwm_state_get(Ecore_X_Atom a)
@@ -922,12 +923,12 @@ _ecore_x_netwm_state_get(Ecore_X_Atom a)
922 return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION; 923 return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
923 else 924 else
924 return ECORE_X_WINDOW_STATE_UNKNOWN; 925 return ECORE_X_WINDOW_STATE_UNKNOWN;
925} /* _ecore_x_netwm_state_get */ 926}
926 927
927static Ecore_X_Atom 928static Ecore_X_Atom
928_ecore_x_netwm_state_atom_get(Ecore_X_Window_State s) 929_ecore_x_netwm_state_atom_get(Ecore_X_Window_State s)
929{ 930{
930 switch(s) 931 switch (s)
931 { 932 {
932 case ECORE_X_WINDOW_STATE_MODAL: 933 case ECORE_X_WINDOW_STATE_MODAL:
933 return ECORE_X_ATOM_NET_WM_STATE_MODAL; 934 return ECORE_X_ATOM_NET_WM_STATE_MODAL;
@@ -967,13 +968,13 @@ _ecore_x_netwm_state_atom_get(Ecore_X_Window_State s)
967 968
968 default: 969 default:
969 return 0; 970 return 0;
970 } /* switch */ 971 }
971} /* _ecore_x_netwm_state_atom_get */ 972}
972 973
973EAPI void 974EAPI void
974ecore_x_netwm_window_state_set(Ecore_X_Window win, 975ecore_x_netwm_window_state_set(Ecore_X_Window win,
975 Ecore_X_Window_State *state, 976 Ecore_X_Window_State *state,
976 unsigned int num) 977 unsigned int num)
977{ 978{
978 Ecore_X_Atom *set; 979 Ecore_X_Atom *set;
979 unsigned int i; 980 unsigned int i;
@@ -995,12 +996,12 @@ ecore_x_netwm_window_state_set(Ecore_X_Window win,
995 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num); 996 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num);
996 997
997 free(set); 998 free(set);
998} /* ecore_x_netwm_window_state_set */ 999}
999 1000
1000EAPI Eina_Bool 1001EAPI Eina_Bool
1001ecore_x_netwm_window_state_get(Ecore_X_Window win, 1002ecore_x_netwm_window_state_get(Ecore_X_Window win,
1002 Ecore_X_Window_State **state, 1003 Ecore_X_Window_State **state,
1003 unsigned int *num) 1004 unsigned int *num)
1004{ 1005{
1005 int num_ret, i; 1006 int num_ret, i;
1006 Ecore_X_Atom *atoms; 1007 Ecore_X_Atom *atoms;
@@ -1030,7 +1031,7 @@ ecore_x_netwm_window_state_get(Ecore_X_Window win,
1030 1031
1031 free(atoms); 1032 free(atoms);
1032 return EINA_TRUE; 1033 return EINA_TRUE;
1033} /* ecore_x_netwm_window_state_get */ 1034}
1034 1035
1035static Ecore_X_Window_Type 1036static Ecore_X_Window_Type
1036_ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom) 1037_ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom)
@@ -1065,7 +1066,7 @@ _ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom)
1065 return ECORE_X_WINDOW_TYPE_DND; 1066 return ECORE_X_WINDOW_TYPE_DND;
1066 else 1067 else
1067 return ECORE_X_WINDOW_TYPE_UNKNOWN; 1068 return ECORE_X_WINDOW_TYPE_UNKNOWN;
1068} /* _ecore_x_netwm_window_type_type_get */ 1069}
1069 1070
1070static Ecore_X_Atom 1071static Ecore_X_Atom
1071_ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type) 1072_ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
@@ -1116,15 +1117,15 @@ _ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
1116 1117
1117 default: 1118 default:
1118 return 0; 1119 return 0;
1119 } /* switch */ 1120 }
1120} /* _ecore_x_netwm_window_type_atom_get */ 1121}
1121 1122
1122/* 1123/*
1123 * FIXME: We should set WM_TRANSIENT_FOR if type is ECORE_X_WINDOW_TYPE_TOOLBAR 1124 * FIXME: We should set WM_TRANSIENT_FOR if type is ECORE_X_WINDOW_TYPE_TOOLBAR
1124 * , ECORE_X_WINDOW_TYPE_MENU or ECORE_X_WINDOW_TYPE_DIALOG 1125 * , ECORE_X_WINDOW_TYPE_MENU or ECORE_X_WINDOW_TYPE_DIALOG
1125 */ 1126 */
1126EAPI void 1127EAPI void
1127ecore_x_netwm_window_type_set(Ecore_X_Window win, 1128ecore_x_netwm_window_type_set(Ecore_X_Window win,
1128 Ecore_X_Window_Type type) 1129 Ecore_X_Window_Type type)
1129{ 1130{
1130 Ecore_X_Atom atom; 1131 Ecore_X_Atom atom;
@@ -1133,11 +1134,11 @@ ecore_x_netwm_window_type_set(Ecore_X_Window win,
1133 atom = _ecore_x_netwm_window_type_atom_get(type); 1134 atom = _ecore_x_netwm_window_type_atom_get(type);
1134 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE, 1135 ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
1135 &atom, 1); 1136 &atom, 1);
1136} /* ecore_x_netwm_window_type_set */ 1137}
1137 1138
1138/* FIXME: Maybe return 0 on some conditions? */ 1139/* FIXME: Maybe return 0 on some conditions? */
1139EAPI Eina_Bool 1140EAPI Eina_Bool
1140ecore_x_netwm_window_type_get(Ecore_X_Window win, 1141ecore_x_netwm_window_type_get(Ecore_X_Window win,
1141 Ecore_X_Window_Type *type) 1142 Ecore_X_Window_Type *type)
1142{ 1143{
1143 int num; 1144 int num;
@@ -1158,10 +1159,10 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win,
1158 return EINA_TRUE; 1159 return EINA_TRUE;
1159 1160
1160 return EINA_FALSE; 1161 return EINA_FALSE;
1161} /* ecore_x_netwm_window_type_get */ 1162}
1162 1163
1163EAPI int 1164EAPI int
1164ecore_x_netwm_window_types_get(Ecore_X_Window win, 1165ecore_x_netwm_window_types_get(Ecore_X_Window win,
1165 Ecore_X_Window_Type **types) 1166 Ecore_X_Window_Type **types)
1166{ 1167{
1167 int num, i; 1168 int num, i;
@@ -1196,7 +1197,7 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win,
1196 free(atoms2); 1197 free(atoms2);
1197 1198
1198 return num; 1199 return num;
1199} /* ecore_x_netwm_window_types_get */ 1200}
1200 1201
1201static Ecore_X_Atom 1202static Ecore_X_Atom
1202_ecore_x_netwm_action_atom_get(Ecore_X_Action action) 1203_ecore_x_netwm_action_atom_get(Ecore_X_Action action)
@@ -1241,8 +1242,8 @@ _ecore_x_netwm_action_atom_get(Ecore_X_Action action)
1241 1242
1242 default: 1243 default:
1243 return 0; 1244 return 0;
1244 } /* switch */ 1245 }
1245} /* _ecore_x_netwm_action_atom_get */ 1246}
1246 1247
1247/* FIXME: Get complete list */ 1248/* FIXME: Get complete list */
1248EAPI Eina_Bool 1249EAPI Eina_Bool
@@ -1272,13 +1273,13 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win,
1272 1273
1273 free(atoms); 1274 free(atoms);
1274 return ret; 1275 return ret;
1275} /* ecore_x_netwm_allowed_action_isset */ 1276}
1276 1277
1277/* FIXME: Set complete list */ 1278/* FIXME: Set complete list */
1278EAPI void 1279EAPI void
1279ecore_x_netwm_allowed_action_set(Ecore_X_Window win, 1280ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
1280 Ecore_X_Action *action, 1281 Ecore_X_Action *action,
1281 unsigned int num) 1282 unsigned int num)
1282{ 1283{
1283 Ecore_X_Atom *set; 1284 Ecore_X_Atom *set;
1284 unsigned int i; 1285 unsigned int i;
@@ -1304,12 +1305,12 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
1304 num); 1305 num);
1305 1306
1306 free(set); 1307 free(set);
1307} /* ecore_x_netwm_allowed_action_set */ 1308}
1308 1309
1309EAPI Eina_Bool 1310EAPI Eina_Bool
1310ecore_x_netwm_allowed_action_get(Ecore_X_Window win, 1311ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
1311 Ecore_X_Action **action, 1312 Ecore_X_Action **action,
1312 unsigned int *num) 1313 unsigned int *num)
1313{ 1314{
1314 int num_ret, i; 1315 int num_ret, i;
1315 Ecore_X_Atom *atoms; 1316 Ecore_X_Atom *atoms;
@@ -1341,20 +1342,20 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
1341 1342
1342 free(atoms); 1343 free(atoms);
1343 return EINA_TRUE; 1344 return EINA_TRUE;
1344} /* ecore_x_netwm_allowed_action_get */ 1345}
1345 1346
1346EAPI void 1347EAPI void
1347ecore_x_netwm_opacity_set(Ecore_X_Window win, 1348ecore_x_netwm_opacity_set(Ecore_X_Window win,
1348 unsigned int opacity) 1349 unsigned int opacity)
1349{ 1350{
1350 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1351 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1351 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY, 1352 ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
1352 &opacity, 1); 1353 &opacity, 1);
1353} /* ecore_x_netwm_opacity_set */ 1354}
1354 1355
1355EAPI Eina_Bool 1356EAPI Eina_Bool
1356ecore_x_netwm_opacity_get(Ecore_X_Window win, 1357ecore_x_netwm_opacity_get(Ecore_X_Window win,
1357 unsigned int *opacity) 1358 unsigned int *opacity)
1358{ 1359{
1359 int ret; 1360 int ret;
1360 unsigned int tmp; 1361 unsigned int tmp;
@@ -1366,14 +1367,14 @@ ecore_x_netwm_opacity_get(Ecore_X_Window win,
1366 *opacity = tmp; 1367 *opacity = tmp;
1367 1368
1368 return ret == 1 ? EINA_TRUE : EINA_FALSE; 1369 return ret == 1 ? EINA_TRUE : EINA_FALSE;
1369} /* ecore_x_netwm_opacity_get */ 1370}
1370 1371
1371EAPI void 1372EAPI void
1372ecore_x_netwm_frame_size_set(Ecore_X_Window win, 1373ecore_x_netwm_frame_size_set(Ecore_X_Window win,
1373 int fl, 1374 int fl,
1374 int fr, 1375 int fr,
1375 int ft, 1376 int ft,
1376 int fb) 1377 int fb)
1377{ 1378{
1378 unsigned int frames[4]; 1379 unsigned int frames[4];
1379 1380
@@ -1386,14 +1387,14 @@ ecore_x_netwm_frame_size_set(Ecore_X_Window win,
1386 ECORE_X_ATOM_NET_FRAME_EXTENTS, 1387 ECORE_X_ATOM_NET_FRAME_EXTENTS,
1387 frames, 1388 frames,
1388 4); 1389 4);
1389} /* ecore_x_netwm_frame_size_set */ 1390}
1390 1391
1391EAPI Eina_Bool 1392EAPI Eina_Bool
1392ecore_x_netwm_frame_size_get(Ecore_X_Window win, 1393ecore_x_netwm_frame_size_get(Ecore_X_Window win,
1393 int *fl, 1394 int *fl,
1394 int *fr, 1395 int *fr,
1395 int *ft, 1396 int *ft,
1396 int *fb) 1397 int *fb)
1397{ 1398{
1398 int ret = 0; 1399 int ret = 0;
1399 unsigned int frames[4]; 1400 unsigned int frames[4];
@@ -1419,10 +1420,10 @@ ecore_x_netwm_frame_size_get(Ecore_X_Window win,
1419 *fb = frames[3]; 1420 *fb = frames[3];
1420 1421
1421 return EINA_TRUE; 1422 return EINA_TRUE;
1422} /* ecore_x_netwm_frame_size_get */ 1423}
1423 1424
1424EAPI Eina_Bool 1425EAPI Eina_Bool
1425ecore_x_netwm_sync_counter_get(Ecore_X_Window win, 1426ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
1426 Ecore_X_Sync_Counter *counter) 1427 Ecore_X_Sync_Counter *counter)
1427{ 1428{
1428 int ret; 1429 int ret;
@@ -1439,7 +1440,7 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
1439 *counter = tmp; 1440 *counter = tmp;
1440 1441
1441 return ret == 1 ? EINA_TRUE : EINA_FALSE; 1442 return ret == 1 ? EINA_TRUE : EINA_FALSE;
1442} /* ecore_x_netwm_sync_counter_get */ 1443}
1443 1444
1444EAPI void 1445EAPI void
1445ecore_x_netwm_ping_send(Ecore_X_Window win) 1446ecore_x_netwm_ping_send(Ecore_X_Window win)
@@ -1462,11 +1463,11 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
1462 xev.xclient.data.l[4] = 0; 1463 xev.xclient.data.l[4] = 0;
1463 1464
1464 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1465 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1465} /* ecore_x_netwm_ping_send */ 1466}
1466 1467
1467EAPI void 1468EAPI void
1468ecore_x_netwm_sync_request_send(Ecore_X_Window win, 1469ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1469 unsigned int serial) 1470 unsigned int serial)
1470{ 1471{
1471 XSyncValue value; 1472 XSyncValue value;
1472 XEvent xev; 1473 XEvent xev;
@@ -1489,14 +1490,14 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1489 xev.xclient.data.l[4] = 0; 1490 xev.xclient.data.l[4] = 0;
1490 1491
1491 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1492 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1492} /* ecore_x_netwm_sync_request_send */ 1493}
1493 1494
1494EAPI void 1495EAPI void
1495ecore_x_netwm_state_request_send(Ecore_X_Window win, 1496ecore_x_netwm_state_request_send(Ecore_X_Window win,
1496 Ecore_X_Window root, 1497 Ecore_X_Window root,
1497 Ecore_X_Window_State s1, 1498 Ecore_X_Window_State s1,
1498 Ecore_X_Window_State s2, 1499 Ecore_X_Window_State s2,
1499 Eina_Bool set) 1500 Eina_Bool set)
1500{ 1501{
1501 XEvent xev; 1502 XEvent xev;
1502 1503
@@ -1524,12 +1525,12 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
1524 1525
1525 XSendEvent(_ecore_x_disp, root, False, 1526 XSendEvent(_ecore_x_disp, root, False,
1526 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1527 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1527} /* ecore_x_netwm_state_request_send */ 1528}
1528 1529
1529EAPI void 1530EAPI void
1530ecore_x_netwm_desktop_request_send(Ecore_X_Window win, 1531ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1531 Ecore_X_Window root, 1532 Ecore_X_Window root,
1532 unsigned int desktop) 1533 unsigned int desktop)
1533{ 1534{
1534 XEvent xev; 1535 XEvent xev;
1535 1536
@@ -1551,11 +1552,11 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1551 1552
1552 XSendEvent(_ecore_x_disp, root, False, 1553 XSendEvent(_ecore_x_disp, root, False,
1553 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1554 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1554} /* ecore_x_netwm_desktop_request_send */ 1555}
1555 1556
1556int 1557int
1557_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__, 1558_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
1558 char *data __UNUSED__) 1559 char *data __UNUSED__)
1559{ 1560{
1560#if 0 1561#if 0
1561 Ecore_X_Startup_Info *info; 1562 Ecore_X_Startup_Info *info;
@@ -1600,11 +1601,11 @@ _ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
1600 1601
1601#endif /* if 0 */ 1602#endif /* if 0 */
1602 return 1; 1603 return 1;
1603} /* _ecore_x_netwm_startup_info_begin */ 1604}
1604 1605
1605int 1606int
1606_ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__, 1607_ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
1607 char *data __UNUSED__) 1608 char *data __UNUSED__)
1608{ 1609{
1609#if 0 1610#if 0
1610 Ecore_X_Startup_Info *info; 1611 Ecore_X_Startup_Info *info;
@@ -1639,26 +1640,26 @@ _ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
1639 1640
1640#endif /* if 0 */ 1641#endif /* if 0 */
1641 return 1; 1642 return 1;
1642} /* _ecore_x_netwm_startup_info */ 1643}
1643 1644
1644/* 1645/*
1645 * Set UTF-8 string property 1646 * Set UTF-8 string property
1646 */ 1647 */
1647static void 1648static void
1648_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, 1649_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
1649 Ecore_X_Atom atom, 1650 Ecore_X_Atom atom,
1650 const char *str) 1651 const char *str)
1651{ 1652{
1652 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8, 1653 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8,
1653 PropModeReplace, (unsigned char *)str, strlen(str)); 1654 PropModeReplace, (unsigned char *)str, strlen(str));
1654} /* _ecore_x_window_prop_string_utf8_set */ 1655}
1655 1656
1656/* 1657/*
1657 * Get UTF-8 string property 1658 * Get UTF-8 string property
1658 */ 1659 */
1659static char * 1660static char *
1660_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, 1661_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
1661 Ecore_X_Atom atom) 1662 Ecore_X_Atom atom)
1662{ 1663{
1663 char *str; 1664 char *str;
1664 unsigned char *prop_ret; 1665 unsigned char *prop_ret;
@@ -1685,7 +1686,7 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
1685 XFree(prop_ret); 1686 XFree(prop_ret);
1686 1687
1687 return str; 1688 return str;
1688} /* _ecore_x_window_prop_string_utf8_get */ 1689}
1689 1690
1690#if 0 /* Unused */ 1691#if 0 /* Unused */
1691/* 1692/*
@@ -1758,19 +1759,19 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
1758 else 1759 else
1759 { 1760 {
1760 /* Discard buffer */ 1761 /* Discard buffer */
1761 info->length = 0; 1762 info->length = 0;
1762 info->buffer[0] = 0; 1763 info->buffer[0] = 0;
1763 } 1764 }
1764 1765
1765 return 1; 1766 return 1;
1766} /* _ecore_x_netwm_startup_info_process */ 1767}
1767 1768
1768/* 1769/*
1769 * Parse startup info 1770 * Parse startup info
1770 */ 1771 */
1771static int 1772static int
1772_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, 1773_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1773 char *data) 1774 char *data)
1774{ 1775{
1775 while (*data) 1776 while (*data)
1776 { 1777 {
@@ -1780,7 +1781,8 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1780 char value[1024]; 1781 char value[1024];
1781 1782
1782 /* Skip space */ 1783 /* Skip space */
1783 while (*data == ' ') data++; 1784 while (*data == ' ')
1785 data++;
1784 /* Get key */ 1786 /* Get key */
1785 key = data; 1787 key = data;
1786 data = strchr(key, '='); 1788 data = strchr(key, '=');
@@ -1920,7 +1922,7 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
1920 return 0; 1922 return 0;
1921 1923
1922 return 1; 1924 return 1;
1923} /* _ecore_x_netwm_startup_info_parse */ 1925}
1924 1926
1925#endif /* if 0 */ 1927#endif /* if 0 */
1926 1928
@@ -1958,7 +1960,7 @@ _ecore_x_netwm_startup_info_free(void *data)
1958 free(info->wmclass); 1960 free(info->wmclass);
1959 1961
1960 free(info); 1962 free(info);
1961} /* _ecore_x_netwm_startup_info_free */ 1963}
1962 1964
1963/* 1965/*
1964 * Is screen composited? 1966 * Is screen composited?
@@ -1981,10 +1983,10 @@ ecore_x_screen_is_composited(int screen)
1981 win = XGetSelectionOwner(_ecore_x_disp, atom); 1983 win = XGetSelectionOwner(_ecore_x_disp, atom);
1982 1984
1983 return (win != None) ? EINA_TRUE : EINA_FALSE; 1985 return (win != None) ? EINA_TRUE : EINA_FALSE;
1984} /* ecore_x_screen_is_composited */ 1986}
1985 1987
1986EAPI void 1988EAPI void
1987ecore_x_screen_is_composited_set(int screen, 1989ecore_x_screen_is_composited_set(int screen,
1988 Ecore_X_Window win) 1990 Ecore_X_Window win)
1989{ 1991{
1990 static Ecore_X_Atom atom = None; 1992 static Ecore_X_Atom atom = None;
@@ -1999,5 +2001,5 @@ ecore_x_screen_is_composited_set(int screen,
1999 return; 2001 return;
2000 2002
2001 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time); 2003 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
2002} /* ecore_x_screen_is_composited_set */ 2004}
2003 2005