From a40c240c157a5b08c8373ecef614d08bf63f2710 Mon Sep 17 00:00:00 2001 From: jeon Date: Tue, 14 Apr 2020 16:08:59 +0900 Subject: [PATCH] e_client: change arguments for event send APIs - Evas_Device to Ecore_Device Change-Id: Ia8d55a4f4b2fa9048ae40d199a725300955e951a --- src/bin/e_client.c | 18 +++---- src/bin/e_client.h | 18 +++---- src/bin/e_comp_wl_rsm.c | 111 +++++++++++++++++++++++++--------------- 3 files changed, 87 insertions(+), 60 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 66207cf95a..07c2365a04 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -7376,7 +7376,7 @@ e_client_window_role_set(E_Client *ec, const char *role) } E_API Eina_Bool -e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, unsigned int time) +e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7386,7 +7386,7 @@ e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev } E_API Eina_Bool -e_client_key_cancel(E_Client *ec, int keycode, Evas_Device *dev, unsigned int time) +e_client_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7396,7 +7396,7 @@ e_client_key_cancel(E_Client *ec, int keycode, Evas_Device *dev, unsigned int ti } E_API Eina_Bool -e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time) +e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time) { Eina_Bool res; @@ -7406,7 +7406,7 @@ e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Evas } E_API Eina_Bool -e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time) +e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time) { Eina_Bool res; @@ -7426,7 +7426,7 @@ e_client_touch_cancel_send(E_Client *ec) } E_API Eina_Bool -e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, unsigned int time) +e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7436,7 +7436,7 @@ e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_De } E_API Eina_Bool -e_client_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time) +e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7446,7 +7446,7 @@ e_client_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned } E_API Eina_Bool -e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, unsigned int time) +e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7456,7 +7456,7 @@ e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, } E_API Eina_Bool -e_client_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time) +e_client_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time) { Eina_Bool res; @@ -7466,7 +7466,7 @@ e_client_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned in } E_API Eina_Bool -e_client_mouse_out_send(E_Client *ec, Evas_Device *dev, unsigned int time) +e_client_mouse_out_send(E_Client *ec, Ecore_Device *dev, unsigned int time) { Eina_Bool res; diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 62cd5015f5..9aa39b5dc1 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1181,16 +1181,16 @@ EINTERN void e_client_transform_core_update_with_desk_zoom(E_Client * E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp); E_API void e_client_window_role_set(E_Client *ec, const char *role); -E_API Eina_Bool e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_key_cancel(E_Client *ec, int keycode, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time); -E_API Eina_Bool e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Evas_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time); +E_API Eina_Bool e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time); +E_API Eina_Bool e_client_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, unsigned int time); E_API Eina_Bool e_client_touch_cancel_send(E_Client *ec); -E_API Eina_Bool e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time); -E_API Eina_Bool e_client_mouse_out_send(E_Client *ec, Evas_Device *dev, unsigned int time); +E_API Eina_Bool e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time); +E_API Eina_Bool e_client_mouse_out_send(E_Client *ec, Ecore_Device *dev, unsigned int time); E_API Eina_Bool e_client_video_client_has(E_Client *ec); E_API Eina_Bool e_client_normal_client_has(E_Client *ec); diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index e5ebe1dfe4..4740b2d590 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -179,22 +179,39 @@ static E_Comp_Wl_Remote_Buffer *_e_comp_wl_remote_buffer_get(E_Comp_Wl_Remote_Su static void _remote_surface_region_clear(E_Comp_Wl_Remote_Surface *remote_surface); static void _remote_surface_ignore_output_transform_send(E_Comp_Wl_Remote_Common *common); -static Evas_Device * -_device_get_by_identifier(const char *identifier) +static Ecore_Device * +_device_get_by_identifier(const char *identifier, Ecore_Device_Class clas) { - Evas_Device *dev = NULL; + Ecore_Device *dev = NULL; const Eina_List *devices, *l; - devices = evas_device_list(e_comp->evas, NULL); + devices = ecore_device_list(); EINA_LIST_FOREACH(devices, l, dev) { - if (!e_util_strcmp(identifier, evas_device_description_get(dev))) + if (clas != ecore_device_class_get(dev)) continue; + if (!e_util_strcmp(identifier, ecore_device_identifier_get(dev))) return dev; } return NULL; } +static Ecore_Device_Class +_device_class_convert_to_ecore(uint32_t clas) +{ + switch (clas) + { + case TIZEN_INPUT_DEVICE_CLAS_MOUSE: + return ECORE_DEVICE_CLASS_MOUSE; + case TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN: + return ECORE_DEVICE_CLASS_TOUCH; + case TIZEN_INPUT_DEVICE_CLAS_KEYBOARD: + return ECORE_DEVICE_CLASS_KEYBOARD; + default: + return ECORE_DEVICE_CLASS_NONE; + } +} + static void _remote_region_mirror_clear(E_Comp_Wl_Remote_Region *region) { @@ -1590,8 +1607,8 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso E_Comp_Wl_Remote_Surface *remote_surface; E_Client *ec; - Evas_Device *edev = NULL; - Evas_Device_Class eclas = EVAS_DEVICE_CLASS_NONE; + Ecore_Device *edev = NULL; + Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; double eradx, erady, epressure, eangle; remote_surface = wl_resource_get_user_data(resource); @@ -1606,22 +1623,15 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso if (e_object_is_del(E_OBJECT(ec))) return; /* identify class */ - if (clas == TIZEN_INPUT_DEVICE_CLAS_MOUSE) - eclas = EVAS_DEVICE_CLASS_MOUSE; - else if (clas == TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN) - eclas = EVAS_DEVICE_CLASS_TOUCH; - else + eclas = _device_class_convert_to_ecore(clas); + if (eclas == ECORE_DEVICE_CLASS_NONE) { - ERR("Not supported device clas(%d) subclas(%d) identifier(%s)", + ERR("Not supported device class(%d) subclass(%d) identifier(%s)", clas, subclas, identifier); } /* find ecore device*/ - edev = _device_get_by_identifier(identifier); - if (edev) - { - eclas = evas_device_class_get(edev); - } + edev = _device_get_by_identifier(identifier, eclas); /* fixed to */ eradx = wl_fixed_to_double(radius_x); @@ -1629,7 +1639,7 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso epressure = wl_fixed_to_double(pressure); eangle = wl_fixed_to_double(angle); - if (eclas == EVAS_DEVICE_CLASS_MOUSE) + if (eclas == ECORE_DEVICE_CLASS_MOUSE) { switch (event_type) { @@ -1669,7 +1679,7 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso break; } } - else if (eclas == EVAS_DEVICE_CLASS_TOUCH) + else if (eclas == ECORE_DEVICE_CLASS_TOUCH) { switch (event_type) { @@ -1706,6 +1716,17 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso eradx, erady, epressure, eangle, time); break; + case TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_IN: + e_client_mouse_in_send(ec, + x, y, + NULL, + time); + break; + case TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_OUT: + e_client_mouse_out_send(ec, + NULL, + time); + break; default: ERR("Not supported event_type(%d)", event_type); break; @@ -1720,7 +1741,8 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso E_Comp_Wl_Remote_Surface *remote_surface; E_Client *ec; - Evas_Device *edev = NULL; + Ecore_Device *edev = NULL; + Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); @@ -1734,7 +1756,13 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso if (e_object_is_del(E_OBJECT(ec))) return; /* identify class */ - edev = _device_get_by_identifier(identifier); + eclas = _device_class_convert_to_ecore(clas); + if (eclas == ECORE_DEVICE_CLASS_NONE) + { + ERR("Not supported device class(%d) subclass(%d) identifier(%s)", + clas, subclas, identifier); + } + edev = _device_get_by_identifier(identifier, eclas); e_client_mouse_wheel_send(ec, direction, z, edev, time); } @@ -1746,8 +1774,8 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso E_Comp_Wl_Remote_Surface *remote_surface; E_Client *ec; - Evas_Device *edev = NULL; - Evas_Device_Class eclas; + Ecore_Device *edev = NULL; + Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; double eradx, erady, epressure, eangle; remote_surface = wl_resource_get_user_data(resource); @@ -1763,7 +1791,7 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso /* identify class */ if (clas == TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN) - eclas = EVAS_DEVICE_CLASS_TOUCH; + eclas = ECORE_DEVICE_CLASS_TOUCH; else { ERR("Not supported device clas(%d) subclas(%d identifier(%s)", @@ -1771,20 +1799,24 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso return; } - /* find ecore device*/ - edev = _device_get_by_identifier(identifier); - if (edev) + /* identify class */ + eclas = _device_class_convert_to_ecore(clas); + if (eclas == ECORE_DEVICE_CLASS_NONE) { - eclas = evas_device_class_get(edev); + ERR("Not supported device class(%d) subclass(%d) identifier(%s)", + clas, subclas, identifier); } + /* find ecore device*/ + edev = _device_get_by_identifier(identifier, eclas); + /* fixed to */ eradx = wl_fixed_to_double(radius_x); erady = wl_fixed_to_double(radius_y); epressure = wl_fixed_to_double(pressure); eangle = wl_fixed_to_double(angle); - if (eclas == EVAS_DEVICE_CLASS_TOUCH) + if (eclas == ECORE_DEVICE_CLASS_TOUCH) { switch (event_type) { @@ -1854,8 +1886,8 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour E_Comp_Wl_Remote_Surface *remote_surface; E_Client *ec; - Evas_Device *edev = NULL; - Evas_Device_Class eclas; + Ecore_Device *edev = NULL; + Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE; remote_surface = wl_resource_get_user_data(resource); EINA_SAFETY_ON_NULL_RETURN(remote_surface); @@ -1869,23 +1901,18 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour if (e_object_is_del(E_OBJECT(ec))) return; /* identify class */ - if (clas == TIZEN_INPUT_DEVICE_CLAS_KEYBOARD) - eclas = EVAS_DEVICE_CLASS_KEYBOARD; - else + eclas = _device_class_convert_to_ecore(clas); + if (eclas == ECORE_DEVICE_CLASS_NONE) { - ERR("Not supported device class(%d) subclass(%d identifier(%s)", + ERR("Not supported device class(%d) subclass(%d) identifier(%s)", clas, subclas, identifier); return; } /* find ecore device*/ - edev = _device_get_by_identifier(identifier); - if (edev) - { - eclas = evas_device_class_get(edev); - } + edev = _device_get_by_identifier(identifier, eclas); - if (eclas == EVAS_DEVICE_CLASS_KEYBOARD) + if (eclas == ECORE_DEVICE_CLASS_KEYBOARD) { switch (event_type) { -- 2.34.1