e_client, e_comp_wl, e_info_client, e_input : replace Ecore_Device stuff with Evas_De...
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 1 Nov 2017 02:27:46 +0000 (11:27 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 8 Nov 2017 07:11:21 +0000 (16:11 +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 2be438fda0661f3e54cc5eff714f55a66fe6abda..34b24980ed3de136b8d873c71fe98a3a27f3950a 100644 (file)
@@ -6679,7 +6679,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;
 
@@ -6689,7 +6689,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;
 
@@ -6699,7 +6699,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;
 
@@ -6719,7 +6719,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;
 
@@ -6729,7 +6729,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;
 
@@ -6739,7 +6739,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;
 
@@ -6749,7 +6749,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;
 
@@ -6759,7 +6759,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 88227b84212872cf274f06ee125fc26ad9c6653a..50b4d08f61f3f6d136015f48bd6066eabe854ea9 100644 (file)
@@ -1102,15 +1102,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 042de54ffdf0f96bef5649c4a0344b2b15cb25ff..798f61563207e2a33e7e3ffbccab7e3ed9ebd7a5 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;
@@ -920,7 +920,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),
@@ -988,7 +988,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);
      }
@@ -5340,7 +5340,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);
@@ -5708,7 +5708,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;
@@ -5737,7 +5737,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);
@@ -5750,7 +5750,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;
@@ -5761,7 +5761,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);
@@ -5770,11 +5770,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);
      }
 
@@ -5787,7 +5787,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;
@@ -5798,7 +5798,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);
@@ -5807,11 +5807,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);
      }
 
@@ -5836,7 +5836,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;
@@ -5851,7 +5851,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,
@@ -5864,7 +5864,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;
@@ -5879,7 +5879,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;
@@ -5890,7 +5890,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;
@@ -5905,7 +5905,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);
 
@@ -5913,7 +5913,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;
@@ -5935,7 +5935,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),
@@ -5946,7 +5946,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;
@@ -5968,7 +5968,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 689e3fb83dc78cceed40ee0c55ac75b3db83837d..9c46f2e81a9d9dfdf331c5de3c94bc8240272c10 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 Eina_Bool e_comp_wl_cursor_hide(E_Client *ec);
 
index a0861120e25220ccbf55db29ce4b073ea8333b14..dc104409d9f86560483534b58adaf2c9e533f1fe 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;
      }
 
@@ -1885,8 +1885,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);
@@ -1902,9 +1902,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)",
@@ -1915,7 +1915,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 */
@@ -1924,7 +1924,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)
           {
@@ -1964,7 +1964,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)
           {
@@ -2015,7 +2015,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);
@@ -2041,8 +2041,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);
@@ -2058,7 +2058,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)",
@@ -2070,7 +2070,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 */
@@ -2079,7 +2079,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)
           {
@@ -2149,8 +2149,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);
@@ -2165,7 +2165,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)",
@@ -2177,10 +2177,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 c92ec493b6d08fe303d7a15c75ad7f42d38ec8ca..32dd6e41f039524c9b34b225452f13af6d23a7d9 100644 (file)
@@ -1150,9 +1150,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 830a1d0af94a2a81ec28b94f1cc0881dc66fb28f..9156e9ae44b3344292b0c535b768c10c4ab2a0ba 100644 (file)
@@ -72,6 +72,7 @@ e_input_init(Ecore_Evas *ee)
         goto device_create_err;
      }
 
+   e_input->ee = ee;
    e_input->dev = dev;
 
    return _e_input_init_count;
@@ -123,3 +124,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 6ee85f761748b44a6d9bef44cc5d6fa0907952aa..48e12ffa7357b76ca84785d782755ab0db28eea1 100644 (file)
@@ -29,7 +29,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
@@ -37,7 +41,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;
@@ -51,6 +59,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;
 };
 
@@ -69,6 +78,8 @@ struct _E_Input_Device
 
 EINTERN int e_input_init(Ecore_Evas *ee);
 EINTERN int e_input_shutdown(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);
@@ -100,7 +111,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 ed0b934a5fde2fcf32b319b4c9e585ad0ea8d80b..5c44e0935daaa636438ae46c3f5e636cc2937e0f 100644 (file)
@@ -250,24 +250,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;
@@ -298,6 +298,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;
@@ -381,7 +390,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);
@@ -399,6 +408,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)
@@ -438,7 +456,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);
 }
@@ -539,6 +557,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;
@@ -576,7 +603,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)
      {
@@ -637,6 +664,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;
@@ -657,7 +693,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))
@@ -683,6 +719,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);
@@ -725,7 +770,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)
      {
@@ -774,6 +819,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;
@@ -811,7 +865,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);
 }
@@ -915,6 +969,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;
@@ -930,6 +994,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);
 
@@ -1033,6 +1098,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 dfbed89f99d72ea2734d1e7a4b9791027ae5c855..b4c0b235a57cdca85eae044a49142d75f5eed941 100644 (file)
@@ -12,13 +12,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);
@@ -37,6 +63,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);
 }
@@ -50,6 +77,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);
 }
@@ -81,150 +109,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);
      }
 }
 
@@ -265,18 +287,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
@@ -301,14 +329,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 10bf73f15178fba4baa662825d3a6301b2f1b53d..b9d7803ec18ae3cc9faf4304681e3f3ddfcbeef2 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
      {
@@ -53,6 +54,7 @@ struct _E_Input_Evdev
 
    const char *path;
    int fd;
+   Evas_Device *evas_dev;
 
    int mt_slot;