}
}
-static short
-_e_comp_wl_device_cap_to_class(int cap)
-{
- switch(cap)
- {
- case ECORE_DEVICE_POINTER:
- return EVAS_DEVICE_CLASS_MOUSE;
- case ECORE_DEVICE_KEYBOARD:
- return EVAS_DEVICE_CLASS_KEYBOARD;
- case ECORE_DEVICE_TOUCH:
- return EVAS_DEVICE_CLASS_TOUCH;
- default:
- return EVAS_DEVICE_CLASS_NONE;
- }
- return EVAS_DEVICE_CLASS_NONE;
-}
-
static void
_e_comp_wl_device_send_event_device(const char *dev_name, Evas_Device_Class dev_class, E_Client *ec, uint32_t timestamp)
{
EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
{
- if ((strcmp(input_dev->identifier, dev_name)) || (_e_comp_wl_device_cap_to_class(input_dev->capability) != dev_class)) continue;
- e_comp_wl->input_device_manager.last_device_cap = input_dev->capability;
+ if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
+ e_comp_wl->input_device_manager.last_device_clas = input_dev->clas;
EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
{
if (wl_resource_get_client(dev_res) != wc) continue;
EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
{
if ((strcmp(input_dev->identifier, e_comp_wl->input_device_manager.last_device_name)) ||
- (input_dev->capability != e_comp_wl->input_device_manager.last_device_cap))
+ (input_dev->clas != e_comp_wl->input_device_manager.last_device_clas))
continue;
EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
{
- if ((strcmp(input_dev->identifier, dev_name)) || (_e_comp_wl_device_cap_to_class(input_dev->capability) != dev_class)) continue;
+ if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
{
if (wl_resource_get_client(dev_res) != wc) continue;
e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
}
- if ((_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_MOUSE) ||
- (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_TOUCH))
+ if ((e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_MOUSE) ||
+ (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_TOUCH))
_e_comp_wl_device_send_last_event_device(ec, ev->timestamp);
if (!eina_list_count(e_comp_wl->ptr.resources)) return;
if (!e_comp_wl->kbd.focused) return EINA_FALSE;
serial = wl_display_next_serial(e_comp_wl->wl.disp);
t = ecore_time_unix_get();
- if (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_KEYBOARD)
+ if (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_KEYBOARD)
_e_comp_wl_device_send_last_event_device(ec, t);
EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
/* send keyboard_leave to all keyboard resources */
serial = wl_display_next_serial(e_comp_wl->wl.disp);
t = ecore_time_unix_get();
- if (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_KEYBOARD)
+ if (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_KEYBOARD)
_e_comp_wl_device_send_last_event_device(ec, t);
EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
{
if ((strcmp(input_dev->identifier, dev_name)) ||
- (input_dev->capability != ECORE_DEVICE_KEYBOARD))
+ (input_dev->clas != ECORE_DEVICE_CLASS_KEYBOARD))
continue;
- e_comp_wl->input_device_manager.last_device_cap = input_dev->capability;
+ e_comp_wl->input_device_manager.last_device_clas = input_dev->clas;
EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
{
if (wl_resource_get_client(dev_res) != wc) continue;
{
char *dev_name;
char *identifier;
- int capability;
+ int clas;
res = eldbus_message_iter_arguments_get(eldbus_msg,
VALUE_TYPE_FOR_INPUTDEV,
&dev_name,
&identifier,
- &capability);
+ &clas);
if (!res)
{
printf("Failed to get device info\n");
dev = E_NEW(E_Comp_Wl_Input_Device, 1);
dev->name = strdup(dev_name);
dev->identifier = strdup(identifier);
- dev->capability = capability;
+ dev->clas = clas;
e_info_client.input_dev = eina_list_append(e_info_client.input_dev, dev);
}
{
i++;
printf("%3d %50s %20s ", i, dev->name, dev->identifier);
- if (dev->capability & ECORE_DEVICE_POINTER) printf("Pointer | ");
- if (dev->capability & ECORE_DEVICE_KEYBOARD) printf("Keyboard | ");
- if (dev->capability & ECORE_DEVICE_TOUCH) printf("Touch | ");
- printf("(0x%x)\n", dev->capability);
+ 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 | ");
+ printf("(0x%x)\n", dev->clas);
}
E_FREE_LIST(e_info_client.input_dev, free);