forked from enlightenment/efl
ecore_drm: Add pointer warping API
Adds a new API: ecore_drm_device_pointer_warp() which warps the pointer to the specified location. All libinput seats with pointers are warped.
This commit is contained in:
parent
4e953ecc4d
commit
ddc6962d77
|
@ -835,6 +835,20 @@ EAPI void ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, ui
|
||||||
*/
|
*/
|
||||||
EAPI void ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y);
|
EAPI void ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Warp the pointer position of Ecore_Drm_Device
|
||||||
|
*
|
||||||
|
* This function will set the pointer position of Ecore_Drm_Device
|
||||||
|
*
|
||||||
|
* @param dev The Ecore_Drm_Device to set pointer position for
|
||||||
|
* @param x The new x co-ordinate
|
||||||
|
* @param y The new y co-ordinate
|
||||||
|
*
|
||||||
|
* @ingroup Ecore_Drm_Device_Group
|
||||||
|
* @since 1.18
|
||||||
|
*/
|
||||||
|
EAPI void ecore_drm_device_pointer_warp(Ecore_Drm_Device *dev, int x, int y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of drm devices which are allocated.
|
* Get the list of drm devices which are allocated.
|
||||||
*
|
*
|
||||||
|
|
|
@ -509,6 +509,30 @@ ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_drm_device_pointer_warp(Ecore_Drm_Device *dev, int x, int y)
|
||||||
|
{
|
||||||
|
Ecore_Drm_Seat *seat;
|
||||||
|
Ecore_Drm_Evdev *edev;
|
||||||
|
Eina_List *l, *ll;
|
||||||
|
|
||||||
|
/* check for valid device */
|
||||||
|
EINA_SAFETY_ON_TRUE_RETURN((!dev) || (dev->drm.fd < 0));
|
||||||
|
EINA_LIST_FOREACH(dev->seats, l, seat)
|
||||||
|
{
|
||||||
|
EINA_LIST_FOREACH(seat->devices, ll, edev)
|
||||||
|
{
|
||||||
|
if (!libinput_device_has_capability(edev->device,
|
||||||
|
LIBINPUT_DEVICE_CAP_POINTER))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
seat->ptr.dx = seat->ptr.ix = x;
|
||||||
|
seat->ptr.dy = seat->ptr.iy = y;
|
||||||
|
_ecore_drm_pointer_motion_post(edev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
ecore_drm_device_software_setup(Ecore_Drm_Device *dev)
|
ecore_drm_device_software_setup(Ecore_Drm_Device *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -399,7 +399,7 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
|
||||||
ev->window = (Ecore_Window)input->dev->window;
|
ev->window = (Ecore_Window)input->dev->window;
|
||||||
ev->event_window = (Ecore_Window)input->dev->window;
|
ev->event_window = (Ecore_Window)input->dev->window;
|
||||||
ev->root_window = (Ecore_Window)input->dev->window;
|
ev->root_window = (Ecore_Window)input->dev->window;
|
||||||
ev->timestamp = libinput_event_pointer_get_time(event);
|
if (event) ev->timestamp = libinput_event_pointer_get_time(event);
|
||||||
ev->same_screen = 1;
|
ev->same_screen = 1;
|
||||||
|
|
||||||
_device_modifiers_update(edev);
|
_device_modifiers_update(edev);
|
||||||
|
@ -424,6 +424,12 @@ _device_pointer_motion(Ecore_Drm_Evdev *edev, struct libinput_event_pointer *eve
|
||||||
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
|
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_drm_pointer_motion_post(Ecore_Drm_Evdev *edev)
|
||||||
|
{
|
||||||
|
_device_pointer_motion(edev, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_device_handle_pointer_motion(struct libinput_device *device, struct libinput_event_pointer *event)
|
_device_handle_pointer_motion(struct libinput_device *device, struct libinput_event_pointer *event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -283,6 +283,7 @@ void _ecore_drm_tty_restore(Ecore_Drm_Device *dev);
|
||||||
Ecore_Drm_Evdev *_ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, struct libinput_device *device);
|
Ecore_Drm_Evdev *_ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, struct libinput_device *device);
|
||||||
void _ecore_drm_evdev_device_destroy(Ecore_Drm_Evdev *evdev);
|
void _ecore_drm_evdev_device_destroy(Ecore_Drm_Evdev *evdev);
|
||||||
Eina_Bool _ecore_drm_evdev_event_process(struct libinput_event *event);
|
Eina_Bool _ecore_drm_evdev_event_process(struct libinput_event *event);
|
||||||
|
void _ecore_drm_pointer_motion_post(Ecore_Drm_Evdev *evdev);
|
||||||
|
|
||||||
Ecore_Drm_Fb *_ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height);
|
Ecore_Drm_Fb *_ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height);
|
||||||
void _ecore_drm_fb_destroy(Ecore_Drm_Fb *fb);
|
void _ecore_drm_fb_destroy(Ecore_Drm_Fb *fb);
|
||||||
|
|
Loading…
Reference in New Issue