diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-27 09:12:53 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-27 09:12:53 -0400 |
commit | 65cfdaa3ddf17f0d5b3d8750e5ae2da026098b20 (patch) | |
tree | 92765c7c4796ef2fe32fddffb43798e8f193e080 /src/lib/elput | |
parent | ec464939d9b8e4daabb55fab07e369a7e00cc941 (diff) |
elput: Add API function to support caching of an xkb_context
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/Elput.h | 11 | ||||
-rw-r--r-- | src/lib/elput/elput_evdev.c | 3 | ||||
-rw-r--r-- | src/lib/elput/elput_input.c | 9 | ||||
-rw-r--r-- | src/lib/elput/elput_private.h | 5 |
4 files changed, 27 insertions, 1 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index a7f0b7e4da..f64943f853 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h | |||
@@ -379,6 +379,17 @@ EAPI Eina_Bool elput_input_key_remap_enable(Elput_Manager *manager, Eina_Bool en | |||
379 | */ | 379 | */ |
380 | EAPI Eina_Bool elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, int num); | 380 | EAPI Eina_Bool elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, int num); |
381 | 381 | ||
382 | /** | ||
383 | * Set a cached context to be used for keyboards | ||
384 | * | ||
385 | * @param manager | ||
386 | * @param context | ||
387 | * | ||
388 | * @ingroup Elput_Input_Group | ||
389 | * @since 1.18 | ||
390 | */ | ||
391 | EAPI void elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context); | ||
392 | |||
382 | # endif | 393 | # endif |
383 | 394 | ||
384 | # undef EAPI | 395 | # undef EAPI |
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index c083a1783b..79386af902 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c | |||
@@ -206,6 +206,7 @@ _keyboard_create(Elput_Seat *seat) | |||
206 | if (!kbd) return NULL; | 206 | if (!kbd) return NULL; |
207 | 207 | ||
208 | kbd->seat = seat; | 208 | kbd->seat = seat; |
209 | |||
209 | return kbd; | 210 | return kbd; |
210 | } | 211 | } |
211 | 212 | ||
@@ -1247,7 +1248,7 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device) | |||
1247 | 1248 | ||
1248 | if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) | 1249 | if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) |
1249 | { | 1250 | { |
1250 | _keyboard_init(seat, NULL); | 1251 | _keyboard_init(seat, seat->manager->cached.keymap); |
1251 | edev->caps |= EVDEV_SEAT_KEYBOARD; | 1252 | edev->caps |= EVDEV_SEAT_KEYBOARD; |
1252 | } | 1253 | } |
1253 | 1254 | ||
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c index e838c9b212..464f69f226 100644 --- a/src/lib/elput/elput_input.c +++ b/src/lib/elput/elput_input.c | |||
@@ -576,3 +576,12 @@ elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys, | |||
576 | 576 | ||
577 | return EINA_TRUE; | 577 | return EINA_TRUE; |
578 | } | 578 | } |
579 | |||
580 | EAPI void | ||
581 | elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context) | ||
582 | { | ||
583 | EINA_SAFETY_ON_NULL_RETURN(manager); | ||
584 | |||
585 | if ((context) && (manager->cached.context == context)) return; | ||
586 | manager->cached.context = context; | ||
587 | } | ||
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index 2d9de141f9..7a57e2f159 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h | |||
@@ -247,6 +247,11 @@ struct _Elput_Manager | |||
247 | Eldbus_Proxy *manager; | 247 | Eldbus_Proxy *manager; |
248 | } dbus; | 248 | } dbus; |
249 | 249 | ||
250 | struct | ||
251 | { | ||
252 | struct xkb_context *context; | ||
253 | } cached; | ||
254 | |||
250 | Elput_Input input; | 255 | Elput_Input input; |
251 | Eina_Bool del : 1; | 256 | Eina_Bool del : 1; |
252 | }; | 257 | }; |