e_input: using ecore_device instead of evas_device 68/173068/2
authorJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 19 Mar 2018 10:21:52 +0000 (19:21 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 19 Mar 2018 10:28:05 +0000 (19:28 +0900)
Change-Id: I00d082192941bb9724e070e921775b2fdbdd86da

src/bin/e_input.h
src/bin/e_input_evdev.c
src/bin/e_input_inputs.c
src/bin/e_input_private.h

index 99c0471..5b838bc 100644 (file)
@@ -38,8 +38,8 @@ struct _E_Input_Event_Input_Device_Add
    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 */
+   Ecore_Device_Class clas; /* class of a device */
+   Ecore_Device_Subclass subclas; /* subclass of a device */
 };
 
 struct _E_Input_Event_Input_Device_Del
@@ -50,8 +50,8 @@ struct _E_Input_Event_Input_Device_Del
    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 */
+   Ecore_Device_Class clas; /* class of a device */
+   Ecore_Device_Subclass subclas; /* subclass of a device */
 };
 
 typedef struct _E_Input_Device E_Input_Device;
@@ -123,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 Evas_Device *e_input_evdev_get_evas_device(const char *path, Evas_Device_Class clas);
+E_API Ecore_Device *e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas);
 
 #endif
 #endif
index 99d925b..3b1f752 100644 (file)
@@ -290,30 +290,70 @@ _device_remapped_key_get(E_Input_Evdev *edev, int code)
    return code;
 }
 
-E_API Evas_Device *
-e_input_evdev_get_evas_device(const char *path, Evas_Device_Class clas)
+E_API Ecore_Device *
+e_input_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Evas_Device *dev = NULL;
+   Ecore_Device *dev = NULL;
    const char *identifier;
 
    if (!path) return NULL;
 
-   dev_list = evas_device_list(e_comp->evas, NULL);
+   dev_list = ecore_device_list();
    if (!dev_list) return NULL;
    EINA_LIST_FOREACH(dev_list, l, dev)
      {
         if (!dev) continue;
-        identifier = evas_device_description_get(dev);
+        identifier = ecore_device_identifier_get(dev);
         if (!identifier) continue;
-        if ((evas_device_class_get(dev) == clas) && !(strcmp(identifier, path)))
+        if ((ecore_device_class_get(dev) == clas) && !(strcmp(identifier, path)))
           return dev;
      }
    return NULL;
 }
 
 static void
+_e_input_event_mouse_move_cb_free(void *data EINA_UNUSED, void *event)
+{
+   Ecore_Event_Mouse_Move *ev = event;
+
+   if (ev->dev) ecore_device_unref(ev->dev);
+
+   free(ev);
+}
+
+static void
+_e_input_event_mouse_wheel_cb_free(void *data EINA_UNUSED, void *event)
+{
+   Ecore_Event_Mouse_Wheel *ev = event;
+
+   if (ev->dev) ecore_device_unref(ev->dev);
+
+   free(ev);
+}
+
+static void
+_e_input_event_mouse_button_cb_free(void *data EINA_UNUSED, void *event)
+{
+   Ecore_Event_Mouse_Button *ev = event;
+
+   if (ev->dev) ecore_device_unref(ev->dev);
+
+   free(ev);
+}
+
+static void
+_e_input_event_key_cb_free(void *data EINA_UNUSED, void *event)
+{
+   Ecore_Event_Key *ev = event;
+
+   if (ev->dev) ecore_device_unref(ev->dev);
+
+   free(ev);
+}
+
+static void
 _device_handle_key(struct libinput_device *device, struct libinput_event_keyboard *event)
 {
    E_Input_Evdev *edev;
@@ -338,12 +378,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_KEYBOARD);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -431,12 +471,12 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
    _device_modifiers_update(edev);
 
    e->modifiers = edev->xkb.modifiers;
-   e->dev = edev->evas_dev;
+   e->dev = ecore_device_ref(edev->ecore_dev);
 
    if (state)
-     ecore_event_add(ECORE_EVENT_KEY_DOWN, e, NULL, NULL);
+     ecore_event_add(ECORE_EVENT_KEY_DOWN, e, _e_input_event_key_cb_free, NULL);
    else
-     ecore_event_add(ECORE_EVENT_KEY_UP, e, NULL, NULL);
+     ecore_event_add(ECORE_EVENT_KEY_UP, e, _e_input_event_key_cb_free, NULL);
 
    if (tmp) free(tmp);
 }
@@ -449,12 +489,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -497,9 +537,9 @@ _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 = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
-   ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+   ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _e_input_event_mouse_move_cb_free, NULL);
 }
 
 void
@@ -598,12 +638,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -644,7 +684,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 = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
    if (state)
      {
@@ -682,9 +722,9 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
      ev->triple_click = 1;
 
    if (state)
-     ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
+     ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, _e_input_event_mouse_button_cb_free, NULL);
    else
-     ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
+     ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, _e_input_event_mouse_button_cb_free, NULL);
 }
 
 static void
@@ -705,12 +745,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -734,7 +774,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 = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
    axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
    if (libinput_event_pointer_has_axis(event, axis))
@@ -747,7 +787,7 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
         ev->z = libinput_event_pointer_get_axis_value(event, axis);
      }
 
-   ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
+   ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _e_input_event_mouse_wheel_cb_free, NULL);
 }
 
 static void
@@ -760,12 +800,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -811,7 +851,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 = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
    if (state == ECORE_EVENT_MOUSE_BUTTON_DOWN)
      {
@@ -848,7 +888,7 @@ _device_handle_touch_event_send(E_Input_Evdev *edev, struct libinput_event_touch
    if (edev->mouse.did_triple)
      ev->triple_click = 1;
 
-   ecore_event_add(state, ev, NULL, NULL);
+   ecore_event_add(state, ev, _e_input_event_mouse_button_cb_free, NULL);
 }
 
 static void
@@ -860,12 +900,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_TOUCH);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         return;
      }
 
@@ -905,9 +945,9 @@ _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 = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
-   ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+   ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, _e_input_event_mouse_move_cb_free, NULL);
 }
 
 static void
@@ -990,8 +1030,10 @@ static void
 _e_input_aux_data_event_free(void *user_data EINA_UNUSED, void *ev)
 {
    Ecore_Event_Axis_Update *e = (Ecore_Event_Axis_Update *)ev;
-   if (e->axis)
-     free(e->axis);
+
+   if (e->axis) free(e->axis);
+   if (e->dev) ecore_device_unref(e->dev);
+
    free(e);
 }
 
@@ -1010,12 +1052,12 @@ _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->ecore_dev)
+     edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
 
-   if (!edev->evas_dev)
+   if (!edev->ecore_dev)
      {
-        ERR("Failed to get source evas device from event !\n");
+        ERR("Failed to get source ecore device from event !\n");
         goto end;
      }
 
@@ -1034,7 +1076,7 @@ _device_handle_touch_aux_data(struct libinput_device *device, struct libinput_ev
         ev->naxis = 1;
      }
    ev->axis = axis;
-   ev->dev = edev->evas_dev;
+   ev->dev = ecore_device_ref(edev->ecore_dev);
 
    ecore_event_add(ECORE_EVENT_AXIS_UPDATE, ev, _e_input_aux_data_event_free, NULL);
 
@@ -1114,7 +1156,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_dev);
+   if (edev->ecore_dev) ecore_device_del(edev->ecore_dev);
    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 4e513ff..b63a928 100644 (file)
@@ -1,49 +1,96 @@
 #include "e.h"
 #include "e_input_private.h"
 
-static E_Input_Seat *
-_seat_create(E_Input_Backend *input, const char *seat)
+static Ecore_Device_Class
+_e_input_seat_cap_to_ecore_device_class(unsigned int cap)
 {
-   E_Input_Seat *s;
-   Evas *evs = NULL;
-   E_Input *ei = NULL;
-   Ecore_Evas *ee = NULL;
-   Evas_Device *evas_dev = NULL;
+   switch(cap)
+     {
+      case E_INPUT_SEAT_POINTER:
+         return ECORE_DEVICE_CLASS_MOUSE;
+      case E_INPUT_SEAT_KEYBOARD:
+         return ECORE_DEVICE_CLASS_KEYBOARD;
+      case E_INPUT_SEAT_TOUCH:
+         return ECORE_DEVICE_CLASS_TOUCH;
+      default:
+         return ECORE_DEVICE_CLASS_NONE;
+     }
+   return ECORE_DEVICE_CLASS_NONE;
+}
+
+static void
+_e_input_ecore_device_info_free(void *data EINA_UNUSED, void *ev)
+{
+   Ecore_Event_Device_Info *e;
+
+   e = ev;
+   eina_stringshare_del(e->name);
+   eina_stringshare_del(e->identifier);
+   eina_stringshare_del(e->seatname);
+
+   free(e);
+}
+
+void
+_e_input_ecore_device_event(Ecore_Device *dev, Eina_Bool flag)
+{
+   Ecore_Event_Device_Info *e;
+   E_Input *e_input;
 
-   ei = e_input_get();
-   if (!ei) return NULL;
+   if (!(e = calloc(1, sizeof(Ecore_Event_Device_Info)))) return;
 
-   ee = e_input_ecore_evas_get(ei);
-   if (!ee) return NULL;
+   e_input = e_input_get();
 
-   evs = ecore_evas_get(ee);
-   if (!evs) return NULL;
+   e->window = e_input?e_input->window:(Ecore_Window)0;
+   e->name = eina_stringshare_add(ecore_device_name_get(dev));
+   e->identifier = eina_stringshare_add(ecore_device_identifier_get(dev));
+   e->seatname = eina_stringshare_add(ecore_device_name_get(dev));
+   e->clas = ecore_device_class_get(dev);
+   e->subclas = ecore_device_subclass_get(dev);
+
+   if (flag)
+     ecore_event_add(ECORE_EVENT_DEVICE_ADD, e, _e_input_ecore_device_info_free, NULL);
+   else
+     ecore_event_add(ECORE_EVENT_DEVICE_DEL, e, _e_input_ecore_device_info_free, NULL);
+}
+
+static E_Input_Seat *
+_seat_create(E_Input_Backend *input, const char *seat)
+{
+   E_Input_Seat *s;
+   Ecore_Device *ecore_dev = NULL;
 
    /* create an evas device of a seat */
-   evas_dev = evas_device_add_full(evs, seat, "Enlightenment seat", NULL, NULL,
-                                   EVAS_DEVICE_CLASS_SEAT, EVAS_DEVICE_SUBCLASS_NONE);
-   if (!evas_dev)
+   ecore_dev = ecore_device_add();
+   if (!ecore_dev)
      {
-        ERR("Failed to create an evas device for a seat !\n");
+        ERR("Failed to create an ecore device for a seat !\n");
                return NULL;
      }
 
+   ecore_device_name_set(ecore_dev, seat);
+   ecore_device_identifier_set(ecore_dev, "Enlightenment seat");
+   ecore_device_class_set(ecore_dev, ECORE_DEVICE_CLASS_SEAT);
+   ecore_device_subclass_set(ecore_dev, ECORE_DEVICE_SUBCLASS_NONE);
+
    /* try to allocate space for new seat */
    if (!(s = calloc(1, sizeof(E_Input_Seat))))
      {
-        evas_device_del(evas_dev);
+        ecore_device_del(ecore_dev);
         return NULL;
      }
 
    s->input = input;
    s->name = eina_stringshare_add(seat);
-   s->evas_dev = evas_dev;
+   s->ecore_dev = ecore_dev;
 
    /* add this new seat to list */
    input->dev->seats = eina_list_append(input->dev->seats, s);
 
    ecore_event_add(E_INPUT_EVENT_SEAT_ADD, NULL, NULL, NULL);
 
+   _e_input_ecore_device_event(ecore_dev, EINA_TRUE);
+
    return s;
 }
 
@@ -89,93 +136,71 @@ _seat_get(E_Input_Backend *input, const char *seat)
    return _seat_create(input, seat);
 }
 
-static Evas_Device_Class
-_e_input_seat_cap_to_evas_device_class(unsigned int cap)
-{
-   switch(cap)
-     {
-      case E_INPUT_SEAT_POINTER:
-         return EVAS_DEVICE_CLASS_MOUSE;
-      case E_INPUT_SEAT_KEYBOARD:
-         return EVAS_DEVICE_CLASS_KEYBOARD;
-      case E_INPUT_SEAT_TOUCH:
-         return EVAS_DEVICE_CLASS_TOUCH;
-      default:
-         return EVAS_DEVICE_CLASS_NONE;
-     }
-   return EVAS_DEVICE_CLASS_NONE;
-}
 
 static Eina_Bool
-_e_input_add_evas_device(E_Input_Evdev *edev, Evas_Device_Class clas)
+_e_input_add_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Evas_Device *dev = NULL;
+   Ecore_Device *dev = NULL;
    const char *identifier;
 
-   Ecore_Evas *ee = NULL;
-   E_Input *ei = NULL;
-   Evas *evs = NULL;
-
    if (!edev || !edev->path) return EINA_FALSE;
 
-   dev_list = evas_device_list(e_comp->evas, NULL);
+   dev_list = ecore_device_list();
    if (dev_list)
      {
         EINA_LIST_FOREACH(dev_list, l, dev)
           {
              if (!dev) continue;
-             identifier = evas_device_description_get(dev);
+             identifier = ecore_device_description_get(dev);
              if (!identifier) continue;
-             if ((evas_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
-                return EINA_FALSE;
+             if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
+               return EINA_FALSE;
           }
      }
 
-   ei = e_input_get();
-   if (!ei) return EINA_FALSE;
-
-   ee = e_input_ecore_evas_get(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);
+   dev = ecore_device_add();
    if (!dev)
      {
-        edev->evas_dev = NULL;
+        edev->ecore_dev = NULL;
         return EINA_FALSE;
      }
 
-   edev->evas_dev = dev;
+   ecore_device_name_set(dev, libinput_device_get_name(edev->device));
+   ecore_device_identifier_set(dev, edev->path);
+   ecore_device_class_set(dev, clas);
+   ecore_device_subclass_set(dev, ECORE_DEVICE_SUBCLASS_NONE);
+
+   edev->ecore_dev = ecore_device_ref(dev);
+
+   _e_input_ecore_device_event(dev, EINA_TRUE);
 
    return EINA_TRUE;
 }
 
 static Eina_Bool
-_e_input_remove_evas_device(E_Input_Evdev *edev, Evas_Device_Class clas)
+_e_input_remove_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
 {
    const Eina_List *dev_list = NULL;
    const Eina_List *l;
-   Evas_Device *dev = NULL;
+   Ecore_Device *dev = NULL;
    const char *identifier;
 
    if (!edev->path) return EINA_FALSE;
 
-   dev_list = evas_device_list(e_comp->evas, NULL);
+   dev_list = ecore_device_list();
    if (!dev_list) return EINA_FALSE;
    EINA_LIST_FOREACH(dev_list, l, dev)
       {
          if (!dev) continue;
-         identifier = evas_device_description_get(dev);
+         identifier = ecore_device_description_get(dev);
          if (!identifier) continue;
-         if ((evas_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
+         if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
            {
-              evas_device_del(dev);
-                         edev->evas_dev = NULL;
+              ecore_device_del(dev);
+              edev->ecore_dev = NULL;
+              _e_input_ecore_device_event(dev, EINA_FALSE);
               return EINA_TRUE;
            }
       }
@@ -186,22 +211,22 @@ Eina_Bool
 _e_input_device_add(E_Input_Evdev *edev)
 {
    Eina_Bool ret = EINA_FALSE;
-   Evas_Device_Class clas;
+   Ecore_Device_Class clas;
 
    if (edev->caps & E_INPUT_SEAT_POINTER)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_POINTER);
-        ret = _e_input_add_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
+        ret = _e_input_add_ecore_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_KEYBOARD)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_KEYBOARD);
-        ret = _e_input_add_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
+        ret = _e_input_add_ecore_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_TOUCH)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_TOUCH);
-        ret = _e_input_add_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
+        ret = _e_input_add_ecore_device(edev, clas);
      }
 
    return ret;
@@ -210,22 +235,22 @@ _e_input_device_add(E_Input_Evdev *edev)
 void
 _e_input_device_remove(E_Input_Evdev *edev)
 {
-   Evas_Device_Class clas;
+   Ecore_Device_Class clas;
 
    if (edev->caps & E_INPUT_SEAT_POINTER)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_POINTER);
-        _e_input_remove_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
+        _e_input_remove_ecore_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_KEYBOARD)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_KEYBOARD);
-        _e_input_remove_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
+        _e_input_remove_ecore_device(edev, clas);
      }
    if (edev->caps & E_INPUT_SEAT_TOUCH)
      {
-        clas = _e_input_seat_cap_to_evas_device_class(E_INPUT_SEAT_TOUCH);
-        _e_input_remove_evas_device(edev, clas);
+        clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
+        _e_input_remove_ecore_device(edev, clas);
      }
 }
 
@@ -269,16 +294,16 @@ _device_added(E_Input_Backend *input, struct libinput_device *device)
    if (EINA_FALSE == _e_input_device_add(edev))
      {
         ERR("Failed to create evas device !\n");
-               return;
+        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->clas = ecore_device_class_get(edev->ecore_dev);
    ev->identifier = eina_stringshare_add(edev->path);
-   ev->subclas = evas_device_subclass_get(edev->evas_dev);
+   ev->subclas = ecore_device_subclass_get(edev->ecore_dev);
 
    ecore_event_add(E_INPUT_EVENT_INPUT_DEVICE_ADD,
                    ev,
@@ -308,9 +333,9 @@ _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->clas = ecore_device_class_get(edev->ecore_dev);
    ev->identifier = eina_stringshare_add(edev->path);
-   ev->subclas = evas_device_subclass_get(edev->evas_dev);
+   ev->subclas = ecore_device_subclass_get(edev->ecore_dev);
 
    ecore_event_add(E_INPUT_EVENT_INPUT_DEVICE_DEL,
                    ev,
index d13711e..289d9cd 100644 (file)
@@ -22,7 +22,7 @@ struct _E_Input_Seat
    E_Input_Backend *input;
    Eina_List *devices;
    struct libinput_seat *seat;
-   Evas_Device *evas_dev;
+   Ecore_Device *ecore_dev;
 
    struct
      {
@@ -62,7 +62,7 @@ struct _E_Input_Evdev
 
    const char *path;
    int fd;
-   Evas_Device *evas_dev;
+   Ecore_Device *ecore_dev;
 
    int mt_slot;