e_client: change arguments for event send APIs 91/230791/1 accepted/tizen/5.5/unified/20200416.164858 submit/tizen_5.5/20200414.073520
authorjeon <jhyuni.kang@samsung.com>
Tue, 14 Apr 2020 07:08:59 +0000 (16:08 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Tue, 14 Apr 2020 07:30:05 +0000 (07:30 +0000)
  - Evas_Device to Ecore_Device

Change-Id: Ia8d55a4f4b2fa9048ae40d199a725300955e951a

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_wl_rsm.c

index 61db04f4bc582ed9a112df89c689050613cf5662..44d59597785e9fa316bad5ae67277f6f1d0b987a 100644 (file)
@@ -7360,7 +7360,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;
 
@@ -7370,7 +7370,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;
 
@@ -7380,7 +7380,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;
 
@@ -7390,7 +7390,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;
 
@@ -7410,7 +7410,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;
 
@@ -7420,7 +7420,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;
 
@@ -7430,7 +7430,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;
 
@@ -7440,7 +7440,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;
 
@@ -7450,7 +7450,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;
 
index 0febaeb7e3635ca09129992288154b1bf0a156f3..b212738be9277ba7e9fa4d0b4d8a77df10f39df0 100644 (file)
@@ -1173,16 +1173,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);
index 4b539ecdf9c759295dd6f83ebcbe293d2c58ea70..cc48a5f4288a581494ca6d890f36ea2dea98e161 100644 (file)
@@ -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)
 {
@@ -1587,8 +1604,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);
@@ -1603,22 +1620,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);
@@ -1626,7 +1636,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)
           {
@@ -1666,7 +1676,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)
           {
@@ -1703,6 +1713,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;
@@ -1717,7 +1738,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);
@@ -1731,7 +1753,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);
 }
@@ -1743,8 +1771,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);
@@ -1760,7 +1788,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)",
@@ -1768,20 +1796,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)
           {
@@ -1851,8 +1883,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);
@@ -1866,23 +1898,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)
           {