evdev: Add API to set the xkb layout index

https://bugzilla.gnome.org/show_bug.cgi?id=733202
This commit is contained in:
Rui Matos 2014-07-06 17:43:14 +02:00 committed by Emmanuele Bassi
parent 72aaeed3f5
commit f95493e7bf
2 changed files with 36 additions and 0 deletions

View File

@ -1846,6 +1846,38 @@ clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev)
return xkb_state_get_keymap (manager_evdev->priv->main_seat->xkb); return xkb_state_get_keymap (manager_evdev->priv->main_seat->xkb);
} }
/**
* clutter_evdev_set_keyboard_layout_index: (skip)
* @evdev: the #ClutterDeviceManager created by the evdev backend
* @idx: the xkb layout index to set
*
* Sets the xkb layout index on the backend's #xkb_state .
*
* Since: 1.20
* Stability: unstable
*/
void
clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
xkb_layout_index_t idx)
{
ClutterDeviceManagerEvdev *manager_evdev;
xkb_mod_mask_t depressed_mods;
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
struct xkb_state *state;
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev), NULL);
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
state = manager_evdev->priv->main_seat->xkb;
depressed_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_DEPRESSED);
latched_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LATCHED);
locked_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED);
xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx);
}
/** /**
* clutter_evdev_set_pointer_constrain_callback: * clutter_evdev_set_pointer_constrain_callback:
* @evdev: the #ClutterDeviceManager created by the evdev backend * @evdev: the #ClutterDeviceManager created by the evdev backend

View File

@ -97,6 +97,10 @@ void clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev
CLUTTER_AVAILABLE_IN_1_18 CLUTTER_AVAILABLE_IN_1_18
struct xkb_keymap * clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev); struct xkb_keymap * clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev);
CLUTTER_AVAILABLE_IN_1_20
void clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
xkb_layout_index_t idx);
CLUTTER_AVAILABLE_IN_1_18 CLUTTER_AVAILABLE_IN_1_18
void clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev, void clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
gboolean repeat, gboolean repeat,