summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-24 16:07:36 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-24 16:18:51 -0500
commita524ab1fe3c20f194d1df5d8f6603593cf5872e3 (patch)
tree19157e593d61141f6d41ad1aeea17054b9a88389 /src/lib/ecore_x
parentb28d6ac5e6fd03de9468c7ade293d7f4b7468168 (diff)
ecore-x: add some useful xkb function wrappers
@feature
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/Ecore_X.h2
-rw-r--r--src/lib/ecore_x/ecore_x.c36
2 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index b095555..cb55dfa 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -2729,6 +2729,8 @@ EAPI Ecore_X_Illume_Window_State ecore_x_e_illume_window_state_get(Eco
2729EAPI void ecore_x_e_illume_window_state_send(Ecore_X_Window win, Ecore_X_Illume_Window_State state); /**< @since 1.9 */ 2729EAPI void ecore_x_e_illume_window_state_send(Ecore_X_Window win, Ecore_X_Illume_Window_State state); /**< @since 1.9 */
2730 2730
2731EAPI void ecore_x_xkb_select_group(int group); /* @since 1.7 */ 2731EAPI void ecore_x_xkb_select_group(int group); /* @since 1.7 */
2732EAPI Eina_Bool ecore_x_xkb_track_state(void); /** @since 1.21 */
2733EAPI Eina_Bool ecore_x_xkb_state_get(Ecore_X_Xkb_State *state); /** @since 1.21 */
2732 2734
2733EAPI void ecore_x_e_window_rotation_supported_set(Ecore_X_Window root, Eina_Bool enabled); /**< @since 1.9 */ 2735EAPI void ecore_x_e_window_rotation_supported_set(Ecore_X_Window root, Eina_Bool enabled); /**< @since 1.9 */
2734EAPI Eina_Bool ecore_x_e_window_rotation_supported_get(Ecore_X_Window root); /**< @since 1.9 */ 2736EAPI Eina_Bool ecore_x_e_window_rotation_supported_get(Ecore_X_Window root); /**< @since 1.9 */
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 81eae65..bab8a41 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -2536,6 +2536,42 @@ ecore_x_xkb_select_group(int group)
2536#endif 2536#endif
2537} 2537}
2538 2538
2539EAPI Eina_Bool
2540ecore_x_xkb_track_state(void)
2541{
2542 Eina_Bool ret = EINA_FALSE;
2543#ifdef ECORE_XKB
2544 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
2545 ret = XkbSelectEvents(_ecore_x_disp, XkbUseCoreKbd, XkbStateNotifyMask, XkbStateNotifyMask);
2546 if (_ecore_xlib_sync) ecore_x_sync();
2547#endif
2548 return ret;
2549}
2550
2551EAPI Eina_Bool
2552ecore_x_xkb_state_get(Ecore_X_Xkb_State *state)
2553{
2554 Eina_Bool ret = EINA_FALSE;
2555#ifdef ECORE_XKB
2556 XkbStateRec xkbstate;
2557
2558 EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
2559 ret = XkbGetState(_ecore_x_disp, XkbUseCoreKbd, &xkbstate);
2560 if (!ret) return ret;
2561
2562 state->group = xkbstate.group;
2563 state->base_group = xkbstate.base_group;
2564 state->latched_group = xkbstate.latched_group;
2565 state->locked_group = xkbstate.locked_group;
2566
2567 state->mods = xkbstate.mods;
2568 state->base_mods = xkbstate.base_mods;
2569 state->latched_mods = xkbstate.latched_mods;
2570 state->locked_mods = xkbstate.locked_mods;
2571#endif
2572 return ret;
2573}
2574
2539/*****************************************************************************/ 2575/*****************************************************************************/
2540/*****************************************************************************/ 2576/*****************************************************************************/
2541/*****************************************************************************/ 2577/*****************************************************************************/