static void
_e_devicemgr_input_device_add(const char *name, const char *identifier, const char *seatname, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
- E_Devicemgr_Input_Device *dev;
+ E_Devicemgr_Input_Device *dev = NULL;
Eina_List *l;
int current_touch_count = -1;
+ EINA_SAFETY_ON_NULL_RETURN(name);
+ EINA_SAFETY_ON_NULL_RETURN(identifier);
+
EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
{
- if ((dev->clas == clas) && (!strcmp(dev->identifier, identifier)))
+ if (!dev->name) continue;
+ if (!dev->identifier) continue;
+ if ((dev->clas == clas) && (dev->subclas == subclas) &&
+ (!strcmp(dev->name, name)) &&
+ (!strcmp(dev->identifier, identifier)))
{
return;
}
static void
_e_devicemgr_input_device_del(const char *name, const char *identifier, const char *seatname, Ecore_Device_Class clas, Ecore_Device_Subclass subclas)
{
- E_Devicemgr_Input_Device *dev;
+ E_Devicemgr_Input_Device *dev = NULL;
Eina_List *l;
+ EINA_SAFETY_ON_NULL_RETURN(name);
+ EINA_SAFETY_ON_NULL_RETURN(identifier);
+
EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
{
+ if (!dev->name) continue;
+ if (!dev->identifier) continue;
if ((dev->clas == clas) && (dev->subclas == subclas) &&
- (dev->name && (!strcmp(dev->name, name))) &&
- (dev->identifier && (!strcmp(dev->identifier, identifier))))
+ (!strcmp(dev->name, name)) &&
+ (!strcmp(dev->identifier, identifier)))
break;
}
if (!dev)
{
Ecore_Event_Device_Info *e;
E_Input *e_input;
+ const char *name, *identifier;
+
+ if (!(name = ecore_device_name_get(dev))) return;
+ if (!(identifier = ecore_device_identifier_get(dev))) return;
if (!(e = calloc(1, sizeof(Ecore_Event_Device_Info)))) return;
e_input = e_input_get();
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->name = eina_stringshare_add(name);
+ e->identifier = eina_stringshare_add(identifier);
+ e->seatname = eina_stringshare_add(name);
e->clas = ecore_device_class_get(dev);
e->subclas = ecore_device_subclass_get(dev);
EINA_LIST_FOREACH(dev_list, l, dev)
{
if (!dev) continue;
- identifier = ecore_device_description_get(dev);
+ identifier = ecore_device_identifier_get(dev);
if (!identifier) continue;
if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
return EINA_FALSE;
EINA_LIST_FOREACH(dev_list, l, dev)
{
if (!dev) continue;
- identifier = ecore_device_description_get(dev);
+ identifier = ecore_device_identifier_get(dev);
if (!identifier) continue;
if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
{
EINA_LIST_FREE(edev->ecore_dev_list, data)
{
WRN("Invalid device is left. name: %s, identifier: %s, clas: %s\n",
- ecore_device_name_get(data), ecore_device_description_get(data),
+ ecore_device_name_get(data), ecore_device_identifier_get(data),
_e_input_ecore_device_class_to_string(ecore_device_class_get(data)));
ecore_device_unref(data);
ecore_device_del(data);