diff options
author | JengHyun Kang <jhyuni.kang@samsung.com> | 2017-01-19 22:41:17 +0900 |
---|---|---|
committer | JengHyun Kang <jhyuni.kang@samsung.com> | 2017-01-19 22:41:17 +0900 |
commit | 387d71f79e8cf42a99644a2a6fb870cba9cb534a (patch) | |
tree | 22505be0922ea61d48a7335fcbaf6fd0358e7032 | |
parent | e6f0c4d0309911791f4c51e3837fe3a1d7e24cec (diff) | |
download | efl-util-387d71f79e8cf42a99644a2a6fb870cba9cb534a.tar.gz efl-util-387d71f79e8cf42a99644a2a6fb870cba9cb534a.tar.bz2 efl-util-387d71f79e8cf42a99644a2a6fb870cba9cb534a.zip |
Add listeners for tizen_input_device
Change-Id: I5ef7daed3121cc7c0d935d5d91f2d6633dbea01f
-rw-r--r-- | src/efl_util.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/efl_util.c b/src/efl_util.c index 19b7ec5..0d977d2 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -184,6 +184,9 @@ static void _cb_device_add(void *data EINA_UNUSED, struct tiz static void _cb_device_remove(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t serial EINA_UNUSED, const char *identifier EINA_UNUSED, struct tizen_input_device *device EINA_UNUSED, struct wl_seat *seat EINA_UNUSED); static void _cb_error(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t errorcode); static void _cb_block_expired(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED); +static void _cb_device_info(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, const char *name EINA_UNUSED, uint32_t clas EINA_UNUSED, uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED); +static void _cb_event_device(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, unsigned int serial EINA_UNUSED, const char *name EINA_UNUSED, uint32_t time EINA_UNUSED); +static void _cb_axis(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED); static const struct wl_registry_listener _wl_reg_listener = { @@ -218,6 +221,13 @@ struct tizen_input_device_manager_listener _wl_tz_devmgr_listener = _cb_block_expired }; +struct tizen_input_device_listener _wl_tz_dev_listener = +{ + _cb_device_info, + _cb_event_device, + _cb_axis, +}; + struct tizen_display_policy_listener _wl_tz_display_policy_listener = { _cb_wl_tz_display_policy_brightness_done, @@ -381,6 +391,7 @@ _wl_shutdown(void) tizen_input_device_release(data); _eflutil.wl.devmgr.device_list = eina_list_remove_list(_eflutil.wl.devmgr.device_list, l); } + ecore_wl_sync(); if (_eflutil.wl.devmgr.devicemgr) tizen_input_device_manager_destroy(_eflutil.wl.devmgr.devicemgr); _eflutil.wl.devmgr.devicemgr = NULL; @@ -402,7 +413,6 @@ _wl_shutdown(void) if (_eflutil.wl.queue) { - wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); wl_event_queue_destroy(_eflutil.wl.queue); _eflutil.wl.queue = NULL; } @@ -1361,7 +1371,7 @@ _cb_device_add(void *data EINA_UNUSED, { if (device == ddata) return; } - + tizen_input_device_add_listener(device, &_wl_tz_dev_listener, NULL); _eflutil.wl.devmgr.device_list = eina_list_append(_eflutil.wl.devmgr.device_list, device); } @@ -1382,6 +1392,7 @@ _cb_device_remove(void *data EINA_UNUSED, if (device == ddata) { _eflutil.wl.devmgr.device_list = eina_list_remove_list(_eflutil.wl.devmgr.device_list, l); + tizen_input_device_release(device); } } } @@ -1404,6 +1415,34 @@ _cb_block_expired(void *data EINA_UNUSED, } /* LCOV_EXCL_STOP */ +/* LCOV_EXCL_START */ +static void +_cb_device_info(void *data EINA_UNUSED, + struct tizen_input_device *tizen_input_device EINA_UNUSED, + const char *name EINA_UNUSED, uint32_t clas EINA_UNUSED, + uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED) +{ + ; +} + +static void +_cb_event_device(void *data EINA_UNUSED, + struct tizen_input_device *tizen_input_device EINA_UNUSED, + unsigned int serial EINA_UNUSED, + const char *name EINA_UNUSED, uint32_t time EINA_UNUSED) +{ + ; +} + +static void +_cb_axis(void *data EINA_UNUSED, + struct tizen_input_device *tizen_input_device EINA_UNUSED, + uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED) +{ + ; +} +/* LCOV_EXCL_STOP */ + static efl_util_error_e _efl_util_input_convert_input_generator_error(int ret) { |