ecore-x: add some useful xkb function wrappers

@feature
This commit is contained in:
Mike Blumenkrantz 2018-01-24 16:07:36 -05:00
parent b28d6ac5e6
commit a524ab1fe3
2 changed files with 38 additions and 0 deletions

View File

@ -2729,6 +2729,8 @@ EAPI Ecore_X_Illume_Window_State ecore_x_e_illume_window_state_get(Eco
EAPI void ecore_x_e_illume_window_state_send(Ecore_X_Window win, Ecore_X_Illume_Window_State state); /**< @since 1.9 */
EAPI void ecore_x_xkb_select_group(int group); /* @since 1.7 */
EAPI Eina_Bool ecore_x_xkb_track_state(void); /** @since 1.21 */
EAPI Eina_Bool ecore_x_xkb_state_get(Ecore_X_Xkb_State *state); /** @since 1.21 */
EAPI void ecore_x_e_window_rotation_supported_set(Ecore_X_Window root, Eina_Bool enabled); /**< @since 1.9 */
EAPI Eina_Bool ecore_x_e_window_rotation_supported_get(Ecore_X_Window root); /**< @since 1.9 */

View File

@ -2536,6 +2536,42 @@ ecore_x_xkb_select_group(int group)
#endif
}
EAPI Eina_Bool
ecore_x_xkb_track_state(void)
{
Eina_Bool ret = EINA_FALSE;
#ifdef ECORE_XKB
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
ret = XkbSelectEvents(_ecore_x_disp, XkbUseCoreKbd, XkbStateNotifyMask, XkbStateNotifyMask);
if (_ecore_xlib_sync) ecore_x_sync();
#endif
return ret;
}
EAPI Eina_Bool
ecore_x_xkb_state_get(Ecore_X_Xkb_State *state)
{
Eina_Bool ret = EINA_FALSE;
#ifdef ECORE_XKB
XkbStateRec xkbstate;
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
ret = XkbGetState(_ecore_x_disp, XkbUseCoreKbd, &xkbstate);
if (!ret) return ret;
state->group = xkbstate.group;
state->base_group = xkbstate.base_group;
state->latched_group = xkbstate.latched_group;
state->locked_group = xkbstate.locked_group;
state->mods = xkbstate.mods;
state->base_mods = xkbstate.base_mods;
state->latched_mods = xkbstate.latched_mods;
state->locked_mods = xkbstate.locked_mods;
#endif
return ret;
}
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/