mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
cursor: use NAN for unspecified axes, refactor absolute warping code
This commit is contained in:
parent
4d7877420d
commit
6e7c0b57f6
3 changed files with 73 additions and 80 deletions
|
|
@ -69,16 +69,34 @@ void wlr_cursor_destroy(struct wlr_cursor *cur);
|
|||
* `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
|
||||
* device mapping constraints will be ignored.
|
||||
*
|
||||
* Returns true when the mouse warp was successful.
|
||||
* Returns true when the cursor warp was successful.
|
||||
*/
|
||||
bool wlr_cursor_warp(struct wlr_cursor *cur, struct wlr_input_device *dev,
|
||||
double x, double y);
|
||||
double lx, double ly);
|
||||
|
||||
/**
|
||||
* Convert absolute 0..1 coordinates to layout coordinates.
|
||||
*
|
||||
* `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
|
||||
* device mapping constraints will be ignored.
|
||||
*/
|
||||
void wlr_cursor_absolute_to_layout_coords(struct wlr_cursor *cur,
|
||||
struct wlr_input_device *dev, double x, double y, double *lx, double *ly);
|
||||
|
||||
/**
|
||||
* Warp the cursor to the given x and y in absolute 0..1 coordinates. If the
|
||||
* given point is out of the layout boundaries or constraints, the closest point
|
||||
* will be used. If one coordinate is NAN, it will be ignored.
|
||||
*
|
||||
* `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
|
||||
* device mapping constraints will be ignored.
|
||||
*/
|
||||
void wlr_cursor_warp_absolute(struct wlr_cursor *cur,
|
||||
struct wlr_input_device *dev, double x, double y);
|
||||
|
||||
/**
|
||||
* Move the cursor in the direction of the given x and y coordinates.
|
||||
* Move the cursor in the direction of the given x and y layout coordinates. If
|
||||
* one coordinate is NAN, it will be ignored.
|
||||
*
|
||||
* `dev` may be passed to respect device mapping constraints. If `dev` is NULL,
|
||||
* device mapping constraints will be ignored.
|
||||
|
|
@ -153,11 +171,4 @@ void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_box *box);
|
|||
void wlr_cursor_map_input_to_region(struct wlr_cursor *cur,
|
||||
struct wlr_input_device *dev, struct wlr_box *box);
|
||||
|
||||
/**
|
||||
* Convert absolute coordinates to layout coordinates for the device.
|
||||
*/
|
||||
bool wlr_cursor_absolute_to_layout_coords(struct wlr_cursor *cur,
|
||||
struct wlr_input_device *device, double x, double y,
|
||||
double *lx, double *ly);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue