forked from enlightenment/efl
elput: Add API function to support caching of existing keymap
@feature Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
parent
65cfdaa3dd
commit
20f418b8d7
|
@ -390,6 +390,17 @@ EAPI Eina_Bool elput_input_key_remap_set(Elput_Manager *manager, int *from_keys,
|
||||||
*/
|
*/
|
||||||
EAPI void elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context);
|
EAPI void elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a cached keymap to be used for keyboards
|
||||||
|
*
|
||||||
|
* @param manager
|
||||||
|
* @param keymap
|
||||||
|
*
|
||||||
|
* @ingroup Elput_Input_Group
|
||||||
|
* @since 1.18
|
||||||
|
*/
|
||||||
|
EAPI void elput_input_keyboard_cached_keymap_set(Elput_Manager *manager, void *keymap);
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# undef EAPI
|
# undef EAPI
|
||||||
|
|
|
@ -165,9 +165,10 @@ _keyboard_info_destroy(Elput_Keyboard_Info *info, Eina_Bool external)
|
||||||
{
|
{
|
||||||
if (--info->refs > 0) return;
|
if (--info->refs > 0) return;
|
||||||
|
|
||||||
|
xkb_keymap_unref(info->keymap.map);
|
||||||
|
|
||||||
if (!external)
|
if (!external)
|
||||||
{
|
{
|
||||||
xkb_keymap_unref(info->keymap.map);
|
|
||||||
if (info->keymap.area) munmap(info->keymap.area, info->keymap.size);
|
if (info->keymap.area) munmap(info->keymap.area, info->keymap.size);
|
||||||
if (info->keymap.fd >= 0) close(info->keymap.fd);
|
if (info->keymap.fd >= 0) close(info->keymap.fd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,3 +585,12 @@ elput_input_keyboard_cached_context_set(Elput_Manager *manager, void *context)
|
||||||
if ((context) && (manager->cached.context == context)) return;
|
if ((context) && (manager->cached.context == context)) return;
|
||||||
manager->cached.context = context;
|
manager->cached.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
elput_input_keyboard_cached_keymap_set(Elput_Manager *manager, void *keymap)
|
||||||
|
{
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(manager);
|
||||||
|
|
||||||
|
if ((keymap) && (manager->cached.keymap == keymap)) return;
|
||||||
|
manager->cached.keymap = keymap;
|
||||||
|
}
|
||||||
|
|
|
@ -249,6 +249,7 @@ struct _Elput_Manager
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
struct xkb_keymap *keymap;
|
||||||
struct xkb_context *context;
|
struct xkb_context *context;
|
||||||
} cached;
|
} cached;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue