diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c | 1071 |
1 files changed, 1071 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c new file mode 100644 index 0000000..c868f5e --- /dev/null +++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_e.c | |||
@@ -0,0 +1,1071 @@ | |||
1 | #include "ecore_xcb_private.h" | ||
2 | |||
3 | /* local function prototypes */ | ||
4 | static Ecore_X_Atom _ecore_xcb_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state); | ||
5 | static Ecore_X_Virtual_Keyboard_State _ecore_xcb_e_vkbd_state_get(Ecore_X_Atom atom); | ||
6 | static Ecore_X_Atom _ecore_xcb_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state); | ||
7 | static Ecore_X_Illume_Quickpanel_State _ecore_xcb_e_quickpanel_state_get(Ecore_X_Atom atom); | ||
8 | static Ecore_X_Atom _ecore_xcb_e_illume_atom_get(Ecore_X_Illume_Mode mode); | ||
9 | static Ecore_X_Illume_Mode _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom); | ||
10 | |||
11 | EAPI void | ||
12 | ecore_x_e_init(void) | ||
13 | { | ||
14 | } | ||
15 | |||
16 | EAPI void | ||
17 | ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, | ||
18 | Ecore_X_Window win) | ||
19 | { | ||
20 | xcb_client_message_event_t ev; | ||
21 | |||
22 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
23 | CHECK_XCB_CONN; | ||
24 | |||
25 | if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
26 | |||
27 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
28 | |||
29 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
30 | ev.format = 32; | ||
31 | ev.window = win; | ||
32 | ev.type = ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE; | ||
33 | ev.data.data32[0] = win; | ||
34 | ev.data.data32[1] = 0; | ||
35 | ev.data.data32[2] = 0; | ||
36 | ev.data.data32[3] = 0; | ||
37 | ev.data.data32[4] = 0; | ||
38 | |||
39 | xcb_send_event(_ecore_xcb_conn, 0, root, | ||
40 | (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | | ||
41 | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev); | ||
42 | // ecore_x_flush(); | ||
43 | } | ||
44 | |||
45 | EAPI void | ||
46 | ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, | ||
47 | Ecore_X_Window win, | ||
48 | int w, | ||
49 | int h) | ||
50 | { | ||
51 | xcb_client_message_event_t ev; | ||
52 | |||
53 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
54 | CHECK_XCB_CONN; | ||
55 | |||
56 | if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
57 | |||
58 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
59 | |||
60 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
61 | ev.format = 32; | ||
62 | ev.window = win; | ||
63 | ev.type = ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE; | ||
64 | ev.data.data32[0] = win; | ||
65 | ev.data.data32[1] = 1; | ||
66 | ev.data.data32[2] = w; | ||
67 | ev.data.data32[3] = h; | ||
68 | ev.data.data32[4] = 0; | ||
69 | |||
70 | xcb_send_event(_ecore_xcb_conn, 0, root, | ||
71 | (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | | ||
72 | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY), (const char *)&ev); | ||
73 | // ecore_x_flush(); | ||
74 | } | ||
75 | |||
76 | EAPI void | ||
77 | ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, | ||
78 | Ecore_X_Sync_Counter counter) | ||
79 | { | ||
80 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
81 | |||
82 | if (counter) | ||
83 | ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER, | ||
84 | ECORE_X_ATOM_CARDINAL, &counter, 1); | ||
85 | else | ||
86 | ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER); | ||
87 | } | ||
88 | |||
89 | EAPI Ecore_X_Sync_Counter | ||
90 | ecore_x_e_comp_sync_counter_get(Ecore_X_Window win) | ||
91 | { | ||
92 | Ecore_X_Sync_Counter counter = 0; | ||
93 | int ret = 0; | ||
94 | |||
95 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
96 | |||
97 | ret = ecore_x_window_prop_xid_get(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER, | ||
98 | ECORE_X_ATOM_CARDINAL, &counter, 1); | ||
99 | if (ret != 1) return 0; | ||
100 | return counter; | ||
101 | } | ||
102 | |||
103 | EAPI Eina_Bool | ||
104 | ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) | ||
105 | { | ||
106 | Ecore_X_Window win, win2; | ||
107 | int ret = 0; | ||
108 | |||
109 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
110 | |||
111 | if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
112 | ret = | ||
113 | ecore_x_window_prop_xid_get(root, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED, | ||
114 | ECORE_X_ATOM_WINDOW, &win, 1); | ||
115 | if ((ret == 1) && (win)) | ||
116 | { | ||
117 | ret = | ||
118 | ecore_x_window_prop_xid_get(win, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED, | ||
119 | ECORE_X_ATOM_WINDOW, &win2, 1); | ||
120 | if ((ret == 1) && (win2 == win)) | ||
121 | return EINA_TRUE; | ||
122 | } | ||
123 | return EINA_FALSE; | ||
124 | } | ||
125 | |||
126 | EAPI void | ||
127 | ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, | ||
128 | Eina_Bool enabled) | ||
129 | { | ||
130 | Ecore_X_Window win; | ||
131 | |||
132 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
133 | |||
134 | if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
135 | if (enabled) | ||
136 | { | ||
137 | win = ecore_x_window_new(root, 1, 2, 3, 4); | ||
138 | ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED, | ||
139 | ECORE_X_ATOM_WINDOW, &win, 1); | ||
140 | ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED, | ||
141 | ECORE_X_ATOM_WINDOW, &win, 1); | ||
142 | } | ||
143 | else | ||
144 | { | ||
145 | int ret = 0; | ||
146 | |||
147 | ret = ecore_x_window_prop_xid_get(root, | ||
148 | ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED, | ||
149 | ECORE_X_ATOM_WINDOW, &win, 1); | ||
150 | if ((ret == 1) && (win)) | ||
151 | { | ||
152 | ecore_x_window_prop_property_del(root, | ||
153 | ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED); | ||
154 | ecore_x_window_free(win); | ||
155 | } | ||
156 | } | ||
157 | } | ||
158 | |||
159 | EAPI void | ||
160 | ecore_x_e_comp_sync_begin_send(Ecore_X_Window win) | ||
161 | { | ||
162 | xcb_client_message_event_t ev; | ||
163 | |||
164 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
165 | CHECK_XCB_CONN; | ||
166 | |||
167 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
168 | |||
169 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
170 | ev.format = 32; | ||
171 | ev.window = win; | ||
172 | ev.type = ECORE_X_ATOM_E_COMP_SYNC_BEGIN; | ||
173 | ev.data.data32[0] = win; | ||
174 | ev.data.data32[1] = 0; | ||
175 | ev.data.data32[2] = 0; | ||
176 | ev.data.data32[3] = 0; | ||
177 | ev.data.data32[4] = 0; | ||
178 | |||
179 | xcb_send_event(_ecore_xcb_conn, 0, win, | ||
180 | XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); | ||
181 | // ecore_x_flush(); | ||
182 | } | ||
183 | |||
184 | EAPI void | ||
185 | ecore_x_e_comp_sync_end_send(Ecore_X_Window win) | ||
186 | { | ||
187 | xcb_client_message_event_t ev; | ||
188 | |||
189 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
190 | CHECK_XCB_CONN; | ||
191 | |||
192 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
193 | |||
194 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
195 | ev.format = 32; | ||
196 | ev.window = win; | ||
197 | ev.type = ECORE_X_ATOM_E_COMP_SYNC_END; | ||
198 | ev.data.data32[0] = win; | ||
199 | ev.data.data32[1] = 0; | ||
200 | ev.data.data32[2] = 0; | ||
201 | ev.data.data32[3] = 0; | ||
202 | ev.data.data32[4] = 0; | ||
203 | |||
204 | xcb_send_event(_ecore_xcb_conn, 0, win, | ||
205 | XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); | ||
206 | // ecore_x_flush(); | ||
207 | } | ||
208 | |||
209 | EAPI void | ||
210 | ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win) | ||
211 | { | ||
212 | xcb_client_message_event_t ev; | ||
213 | |||
214 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
215 | CHECK_XCB_CONN; | ||
216 | |||
217 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
218 | |||
219 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
220 | ev.format = 32; | ||
221 | ev.window = win; | ||
222 | ev.type = ECORE_X_ATOM_E_COMP_SYNC_CANCEL; | ||
223 | ev.data.data32[0] = win; | ||
224 | ev.data.data32[1] = 0; | ||
225 | ev.data.data32[2] = 0; | ||
226 | ev.data.data32[3] = 0; | ||
227 | ev.data.data32[4] = 0; | ||
228 | |||
229 | xcb_send_event(_ecore_xcb_conn, 0, win, | ||
230 | XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); | ||
231 | // ecore_x_flush(); | ||
232 | } | ||
233 | |||
234 | EAPI void | ||
235 | ecore_x_e_comp_flush_send(Ecore_X_Window win) | ||
236 | { | ||
237 | xcb_client_message_event_t ev; | ||
238 | |||
239 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
240 | CHECK_XCB_CONN; | ||
241 | |||
242 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
243 | |||
244 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
245 | ev.format = 32; | ||
246 | ev.window = win; | ||
247 | ev.type = ECORE_X_ATOM_E_COMP_FLUSH; | ||
248 | ev.data.data32[0] = win; | ||
249 | ev.data.data32[1] = 0; | ||
250 | ev.data.data32[2] = 0; | ||
251 | ev.data.data32[3] = 0; | ||
252 | ev.data.data32[4] = 0; | ||
253 | |||
254 | xcb_send_event(_ecore_xcb_conn, 0, win, | ||
255 | XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); | ||
256 | // ecore_x_flush(); | ||
257 | } | ||
258 | |||
259 | EAPI void | ||
260 | ecore_x_e_comp_dump_send(Ecore_X_Window win) | ||
261 | { | ||
262 | xcb_client_message_event_t ev; | ||
263 | |||
264 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
265 | CHECK_XCB_CONN; | ||
266 | |||
267 | memset(&ev, 0, sizeof(xcb_client_message_event_t)); | ||
268 | |||
269 | ev.response_type = XCB_CLIENT_MESSAGE; | ||
270 | ev.format = 32; | ||
271 | ev.window = win; | ||
272 | ev.type = ECORE_X_ATOM_E_COMP_DUMP; | ||
273 | ev.data.data32[0] = win; | ||
274 | ev.data.data32[1] = 0; | ||
275 | ev.data.data32[2] = 0; | ||
276 | ev.data.data32[3] = 0; | ||
277 | ev.data.data32[4] = 0; | ||
278 | |||
279 | xcb_send_event(_ecore_xcb_conn, 0, win, | ||
280 | XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); | ||
281 | // ecore_x_flush(); | ||
282 | } | ||
283 | |||
284 | EAPI void | ||
285 | ecore_x_e_comp_pixmap_set(Ecore_X_Window win, | ||
286 | Ecore_X_Pixmap pixmap) | ||
287 | { | ||
288 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
289 | |||
290 | if (pixmap) | ||
291 | ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_PIXMAP, | ||
292 | ECORE_X_ATOM_PIXMAP, &pixmap, 1); | ||
293 | else | ||
294 | ecore_x_window_prop_property_del(win, pixmap); | ||
295 | } | ||
296 | |||
297 | EAPI Ecore_X_Pixmap | ||
298 | ecore_x_e_comp_pixmap_get(Ecore_X_Window win) | ||
299 | { | ||
300 | Ecore_X_Pixmap pixmap = 0; | ||
301 | int ret = 0; | ||
302 | |||
303 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
304 | |||
305 | ret = ecore_x_window_prop_xid_get(win, ECORE_X_ATOM_E_COMP_PIXMAP, | ||
306 | ECORE_X_ATOM_PIXMAP, &pixmap, 1); | ||
307 | if (ret != 1) return 0; | ||
308 | return pixmap; | ||
309 | } | ||
310 | |||
311 | EAPI void | ||
312 | ecore_x_e_frame_size_set(Ecore_X_Window win, | ||
313 | int fl, | ||
314 | int fr, | ||
315 | int ft, | ||
316 | int fb) | ||
317 | { | ||
318 | uint32_t frames[4]; | ||
319 | |||
320 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
321 | |||
322 | frames[0] = fl; | ||
323 | frames[1] = fr; | ||
324 | frames[2] = ft; | ||
325 | frames[3] = fb; | ||
326 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_FRAME_SIZE, frames, 4); | ||
327 | } | ||
328 | |||
329 | EAPI Ecore_X_Virtual_Keyboard_State | ||
330 | ecore_x_e_virtual_keyboard_state_get(Ecore_X_Window win) | ||
331 | { | ||
332 | Ecore_X_Atom atom = 0; | ||
333 | |||
334 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
335 | |||
336 | if (!ecore_x_window_prop_atom_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE, | ||
337 | &atom, 1)) | ||
338 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; | ||
339 | |||
340 | return _ecore_xcb_e_vkbd_state_get(atom); | ||
341 | } | ||
342 | |||
343 | EAPI void | ||
344 | ecore_x_e_virtual_keyboard_state_set(Ecore_X_Window win, | ||
345 | Ecore_X_Virtual_Keyboard_State state) | ||
346 | { | ||
347 | Ecore_X_Atom atom = 0; | ||
348 | |||
349 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
350 | |||
351 | atom = _ecore_xcb_e_vkbd_atom_get(state); | ||
352 | ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE, | ||
353 | &atom, 1); | ||
354 | } | ||
355 | |||
356 | EAPI void | ||
357 | ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window win, | ||
358 | Ecore_X_Virtual_Keyboard_State state) | ||
359 | { | ||
360 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
361 | |||
362 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE, | ||
363 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
364 | _ecore_xcb_e_vkbd_atom_get(state), | ||
365 | 0, 0, 0, 0); | ||
366 | } | ||
367 | |||
368 | EAPI void | ||
369 | ecore_x_e_virtual_keyboard_set(Ecore_X_Window win, | ||
370 | unsigned int is_keyboard) | ||
371 | { | ||
372 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
373 | |||
374 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD, | ||
375 | &is_keyboard, 1); | ||
376 | } | ||
377 | |||
378 | EAPI Eina_Bool | ||
379 | ecore_x_e_virtual_keyboard_get(Ecore_X_Window win) | ||
380 | { | ||
381 | unsigned int val = 0; | ||
382 | |||
383 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
384 | |||
385 | if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD, | ||
386 | &val, 1)) | ||
387 | return EINA_FALSE; | ||
388 | |||
389 | return val ? EINA_TRUE : EINA_FALSE; | ||
390 | } | ||
391 | |||
392 | EAPI int | ||
393 | ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win) | ||
394 | { | ||
395 | unsigned int val = 0; | ||
396 | |||
397 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
398 | |||
399 | if (!ecore_x_window_prop_card32_get(win, | ||
400 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR, | ||
401 | &val, 1)) | ||
402 | return 0; | ||
403 | |||
404 | return val; | ||
405 | } | ||
406 | |||
407 | EAPI void | ||
408 | ecore_x_e_illume_quickpanel_priority_major_set(Ecore_X_Window win, | ||
409 | unsigned int priority) | ||
410 | { | ||
411 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
412 | |||
413 | ecore_x_window_prop_card32_set(win, | ||
414 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR, | ||
415 | &priority, 1); | ||
416 | } | ||
417 | |||
418 | EAPI int | ||
419 | ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win) | ||
420 | { | ||
421 | unsigned int val = 0; | ||
422 | |||
423 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
424 | |||
425 | if (!ecore_x_window_prop_card32_get(win, | ||
426 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR, | ||
427 | &val, 1)) | ||
428 | return 0; | ||
429 | |||
430 | return val; | ||
431 | } | ||
432 | |||
433 | EAPI void | ||
434 | ecore_x_e_illume_quickpanel_priority_minor_set(Ecore_X_Window win, | ||
435 | unsigned int priority) | ||
436 | { | ||
437 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
438 | |||
439 | ecore_x_window_prop_card32_set(win, | ||
440 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR, | ||
441 | &priority, 1); | ||
442 | } | ||
443 | |||
444 | EAPI void | ||
445 | ecore_x_e_illume_quickpanel_zone_set(Ecore_X_Window win, | ||
446 | unsigned int zone) | ||
447 | { | ||
448 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
449 | |||
450 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE, | ||
451 | &zone, 1); | ||
452 | } | ||
453 | |||
454 | EAPI int | ||
455 | ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win) | ||
456 | { | ||
457 | unsigned int val = 0; | ||
458 | |||
459 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
460 | |||
461 | if (!ecore_x_window_prop_card32_get(win, | ||
462 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE, | ||
463 | &val, 1)) | ||
464 | return 0; | ||
465 | |||
466 | return val; | ||
467 | } | ||
468 | |||
469 | EAPI void | ||
470 | ecore_x_e_illume_quickpanel_position_update_send(Ecore_X_Window win) | ||
471 | { | ||
472 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
473 | |||
474 | ecore_x_client_message32_send(win, | ||
475 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE, | ||
476 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
477 | 1, 0, 0, 0, 0); | ||
478 | } | ||
479 | |||
480 | EAPI Eina_Bool | ||
481 | ecore_x_e_illume_conformant_get(Ecore_X_Window win) | ||
482 | { | ||
483 | unsigned int val = 0; | ||
484 | |||
485 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
486 | |||
487 | if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT, | ||
488 | &val, 1)) | ||
489 | return EINA_FALSE; | ||
490 | |||
491 | return val ? EINA_TRUE : EINA_FALSE; | ||
492 | } | ||
493 | |||
494 | EAPI void | ||
495 | ecore_x_e_illume_conformant_set(Ecore_X_Window win, | ||
496 | unsigned int is_conformant) | ||
497 | { | ||
498 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
499 | |||
500 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT, | ||
501 | &is_conformant, 1); | ||
502 | } | ||
503 | |||
504 | EAPI void | ||
505 | ecore_x_e_illume_softkey_geometry_set(Ecore_X_Window win, | ||
506 | int x, | ||
507 | int y, | ||
508 | int w, | ||
509 | int h) | ||
510 | { | ||
511 | unsigned int geom[4]; | ||
512 | |||
513 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
514 | |||
515 | geom[0] = x; | ||
516 | geom[1] = y; | ||
517 | geom[2] = w; | ||
518 | geom[3] = h; | ||
519 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY, | ||
520 | geom, 4); | ||
521 | } | ||
522 | |||
523 | EAPI Eina_Bool | ||
524 | ecore_x_e_illume_softkey_geometry_get(Ecore_X_Window win, | ||
525 | int *x, | ||
526 | int *y, | ||
527 | int *w, | ||
528 | int *h) | ||
529 | { | ||
530 | unsigned int geom[4]; | ||
531 | |||
532 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
533 | |||
534 | if (x) *x = 0; | ||
535 | if (y) *y = 0; | ||
536 | if (w) *w = 0; | ||
537 | if (h) *h = 0; | ||
538 | |||
539 | if (ecore_x_window_prop_card32_get(win, | ||
540 | ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY, | ||
541 | geom, 4) != 4) | ||
542 | return EINA_FALSE; | ||
543 | |||
544 | if (x) *x = geom[0]; | ||
545 | if (y) *y = geom[1]; | ||
546 | if (w) *w = geom[2]; | ||
547 | if (h) *h = geom[3]; | ||
548 | |||
549 | return EINA_TRUE; | ||
550 | } | ||
551 | |||
552 | EAPI void | ||
553 | ecore_x_e_illume_indicator_geometry_set(Ecore_X_Window win, | ||
554 | int x, | ||
555 | int y, | ||
556 | int w, | ||
557 | int h) | ||
558 | { | ||
559 | unsigned int geom[4]; | ||
560 | |||
561 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
562 | |||
563 | geom[0] = x; | ||
564 | geom[1] = y; | ||
565 | geom[2] = w; | ||
566 | geom[3] = h; | ||
567 | ecore_x_window_prop_card32_set(win, | ||
568 | ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY, | ||
569 | geom, 4); | ||
570 | } | ||
571 | |||
572 | EAPI Eina_Bool | ||
573 | ecore_x_e_illume_indicator_geometry_get(Ecore_X_Window win, | ||
574 | int *x, | ||
575 | int *y, | ||
576 | int *w, | ||
577 | int *h) | ||
578 | { | ||
579 | unsigned int geom[4]; | ||
580 | |||
581 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
582 | |||
583 | if (x) *x = 0; | ||
584 | if (y) *y = 0; | ||
585 | if (w) *w = 0; | ||
586 | if (h) *h = 0; | ||
587 | |||
588 | if (ecore_x_window_prop_card32_get(win, | ||
589 | ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY, | ||
590 | geom, 4) != 4) | ||
591 | return EINA_FALSE; | ||
592 | |||
593 | if (x) *x = geom[0]; | ||
594 | if (y) *y = geom[1]; | ||
595 | if (w) *w = geom[2]; | ||
596 | if (h) *h = geom[3]; | ||
597 | |||
598 | return EINA_TRUE; | ||
599 | } | ||
600 | |||
601 | EAPI void | ||
602 | ecore_x_e_illume_keyboard_geometry_set(Ecore_X_Window win, | ||
603 | int x, | ||
604 | int y, | ||
605 | int w, | ||
606 | int h) | ||
607 | { | ||
608 | unsigned int geom[4]; | ||
609 | |||
610 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
611 | |||
612 | geom[0] = x; | ||
613 | geom[1] = y; | ||
614 | geom[2] = w; | ||
615 | geom[3] = h; | ||
616 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY, | ||
617 | geom, 4); | ||
618 | } | ||
619 | |||
620 | EAPI Eina_Bool | ||
621 | ecore_x_e_illume_keyboard_geometry_get(Ecore_X_Window win, | ||
622 | int *x, | ||
623 | int *y, | ||
624 | int *w, | ||
625 | int *h) | ||
626 | { | ||
627 | unsigned int geom[4]; | ||
628 | |||
629 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
630 | |||
631 | if (x) *x = 0; | ||
632 | if (y) *y = 0; | ||
633 | if (w) *w = 0; | ||
634 | if (h) *h = 0; | ||
635 | |||
636 | if (ecore_x_window_prop_card32_get(win, | ||
637 | ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY, | ||
638 | geom, 4) != 4) | ||
639 | return EINA_FALSE; | ||
640 | |||
641 | if (x) *x = geom[0]; | ||
642 | if (y) *y = geom[1]; | ||
643 | if (w) *w = geom[2]; | ||
644 | if (h) *h = geom[3]; | ||
645 | |||
646 | return EINA_TRUE; | ||
647 | } | ||
648 | |||
649 | EAPI void | ||
650 | ecore_x_e_illume_quickpanel_set(Ecore_X_Window win, | ||
651 | unsigned int is_quickpanel) | ||
652 | { | ||
653 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
654 | |||
655 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL, | ||
656 | &is_quickpanel, 1); | ||
657 | } | ||
658 | |||
659 | EAPI Eina_Bool | ||
660 | ecore_x_e_illume_quickpanel_get(Ecore_X_Window win) | ||
661 | { | ||
662 | unsigned int val = 0; | ||
663 | |||
664 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
665 | |||
666 | if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL, | ||
667 | &val, 1)) | ||
668 | return EINA_FALSE; | ||
669 | |||
670 | return val ? EINA_TRUE : EINA_FALSE; | ||
671 | } | ||
672 | |||
673 | EAPI void | ||
674 | ecore_x_e_illume_quickpanel_state_set(Ecore_X_Window win, | ||
675 | Ecore_X_Illume_Quickpanel_State state) | ||
676 | { | ||
677 | Ecore_X_Atom atom = 0; | ||
678 | |||
679 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
680 | |||
681 | atom = _ecore_xcb_e_quickpanel_atom_get(state); | ||
682 | ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE, | ||
683 | &atom, 1); | ||
684 | } | ||
685 | |||
686 | EAPI Ecore_X_Illume_Quickpanel_State | ||
687 | ecore_x_e_illume_quickpanel_state_get(Ecore_X_Window win) | ||
688 | { | ||
689 | Ecore_X_Atom atom = 0; | ||
690 | |||
691 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
692 | |||
693 | if (!ecore_x_window_prop_atom_get(win, | ||
694 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE, | ||
695 | &atom, 1)) | ||
696 | return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN; | ||
697 | |||
698 | return _ecore_xcb_e_quickpanel_state_get(atom); | ||
699 | } | ||
700 | |||
701 | EAPI void | ||
702 | ecore_x_e_illume_quickpanel_state_send(Ecore_X_Window win, | ||
703 | Ecore_X_Illume_Quickpanel_State state) | ||
704 | { | ||
705 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
706 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE, | ||
707 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
708 | _ecore_xcb_e_quickpanel_atom_get(state), | ||
709 | 0, 0, 0, 0); | ||
710 | } | ||
711 | |||
712 | EAPI void | ||
713 | ecore_x_e_illume_quickpanel_state_toggle(Ecore_X_Window win) | ||
714 | { | ||
715 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
716 | ecore_x_client_message32_send(win, | ||
717 | ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE_TOGGLE, | ||
718 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
719 | 0, 0, 0, 0, 0); | ||
720 | } | ||
721 | |||
722 | EAPI void | ||
723 | ecore_x_e_illume_mode_set(Ecore_X_Window win, | ||
724 | Ecore_X_Illume_Mode mode) | ||
725 | { | ||
726 | Ecore_X_Atom atom = 0; | ||
727 | |||
728 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
729 | |||
730 | atom = _ecore_xcb_e_illume_atom_get(mode); | ||
731 | ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_MODE, &atom, 1); | ||
732 | } | ||
733 | |||
734 | EAPI Ecore_X_Illume_Mode | ||
735 | ecore_x_e_illume_mode_get(Ecore_X_Window win) | ||
736 | { | ||
737 | Ecore_X_Atom atom = 0; | ||
738 | |||
739 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
740 | |||
741 | if (!ecore_x_window_prop_atom_get(win, ECORE_X_ATOM_E_ILLUME_MODE, &atom, 1)) | ||
742 | return ECORE_X_ILLUME_MODE_UNKNOWN; | ||
743 | |||
744 | return _ecore_xcb_e_illume_mode_get(atom); | ||
745 | } | ||
746 | |||
747 | EAPI void | ||
748 | ecore_x_e_illume_mode_send(Ecore_X_Window win, | ||
749 | Ecore_X_Illume_Mode mode) | ||
750 | { | ||
751 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
752 | |||
753 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_MODE, | ||
754 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
755 | _ecore_xcb_e_illume_atom_get(mode), | ||
756 | 0, 0, 0, 0); | ||
757 | } | ||
758 | |||
759 | EAPI void | ||
760 | ecore_x_e_illume_focus_back_send(Ecore_X_Window win) | ||
761 | { | ||
762 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
763 | |||
764 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_BACK, | ||
765 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
766 | 1, 0, 0, 0, 0); | ||
767 | } | ||
768 | |||
769 | EAPI void | ||
770 | ecore_x_e_illume_focus_forward_send(Ecore_X_Window win) | ||
771 | { | ||
772 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
773 | |||
774 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_FORWARD, | ||
775 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
776 | 1, 0, 0, 0, 0); | ||
777 | } | ||
778 | |||
779 | EAPI void | ||
780 | ecore_x_e_illume_focus_home_send(Ecore_X_Window win) | ||
781 | { | ||
782 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
783 | |||
784 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_FOCUS_HOME, | ||
785 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
786 | 1, 0, 0, 0, 0); | ||
787 | } | ||
788 | |||
789 | EAPI void | ||
790 | ecore_x_e_illume_close_send(Ecore_X_Window win) | ||
791 | { | ||
792 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
793 | |||
794 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_CLOSE, | ||
795 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
796 | 1, 0, 0, 0, 0); | ||
797 | } | ||
798 | |||
799 | EAPI void | ||
800 | ecore_x_e_illume_home_new_send(Ecore_X_Window win) | ||
801 | { | ||
802 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
803 | |||
804 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_NEW, | ||
805 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
806 | 1, 0, 0, 0, 0); | ||
807 | } | ||
808 | |||
809 | EAPI void | ||
810 | ecore_x_e_illume_home_del_send(Ecore_X_Window win) | ||
811 | { | ||
812 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
813 | |||
814 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_HOME_DEL, | ||
815 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
816 | 1, 0, 0, 0, 0); | ||
817 | } | ||
818 | |||
819 | EAPI void | ||
820 | ecore_x_e_illume_drag_set(Ecore_X_Window win, | ||
821 | unsigned int drag) | ||
822 | { | ||
823 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
824 | |||
825 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG, &drag, 1); | ||
826 | } | ||
827 | |||
828 | EAPI void | ||
829 | ecore_x_e_illume_drag_locked_set(Ecore_X_Window win, | ||
830 | unsigned int is_locked) | ||
831 | { | ||
832 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
833 | |||
834 | ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED, | ||
835 | &is_locked, 1); | ||
836 | } | ||
837 | |||
838 | EAPI Eina_Bool | ||
839 | ecore_x_e_illume_drag_locked_get(Ecore_X_Window win) | ||
840 | { | ||
841 | unsigned int val = 0; | ||
842 | |||
843 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
844 | |||
845 | if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED, | ||
846 | &val, 1)) | ||
847 | return EINA_FALSE; | ||
848 | |||
849 | return val ? EINA_TRUE : EINA_FALSE; | ||
850 | } | ||
851 | |||
852 | EAPI Eina_Bool | ||
853 | ecore_x_e_illume_drag_get(Ecore_X_Window win) | ||
854 | { | ||
855 | unsigned int val = 0; | ||
856 | |||
857 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
858 | |||
859 | if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG, &val, 1)) | ||
860 | return EINA_FALSE; | ||
861 | |||
862 | return val ? EINA_TRUE : EINA_FALSE; | ||
863 | } | ||
864 | |||
865 | EAPI void | ||
866 | ecore_x_e_illume_drag_start_send(Ecore_X_Window win) | ||
867 | { | ||
868 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
869 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_START, | ||
870 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
871 | 1, 0, 0, 0, 0); | ||
872 | } | ||
873 | |||
874 | EAPI void | ||
875 | ecore_x_e_illume_drag_end_send(Ecore_X_Window win) | ||
876 | { | ||
877 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
878 | ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_DRAG_END, | ||
879 | ECORE_X_EVENT_MASK_WINDOW_CONFIGURE, | ||
880 | 1, 0, 0, 0, 0); | ||
881 | } | ||
882 | |||
883 | EAPI void | ||
884 | ecore_x_e_illume_zone_set(Ecore_X_Window win, | ||
885 | Ecore_X_Window zone) | ||
886 | { | ||
887 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
888 | |||
889 | ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE, &zone, 1); | ||
890 | } | ||
891 | |||
892 | EAPI Ecore_X_Window | ||
893 | ecore_x_e_illume_zone_get(Ecore_X_Window win) | ||
894 | { | ||
895 | Ecore_X_Window zone; | ||
896 | |||
897 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
898 | |||
899 | if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE, | ||
900 | &zone, 1)) | ||
901 | return 0; | ||
902 | |||
903 | return zone; | ||
904 | } | ||
905 | |||
906 | EAPI void | ||
907 | ecore_x_e_illume_zone_list_set(Ecore_X_Window win, | ||
908 | Ecore_X_Window *zones, | ||
909 | unsigned int num) | ||
910 | { | ||
911 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
912 | |||
913 | ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE_LIST, | ||
914 | zones, num); | ||
915 | } | ||
916 | |||
917 | /* local functions */ | ||
918 | static Ecore_X_Atom | ||
919 | _ecore_xcb_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state) | ||
920 | { | ||
921 | switch (state) | ||
922 | { | ||
923 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF: | ||
924 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_OFF; | ||
925 | |||
926 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_ON: | ||
927 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ON; | ||
928 | |||
929 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA: | ||
930 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ALPHA; | ||
931 | |||
932 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC: | ||
933 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_NUMERIC; | ||
934 | |||
935 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN: | ||
936 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PIN; | ||
937 | |||
938 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER: | ||
939 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PHONE_NUMBER; | ||
940 | |||
941 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX: | ||
942 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HEX; | ||
943 | |||
944 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL: | ||
945 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL; | ||
946 | |||
947 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD: | ||
948 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD; | ||
949 | |||
950 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_IP: | ||
951 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_IP; | ||
952 | |||
953 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_HOST: | ||
954 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HOST; | ||
955 | |||
956 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_FILE: | ||
957 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_FILE; | ||
958 | |||
959 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_URL: | ||
960 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_URL; | ||
961 | |||
962 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_KEYPAD: | ||
963 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_KEYPAD; | ||
964 | |||
965 | case ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME: | ||
966 | return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME; | ||
967 | |||
968 | default: | ||
969 | break; | ||
970 | } | ||
971 | return 0; | ||
972 | } | ||
973 | |||
974 | static Ecore_X_Virtual_Keyboard_State | ||
975 | _ecore_xcb_e_vkbd_state_get(Ecore_X_Atom atom) | ||
976 | { | ||
977 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ON) | ||
978 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_ON; | ||
979 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_OFF) | ||
980 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF; | ||
981 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ALPHA) | ||
982 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA; | ||
983 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_NUMERIC) | ||
984 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC; | ||
985 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PIN) | ||
986 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN; | ||
987 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PHONE_NUMBER) | ||
988 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER; | ||
989 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HEX) | ||
990 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX; | ||
991 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL) | ||
992 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL; | ||
993 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD) | ||
994 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD; | ||
995 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_IP) | ||
996 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_IP; | ||
997 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HOST) | ||
998 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_HOST; | ||
999 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_FILE) | ||
1000 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_FILE; | ||
1001 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_URL) | ||
1002 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_URL; | ||
1003 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_KEYPAD) | ||
1004 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_KEYPAD; | ||
1005 | if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME) | ||
1006 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME; | ||
1007 | |||
1008 | return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN; | ||
1009 | } | ||
1010 | |||
1011 | static Ecore_X_Atom | ||
1012 | _ecore_xcb_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state) | ||
1013 | { | ||
1014 | switch (state) | ||
1015 | { | ||
1016 | case ECORE_X_ILLUME_QUICKPANEL_STATE_ON: | ||
1017 | return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON; | ||
1018 | |||
1019 | case ECORE_X_ILLUME_QUICKPANEL_STATE_OFF: | ||
1020 | return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF; | ||
1021 | |||
1022 | default: | ||
1023 | break; | ||
1024 | } | ||
1025 | return 0; | ||
1026 | } | ||
1027 | |||
1028 | static Ecore_X_Illume_Quickpanel_State | ||
1029 | _ecore_xcb_e_quickpanel_state_get(Ecore_X_Atom atom) | ||
1030 | { | ||
1031 | if (atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON) | ||
1032 | return ECORE_X_ILLUME_QUICKPANEL_STATE_ON; | ||
1033 | if (atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF) | ||
1034 | return ECORE_X_ILLUME_QUICKPANEL_STATE_OFF; | ||
1035 | |||
1036 | return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN; | ||
1037 | } | ||
1038 | |||
1039 | static Ecore_X_Atom | ||
1040 | _ecore_xcb_e_illume_atom_get(Ecore_X_Illume_Mode mode) | ||
1041 | { | ||
1042 | switch (mode) | ||
1043 | { | ||
1044 | case ECORE_X_ILLUME_MODE_SINGLE: | ||
1045 | return ECORE_X_ATOM_E_ILLUME_MODE_SINGLE; | ||
1046 | |||
1047 | case ECORE_X_ILLUME_MODE_DUAL_TOP: | ||
1048 | return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP; | ||
1049 | |||
1050 | case ECORE_X_ILLUME_MODE_DUAL_LEFT: | ||
1051 | return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT; | ||
1052 | |||
1053 | default: | ||
1054 | break; | ||
1055 | } | ||
1056 | return ECORE_X_ILLUME_MODE_UNKNOWN; | ||
1057 | } | ||
1058 | |||
1059 | static Ecore_X_Illume_Mode | ||
1060 | _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom) | ||
1061 | { | ||
1062 | if (atom == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE) | ||
1063 | return ECORE_X_ILLUME_MODE_SINGLE; | ||
1064 | if (atom == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP) | ||
1065 | return ECORE_X_ILLUME_MODE_DUAL_TOP; | ||
1066 | if (atom == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT) | ||
1067 | return ECORE_X_ILLUME_MODE_DUAL_LEFT; | ||
1068 | |||
1069 | return ECORE_X_ILLUME_MODE_UNKNOWN; | ||
1070 | } | ||
1071 | |||