From e0cde404757e3c6775f5d8ffb14353e56e6b2a81 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 7 Jul 2016 14:33:38 -0400 Subject: [PATCH] elput: Add API function to return output name associated with input device This patch adds a new API function which we can call from Ecore_Drm2 which will return the name of an output which is associated with a given input device. This output name can then be used to find a matching output, and perform any device calibration that is needed. @feature Signed-off-by: Chris Michael --- src/lib/elput/Elput.h | 12 ++++++++++++ src/lib/elput/elput_input.c | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h index 4595f58e61..3e7bd4b62b 100644 --- a/src/lib/elput/Elput.h +++ b/src/lib/elput/Elput.h @@ -401,6 +401,18 @@ EAPI void elput_input_keyboard_cached_context_set(Elput_Manager *manager, void * */ EAPI void elput_input_keyboard_cached_keymap_set(Elput_Manager *manager, void *keymap); +/** + * Return the output name associated with a given device + * + * @param device + * + * @return An Eina_Stringshare of the output name for this device, or NULL on error + * + * @ingroup Elput_Input_Group + * @since 1.18 + */ +EAPI Eina_Stringshare *elput_input_device_output_name_get(Elput_Device *device); + # endif # undef EAPI diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c index bff5503692..e5182a9ddc 100644 --- a/src/lib/elput/elput_input.c +++ b/src/lib/elput/elput_input.c @@ -629,3 +629,12 @@ elput_input_keyboard_cached_keymap_set(Elput_Manager *manager, void *keymap) if ((keymap) && (manager->cached.keymap == keymap)) return; manager->cached.keymap = keymap; } + +EAPI Eina_Stringshare * +elput_input_device_output_name_get(Elput_Device *device) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(device->output_name, NULL): + + return eina_stringshare_ref(device->output_name); +}