discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7c9e3d2dbd293837d84e15317c2c081f239b38a2
commit 7c9e3d2dbd293837d84e15317c2c081f239b38a2 Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Fri May 12 12:08:32 2017 -0400 ecore-wl2: add some accessors for useful Ecore_Wl2_Input struct members @feature --- src/lib/ecore_wl2/Ecore_Wl2.h | 34 ++++++++++++++++++++++++++++++++ src/lib/ecore_wl2/ecore_wl2_input.c | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index e607f7f..a395c1e 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -944,6 +944,22 @@ EAPI Ecore_Wl2_Seat_Capabilities ecore_wl2_input_seat_capabilities_get(Ecore_Wl2 EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input); /** + * Get the display object of an input + * @param input The input + * @return The display + * @since 1.20 + */ +EAPI Ecore_Wl2_Display *ecore_wl2_input_display_get(const Ecore_Wl2_Input *input); + +/** + * Get the xkb_keymap object of an input + * @param input The input + * @return The xkb_keymap object + * @since 1.20 + */ +EAPI struct xkb_keymap *ecore_wl2_input_keymap_get(const Ecore_Wl2_Input *input); + +/** * Get the name of an input * @param input The input * @return The name @@ -952,6 +968,24 @@ EAPI unsigned int ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input); EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input); /** + * Get the keyboard repeat rate and delay of an input + * @param input The input + * @param rate Pointer to store the repeat rate (in seconds) + * @param rate Pointer to store the repeat delay (in seconds) + * @return True if repeat is enabled + * @since 1.20 + */ +EAPI Eina_Bool ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay); + +/** + * Get the Evas_Device for the seat belonging to a window from an input + * @param input The input + * @param window The window + * @return The device object + * @since 1.20 + */ +EAPI Eo *ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window); +/** * @defgroup Ecore_Wl2_Dnd_Group Wayland Library Drag-n-Drop Functions * @ingroup Ecore_Wl2_Group * diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 56b2c9b..77f5c3d 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1620,3 +1620,42 @@ ecore_wl2_input_seat_id_get(Ecore_Wl2_Input *input) EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, 0); return input->id; } + +EAPI Ecore_Wl2_Display * +ecore_wl2_input_display_get(const Ecore_Wl2_Input *input) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, NULL); + return input->display; +} + +EAPI struct xkb_keymap * +ecore_wl2_input_keymap_get(const Ecore_Wl2_Input *input) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, NULL); + return input->xkb.keymap; +} + +EAPI Eina_Bool +ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(input->display, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(input->wl.keyboard, EINA_FALSE); + if (rate) *rate = input->repeat.rate; + if (delay) *delay = input->repeat.delay; + return input->repeat.enabled; +} + +EAPI Eo * +ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window) +{ + Ecore_Wl2_Input_Devices *devices; + EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); + + devices = _ecore_wl2_devices_get(input, window->id); + return devices ? devices->seat_dev : NULL; +} --