From 9eb2064b858e7986e8ffafc9cfabdba2fafaaa4b Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 10 Jul 2019 18:23:43 +0300 Subject: [PATCH] libweston: Migrate functions that operate on input objects This include 'weston_keyboard', 'weston_touch', 'weston_pointer' and other released classes. Signed-off-by: Marius Vlad --- compositor/screen-share.c | 1 + include/libweston/libweston.h | 32 -------------------------- libweston/libinput-device.c | 1 + libweston/libweston-internal.h | 42 ++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 32 deletions(-) diff --git a/compositor/screen-share.c b/compositor/screen-share.c index 360cd3cd..3e502817 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -41,6 +41,7 @@ #include #include +#include "libweston-internal.h" #include "weston.h" #include "shared/helpers.h" #include "shared/os-compatibility.h" diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index b3ca6b0b..2476d311 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -645,18 +645,8 @@ weston_pointer_start_grab(struct weston_pointer *pointer, void weston_pointer_end_grab(struct weston_pointer *pointer); void -weston_pointer_clamp(struct weston_pointer *pointer, - wl_fixed_t *fx, wl_fixed_t *fy); -void weston_pointer_move(struct weston_pointer *pointer, struct weston_pointer_motion_event *event); -void -weston_pointer_set_default_grab(struct weston_pointer *pointer, - const struct weston_pointer_grab_interface *interface); - -void -weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint); - void weston_keyboard_set_focus(struct weston_keyboard *keyboard, struct weston_surface *surface); @@ -673,8 +663,6 @@ int weston_keyboard_set_locks(struct weston_keyboard *keyboard, uint32_t mask, uint32_t value); -bool -weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard); void weston_keyboard_send_key(struct weston_keyboard *keyboard, const struct timespec *time, uint32_t key, @@ -694,8 +682,6 @@ weston_touch_start_grab(struct weston_touch *touch, void weston_touch_end_grab(struct weston_touch *touch); -bool -weston_touch_has_focus_resource(struct weston_touch *touch); void weston_touch_send_down(struct weston_touch *touch, const struct timespec *time, int touch_id, wl_fixed_t x, wl_fixed_t y); @@ -709,18 +695,6 @@ weston_touch_send_motion(struct weston_touch *touch, void weston_touch_send_frame(struct weston_touch *touch); -struct weston_touch_device * -weston_touch_create_touch_device(struct weston_touch *touch, - const char *syspath, - void *backend_data, - const struct weston_touch_device_ops *ops); - -void -weston_touch_device_destroy(struct weston_touch_device *device); - -bool -weston_touch_device_can_calibrate(struct weston_touch_device *device); - int wl_data_device_manager_init(struct wl_display *display); @@ -734,12 +708,6 @@ weston_pointer_start_drag(struct weston_pointer *pointer, struct weston_data_source *source, struct weston_surface *icon, struct wl_client *client); -int -weston_touch_start_drag(struct weston_touch *touch, - struct weston_data_source *source, - struct weston_surface *icon, - struct wl_client *client); - struct weston_xkb_info { struct xkb_keymap *keymap; size_t keymap_size; diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c index 140e87a4..6941a5c4 100644 --- a/libweston/libinput-device.c +++ b/libweston/libinput-device.c @@ -39,6 +39,7 @@ #include #include +#include "libweston-internal.h" #include "libinput-device.h" #include "shared/helpers.h" #include "shared/timespec-util.h" diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h index a37f585d..8dacbf1e 100644 --- a/libweston/libweston-internal.h +++ b/libweston/libweston-internal.h @@ -207,4 +207,46 @@ weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap); void wl_data_device_set_keyboard_focus(struct weston_seat *seat); +/* weston_pointer */ + +void +weston_pointer_clamp(struct weston_pointer *pointer, + wl_fixed_t *fx, wl_fixed_t *fy); +void +weston_pointer_set_default_grab(struct weston_pointer *pointer, + const struct weston_pointer_grab_interface *interface); + +void +weston_pointer_constraint_destroy(struct weston_pointer_constraint *constraint); + +/* weston_keyboard */ +bool +weston_keyboard_has_focus_resource(struct weston_keyboard *keyboard); + +/* weston_touch */ + +struct weston_touch_device * +weston_touch_create_touch_device(struct weston_touch *touch, + const char *syspath, + void *backend_data, + const struct weston_touch_device_ops *ops); + +void +weston_touch_device_destroy(struct weston_touch_device *device); + +bool +weston_touch_has_focus_resource(struct weston_touch *touch); + +int +weston_touch_start_drag(struct weston_touch *touch, + struct weston_data_source *source, + struct weston_surface *icon, + struct wl_client *client); + + +/* weston_touch_device */ + +bool +weston_touch_device_can_calibrate(struct weston_touch_device *device); + #endif