summaryrefslogtreecommitdiff
path: root/legacy/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-18 11:29:47 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-18 11:29:47 +0000
commit4e17d57b06096618922964ef2584b834d267e15b (patch)
tree4765c352c8d0ae6bf8e207b6e3fe47091f4935dc /legacy/ecore
parent5daa1a432a7a5df73aaa5337a7721d5a904848de (diff)
I know this is a new feature. i know i know. doing this because
otherwise we weill need another efl release for e17 to get out. modified patch from: http://trac.enlightenment.org/e/ticket/1306 SVN revision: 75409
Diffstat (limited to 'legacy/ecore')
-rw-r--r--legacy/ecore/src/lib/ecore_x/Ecore_X.h12
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c6
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c4
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c40
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c21
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h3
6 files changed, 78 insertions, 8 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
index df8a2035a8..a6bc9740de 100644
--- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h
+++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h
@@ -1045,6 +1045,8 @@ EAPI extern int ECORE_X_EVENT_DESKTOP_CHANGE;
1045EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW; 1045EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW;
1046EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE; 1046EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE;
1047EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE; 1047EAPI extern int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE;
1048EAPI extern int ECORE_X_EVENT_XKB_STATE_NOTIFY; /** @since 1.7 */
1049EAPI extern int ECORE_X_EVENT_XKB_NEWKBD_NOTIFY; /** @since 1.7 */
1048 1050
1049EAPI extern int ECORE_X_EVENT_GENERIC; 1051EAPI extern int ECORE_X_EVENT_GENERIC;
1050 1052
@@ -2169,6 +2171,12 @@ struct _Ecore_X_Event_Damage
2169 2171
2170typedef struct _Ecore_X_Event_Damage Ecore_X_Event_Damage; 2172typedef struct _Ecore_X_Event_Damage Ecore_X_Event_Damage;
2171 2173
2174struct _Ecore_X_Event_Xkb
2175{
2176 int group;
2177};
2178typedef struct _Ecore_X_Event_Xkb Ecore_X_Event_Xkb; /** @since 1.7 */
2179
2172EAPI Eina_Bool ecore_x_damage_query(void); 2180EAPI Eina_Bool ecore_x_damage_query(void);
2173EAPI Ecore_X_Damage ecore_x_damage_new(Ecore_X_Drawable d, Ecore_X_Damage_Report_Level level); 2181EAPI Ecore_X_Damage ecore_x_damage_new(Ecore_X_Drawable d, Ecore_X_Damage_Report_Level level);
2174EAPI void ecore_x_damage_free(Ecore_X_Damage damage); 2182EAPI void ecore_x_damage_free(Ecore_X_Damage damage);
@@ -2375,8 +2383,8 @@ EAPI void
2375ecore_x_e_illume_window_state_set(Ecore_X_Window win, 2383ecore_x_e_illume_window_state_set(Ecore_X_Window win,
2376 Ecore_X_Illume_Window_State state); 2384 Ecore_X_Illume_Window_State state);
2377 2385
2378EAPI Ecore_X_Illume_Window_State 2386EAPI Ecore_X_Illume_Window_State ecore_x_e_illume_window_state_get(Ecore_X_Window win);
2379ecore_x_e_illume_window_state_get(Ecore_X_Window win); 2387EAPI void ecore_x_xkb_select_group(int group); /* @since 1.7 */
2380 2388
2381#ifdef __cplusplus 2389#ifdef __cplusplus
2382} 2390}
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c
index 9d8910d3e5..92a5bad8a3 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c
@@ -1404,6 +1404,12 @@ ecore_x_default_depth_get(Ecore_X_Display *disp __UNUSED__, Ecore_X_Screen *scre
1404 return s->root_depth; 1404 return s->root_depth;
1405} 1405}
1406 1406
1407API void
1408ecore_x_xkb_select_group(int group)
1409{
1410 // XXX: implement me */
1411}
1412
1407/** 1413/**
1408 * Sets the timeout for a double and triple clicks to be flagged. 1414 * Sets the timeout for a double and triple clicks to be flagged.
1409 * 1415 *
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
index 272071f6b2..46fc2b0313 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c
@@ -180,6 +180,8 @@ EAPI int ECORE_X_EVENT_DESKTOP_CHANGE = 0;
180EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = 0; 180EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = 0;
181EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = 0; 181EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = 0;
182EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = 0; 182EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = 0;
183EAPI int ECORE_X_EVENT_XKB_STATE_NOTIFY = 0;
184EAPI int ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = 0;
183EAPI int ECORE_X_EVENT_GENERIC = 0; 185EAPI int ECORE_X_EVENT_GENERIC = 0;
184 186
185void 187void
@@ -243,6 +245,8 @@ _ecore_xcb_events_init(void)
243 ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = ecore_event_type_new(); 245 ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = ecore_event_type_new();
244 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new(); 246 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new();
245 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new(); 247 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new();
248 ECORE_X_EVENT_XKB_STATE_NOTIFY = ecore_event_type_new();
249 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new();
246 ECORE_X_EVENT_GENERIC = ecore_event_type_new(); 250 ECORE_X_EVENT_GENERIC = ecore_event_type_new();
247 } 251 }
248} 252}
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
index ce3cd57438..294747b728 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
@@ -50,6 +50,9 @@ static int _ecore_x_event_damage_id = 0;
50#ifdef ECORE_XGESTURE 50#ifdef ECORE_XGESTURE
51static int _ecore_x_event_gesture_id = 0; 51static int _ecore_x_event_gesture_id = 0;
52#endif /* ifdef ECORE_XGESTURE */ 52#endif /* ifdef ECORE_XGESTURE */
53#ifdef ECORE_XKB
54static int _ecore_x_event_xkb_id = 0;
55#endif /* ifdef ECORE_XKB */
53static int _ecore_x_event_handlers_num = 0; 56static int _ecore_x_event_handlers_num = 0;
54static void (**_ecore_x_event_handlers) (XEvent * event) = NULL; 57static void (**_ecore_x_event_handlers) (XEvent * event) = NULL;
55 58
@@ -124,6 +127,10 @@ EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = 0;
124EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = 0; 127EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = 0;
125EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = 0; 128EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = 0;
126 129
130EAPI int ECORE_X_EVENT_XKB_STATE_NOTIFY = 0;
131EAPI int ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = 0;
132
133
127EAPI int ECORE_X_EVENT_GENERIC = 0; 134EAPI int ECORE_X_EVENT_GENERIC = 0;
128 135
129EAPI int ECORE_X_MODIFIER_SHIFT = 0; 136EAPI int ECORE_X_MODIFIER_SHIFT = 0;
@@ -299,7 +306,9 @@ ecore_x_init(const char *name)
299 int gesture_base = 0; 306 int gesture_base = 0;
300 int gesture_err_base = 0; 307 int gesture_err_base = 0;
301#endif /* ifdef ECORE_XGESTURE */ 308#endif /* ifdef ECORE_XGESTURE */
302 309#ifdef ECORE_XKB
310 int xkb_base = 0;
311#endif /* ifdef ECORE_XKB */
303 if (++_ecore_x_init_count != 1) 312 if (++_ecore_x_init_count != 1)
304 return _ecore_x_init_count; 313 return _ecore_x_init_count;
305 314
@@ -390,6 +399,18 @@ ecore_x_init(const char *name)
390 399
391 ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents); 400 ECORE_X_EVENT_HANDLERS_GROW(gesture_base, GestureNumberEvents);
392#endif /* ifdef ECORE_XGESTURE */ 401#endif /* ifdef ECORE_XGESTURE */
402#ifdef ECORE_XKB
403 {
404 int dummy;
405
406 if (XkbQueryExtension(_ecore_x_disp, &dummy, &xkb_base,
407 &dummy, &dummy, &dummy))
408 _ecore_x_event_xkb_id = xkb_base;
409 XkbSelectEventDetails(_ecore_x_disp, XkbUseCoreKbd, XkbStateNotify,
410 XkbAllStateComponentsMask, XkbGroupStateMask);
411 }
412 ECORE_X_EVENT_HANDLERS_GROW(xkb_base, XkbNumberEvents);
413#endif
393 414
394 _ecore_x_event_handlers = calloc(_ecore_x_event_handlers_num, sizeof(void *)); 415 _ecore_x_event_handlers = calloc(_ecore_x_event_handlers_num, sizeof(void *));
395 if (!_ecore_x_event_handlers) 416 if (!_ecore_x_event_handlers)
@@ -502,7 +523,9 @@ ecore_x_init(const char *name)
502 Bool works = 0; 523 Bool works = 0;
503 XkbSetDetectableAutoRepeat(_ecore_x_disp, 1, &works); 524 XkbSetDetectableAutoRepeat(_ecore_x_disp, 1, &works);
504 } 525 }
505 while (0); 526 while (0);
527 if (_ecore_x_event_xkb_id)
528 _ecore_x_event_handlers[_ecore_x_event_xkb_id] = _ecore_x_event_handle_xkb;
506#endif /* ifdef ECORE_XKB */ 529#endif /* ifdef ECORE_XKB */
507 530
508#ifdef ECORE_XGESTURE 531#ifdef ECORE_XGESTURE
@@ -585,6 +608,9 @@ ecore_x_init(const char *name)
585 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new(); 608 ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = ecore_event_type_new();
586 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new(); 609 ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = ecore_event_type_new();
587 610
611 ECORE_X_EVENT_XKB_STATE_NOTIFY = ecore_event_type_new();
612 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new();
613
588 ECORE_X_EVENT_GENERIC = ecore_event_type_new(); 614 ECORE_X_EVENT_GENERIC = ecore_event_type_new();
589 } 615 }
590 616
@@ -1016,14 +1042,12 @@ _ecore_x_fd_handler(void *data,
1016 XEvent ev; 1042 XEvent ev;
1017 1043
1018 XNextEvent(d, &ev); 1044 XNextEvent(d, &ev);
1019
1020#ifdef ENABLE_XIM 1045#ifdef ENABLE_XIM
1021 /* Filter event for XIM */ 1046 /* Filter event for XIM */
1022 if (XFilterEvent(&ev, ev.xkey.window)) 1047 if (XFilterEvent(&ev, ev.xkey.window))
1023 continue; 1048 continue;
1024 1049
1025#endif /* ifdef ENABLE_XIM */ 1050#endif /* ifdef ENABLE_XIM */
1026
1027 if ((ev.type >= 0) && (ev.type < _ecore_x_event_handlers_num)) 1051 if ((ev.type >= 0) && (ev.type < _ecore_x_event_handlers_num))
1028 { 1052 {
1029 if (_ecore_x_event_handlers[AnyXEvent]) 1053 if (_ecore_x_event_handlers[AnyXEvent])
@@ -2135,6 +2159,14 @@ ecore_x_default_depth_get(Ecore_X_Display *disp,
2135 return DefaultDepth(disp, ecore_x_screen_index_get(screen)); 2159 return DefaultDepth(disp, ecore_x_screen_index_get(screen));
2136} 2160}
2137 2161
2162EAPI void
2163ecore_x_xkb_select_group(int group)
2164{
2165#ifdef ECORE_XKB
2166 XkbLockGroup(_ecore_x_disp, XkbUseCoreKbd, group);
2167#endif
2168}
2169
2138/*****************************************************************************/ 2170/*****************************************************************************/
2139/*****************************************************************************/ 2171/*****************************************************************************/
2140/*****************************************************************************/ 2172/*****************************************************************************/
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
index 034a1f1553..797d8c92f8 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -2221,7 +2221,7 @@ _ecore_x_event_handle_fixes_selection_notify(XEvent *event)
2221void 2221void
2222_ecore_x_event_handle_damage_notify(XEvent *event) 2222_ecore_x_event_handle_damage_notify(XEvent *event)
2223{ 2223{
2224 XDamageNotifyEvent *damage_event; 2224 XDamageNotifyEvent *damage_event;
2225 Ecore_X_Event_Damage *e; 2225 Ecore_X_Event_Damage *e;
2226 2226
2227 _ecore_x_last_event_mouse_move = 0; 2227 _ecore_x_last_event_mouse_move = 0;
@@ -2496,4 +2496,21 @@ _ecore_x_event_handle_gesture_notify_group(XEvent *xevent)
2496} 2496}
2497 2497
2498#endif /* ifdef ECORE_XGESTURE */ 2498#endif /* ifdef ECORE_XGESTURE */
2499 2499#ifdef ECORE_XKB
2500void
2501_ecore_x_event_handle_xkb(XEvent *xevent)
2502{
2503 XkbEvent *xkbev;
2504 Ecore_X_Event_Xkb *e;
2505
2506 xkbev = (XkbEvent *) xevent;
2507 e = calloc(1, sizeof(Ecore_X_Event_Xkb));
2508 if (!e)
2509 return;
2510 e->group = xkbev->state.group;
2511 if (xkbev->any.xkb_type == XkbStateNotify)
2512 ecore_event_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, e, NULL, NULL);
2513 else if (xkbev->any.xkb_type == XkbNewKeyboardNotify)
2514 ecore_event_add(ECORE_X_EVENT_XKB_NEWKBD_NOTIFY, e, NULL, NULL);
2515}
2516#endif /* ifdef ECORE_XKB */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
index 4236932cfa..f962ffb4b2 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
@@ -258,6 +258,9 @@ void _ecore_x_event_handle_fixes_selection_notify(XEvent *xevent);
258#ifdef ECORE_XDAMAGE 258#ifdef ECORE_XDAMAGE
259void _ecore_x_event_handle_damage_notify(XEvent *xevent); 259void _ecore_x_event_handle_damage_notify(XEvent *xevent);
260#endif /* ifdef ECORE_XDAMAGE */ 260#endif /* ifdef ECORE_XDAMAGE */
261#ifdef ECORE_XKB
262void _ecore_x_event_handle_xkb(XEvent *xevent);
263#endif /* ifdef ECORE_XKB */
261void _ecore_x_event_handle_generic_event(XEvent *xevent); 264void _ecore_x_event_handle_generic_event(XEvent *xevent);
262 265
263void _ecore_x_selection_data_init(void); 266void _ecore_x_selection_data_init(void);