}
void
-_ecore_drm_device_info_send(unsigned int window, Ecore_Drm_Evdev *edev, Ecore_Device_Class clas, Eina_Bool flag)
+_ecore_drm_device_info_send(unsigned int window, Ecore_Drm_Evdev *edev, Ecore_Device_Class clas, Ecore_Device_Subclass subclas, Eina_Bool flag)
{
Ecore_Event_Device_Info *e;
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)
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_POINTER);
ret = _ecore_drm_device_add_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 1);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
}
if (edev->seat_caps & EVDEV_SEAT_KEYBOARD)
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_KEYBOARD);
ret = _ecore_drm_device_add_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 1);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
}
if (edev->seat_caps & EVDEV_SEAT_TOUCH)
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_TOUCH);
ret = _ecore_drm_device_add_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 1);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 1);
}
}
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_POINTER);
ret = _ecore_drm_device_del_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 0);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
}
if (edev->seat_caps & EVDEV_SEAT_KEYBOARD)
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_KEYBOARD);
ret = _ecore_drm_device_del_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 0);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
}
if (edev->seat_caps & EVDEV_SEAT_TOUCH)
{
clas = _ecore_drm_seat_cap_to_ecore_device_class(EVDEV_SEAT_TOUCH);
ret = _ecore_drm_device_del_ecore_device(edev, clas);
- if (ret) _ecore_drm_device_info_send(window, edev, clas, 0);
+ if (ret) _ecore_drm_device_info_send(window, edev, clas, ECORE_DEVICE_SUBCLASS_NONE, 0);
}
}
const char *identifier;
const char *seatname;
Ecore_Device_Class clas;
+ Ecore_Device_Subclass subclas;
};
/**
}
static void
-_ecore_event_evas_add_evas_device(Evas *e, const char *name, const char *identifier, Ecore_Device_Class clas)
+_ecore_event_evas_add_evas_device(Evas *e, const char *name, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
const Eina_List *dev_list = NULL;
const Eina_List *l;
evas_device_name_set(edev, name);
evas_device_description_set(edev, identifier);
evas_device_class_set(edev, (Evas_Device_Class)clas);
+ evas_device_subclass_set(edev, (Evas_Device_Subclass)subclas);
}
static void
-_ecore_event_evas_del_evas_device(Evas *e, const char *name EINA_UNUSED, const char *identifier, Ecore_Device_Class clas)
+_ecore_event_evas_del_evas_device(Evas *e, const char *name EINA_UNUSED, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
const Eina_List *dev_list = NULL;
const Eina_List *l;
if (!edev) continue;
edev_name = evas_device_description_get(edev);
if (!edev_name) continue;
- if ((evas_device_class_get(edev) == (Evas_Device_Class)clas) && (!strcmp(edev_name, identifier)))
+ if ((evas_device_class_get(edev) == (Evas_Device_Class)clas) &&
+ (evas_device_subclass_get(edev) == (Evas_Device_Subclass)subclas) &&
+ (!strcmp(edev_name, identifier)))
{
evas_device_del(edev);
return;
lookup = _ecore_event_window_match(e->window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- _ecore_event_evas_add_evas_device(lookup->evas, e->name, e->identifier, e->clas);
+ _ecore_event_evas_add_evas_device(lookup->evas, e->name, e->identifier, e->clas, e->subclas);
return ECORE_CALLBACK_PASS_ON;
}
lookup = _ecore_event_window_match(e->window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
- _ecore_event_evas_del_evas_device(lookup->evas, e->name, e->identifier, e->clas);
+ _ecore_event_evas_del_evas_device(lookup->evas, e->name, e->identifier, e->clas, e->subclas);
return ECORE_CALLBACK_PASS_ON;
}
}
void
-_ecore_wl_input_device_info_send(int win_id, const char *name, const char *identifier, Ecore_Device_Class clas, Eina_Bool flag)
+_ecore_wl_input_device_info_send(int win_id, const char *name, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas, Eina_Bool flag)
{
Ecore_Event_Device_Info *e;
e->identifier = eina_stringshare_add(identifier);
e->seatname = eina_stringshare_add(name);
e->clas = clas;
+ e->subclas = subclas;
e->window = win_id;
if (flag)
}
static Eina_Bool
-_ecore_wl_input_add_ecore_device(const char *name, const char *identifier, Ecore_Device_Class clas)
+_ecore_wl_input_add_ecore_device(const char *name, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
const Eina_List *dev_list = NULL;
const Eina_List *l;
ecore_device_description_set(dev, name);
ecore_device_identifier_set(dev, identifier);
ecore_device_class_set(dev, clas);
+ ecore_device_subclass_set(dev, subclas);
return EINA_TRUE;
}
static Eina_Bool
-_ecore_wl_input_del_ecore_device(const char *name EINA_UNUSED, const char *identifier, Ecore_Device_Class clas)
+_ecore_wl_input_del_ecore_device(const char *name EINA_UNUSED, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
const Eina_List *dev_list = NULL;
const Eina_List *l;
if (!dev) continue;
ecdev_name = ecore_device_identifier_get(dev);
if (!ecdev_name) continue;
- if ((ecore_device_class_get(dev) == clas) && (!strcmp(ecdev_name, identifier)))
+ if ((ecore_device_class_get(dev) == clas) &&
+ (ecore_device_subclass_get(dev) == subclas) &&
+ (!strcmp(ecdev_name, identifier)))
{
ecore_device_del(dev);
return EINA_TRUE;
}
void
-_ecore_wl_input_device_info_broadcast(const char *name, const char *identifier, Ecore_Device_Class clas, Eina_Bool flag)
+_ecore_wl_input_device_info_broadcast(const char *name, const char *identifier, Ecore_Device_Class clas, Ecore_Device_Subclass subclas, Eina_Bool flag)
{
Eina_Hash *windows = NULL;
Eina_Iterator *itr;
if (!name) return;
if (flag)
- ret = _ecore_wl_input_add_ecore_device(name, identifier, clas);
- else
- ret = _ecore_wl_input_del_ecore_device(name, identifier, clas);
+ ret = _ecore_wl_input_add_ecore_device(name, identifier, clas, subclas);
+
if (!ret) return;
if (windows)
{
win = data;
has_win = EINA_TRUE;
- _ecore_wl_input_device_info_send(win->id, name, identifier, clas, flag);
+ _ecore_wl_input_device_info_send(win->id, name, identifier, clas, subclas, flag);
}
eina_iterator_free(itr);
}
if (!has_win)
{
- _ecore_wl_input_device_info_send((uintptr_t)NULL, name, identifier, clas, flag);
+ _ecore_wl_input_device_info_send((uintptr_t)NULL, name, identifier, clas, subclas, flag);
}
+
+ else
+ ret = _ecore_wl_input_del_ecore_device(name, identifier, clas, subclas);
}
static void
EINA_LIST_FOREACH(input->devices, l, dev)
{
- ret = _ecore_wl_input_add_ecore_device(dev->name, dev->identifier, dev->clas);
+ ret = _ecore_wl_input_add_ecore_device(dev->name, dev->identifier, dev->clas, dev->subclas);
DBG("ecore_device added.. dev->name:%s, dev->identifier:%s, ret:%d", dev->name? : "NULL", dev->identifier? : "NULL", ret);
- _ecore_wl_input_device_info_send(win->id, dev->name, dev->identifier, dev->clas, EINA_TRUE);
+ _ecore_wl_input_device_info_send(win->id, dev->name, dev->identifier, dev->clas, dev->subclas, EINA_TRUE);
}
}
if (!dev->identifier) continue;
if ((!strcmp(dev->identifier, identifier)) && (seat == dev->seat) && (device == dev->tz_device))
{
- _ecore_wl_input_device_info_broadcast(dev->name, dev->identifier, dev->clas, EINA_FALSE);
+ _ecore_wl_input_device_info_broadcast(dev->name, dev->identifier, dev->clas, dev->subclas, EINA_FALSE);
_ecore_wl_input_device_last_device_unset(dev);
dev->clas = (Ecore_Device_Class)clas;
dev->subclas = (Ecore_Device_Subclass)subclas;
dev->name = eina_stringshare_add(name);
- _ecore_wl_input_device_info_broadcast(dev->name, dev->identifier, dev->clas, EINA_TRUE);
+ _ecore_wl_input_device_info_broadcast(dev->name, dev->identifier, dev->clas, dev->subclas, EINA_TRUE);
}
static void