diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c | 324 |
1 files changed, 162 insertions, 162 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c index 844ab04..6d275bc 100644 --- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x.c | |||
@@ -19,9 +19,9 @@ | |||
19 | #include "Ecore_X_Atoms.h" | 19 | #include "Ecore_X_Atoms.h" |
20 | #include "Ecore_Input.h" | 20 | #include "Ecore_Input.h" |
21 | 21 | ||
22 | static Eina_Bool _ecore_x_fd_handler(void *data, | 22 | static Eina_Bool _ecore_x_fd_handler(void *data, |
23 | Ecore_Fd_Handler *fd_handler); | 23 | Ecore_Fd_Handler *fd_handler); |
24 | static Eina_Bool _ecore_x_fd_handler_buf(void *data, | 24 | static Eina_Bool _ecore_x_fd_handler_buf(void *data, |
25 | Ecore_Fd_Handler *fd_handler); | 25 | Ecore_Fd_Handler *fd_handler); |
26 | static int _ecore_x_key_mask_get(KeySym sym); | 26 | static int _ecore_x_key_mask_get(KeySym sym); |
27 | static int _ecore_x_event_modifier(unsigned int state); | 27 | static int _ecore_x_event_modifier(unsigned int state); |
@@ -139,9 +139,9 @@ EAPI int ECORE_X_LOCK_SHIFT = 0; | |||
139 | #ifdef LOGRT | 139 | #ifdef LOGRT |
140 | static double t0 = 0.0; | 140 | static double t0 = 0.0; |
141 | static Status (*_logrt_real_reply)(Display *disp, | 141 | static Status (*_logrt_real_reply)(Display *disp, |
142 | void *rep, | 142 | void *rep, |
143 | int extra, | 143 | int extra, |
144 | Bool discard) = NULL; | 144 | Bool discard) = NULL; |
145 | static void | 145 | static void |
146 | _logrt_init(void) | 146 | _logrt_init(void) |
147 | { | 147 | { |
@@ -159,13 +159,13 @@ _logrt_init(void) | |||
159 | 159 | ||
160 | _logrt_real_reply = dlsym(lib, "_XReply"); | 160 | _logrt_real_reply = dlsym(lib, "_XReply"); |
161 | t0 = ecore_time_get(); | 161 | t0 = ecore_time_get(); |
162 | } /* _logrt_init */ | 162 | } |
163 | 163 | ||
164 | Status | 164 | Status |
165 | _XReply(Display *disp, | 165 | _XReply(Display *disp, |
166 | void *rep, | 166 | void *rep, |
167 | int extra, | 167 | int extra, |
168 | Bool discard) | 168 | Bool discard) |
169 | { | 169 | { |
170 | void *bt[128]; | 170 | void *bt[128]; |
171 | int i, n; | 171 | int i, n; |
@@ -207,7 +207,7 @@ _XReply(Display *disp, | |||
207 | 207 | ||
208 | // fixme: logme | 208 | // fixme: logme |
209 | return _logrt_real_reply(disp, rep, extra, discard); | 209 | return _logrt_real_reply(disp, rep, extra, discard); |
210 | } /* _XReply */ | 210 | } |
211 | 211 | ||
212 | #endif /* ifdef LOGRT */ | 212 | #endif /* ifdef LOGRT */ |
213 | 213 | ||
@@ -215,35 +215,35 @@ void | |||
215 | _ecore_x_modifiers_get(void) | 215 | _ecore_x_modifiers_get(void) |
216 | { | 216 | { |
217 | /* everything has these... unless its like a pda... :) */ | 217 | /* everything has these... unless its like a pda... :) */ |
218 | ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L); | 218 | ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L); |
219 | ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L); | 219 | ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L); |
220 | 220 | ||
221 | /* apple's xdarwin has no alt!!!! */ | 221 | /* apple's xdarwin has no alt!!!! */ |
222 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L); | 222 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L); |
223 | if (!ECORE_X_MODIFIER_ALT) | 223 | if (!ECORE_X_MODIFIER_ALT) |
224 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Meta_L); | 224 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Meta_L); |
225 | 225 | ||
226 | if (!ECORE_X_MODIFIER_ALT) | 226 | if (!ECORE_X_MODIFIER_ALT) |
227 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Super_L); | 227 | ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Super_L); |
228 | 228 | ||
229 | /* the windows key... a valid modifier :) */ | 229 | /* the windows key... a valid modifier :) */ |
230 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L); | 230 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L); |
231 | if (!ECORE_X_MODIFIER_WIN) | 231 | if (!ECORE_X_MODIFIER_WIN) |
232 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch); | 232 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch); |
233 | 233 | ||
234 | if (!ECORE_X_MODIFIER_WIN) | 234 | if (!ECORE_X_MODIFIER_WIN) |
235 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L); | 235 | ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L); |
236 | 236 | ||
237 | if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT) | 237 | if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT) |
238 | ECORE_X_MODIFIER_WIN = 0; | 238 | ECORE_X_MODIFIER_WIN = 0; |
239 | 239 | ||
240 | if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL) | 240 | if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL) |
241 | ECORE_X_MODIFIER_ALT = 0; | 241 | ECORE_X_MODIFIER_ALT = 0; |
242 | 242 | ||
243 | ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock); | 243 | ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock); |
244 | ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock); | 244 | ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock); |
245 | ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock); | 245 | ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock); |
246 | ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock); | 246 | ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock); |
247 | } | 247 | } |
248 | 248 | ||
249 | /** | 249 | /** |
@@ -300,7 +300,7 @@ ecore_x_init(const char *name) | |||
300 | eina_init(); | 300 | eina_init(); |
301 | _ecore_xlib_log_dom = eina_log_domain_register | 301 | _ecore_xlib_log_dom = eina_log_domain_register |
302 | ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR); | 302 | ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR); |
303 | if(_ecore_xlib_log_dom < 0) | 303 | if (_ecore_xlib_log_dom < 0) |
304 | { | 304 | { |
305 | EINA_LOG_ERR( | 305 | EINA_LOG_ERR( |
306 | "Impossible to create a log domain for the Ecore Xlib module."); | 306 | "Impossible to create a log domain for the Ecore Xlib module."); |
@@ -375,7 +375,7 @@ ecore_x_init(const char *name) | |||
375 | 375 | ||
376 | #ifdef ECORE_XGESTURE | 376 | #ifdef ECORE_XGESTURE |
377 | if (XGestureQueryExtension(_ecore_x_disp, &gesture_base, &gesture_err_base)) | 377 | if (XGestureQueryExtension(_ecore_x_disp, &gesture_base, &gesture_err_base)) |
378 | _ecore_x_event_gesture_id = gesture_base; | 378 | _ecore_x_event_gesture_id = gesture_base; |
379 | 379 | ||
380 | ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents); | 380 | ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents); |
381 | #endif /* ifdef ECORE_XGESTURE */ | 381 | #endif /* ifdef ECORE_XGESTURE */ |
@@ -497,20 +497,20 @@ ecore_x_init(const char *name) | |||
497 | #ifdef ECORE_XGESTURE | 497 | #ifdef ECORE_XGESTURE |
498 | if (_ecore_x_event_gesture_id) | 498 | if (_ecore_x_event_gesture_id) |
499 | { | 499 | { |
500 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyFlick] = | 500 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyFlick] = |
501 | _ecore_x_event_handle_gesture_notify_flick; | 501 | _ecore_x_event_handle_gesture_notify_flick; |
502 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPan] = | 502 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPan] = |
503 | _ecore_x_event_handle_gesture_notify_pan; | 503 | _ecore_x_event_handle_gesture_notify_pan; |
504 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPinchRotation] = | 504 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyPinchRotation] = |
505 | _ecore_x_event_handle_gesture_notify_pinchrotation; | 505 | _ecore_x_event_handle_gesture_notify_pinchrotation; |
506 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTap] = | 506 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTap] = |
507 | _ecore_x_event_handle_gesture_notify_tap; | 507 | _ecore_x_event_handle_gesture_notify_tap; |
508 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTapNHold] = | 508 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyTapNHold] = |
509 | _ecore_x_event_handle_gesture_notify_tapnhold; | 509 | _ecore_x_event_handle_gesture_notify_tapnhold; |
510 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyHold] = | 510 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyHold] = |
511 | _ecore_x_event_handle_gesture_notify_hold; | 511 | _ecore_x_event_handle_gesture_notify_hold; |
512 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyGroup] = | 512 | _ecore_x_event_handlers[_ecore_x_event_gesture_id + GestureNotifyGroup] = |
513 | _ecore_x_event_handle_gesture_notify_group; | 513 | _ecore_x_event_handle_gesture_notify_group; |
514 | } | 514 | } |
515 | 515 | ||
516 | #endif /* ifdef ECORE_XGESTURE */ | 516 | #endif /* ifdef ECORE_XGESTURE */ |
@@ -641,7 +641,7 @@ shutdown_eina: | |||
641 | eina_shutdown(); | 641 | eina_shutdown(); |
642 | 642 | ||
643 | return --_ecore_x_init_count; | 643 | return --_ecore_x_init_count; |
644 | } /* ecore_x_init */ | 644 | } |
645 | 645 | ||
646 | static int | 646 | static int |
647 | _ecore_x_shutdown(int close_display) | 647 | _ecore_x_shutdown(int close_display) |
@@ -683,7 +683,7 @@ _ecore_x_shutdown(int close_display) | |||
683 | eina_shutdown(); | 683 | eina_shutdown(); |
684 | 684 | ||
685 | return _ecore_x_init_count; | 685 | return _ecore_x_init_count; |
686 | } /* _ecore_x_shutdown */ | 686 | } |
687 | 687 | ||
688 | /** | 688 | /** |
689 | * Shuts down the Ecore X library. | 689 | * Shuts down the Ecore X library. |
@@ -699,7 +699,7 @@ EAPI int | |||
699 | ecore_x_shutdown(void) | 699 | ecore_x_shutdown(void) |
700 | { | 700 | { |
701 | return _ecore_x_shutdown(1); | 701 | return _ecore_x_shutdown(1); |
702 | } /* ecore_x_shutdown */ | 702 | } |
703 | 703 | ||
704 | /** | 704 | /** |
705 | * Shuts down the Ecore X library. | 705 | * Shuts down the Ecore X library. |
@@ -712,7 +712,7 @@ EAPI int | |||
712 | ecore_x_disconnect(void) | 712 | ecore_x_disconnect(void) |
713 | { | 713 | { |
714 | return _ecore_x_shutdown(0); | 714 | return _ecore_x_shutdown(0); |
715 | } /* ecore_x_disconnect */ | 715 | } |
716 | 716 | ||
717 | /** | 717 | /** |
718 | * @defgroup Ecore_X_Display_Attr_Group X Display Attributes | 718 | * @defgroup Ecore_X_Display_Attr_Group X Display Attributes |
@@ -729,7 +729,7 @@ EAPI Ecore_X_Display * | |||
729 | ecore_x_display_get(void) | 729 | ecore_x_display_get(void) |
730 | { | 730 | { |
731 | return (Ecore_X_Display *)_ecore_x_disp; | 731 | return (Ecore_X_Display *)_ecore_x_disp; |
732 | } /* ecore_x_display_get */ | 732 | } |
733 | 733 | ||
734 | /** | 734 | /** |
735 | * Retrieves the X display file descriptor. | 735 | * Retrieves the X display file descriptor. |
@@ -741,7 +741,7 @@ ecore_x_fd_get(void) | |||
741 | { | 741 | { |
742 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 742 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
743 | return ConnectionNumber(_ecore_x_disp); | 743 | return ConnectionNumber(_ecore_x_disp); |
744 | } /* ecore_x_fd_get */ | 744 | } |
745 | 745 | ||
746 | /** | 746 | /** |
747 | * Retrieves the Ecore_X_Screen handle used for the current X connection. | 747 | * Retrieves the Ecore_X_Screen handle used for the current X connection. |
@@ -753,7 +753,7 @@ ecore_x_default_screen_get(void) | |||
753 | { | 753 | { |
754 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 754 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
755 | return (Ecore_X_Screen *)DefaultScreenOfDisplay(_ecore_x_disp); | 755 | return (Ecore_X_Screen *)DefaultScreenOfDisplay(_ecore_x_disp); |
756 | } /* ecore_x_default_screen_get */ | 756 | } |
757 | 757 | ||
758 | /** | 758 | /** |
759 | * Retrieves the size of an Ecore_X_Screen. | 759 | * Retrieves the size of an Ecore_X_Screen. |
@@ -767,8 +767,8 @@ ecore_x_default_screen_get(void) | |||
767 | */ | 767 | */ |
768 | EAPI void | 768 | EAPI void |
769 | ecore_x_screen_size_get(const Ecore_X_Screen *screen, | 769 | ecore_x_screen_size_get(const Ecore_X_Screen *screen, |
770 | int *w, | 770 | int *w, |
771 | int *h) | 771 | int *h) |
772 | { | 772 | { |
773 | Screen *s = (Screen *)screen; | 773 | Screen *s = (Screen *)screen; |
774 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 774 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
@@ -840,7 +840,7 @@ ecore_x_double_click_time_set(double t) | |||
840 | t = 0.0; | 840 | t = 0.0; |
841 | 841 | ||
842 | _ecore_x_double_click_time = t; | 842 | _ecore_x_double_click_time = t; |
843 | } /* ecore_x_double_click_time_set */ | 843 | } |
844 | 844 | ||
845 | /** | 845 | /** |
846 | * Retrieves the double and triple click flag timeout. | 846 | * Retrieves the double and triple click flag timeout. |
@@ -854,7 +854,7 @@ EAPI double | |||
854 | ecore_x_double_click_time_get(void) | 854 | ecore_x_double_click_time_get(void) |
855 | { | 855 | { |
856 | return _ecore_x_double_click_time; | 856 | return _ecore_x_double_click_time; |
857 | } /* ecore_x_double_click_time_get */ | 857 | } |
858 | 858 | ||
859 | /** | 859 | /** |
860 | * @defgroup Ecore_X_Flush_Group X Synchronization Functions | 860 | * @defgroup Ecore_X_Flush_Group X Synchronization Functions |
@@ -872,7 +872,7 @@ ecore_x_flush(void) | |||
872 | { | 872 | { |
873 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 873 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
874 | XFlush(_ecore_x_disp); | 874 | XFlush(_ecore_x_disp); |
875 | } /* ecore_x_flush */ | 875 | } |
876 | 876 | ||
877 | /** | 877 | /** |
878 | * Flushes the command buffer and waits until all requests have been | 878 | * Flushes the command buffer and waits until all requests have been |
@@ -884,7 +884,7 @@ ecore_x_sync(void) | |||
884 | { | 884 | { |
885 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 885 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
886 | XSync(_ecore_x_disp, False); | 886 | XSync(_ecore_x_disp, False); |
887 | } /* ecore_x_sync */ | 887 | } |
888 | 888 | ||
889 | /** | 889 | /** |
890 | * Kill all clients with subwindows under a given window. | 890 | * Kill all clients with subwindows under a given window. |
@@ -920,7 +920,7 @@ ecore_x_killall(Ecore_X_Window root) | |||
920 | } | 920 | } |
921 | XUngrabServer(_ecore_x_disp); | 921 | XUngrabServer(_ecore_x_disp); |
922 | XSync(_ecore_x_disp, False); | 922 | XSync(_ecore_x_disp, False); |
923 | } /* ecore_x_killall */ | 923 | } |
924 | 924 | ||
925 | /** | 925 | /** |
926 | * Kill a specific client | 926 | * Kill a specific client |
@@ -934,7 +934,7 @@ ecore_x_kill(Ecore_X_Window win) | |||
934 | { | 934 | { |
935 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 935 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
936 | XKillClient(_ecore_x_disp, win); | 936 | XKillClient(_ecore_x_disp, win); |
937 | } /* ecore_x_kill */ | 937 | } |
938 | 938 | ||
939 | /** | 939 | /** |
940 | * Return the last event time | 940 | * Return the last event time |
@@ -943,7 +943,7 @@ EAPI Ecore_X_Time | |||
943 | ecore_x_current_time_get(void) | 943 | ecore_x_current_time_get(void) |
944 | { | 944 | { |
945 | return _ecore_x_event_last_time; | 945 | return _ecore_x_event_last_time; |
946 | } /* ecore_x_current_time_get */ | 946 | } |
947 | 947 | ||
948 | /** | 948 | /** |
949 | * Return the screen DPI | 949 | * Return the screen DPI |
@@ -965,7 +965,7 @@ ecore_x_dpi_get(void) | |||
965 | return 75; | 965 | return 75; |
966 | 966 | ||
967 | return (((s->width * 254) / s->mwidth) + 5) / 10; | 967 | return (((s->width * 254) / s->mwidth) + 5) / 10; |
968 | } /* ecore_x_dpi_get */ | 968 | } |
969 | 969 | ||
970 | /** | 970 | /** |
971 | * Invoke the standard system beep to alert users | 971 | * Invoke the standard system beep to alert users |
@@ -989,10 +989,10 @@ ecore_x_bell(int percent) | |||
989 | return EINA_FALSE; | 989 | return EINA_FALSE; |
990 | 990 | ||
991 | return EINA_TRUE; | 991 | return EINA_TRUE; |
992 | } /* ecore_x_bell */ | 992 | } |
993 | 993 | ||
994 | static Eina_Bool | 994 | static Eina_Bool |
995 | _ecore_x_fd_handler(void *data, | 995 | _ecore_x_fd_handler(void *data, |
996 | Ecore_Fd_Handler *fd_handler __UNUSED__) | 996 | Ecore_Fd_Handler *fd_handler __UNUSED__) |
997 | { | 997 | { |
998 | Display *d; | 998 | Display *d; |
@@ -1021,10 +1021,10 @@ _ecore_x_fd_handler(void *data, | |||
1021 | } | 1021 | } |
1022 | } | 1022 | } |
1023 | return ECORE_CALLBACK_RENEW; | 1023 | return ECORE_CALLBACK_RENEW; |
1024 | } /* _ecore_x_fd_handler */ | 1024 | } |
1025 | 1025 | ||
1026 | static Eina_Bool | 1026 | static Eina_Bool |
1027 | _ecore_x_fd_handler_buf(void *data, | 1027 | _ecore_x_fd_handler_buf(void *data, |
1028 | Ecore_Fd_Handler *fd_handler __UNUSED__) | 1028 | Ecore_Fd_Handler *fd_handler __UNUSED__) |
1029 | { | 1029 | { |
1030 | Display *d; | 1030 | Display *d; |
@@ -1034,7 +1034,7 @@ _ecore_x_fd_handler_buf(void *data, | |||
1034 | return ECORE_CALLBACK_RENEW; | 1034 | return ECORE_CALLBACK_RENEW; |
1035 | 1035 | ||
1036 | return ECORE_CALLBACK_CANCEL; | 1036 | return ECORE_CALLBACK_CANCEL; |
1037 | } /* _ecore_x_fd_handler_buf */ | 1037 | } |
1038 | 1038 | ||
1039 | static int | 1039 | static int |
1040 | _ecore_x_key_mask_get(KeySym sym) | 1040 | _ecore_x_key_mask_get(KeySym sym) |
@@ -1080,7 +1080,7 @@ _ecore_x_key_mask_get(KeySym sym) | |||
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | return 0; | 1082 | return 0; |
1083 | } /* _ecore_x_key_mask_get */ | 1083 | } |
1084 | 1084 | ||
1085 | /*****************************************************************************/ | 1085 | /*****************************************************************************/ |
1086 | /*****************************************************************************/ | 1086 | /*****************************************************************************/ |
@@ -1132,7 +1132,7 @@ ecore_x_window_root_list(int *num_ret) | |||
1132 | overlap++; | 1132 | overlap++; |
1133 | } | 1133 | } |
1134 | } | 1134 | } |
1135 | roots = malloc((num - overlap) * sizeof(Window)); | 1135 | roots = malloc(MAX((num - overlap) * sizeof(Window), 1)); |
1136 | if (roots) | 1136 | if (roots) |
1137 | { | 1137 | { |
1138 | int k; | 1138 | int k; |
@@ -1195,7 +1195,7 @@ ecore_x_window_root_list(int *num_ret) | |||
1195 | roots[i] = RootWindow(_ecore_x_disp, i); | 1195 | roots[i] = RootWindow(_ecore_x_disp, i); |
1196 | #endif /* ifdef ECORE_XPRINT */ | 1196 | #endif /* ifdef ECORE_XPRINT */ |
1197 | return roots; | 1197 | return roots; |
1198 | } /* ecore_x_window_root_list */ | 1198 | } |
1199 | 1199 | ||
1200 | EAPI Ecore_X_Window | 1200 | EAPI Ecore_X_Window |
1201 | ecore_x_window_root_first_get(void) | 1201 | ecore_x_window_root_first_get(void) |
@@ -1217,7 +1217,7 @@ ecore_x_window_root_first_get(void) | |||
1217 | free(roots); | 1217 | free(roots); |
1218 | return root; | 1218 | return root; |
1219 | */ | 1219 | */ |
1220 | } /* ecore_x_window_root_first_get */ | 1220 | } |
1221 | 1221 | ||
1222 | static void _ecore_x_window_manage_error(void *data); | 1222 | static void _ecore_x_window_manage_error(void *data); |
1223 | 1223 | ||
@@ -1228,7 +1228,7 @@ _ecore_x_window_manage_error(void *data __UNUSED__) | |||
1228 | if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) && | 1228 | if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) && |
1229 | (ecore_x_error_code_get() == BadAccess)) | 1229 | (ecore_x_error_code_get() == BadAccess)) |
1230 | _ecore_x_window_manage_failed = 1; | 1230 | _ecore_x_window_manage_failed = 1; |
1231 | } /* _ecore_x_window_manage_error */ | 1231 | } |
1232 | 1232 | ||
1233 | EAPI Eina_Bool | 1233 | EAPI Eina_Bool |
1234 | ecore_x_window_manage(Ecore_X_Window win) | 1234 | ecore_x_window_manage(Ecore_X_Window win) |
@@ -1262,7 +1262,7 @@ ecore_x_window_manage(Ecore_X_Window win) | |||
1262 | } | 1262 | } |
1263 | 1263 | ||
1264 | return EINA_TRUE; | 1264 | return EINA_TRUE; |
1265 | } /* ecore_x_window_manage */ | 1265 | } |
1266 | 1266 | ||
1267 | EAPI void | 1267 | EAPI void |
1268 | ecore_x_window_container_manage(Ecore_X_Window win) | 1268 | ecore_x_window_container_manage(Ecore_X_Window win) |
@@ -1271,7 +1271,7 @@ ecore_x_window_container_manage(Ecore_X_Window win) | |||
1271 | XSelectInput(_ecore_x_disp, win, | 1271 | XSelectInput(_ecore_x_disp, win, |
1272 | SubstructureRedirectMask | | 1272 | SubstructureRedirectMask | |
1273 | SubstructureNotifyMask); | 1273 | SubstructureNotifyMask); |
1274 | } /* ecore_x_window_container_manage */ | 1274 | } |
1275 | 1275 | ||
1276 | EAPI void | 1276 | EAPI void |
1277 | ecore_x_window_client_manage(Ecore_X_Window win) | 1277 | ecore_x_window_client_manage(Ecore_X_Window win) |
@@ -1287,7 +1287,7 @@ ecore_x_window_client_manage(Ecore_X_Window win) | |||
1287 | SubstructureNotifyMask | 1287 | SubstructureNotifyMask |
1288 | ); | 1288 | ); |
1289 | XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); | 1289 | XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); |
1290 | } /* ecore_x_window_client_manage */ | 1290 | } |
1291 | 1291 | ||
1292 | EAPI void | 1292 | EAPI void |
1293 | ecore_x_window_sniff(Ecore_X_Window win) | 1293 | ecore_x_window_sniff(Ecore_X_Window win) |
@@ -1296,7 +1296,7 @@ ecore_x_window_sniff(Ecore_X_Window win) | |||
1296 | XSelectInput(_ecore_x_disp, win, | 1296 | XSelectInput(_ecore_x_disp, win, |
1297 | PropertyChangeMask | | 1297 | PropertyChangeMask | |
1298 | SubstructureNotifyMask); | 1298 | SubstructureNotifyMask); |
1299 | } /* ecore_x_window_sniff */ | 1299 | } |
1300 | 1300 | ||
1301 | EAPI void | 1301 | EAPI void |
1302 | ecore_x_window_client_sniff(Ecore_X_Window win) | 1302 | ecore_x_window_client_sniff(Ecore_X_Window win) |
@@ -1310,10 +1310,10 @@ ecore_x_window_client_sniff(Ecore_X_Window win) | |||
1310 | StructureNotifyMask | | 1310 | StructureNotifyMask | |
1311 | SubstructureNotifyMask); | 1311 | SubstructureNotifyMask); |
1312 | XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); | 1312 | XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); |
1313 | } /* ecore_x_window_client_sniff */ | 1313 | } |
1314 | 1314 | ||
1315 | EAPI Eina_Bool | 1315 | EAPI Eina_Bool |
1316 | ecore_x_window_attributes_get(Ecore_X_Window win, | 1316 | ecore_x_window_attributes_get(Ecore_X_Window win, |
1317 | Ecore_X_Window_Attributes *att_ret) | 1317 | Ecore_X_Window_Attributes *att_ret) |
1318 | { | 1318 | { |
1319 | XWindowAttributes att; | 1319 | XWindowAttributes att; |
@@ -1353,25 +1353,25 @@ ecore_x_window_attributes_get(Ecore_X_Window win, | |||
1353 | att_ret->colormap = att.colormap; | 1353 | att_ret->colormap = att.colormap; |
1354 | att_ret->visual = att.visual; | 1354 | att_ret->visual = att.visual; |
1355 | return EINA_TRUE; | 1355 | return EINA_TRUE; |
1356 | } /* ecore_x_window_attributes_get */ | 1356 | } |
1357 | 1357 | ||
1358 | EAPI void | 1358 | EAPI void |
1359 | ecore_x_window_save_set_add(Ecore_X_Window win) | 1359 | ecore_x_window_save_set_add(Ecore_X_Window win) |
1360 | { | 1360 | { |
1361 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1361 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1362 | XAddToSaveSet(_ecore_x_disp, win); | 1362 | XAddToSaveSet(_ecore_x_disp, win); |
1363 | } /* ecore_x_window_save_set_add */ | 1363 | } |
1364 | 1364 | ||
1365 | EAPI void | 1365 | EAPI void |
1366 | ecore_x_window_save_set_del(Ecore_X_Window win) | 1366 | ecore_x_window_save_set_del(Ecore_X_Window win) |
1367 | { | 1367 | { |
1368 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1368 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1369 | XRemoveFromSaveSet(_ecore_x_disp, win); | 1369 | XRemoveFromSaveSet(_ecore_x_disp, win); |
1370 | } /* ecore_x_window_save_set_del */ | 1370 | } |
1371 | 1371 | ||
1372 | EAPI Ecore_X_Window * | 1372 | EAPI Ecore_X_Window * |
1373 | ecore_x_window_children_get(Ecore_X_Window win, | 1373 | ecore_x_window_children_get(Ecore_X_Window win, |
1374 | int *num) | 1374 | int *num) |
1375 | { | 1375 | { |
1376 | Ecore_X_Window *windows = NULL; | 1376 | Ecore_X_Window *windows = NULL; |
1377 | Window root_ret = 0, parent_ret = 0, *children_ret = NULL; | 1377 | Window root_ret = 0, parent_ret = 0, *children_ret = NULL; |
@@ -1398,7 +1398,7 @@ ecore_x_window_children_get(Ecore_X_Window win, | |||
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | return windows; | 1400 | return windows; |
1401 | } /* ecore_x_window_children_get */ | 1401 | } |
1402 | 1402 | ||
1403 | EAPI Eina_Bool | 1403 | EAPI Eina_Bool |
1404 | ecore_x_pointer_control_set(int accel_num, | 1404 | ecore_x_pointer_control_set(int accel_num, |
@@ -1408,7 +1408,7 @@ ecore_x_pointer_control_set(int accel_num, | |||
1408 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1408 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1409 | return XChangePointerControl(_ecore_x_disp, 1, 1, | 1409 | return XChangePointerControl(_ecore_x_disp, 1, 1, |
1410 | accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; | 1410 | accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; |
1411 | } /* ecore_x_pointer_control_set */ | 1411 | } |
1412 | 1412 | ||
1413 | EAPI Eina_Bool | 1413 | EAPI Eina_Bool |
1414 | ecore_x_pointer_control_get(int *accel_num, | 1414 | ecore_x_pointer_control_get(int *accel_num, |
@@ -1418,23 +1418,23 @@ ecore_x_pointer_control_get(int *accel_num, | |||
1418 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1418 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1419 | return XGetPointerControl(_ecore_x_disp, | 1419 | return XGetPointerControl(_ecore_x_disp, |
1420 | accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; | 1420 | accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; |
1421 | } /* ecore_x_pointer_control_get */ | 1421 | } |
1422 | 1422 | ||
1423 | EAPI Eina_Bool | 1423 | EAPI Eina_Bool |
1424 | ecore_x_pointer_mapping_set(unsigned char *map, | 1424 | ecore_x_pointer_mapping_set(unsigned char *map, |
1425 | int nmap) | 1425 | int nmap) |
1426 | { | 1426 | { |
1427 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1427 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1428 | return XSetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; | 1428 | return XSetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; |
1429 | } /* ecore_x_pointer_mapping_set */ | 1429 | } |
1430 | 1430 | ||
1431 | EAPI Eina_Bool | 1431 | EAPI Eina_Bool |
1432 | ecore_x_pointer_mapping_get(unsigned char *map, | 1432 | ecore_x_pointer_mapping_get(unsigned char *map, |
1433 | int nmap) | 1433 | int nmap) |
1434 | { | 1434 | { |
1435 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1435 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1436 | return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; | 1436 | return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; |
1437 | } /* ecore_x_pointer_mapping_get */ | 1437 | } |
1438 | 1438 | ||
1439 | EAPI Eina_Bool | 1439 | EAPI Eina_Bool |
1440 | ecore_x_pointer_grab(Ecore_X_Window win) | 1440 | ecore_x_pointer_grab(Ecore_X_Window win) |
@@ -1448,7 +1448,7 @@ ecore_x_pointer_grab(Ecore_X_Window win) | |||
1448 | return EINA_TRUE; | 1448 | return EINA_TRUE; |
1449 | 1449 | ||
1450 | return EINA_FALSE; | 1450 | return EINA_FALSE; |
1451 | } /* ecore_x_pointer_grab */ | 1451 | } |
1452 | 1452 | ||
1453 | EAPI Eina_Bool | 1453 | EAPI Eina_Bool |
1454 | ecore_x_pointer_confine_grab(Ecore_X_Window win) | 1454 | ecore_x_pointer_confine_grab(Ecore_X_Window win) |
@@ -1462,23 +1462,23 @@ ecore_x_pointer_confine_grab(Ecore_X_Window win) | |||
1462 | return EINA_TRUE; | 1462 | return EINA_TRUE; |
1463 | 1463 | ||
1464 | return EINA_FALSE; | 1464 | return EINA_FALSE; |
1465 | } /* ecore_x_pointer_confine_grab */ | 1465 | } |
1466 | 1466 | ||
1467 | EAPI void | 1467 | EAPI void |
1468 | ecore_x_pointer_ungrab(void) | 1468 | ecore_x_pointer_ungrab(void) |
1469 | { | 1469 | { |
1470 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1470 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1471 | XUngrabPointer(_ecore_x_disp, CurrentTime); | 1471 | XUngrabPointer(_ecore_x_disp, CurrentTime); |
1472 | } /* ecore_x_pointer_ungrab */ | 1472 | } |
1473 | 1473 | ||
1474 | EAPI Eina_Bool | 1474 | EAPI Eina_Bool |
1475 | ecore_x_pointer_warp(Ecore_X_Window win, | 1475 | ecore_x_pointer_warp(Ecore_X_Window win, |
1476 | int x, | 1476 | int x, |
1477 | int y) | 1477 | int y) |
1478 | { | 1478 | { |
1479 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1479 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1480 | return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE; | 1480 | return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE; |
1481 | } /* ecore_x_pointer_warp */ | 1481 | } |
1482 | 1482 | ||
1483 | EAPI Eina_Bool | 1483 | EAPI Eina_Bool |
1484 | ecore_x_keyboard_grab(Ecore_X_Window win) | 1484 | ecore_x_keyboard_grab(Ecore_X_Window win) |
@@ -1490,14 +1490,14 @@ ecore_x_keyboard_grab(Ecore_X_Window win) | |||
1490 | return EINA_TRUE; | 1490 | return EINA_TRUE; |
1491 | 1491 | ||
1492 | return EINA_FALSE; | 1492 | return EINA_FALSE; |
1493 | } /* ecore_x_keyboard_grab */ | 1493 | } |
1494 | 1494 | ||
1495 | EAPI void | 1495 | EAPI void |
1496 | ecore_x_keyboard_ungrab(void) | 1496 | ecore_x_keyboard_ungrab(void) |
1497 | { | 1497 | { |
1498 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1498 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1499 | XUngrabKeyboard(_ecore_x_disp, CurrentTime); | 1499 | XUngrabKeyboard(_ecore_x_disp, CurrentTime); |
1500 | } /* ecore_x_keyboard_ungrab */ | 1500 | } |
1501 | 1501 | ||
1502 | EAPI void | 1502 | EAPI void |
1503 | ecore_x_grab(void) | 1503 | ecore_x_grab(void) |
@@ -1506,7 +1506,7 @@ ecore_x_grab(void) | |||
1506 | _ecore_x_grab_count++; | 1506 | _ecore_x_grab_count++; |
1507 | if (_ecore_x_grab_count == 1) | 1507 | if (_ecore_x_grab_count == 1) |
1508 | XGrabServer(_ecore_x_disp); | 1508 | XGrabServer(_ecore_x_disp); |
1509 | } /* ecore_x_grab */ | 1509 | } |
1510 | 1510 | ||
1511 | EAPI void | 1511 | EAPI void |
1512 | ecore_x_ungrab(void) | 1512 | ecore_x_ungrab(void) |
@@ -1518,32 +1518,32 @@ ecore_x_ungrab(void) | |||
1518 | 1518 | ||
1519 | if (_ecore_x_grab_count == 0) | 1519 | if (_ecore_x_grab_count == 0) |
1520 | XUngrabServer(_ecore_x_disp); | 1520 | XUngrabServer(_ecore_x_disp); |
1521 | } /* ecore_x_ungrab */ | 1521 | } |
1522 | 1522 | ||
1523 | int _ecore_window_grabs_num = 0; | 1523 | int _ecore_window_grabs_num = 0; |
1524 | Window *_ecore_window_grabs = NULL; | 1524 | Window *_ecore_window_grabs = NULL; |
1525 | Eina_Bool (*_ecore_window_grab_replay_func)(void *data, | 1525 | Eina_Bool (*_ecore_window_grab_replay_func)(void *data, |
1526 | int event_type, | 1526 | int event_type, |
1527 | void *event); | 1527 | void *event); |
1528 | void *_ecore_window_grab_replay_data; | 1528 | void *_ecore_window_grab_replay_data; |
1529 | 1529 | ||
1530 | EAPI void | 1530 | EAPI void |
1531 | ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data, | 1531 | ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data, |
1532 | int event_type, | 1532 | int event_type, |
1533 | void *event), | 1533 | void *event), |
1534 | void *data) | 1534 | void *data) |
1535 | { | 1535 | { |
1536 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1536 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1537 | _ecore_window_grab_replay_func = func; | 1537 | _ecore_window_grab_replay_func = func; |
1538 | _ecore_window_grab_replay_data = data; | 1538 | _ecore_window_grab_replay_data = data; |
1539 | } /* ecore_x_passive_grab_replay_func_set */ | 1539 | } |
1540 | 1540 | ||
1541 | EAPI void | 1541 | EAPI void |
1542 | ecore_x_window_button_grab(Ecore_X_Window win, | 1542 | ecore_x_window_button_grab(Ecore_X_Window win, |
1543 | int button, | 1543 | int button, |
1544 | Ecore_X_Event_Mask event_mask, | 1544 | Ecore_X_Event_Mask event_mask, |
1545 | int mod, | 1545 | int mod, |
1546 | int any_mod) | 1546 | int any_mod) |
1547 | { | 1547 | { |
1548 | unsigned int b; | 1548 | unsigned int b; |
1549 | unsigned int m; | 1549 | unsigned int m; |
@@ -1578,10 +1578,10 @@ ecore_x_window_button_grab(Ecore_X_Window win, | |||
1578 | if (!t) return; | 1578 | if (!t) return; |
1579 | _ecore_window_grabs = t; | 1579 | _ecore_window_grabs = t; |
1580 | _ecore_window_grabs[_ecore_window_grabs_num - 1] = win; | 1580 | _ecore_window_grabs[_ecore_window_grabs_num - 1] = win; |
1581 | } /* ecore_x_window_button_grab */ | 1581 | } |
1582 | 1582 | ||
1583 | void | 1583 | void |
1584 | _ecore_x_sync_magic_send(int val, | 1584 | _ecore_x_sync_magic_send(int val, |
1585 | Ecore_X_Window swin) | 1585 | Ecore_X_Window swin) |
1586 | { | 1586 | { |
1587 | XEvent xev; | 1587 | XEvent xev; |
@@ -1597,7 +1597,7 @@ _ecore_x_sync_magic_send(int val, | |||
1597 | xev.xclient.data.l[1] = 0x10000000 + val; | 1597 | xev.xclient.data.l[1] = 0x10000000 + val; |
1598 | xev.xclient.data.l[2] = swin; | 1598 | xev.xclient.data.l[2] = swin; |
1599 | XSendEvent(_ecore_x_disp, _ecore_x_private_win, False, NoEventMask, &xev); | 1599 | XSendEvent(_ecore_x_disp, _ecore_x_private_win, False, NoEventMask, &xev); |
1600 | } /* _ecore_x_sync_magic_send */ | 1600 | } |
1601 | 1601 | ||
1602 | void | 1602 | void |
1603 | _ecore_x_window_grab_remove(Ecore_X_Window win) | 1603 | _ecore_x_window_grab_remove(Ecore_X_Window win) |
@@ -1631,13 +1631,13 @@ _ecore_x_window_grab_remove(Ecore_X_Window win) | |||
1631 | _ecore_window_grabs = t; | 1631 | _ecore_window_grabs = t; |
1632 | } | 1632 | } |
1633 | } | 1633 | } |
1634 | } /* _ecore_x_window_grab_remove */ | 1634 | } |
1635 | 1635 | ||
1636 | EAPI void | 1636 | EAPI void |
1637 | ecore_x_window_button_ungrab(Ecore_X_Window win, | 1637 | ecore_x_window_button_ungrab(Ecore_X_Window win, |
1638 | int button, | 1638 | int button, |
1639 | int mod, | 1639 | int mod, |
1640 | int any_mod) | 1640 | int any_mod) |
1641 | { | 1641 | { |
1642 | unsigned int b; | 1642 | unsigned int b; |
1643 | unsigned int m; | 1643 | unsigned int m; |
@@ -1664,16 +1664,16 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, | |||
1664 | for (i = 0; i < 8; i++) | 1664 | for (i = 0; i < 8; i++) |
1665 | XUngrabButton(_ecore_x_disp, b, m | locks[i], win); | 1665 | XUngrabButton(_ecore_x_disp, b, m | locks[i], win); |
1666 | _ecore_x_sync_magic_send(1, win); | 1666 | _ecore_x_sync_magic_send(1, win); |
1667 | } /* ecore_x_window_button_ungrab */ | 1667 | } |
1668 | 1668 | ||
1669 | int _ecore_key_grabs_num = 0; | 1669 | int _ecore_key_grabs_num = 0; |
1670 | Window *_ecore_key_grabs = NULL; | 1670 | Window *_ecore_key_grabs = NULL; |
1671 | 1671 | ||
1672 | EAPI void | 1672 | EAPI void |
1673 | ecore_x_window_key_grab(Ecore_X_Window win, | 1673 | ecore_x_window_key_grab(Ecore_X_Window win, |
1674 | const char *key, | 1674 | const char *key, |
1675 | int mod, | 1675 | int mod, |
1676 | int any_mod) | 1676 | int any_mod) |
1677 | { | 1677 | { |
1678 | KeyCode keycode = 0; | 1678 | KeyCode keycode = 0; |
1679 | KeySym keysym; | 1679 | KeySym keysym; |
@@ -1718,7 +1718,7 @@ ecore_x_window_key_grab(Ecore_X_Window win, | |||
1718 | if (!t) return; | 1718 | if (!t) return; |
1719 | _ecore_key_grabs = t; | 1719 | _ecore_key_grabs = t; |
1720 | _ecore_key_grabs[_ecore_key_grabs_num - 1] = win; | 1720 | _ecore_key_grabs[_ecore_key_grabs_num - 1] = win; |
1721 | } /* ecore_x_window_key_grab */ | 1721 | } |
1722 | 1722 | ||
1723 | void | 1723 | void |
1724 | _ecore_x_key_grab_remove(Ecore_X_Window win) | 1724 | _ecore_x_key_grab_remove(Ecore_X_Window win) |
@@ -1751,13 +1751,13 @@ _ecore_x_key_grab_remove(Ecore_X_Window win) | |||
1751 | _ecore_key_grabs = t; | 1751 | _ecore_key_grabs = t; |
1752 | } | 1752 | } |
1753 | } | 1753 | } |
1754 | } /* _ecore_x_key_grab_remove */ | 1754 | } |
1755 | 1755 | ||
1756 | EAPI void | 1756 | EAPI void |
1757 | ecore_x_window_key_ungrab(Ecore_X_Window win, | 1757 | ecore_x_window_key_ungrab(Ecore_X_Window win, |
1758 | const char *key, | 1758 | const char *key, |
1759 | int mod, | 1759 | int mod, |
1760 | int any_mod) | 1760 | int any_mod) |
1761 | { | 1761 | { |
1762 | KeyCode keycode = 0; | 1762 | KeyCode keycode = 0; |
1763 | KeySym keysym; | 1763 | KeySym keysym; |
@@ -1795,7 +1795,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, | |||
1795 | for (i = 0; i < 8; i++) | 1795 | for (i = 0; i < 8; i++) |
1796 | XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win); | 1796 | XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win); |
1797 | _ecore_x_sync_magic_send(2, win); | 1797 | _ecore_x_sync_magic_send(2, win); |
1798 | } /* ecore_x_window_key_ungrab */ | 1798 | } |
1799 | 1799 | ||
1800 | /** | 1800 | /** |
1801 | * Send client message with given type and format 32. | 1801 | * Send client message with given type and format 32. |
@@ -1811,14 +1811,14 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, | |||
1811 | * @return EINA_TRUE on success EINA_FALSE otherwise. | 1811 | * @return EINA_TRUE on success EINA_FALSE otherwise. |
1812 | */ | 1812 | */ |
1813 | EAPI Eina_Bool | 1813 | EAPI Eina_Bool |
1814 | ecore_x_client_message32_send(Ecore_X_Window win, | 1814 | ecore_x_client_message32_send(Ecore_X_Window win, |
1815 | Ecore_X_Atom type, | 1815 | Ecore_X_Atom type, |
1816 | Ecore_X_Event_Mask mask, | 1816 | Ecore_X_Event_Mask mask, |
1817 | long d0, | 1817 | long d0, |
1818 | long d1, | 1818 | long d1, |
1819 | long d2, | 1819 | long d2, |
1820 | long d3, | 1820 | long d3, |
1821 | long d4) | 1821 | long d4) |
1822 | { | 1822 | { |
1823 | XEvent xev; | 1823 | XEvent xev; |
1824 | 1824 | ||
@@ -1834,7 +1834,7 @@ ecore_x_client_message32_send(Ecore_X_Window win, | |||
1834 | xev.xclient.data.l[4] = d4; | 1834 | xev.xclient.data.l[4] = d4; |
1835 | 1835 | ||
1836 | return XSendEvent(_ecore_x_disp, win, False, mask, &xev) ? EINA_TRUE : EINA_FALSE; | 1836 | return XSendEvent(_ecore_x_disp, win, False, mask, &xev) ? EINA_TRUE : EINA_FALSE; |
1837 | } /* ecore_x_client_message32_send */ | 1837 | } |
1838 | 1838 | ||
1839 | /** | 1839 | /** |
1840 | * Send client message with given type and format 8. | 1840 | * Send client message with given type and format 8. |
@@ -1848,9 +1848,9 @@ ecore_x_client_message32_send(Ecore_X_Window win, | |||
1848 | */ | 1848 | */ |
1849 | EAPI Eina_Bool | 1849 | EAPI Eina_Bool |
1850 | ecore_x_client_message8_send(Ecore_X_Window win, | 1850 | ecore_x_client_message8_send(Ecore_X_Window win, |
1851 | Ecore_X_Atom type, | 1851 | Ecore_X_Atom type, |
1852 | const void *data, | 1852 | const void *data, |
1853 | int len) | 1853 | int len) |
1854 | { | 1854 | { |
1855 | XEvent xev; | 1855 | XEvent xev; |
1856 | 1856 | ||
@@ -1866,12 +1866,12 @@ ecore_x_client_message8_send(Ecore_X_Window win, | |||
1866 | memset(xev.xclient.data.b + len, 0, 20 - len); | 1866 | memset(xev.xclient.data.b + len, 0, 20 - len); |
1867 | 1867 | ||
1868 | return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev) ? EINA_TRUE : EINA_FALSE; | 1868 | return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev) ? EINA_TRUE : EINA_FALSE; |
1869 | } /* ecore_x_client_message8_send */ | 1869 | } |
1870 | 1870 | ||
1871 | EAPI Eina_Bool | 1871 | EAPI Eina_Bool |
1872 | ecore_x_mouse_move_send(Ecore_X_Window win, | 1872 | ecore_x_mouse_move_send(Ecore_X_Window win, |
1873 | int x, | 1873 | int x, |
1874 | int y) | 1874 | int y) |
1875 | { | 1875 | { |
1876 | XEvent xev; | 1876 | XEvent xev; |
1877 | XWindowAttributes att; | 1877 | XWindowAttributes att; |
@@ -1894,13 +1894,13 @@ ecore_x_mouse_move_send(Ecore_X_Window win, | |||
1894 | xev.xmotion.is_hint = 0; | 1894 | xev.xmotion.is_hint = 0; |
1895 | xev.xmotion.same_screen = 1; | 1895 | xev.xmotion.same_screen = 1; |
1896 | return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev) ? EINA_TRUE : EINA_FALSE; | 1896 | return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev) ? EINA_TRUE : EINA_FALSE; |
1897 | } /* ecore_x_mouse_move_send */ | 1897 | } |
1898 | 1898 | ||
1899 | EAPI Eina_Bool | 1899 | EAPI Eina_Bool |
1900 | ecore_x_mouse_down_send(Ecore_X_Window win, | 1900 | ecore_x_mouse_down_send(Ecore_X_Window win, |
1901 | int x, | 1901 | int x, |
1902 | int y, | 1902 | int y, |
1903 | int b) | 1903 | int b) |
1904 | { | 1904 | { |
1905 | XEvent xev; | 1905 | XEvent xev; |
1906 | XWindowAttributes att; | 1906 | XWindowAttributes att; |
@@ -1923,13 +1923,13 @@ ecore_x_mouse_down_send(Ecore_X_Window win, | |||
1923 | xev.xbutton.button = b; | 1923 | xev.xbutton.button = b; |
1924 | xev.xbutton.same_screen = 1; | 1924 | xev.xbutton.same_screen = 1; |
1925 | return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev) ? EINA_TRUE : EINA_FALSE; | 1925 | return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev) ? EINA_TRUE : EINA_FALSE; |
1926 | } /* ecore_x_mouse_down_send */ | 1926 | } |
1927 | 1927 | ||
1928 | EAPI Eina_Bool | 1928 | EAPI Eina_Bool |
1929 | ecore_x_mouse_up_send(Ecore_X_Window win, | 1929 | ecore_x_mouse_up_send(Ecore_X_Window win, |
1930 | int x, | 1930 | int x, |
1931 | int y, | 1931 | int y, |
1932 | int b) | 1932 | int b) |
1933 | { | 1933 | { |
1934 | XEvent xev; | 1934 | XEvent xev; |
1935 | XWindowAttributes att; | 1935 | XWindowAttributes att; |
@@ -1952,21 +1952,21 @@ ecore_x_mouse_up_send(Ecore_X_Window win, | |||
1952 | xev.xbutton.button = b; | 1952 | xev.xbutton.button = b; |
1953 | xev.xbutton.same_screen = 1; | 1953 | xev.xbutton.same_screen = 1; |
1954 | return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE; | 1954 | return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE; |
1955 | } /* ecore_x_mouse_up_send */ | 1955 | } |
1956 | 1956 | ||
1957 | EAPI void | 1957 | EAPI void |
1958 | ecore_x_focus_reset(void) | 1958 | ecore_x_focus_reset(void) |
1959 | { | 1959 | { |
1960 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1960 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1961 | XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime); | 1961 | XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime); |
1962 | } /* ecore_x_focus_reset */ | 1962 | } |
1963 | 1963 | ||
1964 | EAPI void | 1964 | EAPI void |
1965 | ecore_x_events_allow_all(void) | 1965 | ecore_x_events_allow_all(void) |
1966 | { | 1966 | { |
1967 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 1967 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
1968 | XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime); | 1968 | XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime); |
1969 | } /* ecore_x_events_allow_all */ | 1969 | } |
1970 | 1970 | ||
1971 | EAPI void | 1971 | EAPI void |
1972 | ecore_x_pointer_last_xy_get(int *x, | 1972 | ecore_x_pointer_last_xy_get(int *x, |
@@ -1977,12 +1977,12 @@ ecore_x_pointer_last_xy_get(int *x, | |||
1977 | 1977 | ||
1978 | if (y) | 1978 | if (y) |
1979 | *y = _ecore_x_event_last_root_y; | 1979 | *y = _ecore_x_event_last_root_y; |
1980 | } /* ecore_x_pointer_last_xy_get */ | 1980 | } |
1981 | 1981 | ||
1982 | EAPI void | 1982 | EAPI void |
1983 | ecore_x_pointer_xy_get(Ecore_X_Window win, | 1983 | ecore_x_pointer_xy_get(Ecore_X_Window win, |
1984 | int *x, | 1984 | int *x, |
1985 | int *y) | 1985 | int *y) |
1986 | { | 1986 | { |
1987 | Window rwin, cwin; | 1987 | Window rwin, cwin; |
1988 | int rx, ry, wx, wy, ret; | 1988 | int rx, ry, wx, wy, ret; |
@@ -1996,7 +1996,7 @@ ecore_x_pointer_xy_get(Ecore_X_Window win, | |||
1996 | 1996 | ||
1997 | if (x) *x = wx; | 1997 | if (x) *x = wx; |
1998 | if (y) *y = wy; | 1998 | if (y) *y = wy; |
1999 | } /* ecore_x_pointer_xy_get */ | 1999 | } |
2000 | 2000 | ||
2001 | /** | 2001 | /** |
2002 | * Retrieve the Visual ID from a given Visual. | 2002 | * Retrieve the Visual ID from a given Visual. |
@@ -2023,7 +2023,7 @@ ecore_x_visual_id_get(Ecore_X_Visual visual) | |||
2023 | */ | 2023 | */ |
2024 | EAPI Ecore_X_Visual | 2024 | EAPI Ecore_X_Visual |
2025 | ecore_x_default_visual_get(Ecore_X_Display *disp, | 2025 | ecore_x_default_visual_get(Ecore_X_Display *disp, |
2026 | Ecore_X_Screen *screen) | 2026 | Ecore_X_Screen *screen) |
2027 | { | 2027 | { |
2028 | return DefaultVisual(disp, ecore_x_screen_index_get(screen)); | 2028 | return DefaultVisual(disp, ecore_x_screen_index_get(screen)); |
2029 | } | 2029 | } |
@@ -2039,7 +2039,7 @@ ecore_x_default_visual_get(Ecore_X_Display *disp, | |||
2039 | */ | 2039 | */ |
2040 | EAPI Ecore_X_Colormap | 2040 | EAPI Ecore_X_Colormap |
2041 | ecore_x_default_colormap_get(Ecore_X_Display *disp, | 2041 | ecore_x_default_colormap_get(Ecore_X_Display *disp, |
2042 | Ecore_X_Screen *screen) | 2042 | Ecore_X_Screen *screen) |
2043 | { | 2043 | { |
2044 | return DefaultColormap(disp, ecore_x_screen_index_get(screen)); | 2044 | return DefaultColormap(disp, ecore_x_screen_index_get(screen)); |
2045 | } | 2045 | } |
@@ -2055,7 +2055,7 @@ ecore_x_default_colormap_get(Ecore_X_Display *disp, | |||
2055 | */ | 2055 | */ |
2056 | EAPI int | 2056 | EAPI int |
2057 | ecore_x_default_depth_get(Ecore_X_Display *disp, | 2057 | ecore_x_default_depth_get(Ecore_X_Display *disp, |
2058 | Ecore_X_Screen *screen) | 2058 | Ecore_X_Screen *screen) |
2059 | { | 2059 | { |
2060 | return DefaultDepth(disp, ecore_x_screen_index_get(screen)); | 2060 | return DefaultDepth(disp, ecore_x_screen_index_get(screen)); |
2061 | } | 2061 | } |
@@ -2094,5 +2094,5 @@ _ecore_x_event_modifier(unsigned int state) | |||
2094 | xmodifiers |= ECORE_X_LOCK_SHIFT; | 2094 | xmodifiers |= ECORE_X_LOCK_SHIFT; |
2095 | 2095 | ||
2096 | return xmodifiers; | 2096 | return xmodifiers; |
2097 | } /* _ecore_x_event_modifier */ | 2097 | } |
2098 | 2098 | ||