[clutter/clutter-1.18] evdev: Make the keymap available



commit d67b38f96086d8cec316784516154b3af4a449eb
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Jan 15 17:54:25 2014 +0100

    evdev: Make the keymap available
    
    Make the keymap available so that consumers don't have to duplicate it
    if they need it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725102

 clutter/evdev/clutter-device-manager-evdev.c |   20 ++++++++++++++++++++
 clutter/evdev/clutter-evdev.h                |    2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 53fc90b..266d08f 100644
--- a/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/evdev/clutter-device-manager-evdev.c
@@ -1514,6 +1514,26 @@ clutter_evdev_set_keyboard_map (ClutterDeviceManager *evdev,
 }
 
 /**
+ * clutter_evdev_get_keyboard_map: (skip)
+ * @evdev: the #ClutterDeviceManager created by the evdev backend
+ *
+ * Retrieves the #xkb_keymap in use by the evdev backend.
+ *
+ * Return value: the #xkb_keymap.
+ */
+struct xkb_keymap *
+clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev)
+{
+  ClutterDeviceManagerEvdev *manager_evdev;
+
+  g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
+
+  manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
+
+  return xkb_state_get_keymap (manager_evdev->priv->main_seat->xkb);
+}
+
+/**
  * clutter_evdev_set_pointer_constrain_callback:
  * @evdev: the #ClutterDeviceManager created by the evdev backend
  * @callback: the callback
diff --git a/clutter/evdev/clutter-evdev.h b/clutter/evdev/clutter-evdev.h
index e57dc6b..74eb00d 100644
--- a/clutter/evdev/clutter-evdev.h
+++ b/clutter/evdev/clutter-evdev.h
@@ -85,6 +85,8 @@ void  clutter_evdev_set_pointer_constrain_callback (ClutterDeviceManager
 void               clutter_evdev_set_keyboard_map   (ClutterDeviceManager *evdev,
                                                     struct xkb_keymap    *keymap);
 
+struct xkb_keymap * clutter_evdev_get_keyboard_map (ClutterDeviceManager *evdev);
+
 void clutter_evdev_set_keyboard_repeat (ClutterDeviceManager *evdev,
                                         gboolean              repeat,
                                         guint32               delay,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]