e_client, e_comp_wl, e_info_client, e_input : replace Ecore_Device stuff with Evas_De... 79/169479/2
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 1 Nov 2017 02:27:46 +0000 (11:27 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 19 Mar 2018 09:54:40 +0000 (18:54 +0900)
Change-Id: I5de36e14e6c80841e5c8f2d3acc2ff72e84c4783
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_comp_wl_rsm.c
src/bin/e_info_client.c
src/bin/e_input.c
src/bin/e_input.h
src/bin/e_input_evdev.c
src/bin/e_input_inputs.c
src/bin/e_input_private.h

index 987fc20..aacffd6 100644 (file)
@@ -6704,7 +6704,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, Ecore_Device *dev, unsigned int time)
+e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
@@ -6714,7 +6714,7 @@ e_client_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *de
 }
 
 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_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)
 {
    Eina_Bool res;
 
@@ -6724,7 +6724,7 @@ e_client_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecor
 }
 
 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_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)
 {
    Eina_Bool res;
 
@@ -6744,7 +6744,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, Ecore_Device *dev, unsigned int time)
+e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
@@ -6754,7 +6754,7 @@ e_client_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_D
 }
 
 E_API Eina_Bool
-e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time)
+e_client_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
@@ -6764,7 +6764,7 @@ e_client_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned
 }
 
 E_API Eina_Bool
-e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, unsigned int time)
+e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
@@ -6774,7 +6774,7 @@ e_client_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev,
 }
 
 E_API Eina_Bool
-e_client_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned int time)
+e_client_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
@@ -6784,7 +6784,7 @@ e_client_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, unsigned i
 }
 
 E_API Eina_Bool
-e_client_mouse_out_send(E_Client *ec, Ecore_Device *dev, unsigned int time)
+e_client_mouse_out_send(E_Client *ec, Evas_Device *dev, unsigned int time)
 {
    Eina_Bool res;
 
index 3dce14e..6901b92 100644 (file)
@@ -1106,15 +1106,15 @@ E_API void              e_client_transform_core_input_inv_rect_transform(E_Clien
 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, 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_key_send(E_Client *ec, int keycode, Eina_Bool pressed, 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_touch_cancel_send(E_Client *ec);
-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_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_video_client_has(E_Client *ec);
 E_API Eina_Bool e_client_normal_client_has(E_Client *ec);
index ff945d3..6bb72d7 100644 (file)
@@ -46,7 +46,7 @@ typedef struct _E_Comp_Wl_Transform_Context
 typedef struct _E_Comp_Wl_Key_Data
 {
    uint32_t key;
-   Ecore_Device *dev;
+   Evas_Device *dev;
 } E_Comp_Wl_Key_Data;
 
 static Eina_List *handlers = NULL;
@@ -614,15 +614,15 @@ _e_comp_wl_evas_cb_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
 }
 
 static E_Comp_Wl_Input_Device *
-_e_comp_wl_device_last_device_get(Ecore_Device_Class dev_class)
+_e_comp_wl_device_last_device_get(Evas_Device_Class dev_class)
 {
    switch (dev_class)
      {
-      case ECORE_DEVICE_CLASS_MOUSE:
+      case EVAS_DEVICE_CLASS_MOUSE:
          return e_comp_wl->input_device_manager.last_device_ptr;
-      case ECORE_DEVICE_CLASS_KEYBOARD:
+      case EVAS_DEVICE_CLASS_KEYBOARD:
          return e_comp_wl->input_device_manager.last_device_kbd;
-      case ECORE_DEVICE_CLASS_TOUCH:
+      case EVAS_DEVICE_CLASS_TOUCH:
          return e_comp_wl->input_device_manager.last_device_touch;
       default:
          return NULL;;
@@ -631,17 +631,17 @@ _e_comp_wl_device_last_device_get(Ecore_Device_Class dev_class)
 }
 
 static void
-_e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Comp_Wl_Input_Device *device)
+_e_comp_wl_device_last_device_set(Evas_Device_Class dev_class, E_Comp_Wl_Input_Device *device)
 {
    switch (dev_class)
      {
-      case ECORE_DEVICE_CLASS_MOUSE:
+      case EVAS_DEVICE_CLASS_MOUSE:
          e_comp_wl->input_device_manager.last_device_ptr = device;
          break;
-      case ECORE_DEVICE_CLASS_KEYBOARD:
+      case EVAS_DEVICE_CLASS_KEYBOARD:
          e_comp_wl->input_device_manager.last_device_kbd = device;
          break;
-      case ECORE_DEVICE_CLASS_TOUCH:
+      case EVAS_DEVICE_CLASS_TOUCH:
          e_comp_wl->input_device_manager.last_device_touch = device;
          break;
       default:
@@ -650,15 +650,15 @@ _e_comp_wl_device_last_device_set(Ecore_Device_Class dev_class, E_Comp_Wl_Input_
 }
 
 static E_Comp_Wl_Input_Device *
-_e_comp_wl_device_client_last_device_get(E_Client *ec, Ecore_Device_Class dev_class)
+_e_comp_wl_device_client_last_device_get(E_Client *ec, Evas_Device_Class dev_class)
 {
    switch (dev_class)
      {
-      case ECORE_DEVICE_CLASS_MOUSE:
+      case EVAS_DEVICE_CLASS_MOUSE:
          return ec->comp_data->last_device_ptr;
-      case ECORE_DEVICE_CLASS_KEYBOARD:
+      case EVAS_DEVICE_CLASS_KEYBOARD:
          return ec->comp_data->last_device_kbd;
-      case ECORE_DEVICE_CLASS_TOUCH:
+      case EVAS_DEVICE_CLASS_TOUCH:
          return ec->comp_data->last_device_touch;
       default:
          return NULL;;
@@ -667,17 +667,17 @@ _e_comp_wl_device_client_last_device_get(E_Client *ec, Ecore_Device_Class dev_cl
 }
 
 static void
-_e_comp_wl_device_client_last_device_set(E_Client *ec, Ecore_Device_Class dev_class, E_Comp_Wl_Input_Device *device)
+_e_comp_wl_device_client_last_device_set(E_Client *ec, Evas_Device_Class dev_class, E_Comp_Wl_Input_Device *device)
 {
    switch (dev_class)
      {
-      case ECORE_DEVICE_CLASS_MOUSE:
+      case EVAS_DEVICE_CLASS_MOUSE:
          ec->comp_data->last_device_ptr = device;
          break;
-      case ECORE_DEVICE_CLASS_KEYBOARD:
+      case EVAS_DEVICE_CLASS_KEYBOARD:
          ec->comp_data->last_device_kbd = device;
          break;
-      case ECORE_DEVICE_CLASS_TOUCH:
+      case EVAS_DEVICE_CLASS_TOUCH:
          ec->comp_data->last_device_touch = device;
          break;
       default:
@@ -691,7 +691,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim
    E_Comp_Wl_Input_Device *last_device, *ec_last_device, *input_dev;
    struct wl_resource *dev_res;
    const char *dev_name;
-   Ecore_Device_Class dev_class;
+   Evas_Device_Class dev_class;
    struct wl_client *wc;
    uint32_t serial;
    Eina_List *l, *ll;
@@ -705,7 +705,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim
    if ((ec->ignored) && (!ec->remote_surface.provider)) return;
    if (!ec->comp_data || !ec->comp_data->surface) return;
 
-   dev_class = (Ecore_Device_Class)evas_device_class_get(dev);
+   dev_class = (Evas_Device_Class)evas_device_class_get(dev);
    dev_name = evas_device_description_get(dev);
    last_device = _e_comp_wl_device_last_device_get(dev_class);
    ec_last_device = _e_comp_wl_device_client_last_device_get(ec, dev_class);
@@ -730,7 +730,7 @@ _e_comp_wl_device_send_event_device(E_Client *ec, Evas_Device *dev, uint32_t tim
 }
 
 static void
-_e_comp_wl_device_send_last_event_device(E_Client *ec, Ecore_Device_Class dev_class, uint32_t timestamp)
+_e_comp_wl_device_send_last_event_device(E_Client *ec, Evas_Device_Class dev_class, uint32_t timestamp)
 {
    E_Comp_Wl_Input_Device *last_device;
    struct wl_resource *dev_res;
@@ -755,7 +755,7 @@ _e_comp_wl_device_send_last_event_device(E_Client *ec, Ecore_Device_Class dev_cl
  }
 
  static void
-_e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Device *dev, uint32_t serial)
+_e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Evas_Device *dev, uint32_t serial)
 {
    E_Comp_Wl_Input_Device *input_dev;
    struct wl_resource *dev_res;
@@ -764,12 +764,12 @@ _e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Dev
 
    EINA_SAFETY_ON_NULL_RETURN(dev);
 
-   dev_name = ecore_device_identifier_get(dev);
+   dev_name = evas_device_description_get(dev);
 
    EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
      {
         if (!eina_streq(input_dev->identifier, dev_name)) continue;
-        _e_comp_wl_device_last_device_set(ecore_device_class_get(dev), input_dev);
+        _e_comp_wl_device_last_device_set(evas_device_class_get(dev), input_dev);
 
         EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
           {
@@ -838,7 +838,7 @@ _e_comp_wl_device_send_axis(const char *dev_name, Evas_Device_Class dev_class, E
 
    EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
      {
-        if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
+        if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Evas_Device_Class)dev_class)) continue;
         EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
           {
              if (wl_resource_get_client(dev_res) != wc) continue;
@@ -933,7 +933,7 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
         if (!e_comp_wl_input_pointer_check(res)) continue;
         if (wl_resource_get_client(res) != wc) continue;
 
-        _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
+        _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, ev->timestamp);
 
         wl_pointer_send_enter(res, serial, ec->comp_data->surface,
                               wl_fixed_from_int(ev->canvas.x - ec->client.x),
@@ -1001,7 +1001,7 @@ _e_comp_wl_evas_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob
         if (wl_resource_get_client(res) != wc) continue;
         if (ec->pointer_enter_sent == EINA_FALSE) continue;
 
-        _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, ev->timestamp);
+        _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, ev->timestamp);
 
         wl_pointer_send_leave(res, serial, ec->comp_data->surface);
      }
@@ -5383,7 +5383,7 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_
    Eina_List *l;
    uint32_t serial, keycode;
    struct wl_client *wc;
-   Ecore_Device *last_dev;
+   Evas_Device *last_dev;
    E_Comp_Config *comp_conf = NULL;
 
    keycode = (ev->keycode - 8);
@@ -5751,7 +5751,7 @@ e_comp_wl_input_cursor_timer_enable_set(Eina_Bool enabled)
 }
 
 EINTERN Eina_Bool
-e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, uint32_t time)
+e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, uint32_t time)
 {
    struct wl_resource *res;
    struct wl_client *wc;
@@ -5780,7 +5780,7 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-        else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+        else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_KEYBOARD, time);
 
         if (comp_conf && comp_conf->input_log_enable)
           INF("[Server] Key %s (time: %d)\n", (state ? "Down" : "Up"), time);
@@ -5793,7 +5793,7 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d
 }
 
 EINTERN Eina_Bool
-e_comp_wl_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, uint32_t time)
+e_comp_wl_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, uint32_t time)
 {
    struct wl_client *wc;
    uint32_t serial;
@@ -5804,7 +5804,7 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
 
-   if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH);
+   if (!dev) device = _e_comp_wl_device_last_device_get(EVAS_DEVICE_CLASS_TOUCH);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    if (!time) time = (uint32_t)(ecore_time_get() * 1000);
@@ -5813,11 +5813,11 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco
    if (dev)
      {
         _e_comp_wl_send_event_device(wc, time, dev, serial);
-        _e_comp_wl_device_handle_axes(ecore_device_identifier_get(dev), ECORE_DEVICE_CLASS_TOUCH, ec, idx, radius_x, radius_y, pressure, angle);
+        _e_comp_wl_device_handle_axes(evas_device_description_get(dev), EVAS_DEVICE_CLASS_TOUCH, ec, idx, radius_x, radius_y, pressure, angle);
      }
    else if (device)
      {
-        _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_TOUCH, time);
+        _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_TOUCH, time);
         _e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle);
      }
 
@@ -5830,7 +5830,7 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco
 }
 
 EINTERN Eina_Bool
-e_comp_wl_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, uint32_t time)
+e_comp_wl_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, uint32_t time)
 {
    E_Comp_Wl_Input_Device *device;
    uint32_t serial;
@@ -5841,7 +5841,7 @@ e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *d
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data->surface, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
 
-   if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH);
+   if (!dev) device = _e_comp_wl_device_last_device_get(EVAS_DEVICE_CLASS_TOUCH);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    if (!time) time = (uint32_t)(ecore_time_get() * 1000);
@@ -5850,11 +5850,11 @@ e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *d
    if (dev)
      {
         _e_comp_wl_send_event_device(wc, time, dev, serial);
-        _e_comp_wl_device_handle_axes(ecore_device_identifier_get(dev), ECORE_DEVICE_CLASS_TOUCH, ec, idx, radius_x, radius_y, pressure, angle);
+        _e_comp_wl_device_handle_axes(evas_device_description_get(dev), EVAS_DEVICE_CLASS_TOUCH, ec, idx, radius_x, radius_y, pressure, angle);
      }
    else if (device)
      {
-        _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_TOUCH, time);
+        _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_TOUCH, time);
         _e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle);
      }
 
@@ -5879,7 +5879,7 @@ e_comp_wl_touch_cancel_send(E_Client *ec)
 }
 
 EINTERN Eina_Bool
-e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, uint32_t time)
+e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, uint32_t time)
 {
    uint32_t serial;
    struct wl_client *wc;
@@ -5894,7 +5894,7 @@ e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-   else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+   else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, time);
 
    if (pressed)
      e_comp_wl_evas_handle_mouse_button(ec, time, buttons,
@@ -5907,7 +5907,7 @@ e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_
 }
 
 EINTERN Eina_Bool
-e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t time)
+e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, uint32_t time)
 {
    uint32_t serial;
    struct wl_client *wc;
@@ -5922,7 +5922,7 @@ e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-   else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+   else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, time);
 
    x = x + ec->client.x;
    y = y + ec->client.y;
@@ -5933,7 +5933,7 @@ e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_
 }
 
 EINTERN Eina_Bool
-e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, uint32_t time)
+e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, uint32_t time)
 {
    uint32_t serial;
    struct wl_client *wc;
@@ -5948,7 +5948,7 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-   else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+   else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, time);
 
    _e_comp_wl_mouse_wheel_send(ec, direction, z, time);
 
@@ -5956,7 +5956,7 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev
 }
 
 EINTERN Eina_Bool
-e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t time)
+e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, uint32_t time)
 {
    uint32_t serial;
    struct wl_client *wc;
@@ -5978,7 +5978,7 @@ e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t
         if (wl_resource_get_client(res) != wc) continue;
 
         if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-        else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+        else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, time);
 
         wl_pointer_send_enter(res, serial, ec->comp_data->surface,
                               wl_fixed_from_int(x),
@@ -5989,7 +5989,7 @@ e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t
 }
 
 EINTERN Eina_Bool
-e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time)
+e_comp_wl_mouse_out_send(E_Client *ec, Evas_Device *dev, uint32_t time)
 {
    uint32_t serial;
    struct wl_client *wc;
@@ -6011,7 +6011,7 @@ e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time)
         if (wl_resource_get_client(res) != wc) continue;
 
         if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
-        else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_MOUSE, time);
+        else _e_comp_wl_device_send_last_event_device(ec, EVAS_DEVICE_CLASS_MOUSE, time);
 
         wl_pointer_send_leave(res, serial, ec->comp_data->surface);
      }
index 87edb52..d10f749 100644 (file)
@@ -171,8 +171,8 @@ struct _E_Comp_Wl_Input_Device
    Eina_List *resources;
    const char *name;
    const char *identifier;
-   Ecore_Device_Class clas;
-   Ecore_Device_Subclass subclas;
+   Evas_Device_Class clas;
+   Evas_Device_Subclass subclas;
 };
 
 struct _E_Comp_Wl_Input_Device_Multi
@@ -562,15 +562,15 @@ E_API void e_comp_wl_map_apply(E_Client *ec);
 
 E_API void e_comp_wl_input_cursor_timer_enable_set(Eina_Bool enabled);
 
-EINTERN Eina_Bool e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_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, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_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, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Evas_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_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, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_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, uint32_t time);
 EINTERN Eina_Bool e_comp_wl_touch_cancel_send(E_Client *ec);
-EINTERN Eina_Bool e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_Device *dev, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_t time);
-EINTERN Eina_Bool e_comp_wl_mouse_out_send(E_Client *ec, Ecore_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Evas_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Evas_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Evas_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_mouse_in_send(E_Client *ec, int x, int y, Evas_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_mouse_out_send(E_Client *ec, Evas_Device *dev, uint32_t time);
 EINTERN void e_comp_wl_mouse_in_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src);
 EINTERN void e_comp_wl_mouse_out_renew(E_Client *ec, int buttons, int x, int y, void *data, Evas_Modifier *modifiers, Evas_Lock *locks, unsigned int timestamp, Evas_Event_Flags event_flags, Evas_Device *dev, Evas_Object *event_src);
 
index 4921d16..d7a0774 100644 (file)
@@ -179,16 +179,16 @@ static void _remote_surface_region_clear(E_Comp_Wl_Remote_Surface *remote_surfac
 static void _remote_surface_ignore_output_transform_send(E_Comp_Wl_Remote_Common *common);
 static void _remote_source_save_start(E_Comp_Wl_Remote_Source *source);
 
-static Ecore_Device *
+static Evas_Device *
 _device_get_by_identifier(const char *identifier)
 {
-   Ecore_Device *dev = NULL;
+   Evas_Device *dev = NULL;
    const Eina_List *devices, *l;
 
-   devices = ecore_device_list();
+   devices = evas_device_list();
    EINA_LIST_FOREACH(devices, l, dev)
      {
-        if (!e_util_strcmp(identifier, ecore_device_identifier_get(dev)))
+        if (!e_util_strcmp(identifier, evas_device_description_get(dev)))
           return dev;
      }
 
@@ -1895,8 +1895,8 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
    E_Comp_Wl_Remote_Surface *remote_surface;
    E_Client *ec;
 
-   Ecore_Device *edev = NULL;
-   Ecore_Device_Class eclas = ECORE_DEVICE_CLASS_NONE;
+   Evas_Device *edev = NULL;
+   Evas_Device_Class eclas = EVAS_DEVICE_CLASS_NONE;
    double eradx, erady, epressure, eangle;
 
    remote_surface = wl_resource_get_user_data(resource);
@@ -1912,9 +1912,9 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
 
    /* identify class */
    if (clas == TIZEN_INPUT_DEVICE_CLAS_MOUSE)
-     eclas = ECORE_DEVICE_CLASS_MOUSE;
+     eclas = EVAS_DEVICE_CLASS_MOUSE;
    else if (clas == TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN)
-     eclas = ECORE_DEVICE_CLASS_TOUCH;
+     eclas = EVAS_DEVICE_CLASS_TOUCH;
    else
      {
         ERR("Not supported device clas(%d) subclas(%d) identifier(%s)",
@@ -1925,7 +1925,7 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
    edev = _device_get_by_identifier(identifier);
    if (edev)
      {
-        eclas = ecore_device_class_get(edev);
+        eclas = evas_device_class_get(edev);
      }
 
    /* fixed to */
@@ -1934,7 +1934,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 == ECORE_DEVICE_CLASS_MOUSE)
+   if (eclas == EVAS_DEVICE_CLASS_MOUSE)
      {
         switch (event_type)
           {
@@ -1974,7 +1974,7 @@ _remote_surface_cb_mouse_event_transfer(struct wl_client *client, struct wl_reso
               break;
           }
      }
-   else if (eclas == ECORE_DEVICE_CLASS_TOUCH)
+   else if (eclas == EVAS_DEVICE_CLASS_TOUCH)
      {
         switch (event_type)
           {
@@ -2025,7 +2025,7 @@ _remote_surface_cb_mouse_wheel_transfer(struct wl_client *client, struct wl_reso
    E_Comp_Wl_Remote_Surface *remote_surface;
    E_Client *ec;
 
-   Ecore_Device *edev = NULL;
+   Evas_Device *edev = NULL;
 
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
@@ -2051,8 +2051,8 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
    E_Comp_Wl_Remote_Surface *remote_surface;
    E_Client *ec;
 
-   Ecore_Device *edev = NULL;
-   Ecore_Device_Class eclas;
+   Evas_Device *edev = NULL;
+   Evas_Device_Class eclas;
    double eradx, erady, epressure, eangle;
 
    remote_surface = wl_resource_get_user_data(resource);
@@ -2068,7 +2068,7 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
 
    /* identify class */
    if (clas == TIZEN_INPUT_DEVICE_CLAS_TOUCHSCREEN)
-     eclas = ECORE_DEVICE_CLASS_TOUCH;
+     eclas = EVAS_DEVICE_CLASS_TOUCH;
    else
      {
         ERR("Not supported device clas(%d) subclas(%d identifier(%s)",
@@ -2080,7 +2080,7 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
    edev = _device_get_by_identifier(identifier);
    if (edev)
      {
-        eclas = ecore_device_class_get(edev);
+        eclas = evas_device_class_get(edev);
      }
 
    /* fixed to */
@@ -2089,7 +2089,7 @@ _remote_surface_cb_touch_event_transfer(struct wl_client *client, struct wl_reso
    epressure = wl_fixed_to_double(pressure);
    eangle = wl_fixed_to_double(angle);
 
-   if (eclas == ECORE_DEVICE_CLASS_TOUCH)
+   if (eclas == EVAS_DEVICE_CLASS_TOUCH)
      {
         switch (event_type)
           {
@@ -2159,8 +2159,8 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour
    E_Comp_Wl_Remote_Surface *remote_surface;
    E_Client *ec;
 
-   Ecore_Device *edev = NULL;
-   Ecore_Device_Class eclas;
+   Evas_Device *edev = NULL;
+   Evas_Device_Class eclas;
 
    remote_surface = wl_resource_get_user_data(resource);
    EINA_SAFETY_ON_NULL_RETURN(remote_surface);
@@ -2175,7 +2175,7 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour
 
    /* identify class */
    if (clas == TIZEN_INPUT_DEVICE_CLAS_KEYBOARD)
-     eclas = ECORE_DEVICE_CLASS_KEYBOARD;
+     eclas = EVAS_DEVICE_CLASS_KEYBOARD;
    else
      {
         ERR("Not supported device class(%d) subclass(%d identifier(%s)",
@@ -2187,10 +2187,10 @@ _remote_surface_cb_key_event_transfer(struct wl_client *client, struct wl_resour
    edev = _device_get_by_identifier(identifier);
    if (edev)
      {
-        eclas = ecore_device_class_get(edev);
+        eclas = evas_device_class_get(edev);
      }
 
-   if (eclas == ECORE_DEVICE_CLASS_KEYBOARD)
+   if (eclas == EVAS_DEVICE_CLASS_KEYBOARD)
      {
         switch (event_type)
           {
index 79f5df5..598850d 100644 (file)
@@ -1179,9 +1179,9 @@ _e_info_client_proc_input_device_info(int argc, char **argv)
      {
         i++;
         printf("%3d %50s %20s         ", i, dev->name, dev->identifier);
-        if (dev->clas == ECORE_DEVICE_CLASS_MOUSE) printf("Mouse | ");
-        else if (dev->clas == ECORE_DEVICE_CLASS_KEYBOARD) printf("Keyboard | ");
-        else if (dev->clas == ECORE_DEVICE_CLASS_TOUCH) printf("Touch | ");
+        if (dev->clas == EVAS_DEVICE_CLASS_MOUSE) printf("Mouse | ");
+        else if (dev->clas == EVAS_DEVICE_CLASS_KEYBOARD) printf("Keyboard | ");
+        else if (dev->clas == EVAS_DEVICE_CLASS_TOUCH) printf("Touch | ");
         printf("(0x%x)\n", dev->clas);
      }
 
index 42cb45b..ef82aa4 100644 (file)
@@ -170,6 +170,7 @@ e_input_init(Ecore_Evas *ee)
         e_comp_wl_input_seat_caps_set(seat_caps);
      }
 
+   e_input->ee = ee;
    e_input->dev = dev;
 
    E_LIST_HANDLER_APPEND(e_input->handlers, E_EVENT_SCREEN_CHANGE, _e_input_cb_screen_change, NULL);
@@ -232,3 +233,17 @@ e_input_shutdown(void)
 
    return _e_input_init_count;
 }
+
+EINTERN E_Input *
+e_input_get()
+{
+   if (e_input) return e_input;
+   return NULL;
+}
+
+EINTERN Ecore_Evas *
+e_input_get_ecore_evas(E_Input *ei)
+{
+   if (ei) return ei->ee;
+   return NULL;
+}
index 39c0562..3a300fb 100644 (file)
@@ -35,7 +35,11 @@ struct _E_Input_Event_Input_Device_Add
    const char *name; /* descriptive device name */
    const char *sysname; /* system name of the input device */
    const char *seatname; /* logical name of the seat */
+   const char *identifier; /* unique identifier (e.g. path) */
+
    E_Input_Seat_Capabilities caps; /* capabilities on a device */
+   Evas_Device_Class clas; /* class of a device */
+   Evas_Device_Subclass subclas; /* subclass of a device */
 };
 
 struct _E_Input_Event_Input_Device_Del
@@ -43,7 +47,11 @@ struct _E_Input_Event_Input_Device_Del
    const char *name; /* descriptive device name */
    const char *sysname; /* system name of the input device */
    const char *seatname; /* logical name of the seat */
+   const char *identifier; /* unique identifier (e.g. path) */
+
    E_Input_Seat_Capabilities caps; /* capabilities on a device */
+   Evas_Device_Class clas; /* class of a device */
+   Evas_Device_Subclass subclas; /* subclass of a device */
 };
 
 typedef struct _E_Input_Device E_Input_Device;
@@ -57,6 +65,7 @@ typedef struct _E_Input_Event_Input_Device_Del E_Input_Event_Input_Device_Del;
 struct _E_Input
 {
    Ecore_Window window;
+   Ecore_Evas *ee;
    E_Input_Device *dev;
    const char *input_base_dir;
    Eina_List *handlers;
@@ -81,6 +90,8 @@ EINTERN int e_input_init(Ecore_Evas *ee);
 EINTERN int e_input_shutdown(void);
 EINTERN const char *e_input_base_dir_get(void);
 EINTERN Eina_Bool e_input_thread_enabled_get(void);
+EINTERN E_Input *e_input_get(void);
+EINTERN Evas *e_input_get_evas(E_Input *ei);
 
 EINTERN E_Input_Device *e_input_device_open(void);
 EINTERN Eina_Bool e_input_device_close(E_Input_Device *dev);
@@ -112,7 +123,7 @@ E_API void e_input_device_pointer_warp(E_Input_Device *dev, int x, int y);
 E_API const char *e_input_evdev_name_get(E_Input_Evdev *evdev);
 E_API Eina_List *e_input_seat_evdev_list_get(E_Input_Seat *seat);
 E_API int e_input_evdev_wheel_click_angle_get(E_Input_Evdev *dev);
-E_API Ecore_Device *e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas);
+E_API Evas_Device *e_input_evdev_get_evas_device(const char *path, Evas_Device_Class clas);
 
 #endif
 #endif
index f2c2430..83d02ee 100644 (file)
@@ -290,24 +290,24 @@ _device_remapped_key_get(E_Input_Evdev *edev, int code)
    return code;
 }
 
-E_API Ecore_Device *
-e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas)
+E_API Evas_Device *
+e_input_evdev_get_evas_device(const char *path, Evas_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Ecore_Device *dev = NULL;
+   Evas_Device *dev = NULL;
    const char *identifier;
 
    if (!path) return NULL;
 
-   dev_list = ecore_device_list();
+   dev_list = evas_device_list();
    if (!dev_list) return NULL;
    EINA_LIST_FOREACH(dev_list, l, dev)
      {
         if (!dev) continue;
-        identifier = ecore_device_identifier_get(dev);
+        identifier = evas_device_description_get(dev);
         if (!identifier) continue;
-        if ((ecore_device_class_get(dev) == clas) && !(strcmp(identifier, path)))
+        if ((evas_device_class_get(dev) == clas) && !(strcmp(identifier, path)))
           return dev;
      }
    return NULL;
@@ -338,6 +338,15 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
         return;
      }
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_KEYBOARD);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    timestamp = libinput_event_keyboard_get_time(event);
    code = libinput_event_keyboard_get_key(event);
    code = _device_remapped_key_get(edev, code) + 8;
@@ -422,7 +431,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
    _device_modifiers_update(edev);
 
    e->modifiers = edev->xkb.modifiers;
-   e->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_KEYBOARD);
+   e->dev = edev->evas_dev;
 
    if (state)
      ecore_event_add(ECORE_EVENT_KEY_DOWN, e, NULL, NULL);
@@ -440,6 +449,15 @@ _device_pointer_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event
 
    if (!(input = edev->seat->input)) return;
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_MOUSE);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
 
    if (edev->seat->ptr.ix < edev->mouse.minx)
@@ -479,7 +497,7 @@ _device_pointer_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;
    ev->multi.root.y = ev->y;
-   ev->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = edev->evas_dev;
 
    ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
 }
@@ -580,6 +598,15 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
         return;
      }
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_MOUSE);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button))))
      {
         return;
@@ -617,7 +644,7 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;
    ev->multi.root.y = ev->y;
-   ev->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = edev->evas_dev;
 
    if (state)
      {
@@ -678,6 +705,15 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
         return;
      }
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_MOUSE);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel))))
      {
         return;
@@ -698,7 +734,7 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
    ev->y = edev->seat->ptr.iy;
    ev->root.x = ev->x;
    ev->root.y = ev->y;
-   ev->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
+   ev->dev = edev->evas_dev;
 
    axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
    if (libinput_event_pointer_has_axis(event, axis))
@@ -724,6 +760,15 @@ _device_handle_touch_event_send(E_Input_Evdev *edev, struct libinput_event_touch
    if (!edev) return;
    if (!(input = edev->seat->input)) return;
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_TOUCH);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button)))) return;
 
    timestamp = libinput_event_touch_get_time(event);
@@ -766,7 +811,7 @@ _device_handle_touch_event_send(E_Input_Evdev *edev, struct libinput_event_touch
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;
    ev->multi.root.y = ev->y;
-   ev->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
+   ev->dev = edev->evas_dev;
 
    if (state == ECORE_EVENT_MOUSE_BUTTON_DOWN)
      {
@@ -815,6 +860,15 @@ _device_handle_touch_motion_send(E_Input_Evdev *edev, struct libinput_event_touc
    if (!edev) return;
    if (!(input = edev->seat->input)) return;
 
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_TOUCH);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        return;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
 
    ev->window = (Ecore_Window)input->dev->window;
@@ -851,7 +905,7 @@ _device_handle_touch_motion_send(E_Input_Evdev *edev, struct libinput_event_touc
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;
    ev->multi.root.y = ev->y;
-   ev->dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
+   ev->dev = edev->evas_dev;
 
    ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
 }
@@ -955,6 +1009,16 @@ _device_handle_touch_aux_data(struct libinput_device *device, struct libinput_ev
 
    if (!(edev = libinput_device_get_user_data(device))) goto end;
    if (!(input = edev->seat->input)) goto end;
+
+   if (!edev->evas_dev)
+     edev->evas_dev = e_input_evdev_get_evas_device(edev->path, EVAS_DEVICE_CLASS_MOUSE);
+
+   if (!edev->evas_dev)
+     {
+        ERR("Failed to get source evas device from event !\n");
+        goto end;
+     }
+
    if (!(ev = calloc(1, sizeof(Ecore_Event_Axis_Update))))goto end;
 
    ev->window = (Ecore_Window)input->dev->window;
@@ -970,6 +1034,7 @@ _device_handle_touch_aux_data(struct libinput_device *device, struct libinput_ev
         ev->naxis = 1;
      }
    ev->axis = axis;
+   ev->dev = edev->evas_dev;
 
    ecore_event_add(ECORE_EVENT_AXIS_UPDATE, ev, _e_input_aux_data_event_free, NULL);
 
@@ -1049,6 +1114,7 @@ _e_input_evdev_device_destroy(E_Input_Evdev *edev)
         if (edev->xkb.keymap) xkb_map_unref(edev->xkb.keymap);
      }
 
+   if (edev->evas_dev) evas_device_del(edev->evas_device);
    if (edev->path) eina_stringshare_del(edev->path);
    if (edev->device) libinput_device_unref(edev->device);
    if (edev->key_remap_hash) eina_hash_free(edev->key_remap_hash);
index e5cfe88..798da5f 100644 (file)
@@ -5,13 +5,39 @@ static E_Input_Seat *
 _seat_create(E_Input_Backend *input, const char *seat)
 {
    E_Input_Seat *s;
+   Evas *evs = NULL;
+   E_Input *ei = NULL;
+   Ecore_Evas *ee = NULL;
+   Evas_Device *evas_dev = NULL;
+
+   ei = e_input_get();
+   if (!ei) return NULL;
+
+   ee = e_input_get_ecore_evas(ei);
+   if (!ee) return NULL;
+
+   evs = ecore_evas_get(ee);
+   if (!evs) return NULL;
+
+   /* create an evas device of a seat */
+   evas_dev = evas_device_add_full(evs, "Enlightenment seat", s->name, NULL, NULL,
+                                   EVAS_DEVICE_CLASS_SEAT, EVAS_DEVICE_SUBCLASS_NONE);
+   if (!evas_dev)
+     {
+        ERR("Failed to create an evas device for a seat !\n");
+               return NULL;
+     }
 
    /* try to allocate space for new seat */
    if (!(s = calloc(1, sizeof(E_Input_Seat))))
-     return NULL;
+     {
+        evas_device_del(evas_dev);
+        return NULL;
+     }
 
    s->input = input;
    s->name = eina_stringshare_add(seat);
+   s->evas_dev = evas_dev;
 
    /* add this new seat to list */
    input->dev->seats = eina_list_append(input->dev->seats, s);
@@ -30,6 +56,7 @@ _e_input_event_input_device_add_free(void *data EINA_UNUSED, void *ev)
    eina_stringshare_del(e->name);
    eina_stringshare_del(e->sysname);
    eina_stringshare_del(e->seatname);
+   eina_stringshare_del(e->identifier);
 
    free(e);
 }
@@ -43,6 +70,7 @@ _e_input_event_input_device_del_free(void *data EINA_UNUSED, void *ev)
    eina_stringshare_del(e->name);
    eina_stringshare_del(e->sysname);
    eina_stringshare_del(e->seatname);
+   eina_stringshare_del(e->identifier);
 
    free(e);
 }
@@ -74,150 +102,144 @@ _ecore_event_device_info_free(void *data EINA_UNUSED, void *ev)
    free(e);
 }
 
-static Ecore_Device_Class
-_e_input_seat_cap_to_ecore_device_class(unsigned int cap)
+static Evas_Device_Class
+_e_input_seat_cap_to_evas_device_class(unsigned int cap)
 {
    switch(cap)
      {
       case E_INPUT_SEAT_POINTER:
-         return ECORE_DEVICE_CLASS_MOUSE;
+         return EVAS_DEVICE_CLASS_MOUSE;
       case E_INPUT_SEAT_KEYBOARD:
-         return ECORE_DEVICE_CLASS_KEYBOARD;
+         return EVAS_DEVICE_CLASS_KEYBOARD;
       case E_INPUT_SEAT_TOUCH:
-         return ECORE_DEVICE_CLASS_TOUCH;
+         return EVAS_DEVICE_CLASS_TOUCH;
       default:
-         return ECORE_DEVICE_CLASS_NONE;
+         return EVAS_DEVICE_CLASS_NONE;
      }
-   return ECORE_DEVICE_CLASS_NONE;
-}
-
-void
-_e_input_send_device_info(unsigned int window, E_Input_Evdev *edev, Ecore_Device_Class clas, Ecore_Device_Subclass subclas, Eina_Bool flag)
-{
-   Ecore_Event_Device_Info *e;
-
-   if (!(e = calloc(1, sizeof(Ecore_Event_Device_Info)))) return;
-
-   e->name = eina_stringshare_add(libinput_device_get_name(edev->device));
-   e->identifier = eina_stringshare_add(edev->path);
-   e->seatname = eina_stringshare_add(edev->seat->name);
-   e->clas = clas;
-   e->subclas = subclas;
-   e->window = window;
-
-   if (flag)
-     ecore_event_add(ECORE_EVENT_DEVICE_ADD, e, _ecore_event_device_info_free, NULL);
-   else
-     ecore_event_add(ECORE_EVENT_DEVICE_DEL, e, _ecore_event_device_info_free, NULL);
+   return EVAS_DEVICE_CLASS_NONE;
 }
 
 static Eina_Bool
-_e_input_add_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
+_e_input_add_evas_device(E_Input_Evdev *edev, Evas_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Ecore_Device *dev = NULL;
+   Evas_Device *dev = NULL;
    const char *identifier;
 
-   if (!edev->path) return EINA_FALSE;
+   Ecore_Evas *ee = NULL;
+   E_Input *ei = NULL;
+   Evas *evs = NULL;
 
-   dev_list = ecore_device_list();
+   if (!edev || !edev->path) return EINA_FALSE;
+
+   dev_list = evas_device_list();
    if (dev_list)
      {
         EINA_LIST_FOREACH(dev_list, l, dev)
           {
              if (!dev) continue;
-             identifier = ecore_device_identifier_get(dev);
+             identifier = evas_device_description_get(dev);
              if (!identifier) continue;
-             if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
+             if ((evas_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
                 return EINA_FALSE;
           }
      }
 
-   if(!(dev = ecore_device_add())) return EINA_FALSE;
+   ei = e_input_get();
+   if (!ei) return EINA_FALSE;
+
+   ee = e_input_get_ecore_evas(ei);
+   if (!ee) return EINA_FALSE;
+
+   evs = ecore_evas_get(ee);
+   if (!evs) return EINA_FALSE;
+
+   dev = evas_device_add_full(evs,libinput_device_get_name(edev->device),
+                              edev->path, edev->seat->evas_dev , NULL, clas, EVAS_DEVICE_SUBCLASS_NONE)
+   if (!dev)
+     {
+        edev->evas_dev = NULL;
+        return EINA_FALSE;
+     }
+
+   edev->evas_dev = dev;
 
-   ecore_device_name_set(dev, libinput_device_get_name(edev->device));
-   ecore_device_description_set(dev, libinput_device_get_name(edev->device));
-   ecore_device_identifier_set(dev, edev->path);
-   ecore_device_class_set(dev, clas);
    return EINA_TRUE;
 }
 
 static Eina_Bool
-_e_input_remove_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
+_e_input_remove_evas_device(E_Input_Evdev *edev, Evas_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Ecore_Device *dev = NULL;
+   Evas_Device *dev = NULL;
    const char *identifier;
 
    if (!edev->path) return EINA_FALSE;
 
-   dev_list = ecore_device_list();
+   dev_list = evas_device_list();
    if (!dev_list) return EINA_FALSE;
    EINA_LIST_FOREACH(dev_list, l, dev)
       {
          if (!dev) continue;
-         identifier = ecore_device_identifier_get(dev);
+         identifier = evas_device_description_get(dev);
          if (!identifier) continue;
-         if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
+         if ((evas_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
            {
-              ecore_device_del(dev);
+              evas_device_del(dev);
+                         edev->evas_dev = NULL;
               return EINA_TRUE;
            }
       }
    return EINA_FALSE;
 }
 
-void
-_e_input_device_add(unsigned int window, E_Input_Evdev *edev)
+Eina_Bool
+_e_input_device_add(E_Input_Evdev *edev)
 {
    Eina_Bool ret = EINA_FALSE;
-   Ecore_Device_Class clas;
+   Evas_Device_Class clas;
 
    if (edev->caps & E_INPUT_SEAT_POINTER)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
-        ret = _e_input_add_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_POINTER);
+        ret = _e_input_add_evas_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_KEYBOARD)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
-        ret = _e_input_add_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_KEYBOARD);
+        ret = _e_input_add_evas_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_TOUCH)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
-        ret = _e_input_add_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_TOUCH);
+        ret = _e_input_add_evas_device(edev, clas);
      }
+
+   return ret;
 }
 
 void
-_e_input_device_remove(unsigned int window, E_Input_Evdev *edev)
+_e_input_device_remove(E_Input_Evdev *edev)
 {
    Eina_Bool ret = EINA_FALSE;
-   Ecore_Device_Class clas;
+   Evas_Device_Class clas;
 
    if (edev->caps & E_INPUT_SEAT_POINTER)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
-        ret = _e_input_remove_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_POINTER);
+        _e_input_remove_evas_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_KEYBOARD)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
-        ret = _e_input_remove_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_KEYBOARD);
+        _e_input_remove_evas_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_TOUCH)
      {
-        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
-        ret = _e_input_remove_ecore_device(edev, clas);
-        if (ret) _e_input_send_device_info(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
+        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_TOUCH);
+        _e_input_remove_evas_device(edev, clas);
      }
 }
 
@@ -258,18 +280,24 @@ _device_added(E_Input_Backend *input, struct libinput_device *device)
         return;
      }
 
+   if (EINA_FALSE == _e_input_device_add(edev))
+     {
+        ERR("Failed to create evas device !\n");
+               return;
+     }
+
    ev->name = eina_stringshare_add(libinput_device_get_name(device));
    ev->sysname = eina_stringshare_add(edev->path);
    ev->seatname = eina_stringshare_add(edev->seat->name);
    ev->caps = edev->caps;
+   ev->clas = evas_device_class_get(edev->evas_dev);
+   ev->identifier = eina_stringshare_add(edev->path);
+   ev->subclas = evas_device_subclass_get(edev->evas_dev);
 
    ecore_event_add(E_INPUT_EVENT_INPUT_DEVICE_ADD,
                    ev,
                    _e_input_event_input_device_add_free,
                    NULL);
-
-   if (input->dev->window != -1)
-     _e_input_device_add(input->dev->window, edev);
 }
 
 static void
@@ -294,14 +322,16 @@ _device_removed(E_Input_Backend *input, struct libinput_device *device)
    ev->sysname = eina_stringshare_add(edev->path);
    ev->seatname = eina_stringshare_add(edev->seat->name);
    ev->caps = edev->caps;
+   ev->clas = evas_device_class_get(edev->evas_dev);
+   ev->identifier = eina_stringshare_add(edev->path);
+   ev->subclas = evas_device_subclass_get(edev->evas_dev);
 
    ecore_event_add(E_INPUT_EVENT_INPUT_DEVICE_DEL,
                    ev,
                    _e_input_event_input_device_del_free,
                    NULL);
 
-   if (input->dev->window != -1)
-     _e_input_device_remove(input->dev->window, edev);
+   _e_input_device_remove(edev);
 
    /* remove this evdev from the seat's list of devices */
    edev->seat->devices = eina_list_remove(edev->seat->devices, edev);
index 2ba2939..d13711e 100644 (file)
@@ -22,6 +22,7 @@ struct _E_Input_Seat
    E_Input_Backend *input;
    Eina_List *devices;
    struct libinput_seat *seat;
+   Evas_Device *evas_dev;
 
    struct
      {
@@ -61,6 +62,7 @@ struct _E_Input_Evdev
 
    const char *path;
    int fd;
+   Evas_Device *evas_dev;
 
    int mt_slot;