Eina_List *l, *l2, *l3;
E_Input_Device *dev;
E_Input_Seat *seat;
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
EINA_LIST_FOREACH(einput_devices, l, dev)
EINA_LIST_FOREACH(dev->seats, l2, seat)
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l3, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l3, evdev)
{
- xkb_keymap_unref(edev->xkb.keymap);
- edev->xkb.keymap = xkb_keymap_ref(map);
+ xkb_keymap_unref(evdev->xkb.keymap);
+ evdev->xkb.keymap = xkb_keymap_ref(map);
- xkb_state_unref(edev->xkb.state);
- edev->xkb.state = xkb_state_new(map);
+ xkb_state_unref(evdev->xkb.state);
+ evdev->xkb.state = xkb_state_new(map);
}
}
{
E_Input_Backend *input;
E_Input_Seat *seat;
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
EINA_SAFETY_ON_NULL_RETURN(dev);
EINA_LIST_FREE(dev->seats, seat)
{
- EINA_LIST_FREE(seat->devices, edev)
+ EINA_LIST_FREE(seat->devices, evdev)
{
- libinput_device_config_send_events_set_mode(edev->device,
+ libinput_device_config_send_events_set_mode(evdev->device,
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED);
- e_input_evdev_device_destroy(edev);
+ e_input_evdev_device_destroy(evdev);
}
if (seat->name)
e_input_device_pointer_xy_get(E_Input_Device *dev, int *x, int *y)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
Eina_List *l, *ll;
if (x) *x = 0;
EINA_SAFETY_ON_TRUE_RETURN(!dev);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!(edev->caps & E_INPUT_SEAT_POINTER ||
- edev->caps & E_INPUT_SEAT_TOUCH))
+ if (!(evdev->caps & E_INPUT_SEAT_POINTER ||
+ evdev->caps & E_INPUT_SEAT_TOUCH))
continue;
if (x) *x = seat->ptr.dx;
e_input_device_pointer_warp(E_Input_Device *dev, int x, int y)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev, *warp_dev;
+ E_Input_Evdev *evdev, *warp_dev;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
char *device_name = NULL, *device_path = NULL;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
warp_dev = NULL;
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!(edev->caps & E_INPUT_SEAT_POINTER))
+ if (!(evdev->caps & E_INPUT_SEAT_POINTER))
continue;
- if (!e_util_strcmp(edev->name, device_name) &&
- !e_util_strcmp(edev->path, device_path))
+ if (!e_util_strcmp(evdev->name, device_name) &&
+ !e_util_strcmp(evdev->path, device_path))
{
- warp_dev = edev;
+ warp_dev = evdev;
break;
}
- if (!warp_dev) warp_dev = edev;
+ if (!warp_dev) warp_dev = evdev;
}
if (warp_dev)
e_input_device_pointer_left_handed_set(E_Input_Device *dev, Eina_Bool left_handed)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_POINTER)
+ if (evdev->caps & E_INPUT_SEAT_POINTER)
{
- if (libinput_device_config_left_handed_set(edev->device, (int)left_handed) !=
+ if (libinput_device_config_left_handed_set(evdev->device, (int)left_handed) !=
LIBINPUT_CONFIG_STATUS_SUCCESS)
{
WRN("Failed to set left hand mode about device: %s\n",
- edev->name);
+ evdev->name);
continue;
}
}
e_input_device_rotation_set(E_Input_Device *dev, unsigned int rotation)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
E_Output *primary_output = NULL;
int temp;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_POINTER)
+ if (evdev->caps & E_INPUT_SEAT_POINTER)
{
- edev->mouse.minx = edev->mouse.miny = 0;
+ evdev->mouse.minx = evdev->mouse.miny = 0;
e_output_size_get(primary_output,
- &edev->mouse.maxw, &edev->mouse.maxh);
+ &evdev->mouse.maxw, &evdev->mouse.maxh);
if (rotation == 90 || rotation == 270)
{
- temp = edev->mouse.minx;
- edev->mouse.minx = edev->mouse.miny;
- edev->mouse.miny = temp;
+ temp = evdev->mouse.minx;
+ evdev->mouse.minx = evdev->mouse.miny;
+ evdev->mouse.miny = temp;
- temp = edev->mouse.maxw;
- edev->mouse.maxw = edev->mouse.maxh;
- edev->mouse.maxh = temp;
+ temp = evdev->mouse.maxw;
+ evdev->mouse.maxw = evdev->mouse.maxh;
+ evdev->mouse.maxh = temp;
}
}
}
e_input_device_touch_rotation_set(E_Input_Device *dev, unsigned int rotation)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
float mat_translate[6] = {0.0, }, mat_rotation[6] = {0.0, }, result[6] = {0.0, };
float default_w = 0.0, default_h = 0.0;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_TOUCH)
+ if (evdev->caps & E_INPUT_SEAT_TOUCH)
{
_e_input_device_touch_matrix_identify(mat_translate);
_e_input_device_touch_matrix_identify(mat_rotation);
_e_input_device_touch_matrix_identify(result);
- if (edev->touch.transform.x || edev->touch.transform.y ||
- edev->touch.transform.w || edev->touch.transform.h)
+ if (evdev->touch.transform.x || evdev->touch.transform.y ||
+ evdev->touch.transform.w || evdev->touch.transform.h)
{
_e_input_device_touch_matrix_translate_get(mat_translate,
- (float)edev->touch.transform.x,
- (float)edev->touch.transform.y,
- (float)edev->touch.transform.w,
- (float)edev->touch.transform.h,
+ (float)evdev->touch.transform.x,
+ (float)evdev->touch.transform.y,
+ (float)evdev->touch.transform.w,
+ (float)evdev->touch.transform.h,
default_w, default_h);
}
_e_input_device_touch_matrix_multiply(result, mat_translate, mat_rotation);
- if (!e_input_evdev_touch_calibration_set(edev, result))
+ if (!e_input_evdev_touch_calibration_set(evdev, result))
{
res = EINA_FALSE;
continue;
}
else
{
- edev->touch.transform.rotation = rotation;
+ evdev->touch.transform.rotation = rotation;
}
}
}
e_input_device_touch_transformation_set(E_Input_Device *dev, int offset_x, int offset_y, int w, int h)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
float mat_translate[6] = {0.0, }, mat_rotation[6] = {0.0 }, result[6] = {0.0, };
float default_w = 0.0, default_h = 0.0;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_TOUCH)
+ if (evdev->caps & E_INPUT_SEAT_TOUCH)
{
_e_input_device_touch_matrix_identify(mat_translate);
_e_input_device_touch_matrix_identify(mat_rotation);
(float)offset_x, (float)offset_y,
(float)w, (float)h, default_w, default_h);
- if (edev->touch.transform.rotation)
+ if (evdev->touch.transform.rotation)
{
_e_input_device_touch_matrix_rotation_get(mat_rotation,
- edev->touch.transform.rotation,
+ evdev->touch.transform.rotation,
default_w, default_h);
}
_e_input_device_touch_matrix_multiply(result, mat_translate, mat_rotation);
- if (!e_input_evdev_touch_calibration_set(edev, result))
+ if (!e_input_evdev_touch_calibration_set(evdev, result))
{
res = EINA_FALSE;
continue;
}
else
{
- edev->touch.transform.x = offset_x;
- edev->touch.transform.y = offset_y;
- edev->touch.transform.w = w;
- edev->touch.transform.h = h;
+ evdev->touch.transform.x = offset_x;
+ evdev->touch.transform.y = offset_y;
+ evdev->touch.transform.w = w;
+ evdev->touch.transform.h = h;
}
}
}
e_input_device_output_changed(E_Input_Device *dev)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
EINA_SAFETY_ON_NULL_RETURN(dev);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- e_input_evdev_device_calibration_set(edev);
+ e_input_evdev_device_calibration_set(evdev);
}
}
}
e_input_device_mouse_accel_speed_set(E_Input_Device *dev, double speed)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
Eina_Bool res = EINA_TRUE, ret = EINA_TRUE;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_POINTER)
- res = e_input_evdev_mouse_accel_speed_set(edev, speed);
+ if (evdev->caps & E_INPUT_SEAT_POINTER)
+ res = e_input_evdev_mouse_accel_speed_set(evdev, speed);
if (!res) ret = EINA_FALSE;
}
}
e_input_device_touch_pressed_get(E_Input_Device *dev)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
unsigned int pressed = 0x0;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_TOUCH)
- pressed |= e_input_evdev_touch_pressed_get(edev);
+ if (evdev->caps & E_INPUT_SEAT_TOUCH)
+ pressed |= e_input_evdev_touch_pressed_get(evdev);
}
}
e_input_device_keyboard_remap_set(E_Input_Device *dev, int *from_keys, int *to_keys, int num)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
Eina_Bool res = EINA_TRUE, ret = EINA_TRUE;
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- if (edev->caps & E_INPUT_SEAT_KEYBOARD)
+ if (evdev->caps & E_INPUT_SEAT_KEYBOARD)
{
- res = e_input_evdev_key_remap_enable(edev, EINA_TRUE);
+ res = e_input_evdev_key_remap_enable(evdev, EINA_TRUE);
if (res)
- res = e_input_evdev_key_remap_set(edev, from_keys, to_keys, num);
+ res = e_input_evdev_key_remap_set(evdev, from_keys, to_keys, num);
}
if (!res) ret = EINA_FALSE;
}
e_input_device_block(E_Input_Device *dev, unsigned int type, void *client)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
{
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- atomic_store(&edev->touch.blocked, EINA_TRUE);
+ atomic_store(&evdev->touch.blocked, EINA_TRUE);
}
}
}
e_input_device_unblock(E_Input_Device *dev, void *client)
{
E_Input_Seat *seat = NULL;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l = NULL, *l2 = NULL;
unsigned int raw_pressed = 0;
{
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, edev)
+ EINA_LIST_FOREACH(e_input_seat_evdev_list_get(seat), l2, evdev)
{
- raw_pressed = atomic_load(&edev->touch.raw_pressed);
+ raw_pressed = atomic_load(&evdev->touch.raw_pressed);
if (raw_pressed == 0x0)
{
- atomic_store(&edev->touch.blocked, EINA_FALSE);
+ atomic_store(&evdev->touch.blocked, EINA_FALSE);
}
}
}
e_input_device_output_name_set(E_Input_Device *dev, const char *input, const char *output)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!output, EINA_FALSE);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!e_util_strcmp(edev->path, input))
+ if (!e_util_strcmp(evdev->path, input))
{
found = EINA_TRUE;
break;
if (found) break;
}
- if (!found || !edev)
+ if (!found || !evdev)
{
ERR("Failed to find input device: %s", input);
return EINA_FALSE;
if (e_output_find(output))
{
INF("output device found: %s", output);
- eina_stringshare_replace(&edev->output_name, output);
- edev->output_configured = EINA_FALSE;
+ eina_stringshare_replace(&evdev->output_name, output);
+ evdev->output_configured = EINA_FALSE;
return EINA_TRUE;
}
else
e_input_device_output_name_get(E_Input_Device *dev, const char *input)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!input, NULL);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!e_util_strcmp(edev->path, input))
+ if (!e_util_strcmp(evdev->path, input))
{
found = EINA_TRUE;
break;
}
if (found) break;
}
- if (!found || !edev)
+ if (!found || !evdev)
{
ERR("Failed to find input device: %s", input);
return NULL;
}
- return edev->output_name;
+ return evdev->output_name;
}
EINTERN Eina_Bool
e_input_device_seat_name_set(E_Input_Device *dev, const char *input, const char *seat_name)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!seat_name, EINA_FALSE);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!e_util_strcmp(edev->path, input))
+ if (!e_util_strcmp(evdev->path, input))
{
found = EINA_TRUE;
break;
if (found) break;
}
- if (!found || !edev)
+ if (!found || !evdev)
{
ERR("Failed to find input device: %s", input);
return EINA_FALSE;
}
- INF("Current seatname:%s", e_input_evdev_seatname_get(edev));
- if (e_input_evdev_seatname_set(edev, seat_name))
+ INF("Current seatname:%s", e_input_evdev_seatname_get(evdev));
+ if (e_input_evdev_seatname_set(evdev, seat_name))
{
INF("New seatname is now set: %s", seat_name);
return EINA_TRUE;
const Eina_List *l, *ll, *lll;
E_Input_Device *dev;
E_Input_Seat *seat;
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
Eina_Bool found = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(device_name, EINA_FALSE);
{
EINA_LIST_FOREACH(dev->seats, ll, seat)
{
- EINA_LIST_FOREACH(seat->devices, lll, edev)
+ EINA_LIST_FOREACH(seat->devices, lll, evdev)
{
- if ((edev->caps & E_INPUT_SEAT_POINTER) &&
- (!e_util_strcmp(device_name, edev->name)))
+ if ((evdev->caps & E_INPUT_SEAT_POINTER) &&
+ (!e_util_strcmp(device_name, evdev->name)))
{
found = EINA_TRUE;
- edev->disable_acceleration = !enable;
+ evdev->disable_acceleration = !enable;
}
}
}
_e_input_device_find_by_path_cap(E_Input_Device *dev, const char *path, E_Input_Seat_Capabilities caps)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!path, EINA_FALSE);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
- EINA_LIST_FOREACH(seat->devices, ll, edev)
+ EINA_LIST_FOREACH(seat->devices, ll, evdev)
{
- if (!e_util_strcmp(edev->path, path) &&
- (!caps || (caps & edev->caps)))
+ if (!e_util_strcmp(evdev->path, path) &&
+ (!caps || (caps & evdev->caps)))
{
found = EINA_TRUE;
break;
if (found) break;
}
- if (!found || !edev)
+ if (!found || !evdev)
{
ERR("Failed to find input device: %s", path);
return NULL;
}
- return edev;
+ return evdev;
}
E_API Eina_Bool
e_input_device_keyboard_has_key(E_Input_Device *dev, const char *device_path, uint32_t code)
{
- E_Input_Evdev *edev = NULL;
+ E_Input_Evdev *evdev = NULL;
Eina_Bool ret = EINA_FALSE;
- edev = _e_input_device_find_by_path_cap(dev, device_path, E_INPUT_SEAT_KEYBOARD);
- if (edev)
- ret = (libinput_device_keyboard_has_key(edev->device, code) == 1);
+ evdev = _e_input_device_find_by_path_cap(dev, device_path, E_INPUT_SEAT_KEYBOARD);
+ if (evdev)
+ ret = (libinput_device_keyboard_has_key(evdev->device, code) == 1);
INF("device(%s) keyboard_has_key(%d) returns %s", device_path, code, ret ? "True" : "False");
return ret;
#define E_INPUT_POINTER_AXIS_DISCRETE_STEP 120
#define E_INPUT_FINGER_SCROLL_THRESHOLD 1
-static void _device_modifiers_update(E_Input_Evdev *edev);
-static void _device_configured_size_get(E_Input_Evdev *edev, int *x, int *y, int *w, int *h);
-static void _device_output_assign(E_Input_Evdev *edev, E_Input_Seat_Capabilities cap);
+static void _device_modifiers_update(E_Input_Evdev *evdev);
+static void _device_configured_size_get(E_Input_Evdev *evdev, int *x, int *y, int *w, int *h);
+static void _device_output_assign(E_Input_Evdev *evdev, E_Input_Seat_Capabilities cap);
static Eina_Bool _touch_blocked_by_palm, _touch_up_blocked_by_palm;
void
-e_input_evdev_device_calibration_set(E_Input_Evdev *edev)
+e_input_evdev_device_calibration_set(E_Input_Evdev *evdev)
{
E_Output *primary_output;
int w = 0, h = 0;
comp_conf = e_comp_config_get();
if (comp_conf && (comp_conf->input_output_assign_policy == 1)) //use output-assignment policy
{
- _device_output_assign(edev, E_INPUT_SEAT_POINTER);
- _device_output_assign(edev, E_INPUT_SEAT_TOUCH);
+ _device_output_assign(evdev, E_INPUT_SEAT_POINTER);
+ _device_output_assign(evdev, E_INPUT_SEAT_TOUCH);
}
}
if (primary_output)
{
- edev->mouse.minx = edev->mouse.miny = 0;
- edev->mouse.maxw = w;
- edev->mouse.maxh = h;
+ evdev->mouse.minx = evdev->mouse.miny = 0;
+ evdev->mouse.maxw = w;
+ evdev->mouse.maxh = h;
- if (edev->caps & E_INPUT_SEAT_POINTER)
+ if (evdev->caps & E_INPUT_SEAT_POINTER)
{
- edev->seat->ptr.dx = (double)(w / 2);
- edev->seat->ptr.dy = (double)(h / 2);
- edev->seat->ptr.ix = (int)edev->seat->ptr.dx;
- edev->seat->ptr.iy = (int)edev->seat->ptr.dy;
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
+ evdev->seat->ptr.dx = (double)(w / 2);
+ evdev->seat->ptr.dy = (double)(h / 2);
+ evdev->seat->ptr.ix = (int)evdev->seat->ptr.dx;
+ evdev->seat->ptr.iy = (int)evdev->seat->ptr.dy;
+ evdev->mouse.dx = evdev->seat->ptr.dx;
+ evdev->mouse.dy = evdev->seat->ptr.dy;
if (primary_output->config.rotation == 90 || primary_output->config.rotation == 270)
{
- temp = edev->mouse.minx;
- edev->mouse.minx = edev->mouse.miny;
- edev->mouse.miny = temp;
+ temp = evdev->mouse.minx;
+ evdev->mouse.minx = evdev->mouse.miny;
+ evdev->mouse.miny = temp;
- temp = edev->mouse.maxw;
- edev->mouse.maxw = edev->mouse.maxh;
- edev->mouse.maxh = temp;
+ temp = evdev->mouse.maxw;
+ evdev->mouse.maxw = evdev->mouse.maxh;
+ evdev->mouse.maxh = temp;
}
}
}
#ifdef _F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
float cal[6];
- if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
- (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
+ if ((!libinput_device_config_calibration_has_matrix(evdev->device)) ||
+ (libinput_device_config_calibration_get_default_matrix(evdev->device, cal) != 0))
return;
#ifdef _F_E_INPUT_USE_WL_CALIBRATION_
enum libinput_config_status status;
struct udev_device *udev_device = NULL;
- udev_device = libinput_device_get_udev_device(edev->device);
+ udev_device = libinput_device_get_udev_device(evdev->device);
if (!udev_device)
{
ERR("no udev_device");
NULL, cal[0], cal[1], cal[2], cal[3], cal[4], cal[5], w, h);
status =
- libinput_device_config_calibration_set_matrix(edev->device, cal);
+ libinput_device_config_calibration_set_matrix(evdev->device, cal);
if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
ERR("Failed to apply calibration");
}
static void
-_device_output_assign(E_Input_Evdev *edev, E_Input_Seat_Capabilities cap)
+_device_output_assign(E_Input_Evdev *evdev, E_Input_Seat_Capabilities cap)
{
int last_output_idx;
E_Input_Evdev *ed;
const char *output_name;
E_Output *output;
- if (!(edev->caps & cap)) return;
- if (edev->output_name) return; //already assigned
+ if (!(evdev->caps & cap)) return;
+ if (evdev->output_name) return; //already assigned
if (e_comp->e_comp_screen->num_outputs <= 1) return;
last_output_idx = e_comp->e_comp_screen->num_outputs - 1;
- EINA_LIST_FOREACH(edev->seat->devices, l, ed)
+ EINA_LIST_FOREACH(evdev->seat->devices, l, ed)
{
if (!(ed->caps & cap)) continue;
- if (ed == edev) continue;
+ if (ed == evdev) continue;
if (ed->output_name)
{
need_assign_output = EINA_FALSE;
output = e_output_find_by_index(last_output_idx);
if (!output || !output->info.connected) return;
output_name = e_output_output_id_get(output);
- if (output_name) edev->output_name = eina_stringshare_add(output_name);
+ if (output_name) evdev->output_name = eina_stringshare_add(output_name);
ELOGF("E_INPUT_EVDEV", "Device is assigned to output:%s", NULL, output_name);
}
}
static void
-_device_touch_count_update(E_Input_Evdev *edev)
+_device_touch_count_update(E_Input_Evdev *evdev)
{
unsigned int device_touch_count = 0;
static unsigned int _max_device_touch_count = 0;
E_Input *ei = e_input_get();
EINA_SAFETY_ON_NULL_RETURN(ei);
- device_touch_count = libinput_device_touch_get_touch_count(edev->device);
+ device_touch_count = libinput_device_touch_get_touch_count(evdev->device);
if (_max_device_touch_count < device_touch_count)
_max_device_touch_count = device_touch_count;
}
static void
-_device_configure(E_Input_Evdev *edev)
+_device_configure(E_Input_Evdev *evdev)
{
- if (libinput_device_config_tap_get_finger_count(edev->device) > 0)
+ if (libinput_device_config_tap_get_finger_count(evdev->device) > 0)
{
Eina_Bool tap = EINA_FALSE;
- tap = libinput_device_config_tap_get_default_enabled(edev->device);
- libinput_device_config_tap_set_enabled(edev->device, tap);
+ tap = libinput_device_config_tap_get_default_enabled(evdev->device);
+ libinput_device_config_tap_set_enabled(evdev->device, tap);
}
- e_input_evdev_device_calibration_set(edev);
+ e_input_evdev_device_calibration_set(evdev);
}
static void
-_device_keyboard_setup(E_Input_Evdev *edev)
+_device_keyboard_setup(E_Input_Evdev *evdev)
{
E_Input_Backend *input;
xkb_mod_index_t xkb_idx;
- if ((!edev) || (!edev->seat)) return;
- if (!(input = edev->seat->input)) return;
+ if ((!evdev) || (!evdev->seat)) return;
+ if (!(input = evdev->seat->input)) return;
if (!input->dev->xkb_ctx) return;
/* create keymap from xkb context */
- edev->xkb.keymap = e_input_device_cached_keymap_get(input->dev->xkb_ctx, NULL, 0);
- if (!edev->xkb.keymap)
+ evdev->xkb.keymap = e_input_device_cached_keymap_get(input->dev->xkb_ctx, NULL, 0);
+ if (!evdev->xkb.keymap)
{
ERR("Failed to create keymap: %m");
return;
}
/* create xkb state */
- if (!(edev->xkb.state = xkb_state_new(edev->xkb.keymap)))
+ if (!(evdev->xkb.state = xkb_state_new(evdev->xkb.keymap)))
{
ERR("Failed to create xkb state: %m");
return;
}
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_CTRL);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_MOD_NAME_CTRL);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.ctrl_mask = 1 << xkb_idx;
+ evdev->xkb.ctrl_mask = 1 << xkb_idx;
else
- edev->xkb.ctrl_mask = 0;
+ evdev->xkb.ctrl_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_ALT);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_MOD_NAME_ALT);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.alt_mask = 1 << xkb_idx;
+ evdev->xkb.alt_mask = 1 << xkb_idx;
else
- edev->xkb.alt_mask = 0;
+ evdev->xkb.alt_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_SHIFT);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_MOD_NAME_SHIFT);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.shift_mask = 1 << xkb_idx;
+ evdev->xkb.shift_mask = 1 << xkb_idx;
else
- edev->xkb.shift_mask = 0;
+ evdev->xkb.shift_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_LOGO);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_MOD_NAME_LOGO);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.win_mask = 1 << xkb_idx;
+ evdev->xkb.win_mask = 1 << xkb_idx;
else
- edev->xkb.win_mask = 0;
+ evdev->xkb.win_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_LED_NAME_SCROLL);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_LED_NAME_SCROLL);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.scroll_mask = 1 << xkb_idx;
+ evdev->xkb.scroll_mask = 1 << xkb_idx;
else
- edev->xkb.scroll_mask = 0;
+ evdev->xkb.scroll_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_LED_NAME_NUM);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_LED_NAME_NUM);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.num_mask = 1 << xkb_idx;
+ evdev->xkb.num_mask = 1 << xkb_idx;
else
- edev->xkb.num_mask = 0;
+ evdev->xkb.num_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_CAPS);
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, XKB_MOD_NAME_CAPS);
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.caps_mask = 1 << xkb_idx;
+ evdev->xkb.caps_mask = 1 << xkb_idx;
else
- edev->xkb.caps_mask = 0;
+ evdev->xkb.caps_mask = 0;
- xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, "ISO_Level3_Shift");
+ xkb_idx = xkb_map_mod_get_index(evdev->xkb.keymap, "ISO_Level3_Shift");
if (xkb_idx != XKB_MOD_INVALID)
- edev->xkb.altgr_mask = 1 << xkb_idx;
+ evdev->xkb.altgr_mask = 1 << xkb_idx;
else
- edev->xkb.altgr_mask = 0;
+ evdev->xkb.altgr_mask = 0;
}
static int
}
static void
-_device_modifiers_update_device(E_Input_Evdev *edev, E_Input_Evdev *from)
+_device_modifiers_update_device(E_Input_Evdev *evdev, E_Input_Evdev *from)
{
xkb_mod_mask_t mask;
- edev->xkb.depressed =
+ evdev->xkb.depressed =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_DEPRESSED);
- edev->xkb.latched =
+ evdev->xkb.latched =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_LATCHED);
- edev->xkb.locked =
+ evdev->xkb.locked =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_LOCKED);
- edev->xkb.group =
+ evdev->xkb.group =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_EFFECTIVE);
- mask = (edev->xkb.depressed | edev->xkb.latched);
+ mask = (evdev->xkb.depressed | evdev->xkb.latched);
if (mask & from->xkb.ctrl_mask)
- edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ evdev->xkb.modifiers |= ECORE_EVENT_MODIFIER_CTRL;
if (mask & from->xkb.alt_mask)
- edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALT;
+ evdev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALT;
if (mask & from->xkb.shift_mask)
- edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ evdev->xkb.modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
if (mask & from->xkb.win_mask)
- edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ evdev->xkb.modifiers |= ECORE_EVENT_MODIFIER_WIN;
if (mask & from->xkb.scroll_mask)
- edev->xkb.modifiers |= ECORE_EVENT_LOCK_SCROLL;
+ evdev->xkb.modifiers |= ECORE_EVENT_LOCK_SCROLL;
if (mask & from->xkb.num_mask)
- edev->xkb.modifiers |= ECORE_EVENT_LOCK_NUM;
+ evdev->xkb.modifiers |= ECORE_EVENT_LOCK_NUM;
if (mask & from->xkb.caps_mask)
- edev->xkb.modifiers |= ECORE_EVENT_LOCK_CAPS;
+ evdev->xkb.modifiers |= ECORE_EVENT_LOCK_CAPS;
if (mask & from->xkb.altgr_mask)
- edev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
+ evdev->xkb.modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
}
static void
-_device_modifiers_update(E_Input_Evdev *edev)
+_device_modifiers_update(E_Input_Evdev *evdev)
{
Eina_List *l;
E_Input_Evdev *ed;
- edev->xkb.modifiers = 0;
+ evdev->xkb.modifiers = 0;
- if (edev->caps & E_INPUT_SEAT_KEYBOARD)
- _device_modifiers_update_device(edev, edev);
+ if (evdev->caps & E_INPUT_SEAT_KEYBOARD)
+ _device_modifiers_update_device(evdev, evdev);
else
{
- EINA_LIST_FOREACH(edev->seat->devices, l, ed)
+ EINA_LIST_FOREACH(evdev->seat->devices, l, ed)
{
if (!(ed->caps & E_INPUT_SEAT_KEYBOARD)) continue;
- _device_modifiers_update_device(edev, ed);
+ _device_modifiers_update_device(evdev, ed);
}
}
}
static int
-_device_remapped_key_get(E_Input_Evdev *edev, int code)
+_device_remapped_key_get(E_Input_Evdev *evdev, int code)
{
void *ret = NULL;
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, code);
- if (!edev->key_remap_enabled) return code;
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev->key_remap_hash, code);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, code);
+ if (!evdev->key_remap_enabled) return code;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->key_remap_hash, code);
- ret = eina_hash_find(edev->key_remap_hash, &code);
+ ret = eina_hash_find(evdev->key_remap_hash, &code);
if (ret) code = (int)(intptr_t)ret;
static void
_device_handle_key(struct libinput_device *device, struct libinput_event_keyboard *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *input;
uint32_t timestamp;
uint32_t code, nsyms;
const char *device_name = NULL;
Ecore_Device_Subclass device_subclas = ECORE_DEVICE_SUBCLASS_NONE;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- if (!(input = edev->seat->input))
+ if (!(input = evdev->seat->input))
{
return;
}
if (!e_input_thread_mode_get())
{
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_KEYBOARD)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_KEYBOARD);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_KEYBOARD);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
}
else
{
- if (edev->e_dev) e_dev = edev->e_dev;
- else if (edev->e_dev_list && g_list_length(edev->e_dev_list) > 0)
+ if (evdev->e_dev) e_dev = evdev->e_dev;
+ else if (evdev->e_dev_list && g_list_length(evdev->e_dev_list) > 0)
{
- glist = edev->e_dev_list;
+ glist = evdev->e_dev_list;
while (glist)
{
e_dev_data = glist->data;
}
else
{
- edev->e_dev = e_input_evdev_e_device_get(edev->path, ECORE_DEVICE_CLASS_KEYBOARD);
- e_dev = edev->e_dev;
+ evdev->e_dev = e_input_evdev_e_device_get(evdev->path, ECORE_DEVICE_CLASS_KEYBOARD);
+ e_dev = evdev->e_dev;
}
if (!e_dev)
timestamp = libinput_event_keyboard_get_time(event);
code = libinput_event_keyboard_get_key(event);
- code = _device_remapped_key_get(edev, code + 8);
+ code = _device_remapped_key_get(evdev, code + 8);
state = libinput_event_keyboard_get_key_state(event);
key_count = libinput_event_keyboard_get_seat_key_count(event);
if (state == LIBINPUT_KEY_STATE_PRESSED)
{
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_KEYBOARD) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_KEYBOARD))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_KEYBOARD) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_KEYBOARD))
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
ELOGF("Key", "Press (keycode: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
code, device_name, blocked_client,
- edev->seat->dev->server_blocked);
+ evdev->seat->dev->server_blocked);
return;
}
* But we need to consider which way is better to maintain key press/release pair.
*/
- EINA_LIST_FOREACH(edev->xkb.pressed_keys, l, idata)
+ EINA_LIST_FOREACH(evdev->xkb.pressed_keys, l, idata)
{
if (*idata == code)
{
EINA_SAFETY_ON_NULL_RETURN(pressed_keycode);
*pressed_keycode = code;
- edev->xkb.pressed_keys = eina_list_append(edev->xkb.pressed_keys, pressed_keycode);
+ evdev->xkb.pressed_keys = eina_list_append(evdev->xkb.pressed_keys, pressed_keycode);
}
}
else
{
dup_found = EINA_FALSE;
- EINA_LIST_FOREACH_SAFE(edev->xkb.pressed_keys, l, l_next, idata)
+ EINA_LIST_FOREACH_SAFE(evdev->xkb.pressed_keys, l, l_next, idata)
{
if (code == *idata)
{
- edev->xkb.pressed_keys = eina_list_remove_list(edev->xkb.pressed_keys, l);
+ evdev->xkb.pressed_keys = eina_list_remove_list(evdev->xkb.pressed_keys, l);
E_FREE(idata);
dup_found = EINA_TRUE;
break;
}
if (!dup_found)
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
ELOGF("Key", "Release (keycode: %d, device: %s) is blocked by %p", NULL,
code, device_name, blocked_client);
return;
}
}
- xkb_state_update_key(edev->xkb.state, code,
+ xkb_state_update_key(evdev->xkb.state, code,
(state ? XKB_KEY_DOWN : XKB_KEY_UP));
/* get the keysym for this code */
- nsyms = xkb_key_get_syms(edev->xkb.state, code, &syms);
+ nsyms = xkb_key_get_syms(evdev->xkb.state, code, &syms);
if (nsyms == 1) sym = syms[0];
}
/* if shift is active, we need to transform the key to lower */
- if (xkb_state_mod_index_is_active(edev->xkb.state,
- xkb_map_mod_get_index(edev->xkb.keymap,
+ if (xkb_state_mod_index_is_active(evdev->xkb.state,
+ xkb_map_mod_get_index(evdev->xkb.keymap,
XKB_MOD_NAME_SHIFT),
XKB_STATE_MODS_EFFECTIVE))
{
keyname[0] = tolower(keyname[0]);
}
- if (_device_keysym_translate(sym, edev->xkb.modifiers,
+ if (_device_keysym_translate(sym, evdev->xkb.modifiers,
compose_buffer, sizeof(compose_buffer)))
{
compose = eina_str_convert("ISO8859-1", "UTF-8", compose_buffer);
e->keycode = code;
e->data = key_data;
- _device_modifiers_update(edev);
+ _device_modifiers_update(evdev);
- e->modifiers = edev->xkb.modifiers;
+ e->modifiers = evdev->xkb.modifiers;
comp_conf = e_comp_config_get();
}
static void
-_device_pointer_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event)
+_device_pointer_motion(E_Input_Evdev *evdev, struct libinput_event_pointer *event)
{
E_Input_Backend *input;
Ecore_Event_Mouse_Move *ev;
const char *device_name = NULL;
uint32_t timestamp = 0;
- if (!(input = edev->seat->input)) return;
+ if (!(input = evdev->seat->input)) return;
ecore_thread_main_loop_begin();
- device_name = edev->name;
+ device_name = evdev->name;
if (event)
timestamp = libinput_event_pointer_get_time(event);
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_MOUSE);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
- _device_configured_size_get(edev, &x, &y, &w, &h);
+ _device_configured_size_get(evdev, &x, &y, &w, &h);
- if (edev->seat->ptr.ix < x)
- edev->seat->ptr.dx = edev->seat->ptr.ix = x;
- else if (edev->seat->ptr.ix >= (x + w))
- edev->seat->ptr.dx = edev->seat->ptr.ix = (x + w - 1);
+ if (evdev->seat->ptr.ix < x)
+ evdev->seat->ptr.dx = evdev->seat->ptr.ix = x;
+ else if (evdev->seat->ptr.ix >= (x + w))
+ evdev->seat->ptr.dx = evdev->seat->ptr.ix = (x + w - 1);
- if (edev->seat->ptr.iy < y)
- edev->seat->ptr.dy = edev->seat->ptr.iy = y;
- else if (edev->seat->ptr.iy >= (y + h))
- edev->seat->ptr.dy = edev->seat->ptr.iy = (y + h - 1);
+ if (evdev->seat->ptr.iy < y)
+ evdev->seat->ptr.dy = evdev->seat->ptr.iy = y;
+ else if (evdev->seat->ptr.iy >= (y + h))
+ evdev->seat->ptr.dy = evdev->seat->ptr.iy = (y + h - 1);
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
+ evdev->mouse.dx = evdev->seat->ptr.dx;
+ evdev->mouse.dy = evdev->seat->ptr.dy;
ev->window = (Ecore_Window)input->dev->window;
ev->event_window = (Ecore_Window)input->dev->window;
ev->root_window = (Ecore_Window)input->dev->window;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->x, ev->y, ev->timestamp, ecore_device_name_get(ecore_dev));
}
- ev->multi.device = edev->mt_slot;
+ ev->multi.device = evdev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = 1;
ev->multi.radius_y = 1;
}
void
-e_input_evdev_pointer_motion_post(E_Input_Evdev *edev)
+e_input_evdev_pointer_motion_post(E_Input_Evdev *evdev)
{
- _device_pointer_motion(edev, NULL);
+ _device_pointer_motion(evdev, NULL);
}
static void
-_device_pointer_relative_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event, double dx[2], double dy[2])
+_device_pointer_relative_motion(E_Input_Evdev *evdev, struct libinput_event_pointer *event, double dx[2], double dy[2])
{
E_Input_Backend *input;
Ecore_Event_Mouse_Relative_Move *ev;
const char *device_name = NULL;
uint32_t timestamp = 0;
- if (!(input = edev->seat->input)) return;
+ if (!(input = evdev->seat->input)) return;
- device_name = edev->name;
+ device_name = evdev->name;
if (event)
timestamp = libinput_event_pointer_get_time(event);
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_MOUSE);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
ev->event_window = (Ecore_Window)input->dev->window;
if (event) ev->timestamp = timestamp;
- ev->modifiers = edev->xkb.modifiers;
+ ev->modifiers = evdev->xkb.modifiers;
ev->dx = (int)dx[0];
ev->dy = (int)dy[0];
}
static void
-_device_pointer_motion_send(E_Input_Evdev *edev, struct libinput_event_pointer *event, double dx[2], double dy[2])
+_device_pointer_motion_send(E_Input_Evdev *evdev, struct libinput_event_pointer *event, double dx[2], double dy[2])
{
e_input_relative_motion_cb func = e_input_relative_motion_handler_get();
if (func)
{
//func(dx, dy, time_us);
- _device_pointer_relative_motion(edev, event, dx, dy);
+ _device_pointer_relative_motion(evdev, event, dx, dy);
}
else
{
double seat_dx, seat_dy, temp;
- if (edev->disable_acceleration)
+ if (evdev->disable_acceleration)
{
seat_dx = dx[1];
seat_dy = dy[1];
seat_dy = dy[0];
}
- if (edev->seat->ptr.swap)
+ if (evdev->seat->ptr.swap)
{
temp = seat_dx;
seat_dx = seat_dy;
seat_dy = temp;
}
- if (edev->seat->ptr.invert_x)
+ if (evdev->seat->ptr.invert_x)
seat_dx *= -1;
- if (edev->seat->ptr.invert_y)
+ if (evdev->seat->ptr.invert_y)
seat_dy *= -1;
- edev->seat->ptr.dx += seat_dx;
- edev->seat->ptr.dy += seat_dy;
+ evdev->seat->ptr.dx += seat_dx;
+ evdev->seat->ptr.dy += seat_dy;
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
+ evdev->mouse.dx = evdev->seat->ptr.dx;
+ evdev->mouse.dy = evdev->seat->ptr.dy;
- if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
- floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
+ if (floor(evdev->seat->ptr.dx) == evdev->seat->ptr.ix &&
+ floor(evdev->seat->ptr.dy) == evdev->seat->ptr.iy)
{
return;
}
- edev->seat->ptr.ix = edev->seat->ptr.dx;
- edev->seat->ptr.iy = edev->seat->ptr.dy;
+ evdev->seat->ptr.ix = evdev->seat->ptr.dx;
+ evdev->seat->ptr.iy = evdev->seat->ptr.dy;
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
return;
}
- _device_pointer_motion(edev, event);
+ _device_pointer_motion(evdev, event);
}
}
static void
_device_handle_pointer_motion(struct libinput_device *device, struct libinput_event_pointer *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
double delta_x[2]; /* delta_x[0] for accelerated, delta_x[1] for unaccelerated */
double delta_y[2]; /* delta_y[0] for accelerated, delta_y[1] for unaccelerated */
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
delta_y[0] = libinput_event_pointer_get_dy(event);
delta_y[1] = libinput_event_pointer_get_dy_unaccelerated(event);
- _device_pointer_motion_send(edev, event, &delta_x[0], &delta_y[0]);
+ _device_pointer_motion_send(evdev, event, &delta_x[0], &delta_y[0]);
}
static void
_device_handle_pointer_motion_absolute(struct libinput_device *device, struct libinput_event_pointer *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
int w = 0, h = 0;
E_Output *primary_output;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
e_output_size_get(primary_output, &w, &h);
- edev->mouse.dx = edev->seat->ptr.dx =
+ evdev->mouse.dx = evdev->seat->ptr.dx =
libinput_event_pointer_get_absolute_x_transformed(event, w);
- edev->mouse.dy = edev->seat->ptr.dy =
+ evdev->mouse.dy = evdev->seat->ptr.dy =
libinput_event_pointer_get_absolute_y_transformed(event, h);
- if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
- floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
+ if (floor(evdev->seat->ptr.dx) == evdev->seat->ptr.ix &&
+ floor(evdev->seat->ptr.dy) == evdev->seat->ptr.iy)
{
return;
}
- edev->seat->ptr.ix = edev->seat->ptr.dx;
- edev->seat->ptr.iy = edev->seat->ptr.dy;
+ evdev->seat->ptr.ix = evdev->seat->ptr.dx;
+ evdev->seat->ptr.iy = evdev->seat->ptr.dy;
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
return;
}
- _device_pointer_motion(edev, event);
+ _device_pointer_motion(evdev, event);
}
static void
_device_handle_button(struct libinput_device *device, struct libinput_event_pointer *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
enum libinput_button_state state;
E_Comp_Config *comp_conf = NULL;
const char *device_name = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- if (!(input = edev->seat->input))
+ if (!(input = evdev->seat->input))
{
return;
}
state = libinput_event_pointer_get_button_state(event);
button = libinput_event_pointer_get_button(event);
timestamp = libinput_event_pointer_get_time(event);
- device_name = edev->name;
+ device_name = evdev->name;
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_MOUSE);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
if (button == 3) button = 2;
else if (button == 2) button = 3;
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
if (state)
{
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
ELOGF("Mouse", "Button Press (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
button, ecore_device_name_get(ecore_dev), blocked_client,
- edev->seat->dev->server_blocked);
+ evdev->seat->dev->server_blocked);
goto end;
}
else
{
- edev->mouse.pressed_button |= (1 << button);
+ evdev->mouse.pressed_button |= (1 << button);
}
}
else
{
- if (!(edev->mouse.pressed_button & (1 << button)))
+ if (!(evdev->mouse.pressed_button & (1 << button)))
{
ELOGF("Mouse", "Button Release (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
button, ecore_device_name_get(ecore_dev), blocked_client,
- edev->seat->dev->server_blocked);
+ evdev->seat->dev->server_blocked);
goto end;
}
- edev->mouse.pressed_button &= ~(1 << button);
+ evdev->mouse.pressed_button &= ~(1 << button);
}
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Button))))
ev->timestamp = timestamp;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
- ev->multi.device = edev->mt_slot;
+ ev->multi.device = evdev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = 1;
ev->multi.radius_y = 1;
unsigned int current;
current = timestamp;
- edev->mouse.did_double = EINA_FALSE;
- edev->mouse.did_triple = EINA_FALSE;
+ evdev->mouse.did_double = EINA_FALSE;
+ evdev->mouse.did_triple = EINA_FALSE;
- if (((current - edev->mouse.prev) <= edev->mouse.threshold) &&
- (button == edev->mouse.prev_button))
+ if (((current - evdev->mouse.prev) <= evdev->mouse.threshold) &&
+ (button == evdev->mouse.prev_button))
{
- edev->mouse.did_double = EINA_TRUE;
- if (((current - edev->mouse.last) <= (2 * edev->mouse.threshold)) &&
- (button == edev->mouse.last_button))
+ evdev->mouse.did_double = EINA_TRUE;
+ if (((current - evdev->mouse.last) <= (2 * evdev->mouse.threshold)) &&
+ (button == evdev->mouse.last_button))
{
- edev->mouse.did_triple = EINA_TRUE;
- edev->mouse.prev = 0;
- edev->mouse.last = 0;
+ evdev->mouse.did_triple = EINA_TRUE;
+ evdev->mouse.prev = 0;
+ evdev->mouse.last = 0;
current = 0;
}
}
- edev->mouse.last = edev->mouse.prev;
- edev->mouse.prev = current;
- edev->mouse.last_button = edev->mouse.prev_button;
- edev->mouse.prev_button = button;
+ evdev->mouse.last = evdev->mouse.prev;
+ evdev->mouse.prev = current;
+ evdev->mouse.last_button = evdev->mouse.prev_button;
+ evdev->mouse.prev_button = button;
}
ev->buttons = button;
- if (edev->mouse.did_double)
+ if (evdev->mouse.did_double)
ev->double_click = 1;
- if (edev->mouse.did_triple)
+ if (evdev->mouse.did_triple)
ev->triple_click = 1;
comp_conf = e_comp_config_get();
static void
_device_handle_axis(struct libinput_device *device, struct libinput_event_pointer *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *input;
Ecore_Event_Mouse_Wheel *ev;
uint32_t timestamp;
int direction = 0, z = 0;
const char *device_name = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- if (!(input = edev->seat->input))
+ if (!(input = evdev->seat->input))
{
return;
}
- device_name = edev->name;
+ device_name = evdev->name;
timestamp = libinput_event_pointer_get_time(event);
axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_MOUSE);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
z = (int)(z * comp_conf->e_wheel_click_angle);
}
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
if (detent_data)
ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, evdev->seat->dev->server_blocked);
else
ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, evdev->seat->dev->server_blocked);
goto end;
}
ev->timestamp = timestamp;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->z = z;
static void
_device_handle_axis_v120(struct libinput_device *device, struct libinput_event_pointer *event, E_Input_Evdev_Axis_Source source)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *input;
Ecore_Event_Mouse_Wheel *ev;
uint32_t timestamp;
int direction = 0, z = 0;
const char *device_name = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- if (!(input = edev->seat->input))
+ if (!(input = evdev->seat->input))
{
return;
}
- device_name = edev->name;
+ device_name = evdev->name;
timestamp = libinput_event_pointer_get_time(event);
axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_MOUSE);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
z = (int)(z * comp_conf->e_wheel_click_angle);
}
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ if ((evdev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (evdev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
if (detent_data)
ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, evdev->seat->dev->server_blocked);
else
ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, evdev->seat->dev->server_blocked);
goto end;
}
ev->timestamp = timestamp;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->z = z;
#endif
static void
-_device_handle_touch_event_send(E_Input_Evdev *edev, struct libinput_event_touch *event, int state)
+_device_handle_touch_event_send(E_Input_Evdev *evdev, struct libinput_event_touch *event, int state)
{
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
double pressure = 1.0;
double angle = 0.0;
- if (!edev) return;
- if (!(input = edev->seat->input)) return;
+ if (!evdev) return;
+ if (!(input = evdev->seat->input)) return;
timestamp = libinput_event_touch_get_time(event);
#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_TOUCH);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_TOUCH);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
ev->timestamp = timestamp;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
- ev->multi.device = edev->mt_slot;
+ ev->multi.device = evdev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = radius_x;
ev->multi.radius_y = radius_y;
unsigned int current;
current = timestamp;
- edev->mouse.did_double = EINA_FALSE;
- edev->mouse.did_triple = EINA_FALSE;
+ evdev->mouse.did_double = EINA_FALSE;
+ evdev->mouse.did_triple = EINA_FALSE;
- if (((current - edev->mouse.prev) <= edev->mouse.threshold) &&
- (button == edev->mouse.prev_button))
+ if (((current - evdev->mouse.prev) <= evdev->mouse.threshold) &&
+ (button == evdev->mouse.prev_button))
{
- edev->mouse.did_double = EINA_TRUE;
- if (((current - edev->mouse.last) <= (2 * edev->mouse.threshold)) &&
- (button == edev->mouse.last_button))
+ evdev->mouse.did_double = EINA_TRUE;
+ if (((current - evdev->mouse.last) <= (2 * evdev->mouse.threshold)) &&
+ (button == evdev->mouse.last_button))
{
- edev->mouse.did_triple = EINA_TRUE;
- edev->mouse.prev = 0;
- edev->mouse.last = 0;
+ evdev->mouse.did_triple = EINA_TRUE;
+ evdev->mouse.prev = 0;
+ evdev->mouse.last = 0;
current = 0;
}
}
- edev->mouse.last = edev->mouse.prev;
- edev->mouse.prev = current;
- edev->mouse.last_button = edev->mouse.prev_button;
- edev->mouse.prev_button = button;
- edev->touch.pressed |= (1 << ev->multi.device);
+ evdev->mouse.last = evdev->mouse.prev;
+ evdev->mouse.prev = current;
+ evdev->mouse.last_button = evdev->mouse.prev_button;
+ evdev->mouse.prev_button = button;
+ evdev->touch.pressed |= (1 << ev->multi.device);
}
else
{
- edev->touch.pressed &= ~(1 << ev->multi.device);
+ evdev->touch.pressed &= ~(1 << ev->multi.device);
}
ev->buttons = ((button & 0x00F) + 1);
- if (edev->mouse.did_double)
+ if (evdev->mouse.did_double)
ev->double_click = 1;
- if (edev->mouse.did_triple)
+ if (evdev->mouse.did_triple)
ev->triple_click = 1;
ecore_event_add(state, ev, _e_input_event_mouse_button_cb_free, NULL);
}
static void
-_device_handle_touch_motion_send(E_Input_Evdev *edev, struct libinput_event_touch *event)
+_device_handle_touch_motion_send(E_Input_Evdev *evdev, struct libinput_event_touch *event)
{
E_Input_Backend *input;
Ecore_Event_Mouse_Move *ev;
uint32_t timestamp = 0;
double radius_x = 1.0, radius_y = 1.0, pressure = 1.0, angle = 0.0;
- if (!edev) return;
- if (!(input = edev->seat->input)) return;
+ if (!evdev) return;
+ if (!(input = evdev->seat->input)) return;
timestamp = libinput_event_touch_get_time(event);
#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_TOUCH);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_TOUCH);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
ev->timestamp = timestamp;
ev->same_screen = 1;
- _device_modifiers_update(edev);
- ev->modifiers = edev->xkb.modifiers;
+ _device_modifiers_update(evdev);
+ ev->modifiers = evdev->xkb.modifiers;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
- ev->multi.device = edev->mt_slot;
+ ev->multi.device = evdev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = radius_x;
ev->multi.radius_y = radius_y;
}
static void
-_device_handle_touch_cancel_send(E_Input_Evdev *edev, struct libinput_event_touch *event)
+_device_handle_touch_cancel_send(E_Input_Evdev *evdev, struct libinput_event_touch *event)
{
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
Ecore_Device *ecore_dev = NULL, *data;
Eina_List *l;
- if (!edev) return;
- if (!(input = edev->seat->input)) return;
+ if (!evdev) return;
+ if (!(input = evdev->seat->input)) return;
timestamp = libinput_event_touch_get_time(event);
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_TOUCH);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_TOUCH);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
ev->timestamp = timestamp;
ev->same_screen = 1;
- ev->x = edev->seat->ptr.ix;
- ev->y = edev->seat->ptr.iy;
+ ev->x = evdev->seat->ptr.ix;
+ ev->y = evdev->seat->ptr.iy;
ev->root.x = ev->x;
ev->root.y = ev->y;
- ev->multi.device = edev->mt_slot;
+ ev->multi.device = evdev->mt_slot;
ev->multi.radius = 1;
ev->multi.radius_x = 1;
ev->multi.radius_y = 1;
ev->multi.root.x = ev->x;
ev->multi.root.y = ev->y;
- edev->touch.pressed &= ~(1 << ev->multi.device);
+ evdev->touch.pressed &= ~(1 << ev->multi.device);
ev->buttons = ((button & 0x00F) + 1);
ev->dev = ecore_device_ref(ecore_dev);
}
static void
-_device_configured_size_get(E_Input_Evdev *edev, int *x, int *y, int *w, int *h)
+_device_configured_size_get(E_Input_Evdev *evdev, int *x, int *y, int *w, int *h)
{
E_Output *output = NULL;
- EINA_SAFETY_ON_NULL_RETURN(edev);
+ EINA_SAFETY_ON_NULL_RETURN(evdev);
- if (!edev->output_configured)
+ if (!evdev->output_configured)
{
- if (edev->output_name)
+ if (evdev->output_name)
{
- output = e_output_find(edev->output_name);
+ output = e_output_find(evdev->output_name);
if (output)
{
- edev->mouse.minx = output->config.geom.x;
- edev->mouse.miny = output->config.geom.y;
- edev->mouse.maxw = output->config.geom.w;
- edev->mouse.maxh = output->config.geom.h;
- if (edev->caps & E_INPUT_SEAT_POINTER)
+ evdev->mouse.minx = output->config.geom.x;
+ evdev->mouse.miny = output->config.geom.y;
+ evdev->mouse.maxw = output->config.geom.w;
+ evdev->mouse.maxh = output->config.geom.h;
+ if (evdev->caps & E_INPUT_SEAT_POINTER)
{
- edev->seat->ptr.dx = (double)(edev->mouse.maxw / 2);
- edev->seat->ptr.dy = (double)(edev->mouse.maxh / 2);
- edev->seat->ptr.ix = (int)edev->seat->ptr.dx;
- edev->seat->ptr.iy = (int)edev->seat->ptr.dy;
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
+ evdev->seat->ptr.dx = (double)(evdev->mouse.maxw / 2);
+ evdev->seat->ptr.dy = (double)(evdev->mouse.maxh / 2);
+ evdev->seat->ptr.ix = (int)evdev->seat->ptr.dx;
+ evdev->seat->ptr.iy = (int)evdev->seat->ptr.dy;
+ evdev->mouse.dx = evdev->seat->ptr.dx;
+ evdev->mouse.dy = evdev->seat->ptr.dy;
}
}
}
- edev->output_configured = EINA_TRUE;
+ evdev->output_configured = EINA_TRUE;
ELOGF("E_INPUT_EVDEV", "Device is configured by output x:%d,y:%d (w:%d, h:%d)",
- NULL, edev->mouse.minx, edev->mouse.miny, edev->mouse.maxw, edev->mouse.maxh);
+ NULL, evdev->mouse.minx, evdev->mouse.miny, evdev->mouse.maxw, evdev->mouse.maxh);
}
- if (x) *x = edev->mouse.minx;
- if (y) *y = edev->mouse.miny;
- if (w) *w = edev->mouse.maxw;
- if (h) *h = edev->mouse.maxh;
+ if (x) *x = evdev->mouse.minx;
+ if (y) *y = evdev->mouse.miny;
+ if (w) *w = evdev->mouse.maxw;
+ if (h) *h = evdev->mouse.maxh;
}
static void
_device_handle_touch_down(struct libinput_device *device, struct libinput_event_touch *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
int x = 0, y = 0, w = 0, h = 0;
E_Comp_Config *comp_conf = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- _device_configured_size_get(edev, &x, &y, &w, &h);
+ _device_configured_size_get(evdev, &x, &y, &w, &h);
- edev->mouse.dx = edev->seat->ptr.ix = edev->seat->ptr.dx =
+ evdev->mouse.dx = evdev->seat->ptr.ix = evdev->seat->ptr.dx =
x + libinput_event_touch_get_x_transformed(event, w);
- edev->mouse.dy = edev->seat->ptr.iy = edev->seat->ptr.dy =
+ evdev->mouse.dy = evdev->seat->ptr.iy = evdev->seat->ptr.dy =
y + libinput_event_touch_get_y_transformed(event, h);
- edev->mt_slot = libinput_event_touch_get_slot(event);
- if (edev->mt_slot < 0)
+ evdev->mt_slot = libinput_event_touch_get_slot(event);
+ if (evdev->mt_slot < 0)
{
/* FIXME: The single touch device return slot id -1
* But currently we have no API to distinguish multi touch or single touch
* After libinput 1.11 version, libinput provides get_touch_count API,
* so we can distinguish multi touch device or single touch device.
*/
- if (edev->mt_slot == -1)
- edev->mt_slot = 0;
+ if (evdev->mt_slot == -1)
+ evdev->mt_slot = 0;
else
{
- WRN("%d slot touch down events are not supported\n", edev->mt_slot);
+ WRN("%d slot touch down events are not supported\n", evdev->mt_slot);
return;
}
}
- if (edev->mt_slot < e_input_touch_max_count_get())
+ if (evdev->mt_slot < e_input_touch_max_count_get())
{
- edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix;
- edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
+ evdev->touch.coords[evdev->mt_slot].x = evdev->seat->ptr.ix;
+ evdev->touch.coords[evdev->mt_slot].y = evdev->seat->ptr.iy;
}
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
- ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
- atomic_fetch_or(&edev->touch.raw_pressed, (1 << edev->mt_slot));
+ atomic_fetch_or(&evdev->touch.raw_pressed, (1 << evdev->mt_slot));
if (_touch_blocked_by_palm)
{
ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked during palm", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
return;
}
- if (edev->touch.blocked)
+ if (evdev->touch.blocked)
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked by %p, server: 0x%x", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, blocked_client,
- edev->seat->dev->server_blocked);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy, blocked_client,
+ evdev->seat->dev->server_blocked);
return;
}
- _device_handle_touch_motion_send(edev, event);
- _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
+ _device_handle_touch_motion_send(evdev, event);
+ _device_handle_touch_event_send(evdev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
}
static void
_device_handle_touch_motion(struct libinput_device *device, struct libinput_event_touch *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
int x = 0, y = 0, w = 0, h = 0;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- _device_configured_size_get(edev, &x, &y, &w, &h);
+ _device_configured_size_get(evdev, &x, &y, &w, &h);
- edev->mouse.dx = edev->seat->ptr.dx =
+ evdev->mouse.dx = evdev->seat->ptr.dx =
x + libinput_event_touch_get_x_transformed(event, w);
- edev->mouse.dy = edev->seat->ptr.dy =
+ evdev->mouse.dy = evdev->seat->ptr.dy =
y + libinput_event_touch_get_y_transformed(event, h);
- if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
- floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
+ if (floor(evdev->seat->ptr.dx) == evdev->seat->ptr.ix &&
+ floor(evdev->seat->ptr.dy) == evdev->seat->ptr.iy)
{
return;
}
- edev->seat->ptr.ix = edev->seat->ptr.dx;
- edev->seat->ptr.iy = edev->seat->ptr.dy;
+ evdev->seat->ptr.ix = evdev->seat->ptr.dx;
+ evdev->seat->ptr.iy = evdev->seat->ptr.dy;
- edev->mt_slot = libinput_event_touch_get_slot(event);
- if (edev->mt_slot < 0)
+ evdev->mt_slot = libinput_event_touch_get_slot(event);
+ if (evdev->mt_slot < 0)
{
/* FIXME: The single touch device return slot id -1
* But currently we have no API to distinguish multi touch or single touch
* After libinput 1.11 version, libinput provides get_touch_count API,
* so we can distinguish multi touch device or single touch device.
*/
- if (edev->mt_slot == -1)
- edev->mt_slot = 0;
+ if (evdev->mt_slot == -1)
+ evdev->mt_slot = 0;
else
{
- WRN("%d slot touch motion events are not supported\n", edev->mt_slot);
+ WRN("%d slot touch motion events are not supported\n", evdev->mt_slot);
return;
}
}
- if (edev->mt_slot < e_input_touch_max_count_get())
+ if (evdev->mt_slot < e_input_touch_max_count_get())
{
- edev->touch.coords[edev->mt_slot].x = edev->seat->ptr.ix;
- edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
+ evdev->touch.coords[evdev->mt_slot].x = evdev->seat->ptr.ix;
+ evdev->touch.coords[evdev->mt_slot].y = evdev->seat->ptr.iy;
}
if (_touch_blocked_by_palm)
{
ELOGF("Touch", "Move (id: %d, x: %d, y: %d) is blocked during palm", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
return;
}
- if (!(edev->touch.pressed & (1 << edev->mt_slot)))
+ if (!(evdev->touch.pressed & (1 << evdev->mt_slot)))
{
- if (edev->touch.blocked)
+ if (evdev->touch.blocked)
{
return;
}
}
- _device_handle_touch_motion_send(edev, event);
+ _device_handle_touch_motion_send(evdev, event);
}
static void
_device_handle_touch_up(struct libinput_device *device, struct libinput_event_touch *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Comp_Config *comp_conf = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- edev->mt_slot = libinput_event_touch_get_slot(event);
- if (edev->mt_slot < 0)
+ evdev->mt_slot = libinput_event_touch_get_slot(event);
+ if (evdev->mt_slot < 0)
{
/* FIXME: The single touch device return slot id -1
* But currently we have no API to distinguish multi touch or single touch
* After libinput 1.11 version, libinput provides get_touch_count API,
* so we can distinguish multi touch device or single touch device.
*/
- if (edev->mt_slot == -1)
- edev->mt_slot = 0;
+ if (evdev->mt_slot == -1)
+ evdev->mt_slot = 0;
else
{
- WRN("%d slot touch up events are not supported\n", edev->mt_slot);
+ WRN("%d slot touch up events are not supported\n", evdev->mt_slot);
return;
}
}
- if (edev->mt_slot < e_input_touch_max_count_get())
+ if (evdev->mt_slot < e_input_touch_max_count_get())
{
- edev->mouse.dx = edev->seat->ptr.dx = edev->seat->ptr.ix =
- edev->touch.coords[edev->mt_slot].x;
- edev->mouse.dy = edev->seat->ptr.dy = edev->seat->ptr.iy =
- edev->touch.coords[edev->mt_slot].y;
+ evdev->mouse.dx = evdev->seat->ptr.dx = evdev->seat->ptr.ix =
+ evdev->touch.coords[evdev->mt_slot].x;
+ evdev->mouse.dy = evdev->seat->ptr.dy = evdev->seat->ptr.iy =
+ evdev->touch.coords[evdev->mt_slot].y;
}
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
- ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
- atomic_fetch_and(&edev->touch.raw_pressed, ~(1 << edev->mt_slot));
+ atomic_fetch_and(&evdev->touch.raw_pressed, ~(1 << evdev->mt_slot));
if (_touch_blocked_by_palm)
{
ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked during palm", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
return;
}
else if (_touch_up_blocked_by_palm)
{
ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked lastly on palm up.", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
_touch_up_blocked_by_palm = EINA_FALSE;
return;
}
- if (edev->touch.blocked)
+ if (evdev->touch.blocked)
{
- if (!(edev->touch.pressed & (1 << edev->mt_slot)))
+ if (!(evdev->touch.pressed & (1 << evdev->mt_slot)))
{
- void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+ void *blocked_client = atomic_load(&evdev->seat->dev->blocked_client);
ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked by %p, server(0x%x)", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, blocked_client,
- edev->seat->dev->server_blocked);
+ evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy, blocked_client,
+ evdev->seat->dev->server_blocked);
- if (edev->touch.raw_pressed == 0x0)
+ if (evdev->touch.raw_pressed == 0x0)
{
- edev->touch.blocked = EINA_FALSE;
+ evdev->touch.blocked = EINA_FALSE;
}
return;
}
}
- _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
+ _device_handle_touch_event_send(evdev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
}
static void
_device_handle_touch_cancel(struct libinput_device *device, struct libinput_event_touch *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Comp_Config *comp_conf = NULL;
- if (!(edev = libinput_device_get_user_data(device)))
+ if (!(evdev = libinput_device_get_user_data(device)))
{
return;
}
- edev->mt_slot = libinput_event_touch_get_slot(event);
- if (edev->mt_slot < 0)
+ evdev->mt_slot = libinput_event_touch_get_slot(event);
+ if (evdev->mt_slot < 0)
{
/* FIXME: The single touch device return slot id -1
* But currently we have no API to distinguish multi touch or single touch
* After libinput 1.11 version, libinput provides get_touch_count API,
* so we can distinguish multi touch device or single touch device.
*/
- if (edev->mt_slot == -1)
- edev->mt_slot = 0;
+ if (evdev->mt_slot == -1)
+ evdev->mt_slot = 0;
else
{
- WRN("%d slot touch up events are not supported\n", edev->mt_slot);
+ WRN("%d slot touch up events are not supported\n", evdev->mt_slot);
return;
}
}
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
- ELOGF("Touch", "cancel (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+ ELOGF("Touch", "cancel (id: %d, x: %d, y: %d)", NULL, evdev->mt_slot, evdev->seat->ptr.ix, evdev->seat->ptr.iy);
- _device_handle_touch_cancel_send(edev, event);
+ _device_handle_touch_cancel_send(evdev, event);
}
static void
_device_handle_touch_aux_data(struct libinput_device *device, struct libinput_event_touch_aux_data *event)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *input;
Ecore_Event_Axis_Update *ev;
Ecore_Axis *axis;
libinput_event_touch_aux_data_get_value(event) > 0)
return;
- if (!(edev = libinput_device_get_user_data(device))) return;
- if (!(input = edev->seat->input)) return;
+ if (!(evdev = libinput_device_get_user_data(device))) return;
+ if (!(input = evdev->seat->input)) return;
timestamp = libinput_event_touch_aux_data_get_time(event);
touch_value = libinput_event_touch_aux_data_get_value(event);
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
+ if (evdev->ecore_dev) ecore_dev = evdev->ecore_dev;
+ else if (evdev->ecore_dev_list && eina_list_count(evdev->ecore_dev_list) > 0)
{
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
+ EINA_LIST_FOREACH(evdev->ecore_dev_list, l, data)
{
if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_TOUCH)
{
}
else
{
- edev->ecore_dev = e_input_evdev_ecore_device_get(edev->path, ECORE_DEVICE_CLASS_TOUCH);
- ecore_dev = edev->ecore_dev;
+ evdev->ecore_dev = e_input_evdev_ecore_device_get(evdev->path, ECORE_DEVICE_CLASS_TOUCH);
+ ecore_dev = evdev->ecore_dev;
}
if (!ecore_dev)
E_Input_Evdev *
e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
{
- E_Input_Evdev *edev;
+ E_Input_Evdev *evdev;
E_Input_Backend *b_input;
const char *output_name;
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
/* try to allocate space for new evdev */
- if (!(edev = calloc(1, sizeof(E_Input_Evdev)))) return NULL;
+ if (!(evdev = calloc(1, sizeof(E_Input_Evdev)))) return NULL;
- edev->seat = seat;
- edev->device = device;
- edev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
- edev->name = eina_stringshare_add(libinput_device_get_name(device) ?: "No Name");
+ evdev->seat = seat;
+ evdev->device = device;
+ evdev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
+ evdev->name = eina_stringshare_add(libinput_device_get_name(device) ?: "No Name");
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
{
- edev->caps |= E_INPUT_SEAT_KEYBOARD;
- _device_keyboard_setup(edev);
+ evdev->caps |= E_INPUT_SEAT_KEYBOARD;
+ _device_keyboard_setup(evdev);
}
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER))
{
- edev->caps |= E_INPUT_SEAT_POINTER;
+ evdev->caps |= E_INPUT_SEAT_POINTER;
/* TODO: make this configurable */
- edev->mouse.threshold = 250;
+ evdev->mouse.threshold = 250;
b_input = seat->input;
if (b_input->left_handed == EINA_TRUE)
LIBINPUT_CONFIG_STATUS_SUCCESS)
{
WRN("Failed to set left hand mode about device: %s\n",
- edev->name);
+ evdev->name);
}
}
}
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
{
int palm_code;
- edev->caps |= E_INPUT_SEAT_TOUCH;
+ evdev->caps |= E_INPUT_SEAT_TOUCH;
palm_code = libinput_device_touch_aux_data_get_code(LIBINPUT_TOUCH_AUX_DATA_TYPE_PALM);
if (libinput_device_touch_has_aux_data(device, palm_code))
{
libinput_device_touch_set_aux_data(device, palm_code);
}
- _device_touch_count_update(edev);
+ _device_touch_count_update(evdev);
- edev->touch.coords = calloc(1, sizeof(E_Input_Coord)*e_input_touch_max_count_get());
+ evdev->touch.coords = calloc(1, sizeof(E_Input_Coord)*e_input_touch_max_count_get());
- if (!edev->touch.coords)
+ if (!evdev->touch.coords)
ERR("Failed to allocate memory for touch coords !\n");
}
output_name = libinput_device_get_output_name(device);
if (output_name)
{
- eina_stringshare_replace(&edev->output_name, output_name);
+ eina_stringshare_replace(&evdev->output_name, output_name);
ELOGF("E_INPUT_EVDEV", "Device has output_name:%s", NULL, output_name);
}
- libinput_device_set_user_data(device, edev);
+ libinput_device_set_user_data(device, evdev);
libinput_device_ref(device);
/* configure device */
- _device_configure(edev);
+ _device_configure(evdev);
- return edev;
+ return evdev;
}
void
-e_input_evdev_device_destroy(E_Input_Evdev *edev)
+e_input_evdev_device_destroy(E_Input_Evdev *evdev)
{
Ecore_Device *dev;
- EINA_SAFETY_ON_NULL_RETURN(edev);
+ EINA_SAFETY_ON_NULL_RETURN(evdev);
- if (edev->caps & E_INPUT_SEAT_KEYBOARD)
+ if (evdev->caps & E_INPUT_SEAT_KEYBOARD)
{
- if (edev->xkb.state) xkb_state_unref(edev->xkb.state);
+ if (evdev->xkb.state) xkb_state_unref(evdev->xkb.state);
- if (edev->xkb.keymap) xkb_map_unref(edev->xkb.keymap);
+ if (evdev->xkb.keymap) xkb_map_unref(evdev->xkb.keymap);
}
ecore_thread_main_loop_begin();
- if (edev->ecore_dev) ecore_device_del(edev->ecore_dev);
- if (edev->ecore_dev_list)
- EINA_LIST_FREE(edev->ecore_dev_list, dev)
+ if (evdev->ecore_dev) ecore_device_del(evdev->ecore_dev);
+ if (evdev->ecore_dev_list)
+ EINA_LIST_FREE(evdev->ecore_dev_list, dev)
{
ecore_device_del(dev);
}
- if (edev->e_dev) g_object_unref(edev->e_dev);
- if (edev->e_dev_list)
+ if (evdev->e_dev) g_object_unref(evdev->e_dev);
+ if (evdev->e_dev_list)
{
- GList *glist = edev->e_dev_list;
+ GList *glist = evdev->e_dev_list;
E_Device *e_dev;
while (glist)
{
glist = g_list_next(glist);
}
}
- if (edev->name) eina_stringshare_del(edev->name);
- 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);
- if (edev->touch.coords)
+ if (evdev->name) eina_stringshare_del(evdev->name);
+ if (evdev->path) eina_stringshare_del(evdev->path);
+ if (evdev->device) libinput_device_unref(evdev->device);
+ if (evdev->key_remap_hash) eina_hash_free(evdev->key_remap_hash);
+ if (evdev->touch.coords)
{
- free(edev->touch.coords);
- edev->touch.coords = NULL;
+ free(evdev->touch.coords);
+ evdev->touch.coords = NULL;
}
- eina_stringshare_del(edev->output_name);
+ eina_stringshare_del(evdev->output_name);
ecore_thread_main_loop_end();
- free(edev);
+ free(evdev);
}
EINTERN Eina_List *
* not, unsupported device.
*/
EINTERN void
-e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h)
+e_input_evdev_axis_size_set(E_Input_Evdev *evdev, int w, int h)
{
float cal[6];
const char *vals;
enum libinput_config_status status;
struct udev_device *udev_device = NULL;
- EINA_SAFETY_ON_NULL_RETURN(edev);
+ EINA_SAFETY_ON_NULL_RETURN(evdev);
EINA_SAFETY_ON_TRUE_RETURN((w == 0) || (h == 0));
- if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
- (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
+ if ((!libinput_device_config_calibration_has_matrix(evdev->device)) ||
+ (libinput_device_config_calibration_get_default_matrix(evdev->device, cal) != 0))
return;
- udev_device = libinput_device_get_udev_device(edev->device);
+ udev_device = libinput_device_get_udev_device(evdev->device);
if (!udev_device)
{
ERR("no udev_device");
cal[5] /= h;
status =
- libinput_device_config_calibration_set_matrix(edev->device, cal);
+ libinput_device_config_calibration_set_matrix(evdev->device, cal);
if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
ERR("Failed to apply calibration");
}
EINTERN Eina_Bool
-e_input_evdev_key_remap_enable(E_Input_Evdev *edev, Eina_Bool enable)
+e_input_evdev_key_remap_enable(E_Input_Evdev *evdev, Eina_Bool enable)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, EINA_FALSE);
- edev->key_remap_enabled = enable;
+ evdev->key_remap_enabled = enable;
- if (enable == EINA_FALSE && edev->key_remap_hash)
+ if (enable == EINA_FALSE && evdev->key_remap_hash)
{
- eina_hash_free(edev->key_remap_hash);
- edev->key_remap_hash = NULL;
+ eina_hash_free(evdev->key_remap_hash);
+ evdev->key_remap_hash = NULL;
}
return EINA_TRUE;
}
EINTERN Eina_Bool
-e_input_evdev_key_remap_set(E_Input_Evdev *edev, int *from_keys, int *to_keys, int num)
+e_input_evdev_key_remap_set(E_Input_Evdev *evdev, int *from_keys, int *to_keys, int num)
{
int i;
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(from_keys, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(to_keys, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(num <= 0, EINA_FALSE);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(!edev->key_remap_enabled, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!evdev->key_remap_enabled, EINA_FALSE);
- if (edev->key_remap_hash == NULL)
- edev->key_remap_hash = eina_hash_int32_new(NULL);
+ if (evdev->key_remap_hash == NULL)
+ evdev->key_remap_hash = eina_hash_int32_new(NULL);
- if (edev->key_remap_hash == NULL)
+ if (evdev->key_remap_hash == NULL)
{
ERR("Failed to set remap key information : creating a hash is failed.");
return EINA_FALSE;
for (i = 0; i < num ; i++)
{
- eina_hash_add(edev->key_remap_hash, &from_keys[i], (void *)(intptr_t)to_keys[i]);
+ eina_hash_add(evdev->key_remap_hash, &from_keys[i], (void *)(intptr_t)to_keys[i]);
}
return EINA_TRUE;
}
EINTERN Eina_Bool
-e_input_evdev_touch_calibration_set(E_Input_Evdev *edev, float matrix[6])
+e_input_evdev_touch_calibration_set(E_Input_Evdev *evdev, float matrix[6])
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, EINA_FALSE);
- if (!libinput_device_config_calibration_has_matrix(edev->device) ||
- !(edev->caps & E_INPUT_SEAT_TOUCH))
+ if (!libinput_device_config_calibration_has_matrix(evdev->device) ||
+ !(evdev->caps & E_INPUT_SEAT_TOUCH))
return EINA_FALSE;
- if (libinput_device_config_calibration_set_matrix(edev->device, matrix) !=
+ if (libinput_device_config_calibration_set_matrix(evdev->device, matrix) !=
LIBINPUT_CONFIG_STATUS_SUCCESS)
{
WRN("Failed to set input transformation about device: %s\n",
- edev->name);
+ evdev->name);
return EINA_FALSE;
}
}
EINTERN Eina_Bool
-e_input_evdev_mouse_accel_speed_set(E_Input_Evdev *edev, double speed)
+e_input_evdev_mouse_accel_speed_set(E_Input_Evdev *evdev, double speed)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev->device, EINA_FALSE);
- if (!(edev->caps & E_INPUT_SEAT_POINTER))
+ if (!(evdev->caps & E_INPUT_SEAT_POINTER))
return EINA_FALSE;
- if (!libinput_device_config_accel_is_available(edev->device))
+ if (!libinput_device_config_accel_is_available(evdev->device))
return EINA_FALSE;
- if (libinput_device_config_accel_set_speed(edev->device, speed) !=
+ if (libinput_device_config_accel_set_speed(evdev->device, speed) !=
LIBINPUT_CONFIG_STATUS_SUCCESS)
{
WRN("Failed to set mouse accel about device: %s\n",
- edev->name);
+ evdev->name);
return EINA_FALSE;
}
}
EINTERN unsigned int
-e_input_evdev_touch_pressed_get(E_Input_Evdev *edev)
+e_input_evdev_touch_pressed_get(E_Input_Evdev *evdev)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, 0x0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(evdev, 0x0);
- return edev->touch.pressed;
+ return evdev->touch.pressed;
}
const char *