summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-12-03 08:35:53 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-12-03 08:35:53 +0000
commitdc0c272d2f87b9e5eefac1c4c3e9cbf97fd5a07d (patch)
tree84414b2acedbfdcab18d072722b13c02c5ebf87f /src
parenta154c405e1a2a96ee672bb6ccf457b5f9824b933 (diff)
ecore: remove useless ECORE_HAVE_EET, remove old XCB code and remove BUILD_ECORE_CON checks as ecore_con is always compiled anyway
SVN revision: 80024
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_file/ecore_file_download.c52
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_error.c7
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_events.c22
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_icccm.c312
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_window_prop.c37
5 files changed, 11 insertions, 419 deletions
diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c
index 98d4a1f972..028276407c 100644
--- a/src/lib/ecore_file/ecore_file_download.c
+++ b/src/lib/ecore_file/ecore_file_download.c
@@ -6,14 +6,10 @@
6#include <stdio.h> 6#include <stdio.h>
7#include <string.h> 7#include <string.h>
8 8
9#ifdef BUILD_ECORE_CON
10# include "Ecore_Con.h" 9# include "Ecore_Con.h"
11#endif
12 10
13#include "ecore_file_private.h" 11#include "ecore_file_private.h"
14 12
15#ifdef BUILD_ECORE_CON
16
17#define ECORE_MAGIC_FILE_DOWNLOAD_JOB 0xf7427cb8 13#define ECORE_MAGIC_FILE_DOWNLOAD_JOB 0xf7427cb8
18#define ECORE_FILE_DOWNLOAD_TIMEOUT 30 14#define ECORE_FILE_DOWNLOAD_TIMEOUT 30
19 15
@@ -47,12 +43,9 @@ static Eina_List *_job_list;
47 43
48static int download_init = 0; 44static int download_init = 0;
49 45
50#endif /* BUILD_ECORE_CON */
51
52int 46int
53ecore_file_download_init(void) 47ecore_file_download_init(void)
54{ 48{
55#ifdef BUILD_ECORE_CON
56 download_init++; 49 download_init++;
57 if (download_init > 1) return 1; 50 if (download_init > 1) return 1;
58 if (!ecore_con_init()) return 0; 51 if (!ecore_con_init()) return 0;
@@ -61,18 +54,16 @@ ecore_file_download_init(void)
61 ecore_con_shutdown(); 54 ecore_con_shutdown();
62 return 0; 55 return 0;
63 } 56 }
64# ifdef HAVE_CURL 57#ifdef HAVE_CURL
65 _url_complete_handler = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _ecore_file_download_url_complete_cb, NULL); 58 _url_complete_handler = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _ecore_file_download_url_complete_cb, NULL);
66 _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL); 59 _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL);
67# endif 60#endif
68#endif /* BUILD_ECORE_CON */
69 return 1; 61 return 1;
70} 62}
71 63
72void 64void
73ecore_file_download_shutdown(void) 65ecore_file_download_shutdown(void)
74{ 66{
75#ifdef BUILD_ECORE_CON
76 download_init--; 67 download_init--;
77 if (download_init > 0) return; 68 if (download_init > 0) return;
78 if (_url_complete_handler) 69 if (_url_complete_handler)
@@ -84,10 +75,8 @@ ecore_file_download_shutdown(void)
84 ecore_file_download_abort_all(); 75 ecore_file_download_abort_all();
85 ecore_con_url_shutdown(); 76 ecore_con_url_shutdown();
86 ecore_con_shutdown(); 77 ecore_con_shutdown();
87#endif /* BUILD_ECORE_CON */
88} 78}
89 79
90#ifdef BUILD_ECORE_CON
91# ifdef HAVE_CURL 80# ifdef HAVE_CURL
92static Eina_Bool 81static Eina_Bool
93_ecore_file_download_headers_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata) 82_ecore_file_download_headers_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data, void *fdata)
@@ -98,7 +87,6 @@ _ecore_file_download_headers_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const
98 return EINA_TRUE; 87 return EINA_TRUE;
99} 88}
100# endif 89# endif
101#endif
102 90
103static Eina_Bool 91static Eina_Bool
104_ecore_file_download(const char *url, 92_ecore_file_download(const char *url,
@@ -109,7 +97,6 @@ _ecore_file_download(const char *url,
109 Ecore_File_Download_Job **job_ret, 97 Ecore_File_Download_Job **job_ret,
110 Eina_Hash *headers) 98 Eina_Hash *headers)
111{ 99{
112#ifdef BUILD_ECORE_CON
113 if (!url) 100 if (!url)
114 { 101 {
115 CRIT("Download URL is null"); 102 CRIT("Download URL is null");
@@ -142,7 +129,7 @@ _ecore_file_download(const char *url,
142 url = strchr(url, '/'); 129 url = strchr(url, '/');
143 return ecore_file_cp(url, dst); 130 return ecore_file_cp(url, dst);
144 } 131 }
145# ifdef HAVE_CURL 132#ifdef HAVE_CURL
146 else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || 133 else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) ||
147 (!strncmp(url, "ftp://", 6))) 134 (!strncmp(url, "ftp://", 6)))
148 { 135 {
@@ -160,7 +147,7 @@ _ecore_file_download(const char *url,
160 } 147 }
161 return job ? EINA_TRUE : EINA_FALSE; 148 return job ? EINA_TRUE : EINA_FALSE;
162 } 149 }
163# else 150#else
164 else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || 151 else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) ||
165 (!strncmp(url, "ftp://", 6))) 152 (!strncmp(url, "ftp://", 6)))
166 { 153 {
@@ -171,21 +158,11 @@ _ecore_file_download(const char *url,
171 (void)headers; 158 (void)headers;
172 return EINA_FALSE; 159 return EINA_FALSE;
173 } 160 }
174# endif 161#endif
175 else 162 else
176 { 163 {
177 return EINA_FALSE; 164 return EINA_FALSE;
178 } 165 }
179#else
180 (void)url;
181 (void)dst;
182 (void)completion_cb;
183 (void)progress_cb;
184 (void)data;
185 (void)job_ret;
186 (void)headers;
187 return EINA_FALSE;
188#endif /* BUILD_ECORE_CON */
189} 166}
190 167
191/** 168/**
@@ -272,21 +249,15 @@ ecore_file_download_full(const char *url,
272EAPI Eina_Bool 249EAPI Eina_Bool
273ecore_file_download_protocol_available(const char *protocol) 250ecore_file_download_protocol_available(const char *protocol)
274{ 251{
275#ifdef BUILD_ECORE_CON
276 if (!strncmp(protocol, "file://", 7)) return EINA_TRUE; 252 if (!strncmp(protocol, "file://", 7)) return EINA_TRUE;
277# ifdef HAVE_CURL 253#ifdef HAVE_CURL
278 else if (!strncmp(protocol, "http://", 7)) return EINA_TRUE; 254 else if (!strncmp(protocol, "http://", 7)) return EINA_TRUE;
279 else if (!strncmp(protocol, "ftp://", 6)) return EINA_TRUE; 255 else if (!strncmp(protocol, "ftp://", 6)) return EINA_TRUE;
280# endif 256#endif
281#else
282 (void)protocol;
283#endif /* BUILD_ECORE_CON */
284 257
285 return EINA_FALSE; 258 return EINA_FALSE;
286} 259}
287 260
288#ifdef BUILD_ECORE_CON
289
290# ifdef HAVE_CURL 261# ifdef HAVE_CURL
291static int 262static int
292_ecore_file_download_url_compare_job(const void *data1, const void *data2) 263_ecore_file_download_url_compare_job(const void *data1, const void *data2)
@@ -397,7 +368,6 @@ _ecore_file_download_curl(const char *url, const char *dst,
397 368
398 return job; 369 return job;
399} 370}
400# endif
401#endif 371#endif
402 372
403/** 373/**
@@ -418,17 +388,15 @@ ecore_file_download_abort(Ecore_File_Download_Job *job)
418 if (!job) 388 if (!job)
419 return; 389 return;
420 390
421#ifdef BUILD_ECORE_CON
422 if (job->completion_cb) 391 if (job->completion_cb)
423 job->completion_cb(ecore_con_url_data_get(job->url_con), job->dst, 1); 392 job->completion_cb(ecore_con_url_data_get(job->url_con), job->dst, 1);
424# ifdef HAVE_CURL 393#ifdef HAVE_CURL
425 ecore_con_url_free(job->url_con); 394 ecore_con_url_free(job->url_con);
426# endif 395#endif
427 _job_list = eina_list_remove(_job_list, job); 396 _job_list = eina_list_remove(_job_list, job);
428 fclose(job->file); 397 fclose(job->file);
429 free(job->dst); 398 free(job->dst);
430 free(job); 399 free(job);
431#endif /* BUILD_ECORE_CON */
432} 400}
433 401
434/** 402/**
@@ -442,12 +410,10 @@ ecore_file_download_abort(Ecore_File_Download_Job *job)
442EAPI void 410EAPI void
443ecore_file_download_abort_all(void) 411ecore_file_download_abort_all(void)
444{ 412{
445#ifdef BUILD_ECORE_CON
446 Ecore_File_Download_Job *job; 413 Ecore_File_Download_Job *job;
447 414
448 EINA_LIST_FREE(_job_list, job) 415 EINA_LIST_FREE(_job_list, job)
449 ecore_file_download_abort(job); 416 ecore_file_download_abort(job);
450#endif /* BUILD_ECORE_CON */
451} 417}
452 418
453/** 419/**
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_error.c b/src/lib/ecore_x/xcb/ecore_xcb_error.c
index fc329265d5..5c79e4c27d 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_error.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_error.c
@@ -83,17 +83,10 @@ _ecore_xcb_error_handle(xcb_generic_error_t *err)
83 WRN("\tEvent: %s", xcb_event_get_request_label(err->major_code)); 83 WRN("\tEvent: %s", xcb_event_get_request_label(err->major_code));
84 WRN("\tError: %s", xcb_event_get_error_label(err->error_code)); 84 WRN("\tError: %s", xcb_event_get_error_label(err->error_code));
85 85
86#ifdef OLD_XCB_VERSION
87 if (err->error_code == XCB_EVENT_ERROR_BAD_VALUE)
88 WRN("\tBad Value: %d", ((xcb_value_error_t *)err)->bad_value);
89 else if (err->error_code == XCB_EVENT_ERROR_BAD_WINDOW)
90 WRN("\tBad Window: %d", ((xcb_window_error_t *)err)->bad_value);
91#else
92 if (err->error_code == XCB_VALUE) 86 if (err->error_code == XCB_VALUE)
93 WRN("\tBad Value: %d", ((xcb_value_error_t *)err)->bad_value); 87 WRN("\tBad Value: %d", ((xcb_value_error_t *)err)->bad_value);
94 else if (err->error_code == XCB_WINDOW) 88 else if (err->error_code == XCB_WINDOW)
95 WRN("\tBad Window: %d", ((xcb_window_error_t *)err)->bad_value); 89 WRN("\tBad Window: %d", ((xcb_window_error_t *)err)->bad_value);
96#endif
97 90
98 _error_request_code = err->sequence; 91 _error_request_code = err->sequence;
99 _error_code = err->error_code; 92 _error_code = err->error_code;
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_events.c b/src/lib/ecore_x/xcb/ecore_xcb_events.c
index 9cc86f62a8..ed9c1e1447 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_events.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_events.c
@@ -294,22 +294,6 @@ _ecore_xcb_events_handle(xcb_generic_event_t *ev)
294 * so trap those cases and ignore. We also ignore BadValue from 294 * so trap those cases and ignore. We also ignore BadValue from
295 * xcb_grab/ungrab_button (happens when we are using any_mod) 295 * xcb_grab/ungrab_button (happens when we are using any_mod)
296 * and a few others */ 296 * and a few others */
297#ifdef OLD_XCB_VERSION
298 if (err->error_code == XCB_EVENT_ERROR_BAD_WINDOW) return;
299 else if (err->error_code == XCB_EVENT_ERROR_BAD_MATCH)
300 {
301 if ((err->major_code == XCB_SET_INPUT_FOCUS) ||
302 (err->major_code == XCB_CONFIGURE_WINDOW))
303 return;
304 }
305 else if (err->error_code == XCB_EVENT_ERROR_BAD_VALUE)
306 {
307 if ((err->major_code == XCB_KILL_CLIENT) ||
308 (err->major_code == XCB_GRAB_BUTTON) ||
309 (err->major_code == XCB_UNGRAB_BUTTON))
310 return;
311 }
312#else
313 if (err->error_code == XCB_WINDOW) return; 297 if (err->error_code == XCB_WINDOW) return;
314 else if (err->error_code == XCB_MATCH) 298 else if (err->error_code == XCB_MATCH)
315 { 299 {
@@ -324,7 +308,6 @@ _ecore_xcb_events_handle(xcb_generic_event_t *ev)
324 (err->major_code == XCB_UNGRAB_BUTTON)) 308 (err->major_code == XCB_UNGRAB_BUTTON))
325 return; 309 return;
326 } 310 }
327#endif
328 WRN("Got Event Error:"); 311 WRN("Got Event Error:");
329 WRN("\tMajor Code: %d", err->major_code); 312 WRN("\tMajor Code: %d", err->major_code);
330 WRN("\tMinor Code: %d", err->minor_code); 313 WRN("\tMinor Code: %d", err->minor_code);
@@ -1679,13 +1662,8 @@ _ecore_xcb_event_handle_client_message(xcb_generic_event_t *event)
1679 e->source = ev->data.data32[3]; 1662 e->source = ev->data.data32[3];
1680 ecore_event_add(ECORE_X_EVENT_WINDOW_STATE_REQUEST, e, NULL, NULL); 1663 ecore_event_add(ECORE_X_EVENT_WINDOW_STATE_REQUEST, e, NULL, NULL);
1681 } 1664 }
1682#ifdef OLD_XCB_VERSION
1683 else if ((ev->type == ECORE_X_ATOM_WM_CHANGE_STATE) &&
1684 (ev->format == 32) && (ev->data.data32[0] == XCB_WM_STATE_ICONIC))
1685#else
1686 else if ((ev->type == ECORE_X_ATOM_WM_CHANGE_STATE) && (ev->format == 32) && 1665 else if ((ev->type == ECORE_X_ATOM_WM_CHANGE_STATE) && (ev->format == 32) &&
1687 (ev->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC)) 1666 (ev->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC))
1688#endif
1689 { 1667 {
1690 Ecore_X_Event_Window_State_Request *e; 1668 Ecore_X_Event_Window_State_Request *e;
1691 1669
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_icccm.c b/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
index 8dea8617d1..5a36b4e5aa 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_icccm.c
@@ -166,11 +166,7 @@ EAPI char *
166ecore_x_icccm_title_get(Ecore_X_Window win) 166ecore_x_icccm_title_get(Ecore_X_Window win)
167{ 167{
168 xcb_get_property_cookie_t cookie; 168 xcb_get_property_cookie_t cookie;
169#ifdef OLD_XCB_VERSION
170 xcb_get_text_property_reply_t prop;
171#else
172 xcb_icccm_get_text_property_reply_t prop; 169 xcb_icccm_get_text_property_reply_t prop;
173#endif
174 uint8_t ret = 0; 170 uint8_t ret = 0;
175 char *title = NULL; 171 char *title = NULL;
176 172
@@ -178,31 +174,18 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
178 CHECK_XCB_CONN; 174 CHECK_XCB_CONN;
179 175
180 if (!win) return NULL; 176 if (!win) return NULL;
181#ifdef OLD_XCB_VERSION
182 cookie = xcb_get_wm_name_unchecked(_ecore_xcb_conn, win);
183 ret = xcb_get_wm_name_reply(_ecore_xcb_conn, cookie, &prop, NULL);
184#else
185 cookie = xcb_icccm_get_wm_name_unchecked(_ecore_xcb_conn, win); 177 cookie = xcb_icccm_get_wm_name_unchecked(_ecore_xcb_conn, win);
186 ret = xcb_icccm_get_wm_name_reply(_ecore_xcb_conn, cookie, &prop, NULL); 178 ret = xcb_icccm_get_wm_name_reply(_ecore_xcb_conn, cookie, &prop, NULL);
187#endif
188 if (ret == 0) return NULL; 179 if (ret == 0) return NULL;
189 if (prop.name_len < 1) 180 if (prop.name_len < 1)
190 { 181 {
191#ifdef OLD_XCB_VERSION
192 xcb_get_text_property_reply_wipe(&prop);
193#else
194 xcb_icccm_get_text_property_reply_wipe(&prop); 182 xcb_icccm_get_text_property_reply_wipe(&prop);
195#endif
196 return NULL; 183 return NULL;
197 } 184 }
198 185
199 if (!(title = malloc((prop.name_len + 1) * sizeof(char *)))) 186 if (!(title = malloc((prop.name_len + 1) * sizeof(char *))))
200 { 187 {
201#ifdef OLD_XCB_VERSION
202 xcb_get_text_property_reply_wipe(&prop);
203#else
204 xcb_icccm_get_text_property_reply_wipe(&prop); 188 xcb_icccm_get_text_property_reply_wipe(&prop);
205#endif
206 return NULL; 189 return NULL;
207 } 190 }
208 memcpy(title, prop.name, sizeof(char *) * prop.name_len); 191 memcpy(title, prop.name, sizeof(char *) * prop.name_len);
@@ -232,11 +215,7 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
232 } 215 }
233 } 216 }
234 217
235#ifdef OLD_XCB_VERSION
236 xcb_get_text_property_reply_wipe(&prop);
237#else
238 xcb_icccm_get_text_property_reply_wipe(&prop); 218 xcb_icccm_get_text_property_reply_wipe(&prop);
239#endif
240 return title; 219 return title;
241} 220}
242 221
@@ -266,23 +245,13 @@ ecore_x_icccm_title_set(Ecore_X_Window win,
266 245
267 if (ret) 246 if (ret)
268 { 247 {
269#ifdef OLD_XCB_VERSION
270 xcb_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
271 strlen(prop.value), prop.value);
272#else
273 xcb_icccm_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 8, 248 xcb_icccm_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 8,
274 strlen(prop.value), prop.value); 249 strlen(prop.value), prop.value);
275#endif
276 if (prop.value) free(prop.value); 250 if (prop.value) free(prop.value);
277 } 251 }
278 else 252 else
279#ifdef OLD_XCB_VERSION
280 xcb_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
281 strlen(title), title);
282#else
283 xcb_icccm_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 8, 253 xcb_icccm_set_wm_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 8,
284 strlen(title), title); 254 strlen(title), title);
285#endif
286 free(list[0]); 255 free(list[0]);
287} 256}
288 257
@@ -300,11 +269,7 @@ ecore_x_icccm_name_class_get(Ecore_X_Window win,
300 char **class) 269 char **class)
301{ 270{
302 xcb_get_property_cookie_t cookie; 271 xcb_get_property_cookie_t cookie;
303#ifdef OLD_XCB_VERSION
304 xcb_get_wm_class_reply_t prop;
305#else
306 xcb_icccm_get_wm_class_reply_t prop; 272 xcb_icccm_get_wm_class_reply_t prop;
307#endif
308 uint8_t ret = 0; 273 uint8_t ret = 0;
309 274
310 LOGFN(__FILE__, __LINE__, __FUNCTION__); 275 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -313,23 +278,14 @@ ecore_x_icccm_name_class_get(Ecore_X_Window win,
313 if (name) *name = NULL; 278 if (name) *name = NULL;
314 if (class) *class = NULL; 279 if (class) *class = NULL;
315 280
316#ifdef OLD_XCB_VERSION
317 cookie = xcb_get_wm_class_unchecked(_ecore_xcb_conn, win);
318 ret = xcb_get_wm_class_reply(_ecore_xcb_conn, cookie, &prop, NULL);
319#else
320 cookie = xcb_icccm_get_wm_class_unchecked(_ecore_xcb_conn, win); 281 cookie = xcb_icccm_get_wm_class_unchecked(_ecore_xcb_conn, win);
321 ret = xcb_icccm_get_wm_class_reply(_ecore_xcb_conn, cookie, &prop, NULL); 282 ret = xcb_icccm_get_wm_class_reply(_ecore_xcb_conn, cookie, &prop, NULL);
322#endif
323 if (ret == 0) return; 283 if (ret == 0) return;
324 284
325 if (name) *name = strdup(prop.instance_name); 285 if (name) *name = strdup(prop.instance_name);
326 if (class) *class = strdup(prop.class_name); 286 if (class) *class = strdup(prop.class_name);
327 287
328#ifdef OLD_XCB_VERSION
329 xcb_get_wm_class_reply_wipe(&prop);
330#else
331 xcb_icccm_get_wm_class_reply_wipe(&prop); 288 xcb_icccm_get_wm_class_reply_wipe(&prop);
332#endif
333} 289}
334 290
335/** 291/**
@@ -420,13 +376,8 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
420 LOGFN(__FILE__, __LINE__, __FUNCTION__); 376 LOGFN(__FILE__, __LINE__, __FUNCTION__);
421 CHECK_XCB_CONN; 377 CHECK_XCB_CONN;
422 378
423#ifdef OLD_XCB_VERSION
424 cookie = xcb_get_wm_transient_for_unchecked(_ecore_xcb_conn, win);
425 xcb_get_wm_transient_for_reply(_ecore_xcb_conn, cookie, &forwin, NULL);
426#else
427 cookie = xcb_icccm_get_wm_transient_for_unchecked(_ecore_xcb_conn, win); 379 cookie = xcb_icccm_get_wm_transient_for_unchecked(_ecore_xcb_conn, win);
428 xcb_icccm_get_wm_transient_for_reply(_ecore_xcb_conn, cookie, &forwin, NULL); 380 xcb_icccm_get_wm_transient_for_reply(_ecore_xcb_conn, cookie, &forwin, NULL);
429#endif
430 381
431 return forwin; 382 return forwin;
432} 383}
@@ -519,25 +470,6 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
519 } 470 }
520 471
521 prop = (uint8_t *)xcb_get_property_value(reply); 472 prop = (uint8_t *)xcb_get_property_value(reply);
522#ifdef OLD_XCB_VERSION
523 switch (prop[0])
524 {
525 case XCB_WM_STATE_WITHDRAWN:
526 hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
527 break;
528
529 case XCB_WM_STATE_NORMAL:
530 hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
531 break;
532
533 case XCB_WM_STATE_ICONIC:
534 hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
535 break;
536
537 default:
538 break;
539 }
540#else
541 switch (prop[0]) 473 switch (prop[0])
542 { 474 {
543 case XCB_ICCCM_WM_STATE_WITHDRAWN: 475 case XCB_ICCCM_WM_STATE_WITHDRAWN:
@@ -555,7 +487,6 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
555 default: 487 default:
556 break; 488 break;
557 } 489 }
558#endif
559 490
560 free(reply); 491 free(reply);
561 return hint; 492 return hint;
@@ -565,29 +496,11 @@ EAPI void
565ecore_x_icccm_state_set(Ecore_X_Window win, 496ecore_x_icccm_state_set(Ecore_X_Window win,
566 Ecore_X_Window_State_Hint state) 497 Ecore_X_Window_State_Hint state)
567{ 498{
568#ifdef OLD_XCB_VERSION
569 xcb_wm_hints_t hints;
570#else
571 xcb_icccm_wm_hints_t hints; 499 xcb_icccm_wm_hints_t hints;
572#endif
573 500
574 LOGFN(__FILE__, __LINE__, __FUNCTION__); 501 LOGFN(__FILE__, __LINE__, __FUNCTION__);
575 CHECK_XCB_CONN; 502 CHECK_XCB_CONN;
576 503
577#ifdef OLD_XCB_VERSION
578 xcb_wm_hints_set_none(&hints);
579
580 hints.flags = XCB_WM_HINT_STATE;
581
582 if (state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
583 xcb_wm_hints_set_withdrawn(&hints);
584 else if (state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
585 xcb_wm_hints_set_normal(&hints);
586 else if (state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
587 xcb_wm_hints_set_iconic(&hints);
588
589 xcb_set_wm_hints(_ecore_xcb_conn, win, &hints);
590#else
591 xcb_icccm_wm_hints_set_none(&hints); 504 xcb_icccm_wm_hints_set_none(&hints);
592 505
593 hints.flags = XCB_ICCCM_WM_HINT_STATE; 506 hints.flags = XCB_ICCCM_WM_HINT_STATE;
@@ -600,7 +513,6 @@ ecore_x_icccm_state_set(Ecore_X_Window win,
600 xcb_icccm_wm_hints_set_iconic(&hints); 513 xcb_icccm_wm_hints_set_iconic(&hints);
601 514
602 xcb_icccm_set_wm_hints(_ecore_xcb_conn, win, &hints); 515 xcb_icccm_set_wm_hints(_ecore_xcb_conn, win, &hints);
603#endif
604} 516}
605 517
606EAPI void 518EAPI void
@@ -623,34 +535,11 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
623 Ecore_X_Window window_group, 535 Ecore_X_Window window_group,
624 Eina_Bool is_urgent) 536 Eina_Bool is_urgent)
625{ 537{
626#ifdef OLD_XCB_VERSION
627 xcb_wm_hints_t hints;
628#else
629 xcb_icccm_wm_hints_t hints; 538 xcb_icccm_wm_hints_t hints;
630#endif
631 539
632 LOGFN(__FILE__, __LINE__, __FUNCTION__); 540 LOGFN(__FILE__, __LINE__, __FUNCTION__);
633 CHECK_XCB_CONN; 541 CHECK_XCB_CONN;
634 542
635#ifdef OLD_XCB_VERSION
636 xcb_wm_hints_set_none(&hints);
637 xcb_wm_hints_set_input(&hints, accepts_focus);
638
639 if (initial_state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
640 xcb_wm_hints_set_withdrawn(&hints);
641 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
642 xcb_wm_hints_set_normal(&hints);
643 else if (initial_state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
644 xcb_wm_hints_set_iconic(&hints);
645
646 if (icon_pixmap != 0) xcb_wm_hints_set_icon_pixmap(&hints, icon_pixmap);
647 if (icon_mask != 0) xcb_wm_hints_set_icon_mask(&hints, icon_mask);
648 if (icon_window != 0) xcb_wm_hints_set_icon_window(&hints, icon_window);
649 if (window_group != 0) xcb_wm_hints_set_window_group(&hints, window_group);
650 if (is_urgent) xcb_wm_hints_set_urgency(&hints);
651
652 xcb_set_wm_hints(_ecore_xcb_conn, win, &hints);
653#else
654 xcb_icccm_wm_hints_set_none(&hints); 543 xcb_icccm_wm_hints_set_none(&hints);
655 xcb_icccm_wm_hints_set_input(&hints, accepts_focus); 544 xcb_icccm_wm_hints_set_input(&hints, accepts_focus);
656 545
@@ -673,7 +562,6 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
673 xcb_icccm_wm_hints_set_urgency(&hints); 562 xcb_icccm_wm_hints_set_urgency(&hints);
674 563
675 xcb_icccm_set_wm_hints(_ecore_xcb_conn, win, &hints); 564 xcb_icccm_set_wm_hints(_ecore_xcb_conn, win, &hints);
676#endif
677} 565}
678 566
679EAPI Eina_Bool 567EAPI Eina_Bool
@@ -687,11 +575,7 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
687 Eina_Bool *is_urgent) 575 Eina_Bool *is_urgent)
688{ 576{
689 xcb_get_property_cookie_t cookie; 577 xcb_get_property_cookie_t cookie;
690#ifdef OLD_XCB_VERSION
691 xcb_wm_hints_t hints;
692#else
693 xcb_icccm_wm_hints_t hints; 578 xcb_icccm_wm_hints_t hints;
694#endif
695 uint8_t ret = 0; 579 uint8_t ret = 0;
696 580
697 LOGFN(__FILE__, __LINE__, __FUNCTION__); 581 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -705,22 +589,12 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
705 if (window_group) *window_group = 0; 589 if (window_group) *window_group = 0;
706 if (is_urgent) *is_urgent = EINA_FALSE; 590 if (is_urgent) *is_urgent = EINA_FALSE;
707 591
708#ifdef OLD_XCB_VERSION
709 xcb_wm_hints_set_none(&hints);
710 cookie = xcb_get_wm_hints_unchecked(_ecore_xcb_conn, win);
711 ret = xcb_get_wm_hints_reply(_ecore_xcb_conn, cookie, &hints, NULL);
712#else
713 xcb_icccm_wm_hints_set_none(&hints); 592 xcb_icccm_wm_hints_set_none(&hints);
714 cookie = xcb_icccm_get_wm_hints_unchecked(_ecore_xcb_conn, win); 593 cookie = xcb_icccm_get_wm_hints_unchecked(_ecore_xcb_conn, win);
715 ret = xcb_icccm_get_wm_hints_reply(_ecore_xcb_conn, cookie, &hints, NULL); 594 ret = xcb_icccm_get_wm_hints_reply(_ecore_xcb_conn, cookie, &hints, NULL);
716#endif
717 if (!ret) return EINA_FALSE; 595 if (!ret) return EINA_FALSE;
718 596
719#ifdef OLD_XCB_VERSION
720 if ((hints.flags & XCB_WM_HINT_INPUT) && (accepts_focus))
721#else
722 if ((hints.flags & XCB_ICCCM_WM_HINT_INPUT) && (accepts_focus)) 597 if ((hints.flags & XCB_ICCCM_WM_HINT_INPUT) && (accepts_focus))
723#endif
724 { 598 {
725 if (hints.input) 599 if (hints.input)
726 *accepts_focus = EINA_TRUE; 600 *accepts_focus = EINA_TRUE;
@@ -728,32 +602,6 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
728 *accepts_focus = EINA_FALSE; 602 *accepts_focus = EINA_FALSE;
729 } 603 }
730 604
731#ifdef OLD_XCB_VERSION
732 if ((hints.flags & XCB_WM_HINT_STATE) && (initial_state))
733 {
734 if (hints.initial_state == XCB_WM_STATE_WITHDRAWN)
735 *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
736 else if (hints.initial_state == XCB_WM_STATE_NORMAL)
737 *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
738 else if (hints.initial_state == XCB_WM_STATE_ICONIC)
739 *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
740 }
741
742 if ((hints.flags & XCB_WM_HINT_ICON_PIXMAP) && (icon_pixmap))
743 *icon_pixmap = hints.icon_pixmap;
744
745 if ((hints.flags & XCB_WM_HINT_ICON_MASK) && (icon_mask))
746 *icon_mask = hints.icon_mask;
747
748 if ((hints.flags & XCB_WM_HINT_ICON_WINDOW) && (icon_window))
749 *icon_window = hints.icon_window;
750
751 if ((hints.flags & XCB_WM_HINT_WINDOW_GROUP) && (window_group))
752 *window_group = hints.window_group;
753
754 if ((hints.flags & XCB_WM_HINT_X_URGENCY) && (is_urgent))
755 *is_urgent = EINA_TRUE;
756#else
757 if ((hints.flags & XCB_ICCCM_WM_HINT_STATE) && (initial_state)) 605 if ((hints.flags & XCB_ICCCM_WM_HINT_STATE) && (initial_state))
758 { 606 {
759 if (hints.initial_state == XCB_ICCCM_WM_STATE_WITHDRAWN) 607 if (hints.initial_state == XCB_ICCCM_WM_STATE_WITHDRAWN)
@@ -778,7 +626,6 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
778 626
779 if ((hints.flags & XCB_ICCCM_WM_HINT_X_URGENCY) && (is_urgent)) 627 if ((hints.flags & XCB_ICCCM_WM_HINT_X_URGENCY) && (is_urgent))
780 *is_urgent = EINA_TRUE; 628 *is_urgent = EINA_TRUE;
781#endif
782 629
783 return EINA_TRUE; 630 return EINA_TRUE;
784} 631}
@@ -794,11 +641,7 @@ EAPI char *
794ecore_x_icccm_icon_name_get(Ecore_X_Window win) 641ecore_x_icccm_icon_name_get(Ecore_X_Window win)
795{ 642{
796 xcb_get_property_cookie_t cookie; 643 xcb_get_property_cookie_t cookie;
797#ifdef OLD_XCB_VERSION
798 xcb_get_text_property_reply_t prop;
799#else
800 xcb_icccm_get_text_property_reply_t prop; 644 xcb_icccm_get_text_property_reply_t prop;
801#endif
802 uint8_t ret = 0; 645 uint8_t ret = 0;
803 char *tmp = NULL; 646 char *tmp = NULL;
804 647
@@ -807,32 +650,19 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
807 650
808 if (!win) return NULL; 651 if (!win) return NULL;
809 652
810#ifdef OLD_XCB_VERSION
811 cookie = xcb_get_wm_icon_name_unchecked(_ecore_xcb_conn, win);
812 ret = xcb_get_wm_icon_name_reply(_ecore_xcb_conn, cookie, &prop, NULL);
813#else
814 cookie = xcb_icccm_get_wm_icon_name_unchecked(_ecore_xcb_conn, win); 653 cookie = xcb_icccm_get_wm_icon_name_unchecked(_ecore_xcb_conn, win);
815 ret = xcb_icccm_get_wm_icon_name_reply(_ecore_xcb_conn, cookie, &prop, NULL); 654 ret = xcb_icccm_get_wm_icon_name_reply(_ecore_xcb_conn, cookie, &prop, NULL);
816#endif
817 if (ret == 0) return NULL; 655 if (ret == 0) return NULL;
818 656
819 if (prop.name_len < 1) 657 if (prop.name_len < 1)
820 { 658 {
821#ifdef OLD_XCB_VERSION
822 xcb_get_text_property_reply_wipe(&prop);
823#else
824 xcb_icccm_get_text_property_reply_wipe(&prop); 659 xcb_icccm_get_text_property_reply_wipe(&prop);
825#endif
826 return NULL; 660 return NULL;
827 } 661 }
828 662
829 if (!(tmp = malloc((prop.name_len + 1) * sizeof(char *)))) 663 if (!(tmp = malloc((prop.name_len + 1) * sizeof(char *))))
830 { 664 {
831#ifdef OLD_XCB_VERSION
832 xcb_get_text_property_reply_wipe(&prop);
833#else
834 xcb_icccm_get_text_property_reply_wipe(&prop); 665 xcb_icccm_get_text_property_reply_wipe(&prop);
835#endif
836 return NULL; 666 return NULL;
837 } 667 }
838 memcpy(tmp, prop.name, sizeof(char *) * prop.name_len); 668 memcpy(tmp, prop.name, sizeof(char *) * prop.name_len);
@@ -862,11 +692,7 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
862 } 692 }
863 } 693 }
864 694
865#ifdef OLD_XCB_VERSION
866 xcb_get_text_property_reply_wipe(&prop);
867#else
868 xcb_icccm_get_text_property_reply_wipe(&prop); 695 xcb_icccm_get_text_property_reply_wipe(&prop);
869#endif
870 return tmp; 696 return tmp;
871} 697}
872 698
@@ -903,23 +729,13 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win,
903 729
904 if (ret) 730 if (ret)
905 { 731 {
906#ifdef OLD_XCB_VERSION
907 xcb_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
908 strlen(prop.value), prop.value);
909#else
910 xcb_icccm_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 732 xcb_icccm_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
911 8, strlen(prop.value), prop.value); 733 8, strlen(prop.value), prop.value);
912#endif
913 if (prop.value) free(prop.value); 734 if (prop.value) free(prop.value);
914 } 735 }
915 else 736 else
916#ifdef OLD_XCB_VERSION
917 xcb_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
918 strlen(name), name);
919#else
920 xcb_icccm_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING, 737 xcb_icccm_set_wm_icon_name(_ecore_xcb_conn, win, ECORE_X_ATOM_STRING,
921 8, strlen(name), name); 738 8, strlen(name), name);
922#endif
923 739
924 free(list[0]); 740 free(list[0]);
925} 741}
@@ -942,11 +758,7 @@ ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
942 ev.format = 32; 758 ev.format = 32;
943 ev.window = win; 759 ev.window = win;
944 ev.type = ECORE_X_ATOM_WM_CHANGE_STATE; 760 ev.type = ECORE_X_ATOM_WM_CHANGE_STATE;
945#ifdef OLD_XCB_VERSION
946 ev.data.data32[0] = XCB_WM_STATE_ICONIC;
947#else
948 ev.data.data32[0] = XCB_ICCCM_WM_STATE_ICONIC; 761 ev.data.data32[0] = XCB_ICCCM_WM_STATE_ICONIC;
949#endif
950 762
951 xcb_send_event(_ecore_xcb_conn, 0, root, 763 xcb_send_event(_ecore_xcb_conn, 0, root,
952 (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | 764 (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY |
@@ -968,11 +780,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
968{ 780{
969 Ecore_X_Atom proto; 781 Ecore_X_Atom proto;
970 xcb_get_property_cookie_t cookie; 782 xcb_get_property_cookie_t cookie;
971#ifdef OLD_XCB_VERSION
972 xcb_get_wm_protocols_reply_t protos;
973#else
974 xcb_icccm_get_wm_protocols_reply_t protos; 783 xcb_icccm_get_wm_protocols_reply_t protos;
975#endif
976 int i = 0, count = 0, set = 0; 784 int i = 0, count = 0, set = 0;
977 785
978 LOGFN(__FILE__, __LINE__, __FUNCTION__); 786 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -980,13 +788,8 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
980 788
981 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return; 789 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return;
982 proto = _ecore_xcb_atoms_wm_protocol[protocol]; 790 proto = _ecore_xcb_atoms_wm_protocol[protocol];
983#ifdef OLD_XCB_VERSION
984 cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto);
985 if (!xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL))
986#else
987 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto); 791 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto);
988 if (!xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL)) 792 if (!xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL))
989#endif
990 count = 0; 793 count = 0;
991 else 794 else
992 count = protos.atoms_len; 795 count = protos.atoms_len;
@@ -1012,15 +815,9 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
1012 for (i = 0; i < count; i++) 815 for (i = 0; i < count; i++)
1013 atoms[i] = protos.atoms[i]; 816 atoms[i] = protos.atoms[i];
1014 atoms[count] = proto; 817 atoms[count] = proto;
1015#ifdef OLD_XCB_VERSION
1016 xcb_set_wm_protocols(_ecore_xcb_conn,
1017 ECORE_X_ATOM_WM_PROTOCOLS,
1018 win, count, atoms);
1019#else
1020 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win, 818 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win,
1021 ECORE_X_ATOM_WM_PROTOCOLS, 819 ECORE_X_ATOM_WM_PROTOCOLS,
1022 count, atoms); 820 count, atoms);
1023#endif
1024 free(atoms); 821 free(atoms);
1025 } 822 }
1026 } 823 }
@@ -1038,15 +835,9 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
1038 for (j = (i + 1); j < count; j++) 835 for (j = (i + 1); j < count; j++)
1039 protos.atoms[j - 1] = protos.atoms[j]; 836 protos.atoms[j - 1] = protos.atoms[j];
1040 if (count > 1) 837 if (count > 1)
1041#ifdef OLD_XCB_VERSION
1042 xcb_set_wm_protocols(_ecore_xcb_conn,
1043 ECORE_X_ATOM_WM_PROTOCOLS,
1044 win, count - 1, protos.atoms);
1045#else
1046 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win, 838 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win,
1047 ECORE_X_ATOM_WM_PROTOCOLS, 839 ECORE_X_ATOM_WM_PROTOCOLS,
1048 count - 1, protos.atoms); 840 count - 1, protos.atoms);
1049#endif
1050 else 841 else
1051 ecore_x_window_prop_property_del(win, 842 ecore_x_window_prop_property_del(win,
1052 ECORE_X_ATOM_WM_PROTOCOLS); 843 ECORE_X_ATOM_WM_PROTOCOLS);
@@ -1056,11 +847,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
1056 } 847 }
1057 } 848 }
1058 849
1059#ifdef OLD_XCB_VERSION
1060 xcb_get_wm_protocols_reply_wipe(&protos);
1061#else
1062 xcb_icccm_get_wm_protocols_reply_wipe(&protos); 850 xcb_icccm_get_wm_protocols_reply_wipe(&protos);
1063#endif
1064} 851}
1065 852
1066/** 853/**
@@ -1076,11 +863,7 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
1076 Ecore_X_Atom proto; 863 Ecore_X_Atom proto;
1077 Eina_Bool ret = EINA_FALSE; 864 Eina_Bool ret = EINA_FALSE;
1078 xcb_get_property_cookie_t cookie; 865 xcb_get_property_cookie_t cookie;
1079#ifdef OLD_XCB_VERSION
1080 xcb_get_wm_protocols_reply_t reply;
1081#else
1082 xcb_icccm_get_wm_protocols_reply_t reply; 866 xcb_icccm_get_wm_protocols_reply_t reply;
1083#endif
1084 uint8_t val = 0; 867 uint8_t val = 0;
1085 unsigned int i = 0; 868 unsigned int i = 0;
1086 869
@@ -1090,13 +873,8 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
1090 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE; 873 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE;
1091 874
1092 proto = _ecore_xcb_atoms_wm_protocol[protocol]; 875 proto = _ecore_xcb_atoms_wm_protocol[protocol];
1093#ifdef OLD_XCB_VERSION
1094 cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto);
1095 val = xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &reply, NULL);
1096#else
1097 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto); 876 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, proto);
1098 val = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &reply, NULL); 877 val = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &reply, NULL);
1099#endif
1100 if (!val) return EINA_FALSE; 878 if (!val) return EINA_FALSE;
1101 879
1102 for (i = 0; i < reply.atoms_len; i++) 880 for (i = 0; i < reply.atoms_len; i++)
@@ -1106,11 +884,7 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
1106 break; 884 break;
1107 } 885 }
1108 886
1109#ifdef OLD_XCB_VERSION
1110 xcb_get_wm_protocols_reply_wipe(&reply);
1111#else
1112 xcb_icccm_get_wm_protocols_reply_wipe(&reply); 887 xcb_icccm_get_wm_protocols_reply_wipe(&reply);
1113#endif
1114 888
1115 return ret; 889 return ret;
1116} 890}
@@ -1130,13 +904,8 @@ ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
1130 CHECK_XCB_CONN; 904 CHECK_XCB_CONN;
1131 905
1132 if (num > 0) 906 if (num > 0)
1133#ifdef OLD_XCB_VERSION 907 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win,
1134 xcb_set_wm_protocols(_ecore_xcb_conn, ECORE_X_ATOM_WM_PROTOCOLS,
1135 win, num, protos);
1136#else
1137 xcb_icccm_set_wm_protocols(_ecore_xcb_conn, win,
1138 ECORE_X_ATOM_WM_PROTOCOLS, num, protos); 908 ECORE_X_ATOM_WM_PROTOCOLS, num, protos);
1139#endif
1140 else 909 else
1141 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_WM_PROTOCOLS); 910 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_WM_PROTOCOLS);
1142} 911}
@@ -1181,51 +950,29 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
1181 if (min_aspect) *min_aspect = mina; 950 if (min_aspect) *min_aspect = mina;
1182 if (max_aspect) *max_aspect = maxa; 951 if (max_aspect) *max_aspect = maxa;
1183 952
1184#ifdef OLD_XCB_VERSION
1185 cookie = xcb_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win);
1186 ret = xcb_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie, &hints, NULL);
1187#else
1188 cookie = xcb_icccm_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win); 953 cookie = xcb_icccm_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win);
1189 ret = xcb_icccm_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie, 954 ret = xcb_icccm_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie,
1190 &hints, NULL); 955 &hints, NULL);
1191#endif
1192 if (!ret) return EINA_FALSE; 956 if (!ret) return EINA_FALSE;
1193 957
1194#ifdef OLD_XCB_VERSION
1195 if ((hints.flags & XCB_SIZE_HINT_US_POSITION) ||
1196 (hints.flags & XCB_SIZE_HINT_P_POSITION))
1197#else
1198 if ((hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION) || 958 if ((hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION) ||
1199 (hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION)) 959 (hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION))
1200#endif
1201 { 960 {
1202 if (request_pos) *request_pos = EINA_TRUE; 961 if (request_pos) *request_pos = EINA_TRUE;
1203 } 962 }
1204 963
1205#ifdef OLD_XCB_VERSION
1206 if (hints.flags & XCB_SIZE_HINT_P_WIN_GRAVITY)
1207#else
1208 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY) 964 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY)
1209#endif
1210 { 965 {
1211 if (gravity) *gravity = hints.win_gravity; 966 if (gravity) *gravity = hints.win_gravity;
1212 } 967 }
1213 968
1214#ifdef OLD_XCB_VERSION
1215 if (hints.flags & XCB_SIZE_HINT_P_MIN_SIZE)
1216#else
1217 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) 969 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE)
1218#endif
1219 { 970 {
1220 minw = hints.min_width; 971 minw = hints.min_width;
1221 minh = hints.min_height; 972 minh = hints.min_height;
1222 } 973 }
1223 974
1224#ifdef OLD_XCB_VERSION
1225 if (hints.flags & XCB_SIZE_HINT_P_MAX_SIZE)
1226#else
1227 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) 975 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE)
1228#endif
1229 { 976 {
1230 maxw = hints.max_width; 977 maxw = hints.max_width;
1231 maxh = hints.max_height; 978 maxh = hints.max_height;
@@ -1233,11 +980,7 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
1233 if (maxh < minh) maxh = minh; 980 if (maxh < minh) maxh = minh;
1234 } 981 }
1235 982
1236#ifdef OLD_XCB_VERSION
1237 if (hints.flags & XCB_SIZE_HINT_BASE_SIZE)
1238#else
1239 if (hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) 983 if (hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE)
1240#endif
1241 { 984 {
1242 basew = hints.base_width; 985 basew = hints.base_width;
1243 baseh = hints.base_height; 986 baseh = hints.base_height;
@@ -1245,11 +988,7 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
1245 if (baseh > minh) minh = baseh; 988 if (baseh > minh) minh = baseh;
1246 } 989 }
1247 990
1248#ifdef OLD_XCB_VERSION
1249 if (hints.flags & XCB_SIZE_HINT_P_RESIZE_INC)
1250#else
1251 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC) 991 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC)
1252#endif
1253 { 992 {
1254 stepx = hints.width_inc; 993 stepx = hints.width_inc;
1255 stepy = hints.height_inc; 994 stepy = hints.height_inc;
@@ -1257,11 +996,7 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
1257 if (stepy < 1) stepy = 1; 996 if (stepy < 1) stepy = 1;
1258 } 997 }
1259 998
1260#ifdef OLD_XCB_VERSION
1261 if (hints.flags & XCB_SIZE_HINT_P_ASPECT)
1262#else
1263 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT) 999 if (hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT)
1264#endif
1265 { 1000 {
1266 if (hints.min_aspect_den > 0) 1001 if (hints.min_aspect_den > 0)
1267 mina = ((double)hints.min_aspect_num) / ((double)hints.min_aspect_den); 1002 mina = ((double)hints.min_aspect_num) / ((double)hints.min_aspect_den);
@@ -1306,39 +1041,13 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
1306 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1041 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1307 CHECK_XCB_CONN; 1042 CHECK_XCB_CONN;
1308 1043
1309#ifdef OLD_XCB_VERSION
1310 cookie = xcb_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win);
1311 ret = xcb_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie, &hints, NULL);
1312#else
1313 cookie = xcb_icccm_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win); 1044 cookie = xcb_icccm_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win);
1314 ret = xcb_icccm_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie, 1045 ret = xcb_icccm_get_wm_normal_hints_reply(_ecore_xcb_conn, cookie,
1315 &hints, NULL); 1046 &hints, NULL);
1316#endif
1317 if (!ret) memset(&hints, 0, sizeof(xcb_size_hints_t)); 1047 if (!ret) memset(&hints, 0, sizeof(xcb_size_hints_t));
1318 1048
1319 hints.flags = 0; 1049 hints.flags = 0;
1320 1050
1321#ifdef OLD_XCB_VERSION
1322 if (request_pos)
1323 hints.flags |= XCB_SIZE_HINT_US_POSITION;
1324
1325 if (gravity != ECORE_X_GRAVITY_NW)
1326 xcb_size_hints_set_win_gravity(&hints, gravity);
1327 if ((min_w > 0) || (min_h > 0))
1328 xcb_size_hints_set_min_size(&hints, min_w, min_h);
1329 if ((max_w > 0) || (max_h > 0))
1330 xcb_size_hints_set_max_size(&hints, max_w, max_h);
1331 if ((base_w > 0) || (base_h > 0))
1332 xcb_size_hints_set_base_size(&hints, base_w, base_h);
1333 if ((step_x > 1) || (step_y > 1))
1334 xcb_size_hints_set_resize_inc(&hints, step_x, step_y);
1335 if ((min_aspect > 0.0) || (max_aspect > 0.0))
1336 xcb_size_hints_set_aspect(&hints,
1337 (int32_t)(min_aspect * 10000), 10000,
1338 (int32_t)(max_aspect * 10000), 10000);
1339
1340 xcb_set_wm_normal_hints(_ecore_xcb_conn, win, &hints);
1341#else
1342 if (request_pos) 1051 if (request_pos)
1343 hints.flags |= XCB_ICCCM_SIZE_HINT_US_POSITION; 1052 hints.flags |= XCB_ICCCM_SIZE_HINT_US_POSITION;
1344 1053
@@ -1358,7 +1067,6 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
1358 (int32_t)(max_aspect * 10000), 10000); 1067 (int32_t)(max_aspect * 10000), 10000);
1359 1068
1360 xcb_icccm_set_wm_normal_hints(_ecore_xcb_conn, win, &hints); 1069 xcb_icccm_set_wm_normal_hints(_ecore_xcb_conn, win, &hints);
1361#endif
1362} 1070}
1363 1071
1364EAPI void 1072EAPI void
@@ -1404,45 +1112,28 @@ EAPI char *
1404ecore_x_icccm_client_machine_get(Ecore_X_Window win) 1112ecore_x_icccm_client_machine_get(Ecore_X_Window win)
1405{ 1113{
1406 xcb_get_property_cookie_t cookie; 1114 xcb_get_property_cookie_t cookie;
1407#ifdef OLD_XCB_VERSION
1408 xcb_get_text_property_reply_t prop;
1409#else
1410 xcb_icccm_get_text_property_reply_t prop; 1115 xcb_icccm_get_text_property_reply_t prop;
1411#endif
1412 uint8_t ret = 0; 1116 uint8_t ret = 0;
1413 char *tmp = NULL; 1117 char *tmp = NULL;
1414 1118
1415 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1119 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1416 CHECK_XCB_CONN; 1120 CHECK_XCB_CONN;
1417 1121
1418#ifdef OLD_XCB_VERSION
1419 cookie = xcb_get_wm_client_machine_unchecked(_ecore_xcb_conn, win);
1420 ret = xcb_get_wm_client_machine_reply(_ecore_xcb_conn, cookie, &prop, NULL);
1421#else
1422 cookie = xcb_icccm_get_wm_client_machine_unchecked(_ecore_xcb_conn, win); 1122 cookie = xcb_icccm_get_wm_client_machine_unchecked(_ecore_xcb_conn, win);
1423 ret = xcb_icccm_get_wm_client_machine_reply(_ecore_xcb_conn, cookie, 1123 ret = xcb_icccm_get_wm_client_machine_reply(_ecore_xcb_conn, cookie,
1424 &prop, NULL); 1124 &prop, NULL);
1425#endif
1426 if (ret == 0) return NULL; 1125 if (ret == 0) return NULL;
1427 1126
1428 tmp = malloc((prop.name_len + 1) * sizeof(char *)); 1127 tmp = malloc((prop.name_len + 1) * sizeof(char *));
1429 if (!tmp) 1128 if (!tmp)
1430 { 1129 {
1431#ifdef OLD_XCB_VERSION
1432 xcb_get_text_property_reply_wipe(&prop);
1433#else
1434 xcb_icccm_get_text_property_reply_wipe(&prop); 1130 xcb_icccm_get_text_property_reply_wipe(&prop);
1435#endif
1436 return NULL; 1131 return NULL;
1437 } 1132 }
1438 memcpy(tmp, prop.name, sizeof(char *) * prop.name_len); 1133 memcpy(tmp, prop.name, sizeof(char *) * prop.name_len);
1439 tmp[prop.name_len] = '\0'; 1134 tmp[prop.name_len] = '\0';
1440 1135
1441#ifdef OLD_XCB_VERSION
1442 xcb_get_text_property_reply_wipe(&prop);
1443#else
1444 xcb_icccm_get_text_property_reply_wipe(&prop); 1136 xcb_icccm_get_text_property_reply_wipe(&prop);
1445#endif
1446 1137
1447 return tmp; 1138 return tmp;
1448} 1139}
@@ -1566,4 +1257,3 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win,
1566 } 1257 }
1567 if (odata) free(odata); 1258 if (odata) free(odata);
1568} 1259}
1569
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c b/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
index e00fdc1963..85db1ebcb2 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
@@ -560,11 +560,7 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
560{ 560{
561 Eina_Bool ret = EINA_FALSE; 561 Eina_Bool ret = EINA_FALSE;
562 Ecore_X_Atom proto; 562 Ecore_X_Atom proto;
563#ifdef OLD_XCB_VERSION
564 xcb_get_wm_protocols_reply_t protos;
565#else
566 xcb_icccm_get_wm_protocols_reply_t protos; 563 xcb_icccm_get_wm_protocols_reply_t protos;
567#endif
568 xcb_get_property_cookie_t cookie; 564 xcb_get_property_cookie_t cookie;
569 uint8_t reply; 565 uint8_t reply;
570 uint32_t count = 0, i = 0; 566 uint32_t count = 0, i = 0;
@@ -575,16 +571,10 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
575 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE; 571 if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE;
576 572
577 proto = _ecore_xcb_atoms_wm_protocol[protocol]; 573 proto = _ecore_xcb_atoms_wm_protocol[protocol];
578#ifdef OLD_XCB_VERSION
579 cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
580 ECORE_X_ATOM_WM_PROTOCOLS);
581 reply = xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL);
582#else
583 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, 574 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
584 ECORE_X_ATOM_WM_PROTOCOLS); 575 ECORE_X_ATOM_WM_PROTOCOLS);
585 reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, 576 reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
586 &protos, NULL); 577 &protos, NULL);
587#endif
588 if (!reply) return EINA_FALSE; 578 if (!reply) return EINA_FALSE;
589 579
590 count = protos.atoms_len; 580 count = protos.atoms_len;
@@ -597,11 +587,8 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
597 } 587 }
598 } 588 }
599 589
600#ifdef OLD_XCB_VERSION
601 xcb_get_wm_protocols_reply_wipe(&protos);
602#else
603 xcb_icccm_get_wm_protocols_reply_wipe(&protos); 590 xcb_icccm_get_wm_protocols_reply_wipe(&protos);
604#endif 591
605 return ret; 592 return ret;
606} 593}
607 594
@@ -609,11 +596,7 @@ EAPI Ecore_X_WM_Protocol *
609ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, 596ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
610 int *num_ret) 597 int *num_ret)
611{ 598{
612#ifdef OLD_XCB_VERSION
613 xcb_get_wm_protocols_reply_t protos;
614#else
615 xcb_icccm_get_wm_protocols_reply_t protos; 599 xcb_icccm_get_wm_protocols_reply_t protos;
616#endif
617 xcb_get_property_cookie_t cookie; 600 xcb_get_property_cookie_t cookie;
618 uint8_t reply; 601 uint8_t reply;
619 uint32_t count = 0, i = 0; 602 uint32_t count = 0, i = 0;
@@ -626,37 +609,23 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
626 609
627 *num_ret = 0; 610 *num_ret = 0;
628 611
629#ifdef OLD_XCB_VERSION
630 cookie = xcb_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
631 ECORE_X_ATOM_WM_PROTOCOLS);
632 reply = xcb_get_wm_protocols_reply(_ecore_xcb_conn, cookie, &protos, NULL);
633#else
634 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win, 612 cookie = xcb_icccm_get_wm_protocols_unchecked(_ecore_xcb_conn, win,
635 ECORE_X_ATOM_WM_PROTOCOLS); 613 ECORE_X_ATOM_WM_PROTOCOLS);
636 reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie, 614 reply = xcb_icccm_get_wm_protocols_reply(_ecore_xcb_conn, cookie,
637 &protos, NULL); 615 &protos, NULL);
638#endif
639 if (!reply) return NULL; 616 if (!reply) return NULL;
640 617
641 count = protos.atoms_len; 618 count = protos.atoms_len;
642 if (count <= 0) 619 if (count <= 0)
643 { 620 {
644#ifdef OLD_XCB_VERSION
645 xcb_get_wm_protocols_reply_wipe(&protos);
646#else
647 xcb_icccm_get_wm_protocols_reply_wipe(&protos); 621 xcb_icccm_get_wm_protocols_reply_wipe(&protos);
648#endif
649 return NULL; 622 return NULL;
650 } 623 }
651 624
652 prot_ret = calloc(1, count * sizeof(Ecore_X_WM_Protocol)); 625 prot_ret = calloc(1, count * sizeof(Ecore_X_WM_Protocol));
653 if (!prot_ret) 626 if (!prot_ret)
654 { 627 {
655#ifdef OLD_XCB_VERSION
656 xcb_get_wm_protocols_reply_wipe(&protos);
657#else
658 xcb_icccm_get_wm_protocols_reply_wipe(&protos); 628 xcb_icccm_get_wm_protocols_reply_wipe(&protos);
659#endif
660 return NULL; 629 return NULL;
661 } 630 }
662 631
@@ -674,11 +643,7 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
674 643
675 if (num_ret) *num_ret = count; 644 if (num_ret) *num_ret = count;
676 645
677#ifdef OLD_XCB_VERSION
678 xcb_get_wm_protocols_reply_wipe(&protos);
679#else
680 xcb_icccm_get_wm_protocols_reply_wipe(&protos); 646 xcb_icccm_get_wm_protocols_reply_wipe(&protos);
681#endif
682 return prot_ret; 647 return prot_ret;
683} 648}
684 649