forked from enlightenment/efl
efl/eeze: remove other traces of old libudev support.
SVN revision: 82101
This commit is contained in:
parent
68188ac0c8
commit
e4654ee6cf
|
@ -165,34 +165,22 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype,
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_KEYBOARD:
|
case EEZE_UDEV_TYPE_KEYBOARD:
|
||||||
udev_enumerate_add_match_subsystem(en, "input");
|
udev_enumerate_add_match_subsystem(en, "input");
|
||||||
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
udev_enumerate_add_match_property(en, "ID_INPUT_KEYBOARD", "1");
|
udev_enumerate_add_match_property(en, "ID_INPUT_KEYBOARD", "1");
|
||||||
#else
|
|
||||||
udev_enumerate_add_match_property(en, "ID_CLASS", "kbd");
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_MOUSE:
|
case EEZE_UDEV_TYPE_MOUSE:
|
||||||
udev_enumerate_add_match_subsystem(en, "input");
|
udev_enumerate_add_match_subsystem(en, "input");
|
||||||
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
udev_enumerate_add_match_property(en, "ID_INPUT_MOUSE", "1");
|
udev_enumerate_add_match_property(en, "ID_INPUT_MOUSE", "1");
|
||||||
#else
|
|
||||||
udev_enumerate_add_match_property(en, "ID_CLASS", "mouse");
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_TOUCHPAD:
|
case EEZE_UDEV_TYPE_TOUCHPAD:
|
||||||
udev_enumerate_add_match_subsystem(en, "input");
|
udev_enumerate_add_match_subsystem(en, "input");
|
||||||
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
udev_enumerate_add_match_property(en, "ID_INPUT_TOUCHPAD", "1");
|
udev_enumerate_add_match_property(en, "ID_INPUT_TOUCHPAD", "1");
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_JOYSTICK:
|
case EEZE_UDEV_TYPE_JOYSTICK:
|
||||||
udev_enumerate_add_match_subsystem(en, "input");
|
udev_enumerate_add_match_subsystem(en, "input");
|
||||||
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
udev_enumerate_add_match_property(en, "ID_INPUT_JOYSTICK", "1");
|
udev_enumerate_add_match_property(en, "ID_INPUT_JOYSTICK", "1");
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
|
case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
|
||||||
|
|
|
@ -155,24 +155,12 @@ eeze_udev_syspath_is_mouse(const char *syspath)
|
||||||
|
|
||||||
if (!(device = _new_device(syspath)))
|
if (!(device = _new_device(syspath)))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
mouse = _walk_parents_test_attr(device, "bInterfaceProtocol", "02");
|
|
||||||
|
|
||||||
if (!mouse)
|
|
||||||
{
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((test) && (!strcmp(test, "mouse")))
|
|
||||||
mouse = EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
test = udev_device_get_property_value(device, "ID_INPUT_MOUSE");
|
test = udev_device_get_property_value(device, "ID_INPUT_MOUSE");
|
||||||
|
|
||||||
if (test && (test[0] == '1'))
|
if (test && (test[0] == '1'))
|
||||||
mouse = EINA_TRUE;
|
mouse = EINA_TRUE;
|
||||||
|
|
||||||
#endif
|
|
||||||
udev_device_unref(device);
|
udev_device_unref(device);
|
||||||
return mouse;
|
return mouse;
|
||||||
}
|
}
|
||||||
|
@ -189,24 +177,12 @@ eeze_udev_syspath_is_kbd(const char *syspath)
|
||||||
|
|
||||||
if (!(device = _new_device(syspath)))
|
if (!(device = _new_device(syspath)))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
kbd = _walk_parents_test_attr(device, "bInterfaceProtocol", "01");
|
|
||||||
|
|
||||||
if (!kbd)
|
|
||||||
{
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((test) && (!strcmp(test, "kbd")))
|
|
||||||
kbd = EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
test = udev_device_get_property_value(device, "ID_INPUT_KEYBOARD");
|
test = udev_device_get_property_value(device, "ID_INPUT_KEYBOARD");
|
||||||
|
|
||||||
if (test && (test[0] == '1'))
|
if (test && (test[0] == '1'))
|
||||||
kbd = EINA_TRUE;
|
kbd = EINA_TRUE;
|
||||||
|
|
||||||
#endif
|
|
||||||
udev_device_unref(device);
|
udev_device_unref(device);
|
||||||
return kbd;
|
return kbd;
|
||||||
}
|
}
|
||||||
|
@ -216,22 +192,19 @@ eeze_udev_syspath_is_touchpad(const char *syspath)
|
||||||
{
|
{
|
||||||
_udev_device *device = NULL;
|
_udev_device *device = NULL;
|
||||||
Eina_Bool touchpad = EINA_FALSE;
|
Eina_Bool touchpad = EINA_FALSE;
|
||||||
|
const char *test;
|
||||||
|
|
||||||
if (!syspath)
|
if (!syspath)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
if (!(device = _new_device(syspath)))
|
if (!(device = _new_device(syspath)))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
touchpad = _walk_parents_test_attr(device, "resolution", NULL);
|
|
||||||
#else
|
|
||||||
const char *test;
|
|
||||||
test = udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD");
|
test = udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD");
|
||||||
|
|
||||||
if (test && (test[0] == '1'))
|
if (test && (test[0] == '1'))
|
||||||
touchpad = EINA_TRUE;
|
touchpad = EINA_TRUE;
|
||||||
|
|
||||||
#endif
|
|
||||||
udev_device_unref(device);
|
udev_device_unref(device);
|
||||||
return touchpad;
|
return touchpad;
|
||||||
}
|
}
|
||||||
|
@ -248,18 +221,12 @@ eeze_udev_syspath_is_joystick(const char *syspath)
|
||||||
|
|
||||||
if (!(device = _new_device(syspath)))
|
if (!(device = _new_device(syspath)))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((test) && (!strcmp(test, "joystick")))
|
|
||||||
joystick = EINA_TRUE;
|
|
||||||
#else
|
|
||||||
test = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK");
|
test = udev_device_get_property_value(device, "ID_INPUT_JOYSTICK");
|
||||||
|
|
||||||
if (test && (test[0] == '1'))
|
if (test && (test[0] == '1'))
|
||||||
joystick = EINA_TRUE;
|
joystick = EINA_TRUE;
|
||||||
|
|
||||||
#endif
|
|
||||||
udev_device_unref(device);
|
udev_device_unref(device);
|
||||||
return joystick;
|
return joystick;
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,19 +111,6 @@ _get_syspath_from_watch(void *data,
|
||||||
switch (store->type)
|
switch (store->type)
|
||||||
{
|
{
|
||||||
case EEZE_UDEV_TYPE_KEYBOARD:
|
case EEZE_UDEV_TYPE_KEYBOARD:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "input")))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((_walk_parents_test_attr(device, "bInterfaceProtocol", "01"))
|
|
||||||
|| ((test) && (!strcmp(test, "kbd"))))
|
|
||||||
break;
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
if ((!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD")) &&
|
if ((!udev_device_get_property_value(device, "ID_INPUT_KEYBOARD")) &&
|
||||||
(!udev_device_get_property_value(device, "ID_INPUT_KEY")))
|
(!udev_device_get_property_value(device, "ID_INPUT_KEY")))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -131,65 +118,24 @@ _get_syspath_from_watch(void *data,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_MOUSE:
|
case EEZE_UDEV_TYPE_MOUSE:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "input")))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((_walk_parents_test_attr(device, "bInterfaceProtocol", "02"))
|
|
||||||
|| ((test) && (!strcmp(test, "mouse"))))
|
|
||||||
break;
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_MOUSE"))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_TOUCHPAD:
|
case EEZE_UDEV_TYPE_TOUCHPAD:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "input")))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (_walk_parents_test_attr(device, "resolution", NULL))
|
|
||||||
break;
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_TOUCHPAD"))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_JOYSTICK:
|
case EEZE_UDEV_TYPE_JOYSTICK:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "input")))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
test = udev_device_get_property_value(device, "ID_CLASS");
|
|
||||||
|
|
||||||
if ((test) && (!strcmp(test, "joystick")))
|
|
||||||
break;
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
if (!udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"))
|
if (!udev_device_get_property_value(device, "ID_INPUT_JOYSTICK"))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
|
case EEZE_UDEV_TYPE_DRIVE_MOUNTABLE:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "block")))
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) ||
|
if (!(test = (udev_device_get_property_value(device, "ID_FS_USAGE"))) ||
|
||||||
(strcmp("filesystem", test)))
|
(strcmp("filesystem", test)))
|
||||||
{
|
{
|
||||||
|
@ -237,31 +183,16 @@ _get_syspath_from_watch(void *data,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_POWER_AC:
|
case EEZE_UDEV_TYPE_POWER_AC:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "power_supply")))
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
test = udev_device_get_property_value(device, "POWER_SUPPLY_ONLINE");
|
test = udev_device_get_property_value(device, "POWER_SUPPLY_ONLINE");
|
||||||
if (!test) goto error;
|
if (!test) goto error;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_POWER_BAT:
|
case EEZE_UDEV_TYPE_POWER_BAT:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "power_supply")))
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
test = udev_device_get_property_value(device, "POWER_SUPPLY_PRESENT");
|
test = udev_device_get_property_value(device, "POWER_SUPPLY_PRESENT");
|
||||||
if ((!test) || (strcmp(test, "1"))) goto error;
|
if ((!test) || (strcmp(test, "1"))) goto error;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_NET:
|
case EEZE_UDEV_TYPE_NET:
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "net")))
|
|
||||||
goto error;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
|
case EEZE_UDEV_TYPE_IS_IT_HOT_OR_IS_IT_COLD_SENSOR:
|
||||||
|
@ -269,11 +200,6 @@ _get_syspath_from_watch(void *data,
|
||||||
Eina_Bool one, two;
|
Eina_Bool one, two;
|
||||||
const char *t;
|
const char *t;
|
||||||
|
|
||||||
#ifdef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
if ((!(test = udev_device_get_subsystem(device)))
|
|
||||||
|| (strcmp(test, "hwmon")))
|
|
||||||
goto error;
|
|
||||||
#endif /* have to do stuff up here since we need info from the parent */
|
|
||||||
one = _walk_parents_test_attr(device, "temp1_input", NULL);
|
one = _walk_parents_test_attr(device, "temp1_input", NULL);
|
||||||
two = _walk_parents_test_attr(device, "temp2_input", NULL);
|
two = _walk_parents_test_attr(device, "temp2_input", NULL);
|
||||||
if ((!one) && (!two)) goto error;
|
if ((!one) && (!two)) goto error;
|
||||||
|
@ -341,8 +267,6 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
|
||||||
if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
|
if (!(mon = udev_monitor_new_from_netlink(udev, "udev")))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
#ifndef OLD_UDEV_RRRRRRRRRRRRRR
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case EEZE_UDEV_TYPE_JOYSTICK:
|
case EEZE_UDEV_TYPE_JOYSTICK:
|
||||||
|
@ -395,8 +319,6 @@ eeze_udev_watch_add(Eeze_Udev_Type type,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (udev_monitor_enable_receiving(mon))
|
if (udev_monitor_enable_receiving(mon))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue