implement cursor and device geometry mapping

This commit is contained in:
Tony Crisci 2017-08-25 13:26:13 -04:00
parent d0cf8d0d01
commit 0a97b68278
10 changed files with 186 additions and 5 deletions

View file

@ -4,6 +4,7 @@
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_geometry.h>
#include <wlr/xcursor.h>
struct wlr_cursor_state;
@ -87,12 +88,13 @@ void wlr_cursor_map_input_to_output(struct wlr_cursor *cur,
/**
* Maps this cursor to an arbitrary region on the associated wlr_output_layout.
*/
//void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_geometry *geo);
void wlr_cursor_map_to_region(struct wlr_cursor *cur, struct wlr_geometry *geo);
/**
* Maps inputs from this input device to an arbitrary region on the associated
* wlr_output_layout.
*/
//void wlr_cursor_map_input_to_region(struct wlr_cursor *cur, struct wlr_input_device *dev, struct wlr_geometry *geo);
void wlr_cursor_map_input_to_region(struct wlr_cursor *cur,
struct wlr_input_device *dev, struct wlr_geometry *geo);
#endif

View file

@ -0,0 +1,12 @@
#ifndef _WLR_TYPES_GEOMETRY_H
#define _WLR_TYPES_GEOMETRY_H
struct wlr_geometry {
int x, y;
int width, height;
};
void wlr_geometry_closest_boundary(struct wlr_geometry *geo, double x, double y,
int *dest_x, int *dest_y, double *distance);
#endif