diff options
| author | Matt Roper <matthew.d.roper@intel.com> | 2012-10-10 16:56:52 -0700 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-15 19:44:08 -0400 |
| commit | 4ce294d641a7b59c5fa79b508cdd69a333902a72 (patch) | |
| tree | 74166acb7739bed759af64d9539fc482a642a0f8 /src/wayland-server.h | |
| parent | wayland-client: forward fatal errors to caller (diff) | |
| download | wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar.gz wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar.bz2 wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar.lz wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar.xz wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.tar.zst wayland-4ce294d641a7b59c5fa79b508cdd69a333902a72.zip | |
wayland-server: Add touch grab support
Touch grabs allow the compositor to be placed into a mode where touch events
temporarily bypass their default behavior and perform other operations.
Wayland already supports keyboard and pointer grabs, but was lacking
corresponding touch support. The default touch grab handlers here contain the
client event delivery code that was previously called directly in weston.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Diffstat (limited to 'src/wayland-server.h')
| -rw-r--r-- | src/wayland-server.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/wayland-server.h b/src/wayland-server.h index 0a4dcc2..3357105 100644 --- a/src/wayland-server.h +++ b/src/wayland-server.h @@ -226,6 +226,29 @@ struct wl_keyboard_grab { uint32_t key; }; +struct wl_touch_grab; +struct wl_touch_grab_interface { + void (*down)(struct wl_touch_grab *grab, + uint32_t time, + int touch_id, + wl_fixed_t sx, + wl_fixed_t sy); + void (*up)(struct wl_touch_grab *grab, + uint32_t time, + int touch_id); + void (*motion)(struct wl_touch_grab *grab, + uint32_t time, + int touch_id, + wl_fixed_t sx, + wl_fixed_t sy); +}; + +struct wl_touch_grab { + const struct wl_touch_grab_interface *interface; + struct wl_touch *touch; + struct wl_surface *focus; +}; + struct wl_data_offer { struct wl_resource resource; struct wl_data_source *source; @@ -301,6 +324,13 @@ struct wl_touch { struct wl_resource *focus_resource; struct wl_listener focus_listener; uint32_t focus_serial; + struct wl_signal focus_signal; + + struct wl_touch_grab *grab; + struct wl_touch_grab default_grab; + wl_fixed_t grab_x, grab_y; + uint32_t grab_serial; + uint32_t grab_time; }; struct wl_seat { @@ -410,6 +440,11 @@ void wl_touch_init(struct wl_touch *touch); void wl_touch_release(struct wl_touch *touch); +void +wl_touch_start_grab(struct wl_touch *device, + struct wl_touch_grab *grab); +void +wl_touch_end_grab(struct wl_touch *touch); void wl_data_device_set_keyboard_focus(struct wl_seat *seat); |
