diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-17 16:02:53 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2017-05-19 12:41:16 -0400 |
commit | 871e0c8de8f05fc307726db0a4dc1e9f663adeab (patch) | |
tree | 2a2db751ead450ab6703df297570f437575c0f6f | |
parent | 01d3edef00c4a5501d5fe328d554fc8c36a84394 (diff) | |
download | efl-871e0c8de8f05fc307726db0a4dc1e9f663adeab.tar.gz |
ecore-wl2: add ecore_wl2_display_input_find_by_name()
@feature
-rw-r--r-- | src/lib/ecore_wl2/Ecore_Wl2.h | 9 | ||||
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_display.c | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 8e0e39832e..3fdd59058a 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -531,6 +531,15 @@ EAPI Eina_Iterator *ecore_wl2_display_inputs_get(Ecore_Wl2_Display *display); EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find(const Ecore_Wl2_Display *display, unsigned int id); /** + * Find a seat for a given display object using the seat id + * @param display The display + * @param name The seat name + * @return The corresponding Ecore_Wl2_Input object or @c NULL if no match is found + * @since 1.20 + */ +EAPI Ecore_Wl2_Input *ecore_wl2_display_input_find_by_name(const Ecore_Wl2_Display *display, const char *name); + +/** * Find an Ecore_Wl2_Window based on id * * @param display The display to search for the window diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c index 61b15b33ad..999591b533 100644 --- a/src/lib/ecore_wl2/ecore_wl2_display.c +++ b/src/lib/ecore_wl2/ecore_wl2_display.c @@ -979,6 +979,18 @@ ecore_wl2_display_input_find(const Ecore_Wl2_Display *display, unsigned int id) return NULL; } +EAPI Ecore_Wl2_Input * +ecore_wl2_display_input_find_by_name(const Ecore_Wl2_Display *display, const char *name) +{ + Ecore_Wl2_Input *input; + + EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL); + EINA_SAFETY_ON_TRUE_RETURN_VAL(display->pid, NULL); + EINA_INLIST_FOREACH(display->inputs, input) + if (eina_streq(input->name, name)) return input; + return NULL; +} + EAPI Eina_Bool ecore_wl2_display_sync_is_done(const Ecore_Wl2_Display *display) { |