clients: Add API for pointer locking and pointer confinement
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
diff --git a/clients/window.h b/clients/window.h
index 8c8568f..cd5611a 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -213,6 +213,29 @@
typedef void (*window_state_changed_handler_t)(struct window *window,
void *data);
+
+typedef void (*window_locked_pointer_motion_handler_t)(struct window *window,
+ struct input *input,
+ uint32_t time,
+ float x, float y,
+ void *data);
+
+typedef void (*locked_pointer_locked_handler_t)(struct window *window,
+ struct input *input,
+ void *data);
+
+typedef void (*locked_pointer_unlocked_handler_t)(struct window *window,
+ struct input *input,
+ void *data);
+
+typedef void (*confined_pointer_confined_handler_t)(struct window *window,
+ struct input *input,
+ void *data);
+
+typedef void (*confined_pointer_unconfined_handler_t)(struct window *window,
+ struct input *input,
+ void *data);
+
typedef void (*widget_resize_handler_t)(struct widget *widget,
int32_t width, int32_t height,
void *data);
@@ -359,6 +382,24 @@
void
window_schedule_resize(struct window *window, int width, int height);
+int
+window_lock_pointer(struct window *window, struct input *input);
+
+void
+window_unlock_pointer(struct window *window);
+
+void
+widget_set_locked_pointer_cursor_hint(struct widget *widget,
+ float x, float y);
+
+int
+window_confine_pointer_to_widget(struct window *window,
+ struct widget *widget,
+ struct input *input);
+
+void
+window_unconfine_pointer(struct window *window);
+
cairo_surface_t *
window_get_surface(struct window *window);
@@ -437,6 +478,20 @@
window_state_changed_handler_t handler);
void
+window_set_pointer_locked_handler(struct window *window,
+ locked_pointer_locked_handler_t locked,
+ locked_pointer_unlocked_handler_t unlocked);
+
+void
+window_set_pointer_confined_handler(struct window *window,
+ confined_pointer_confined_handler_t confined,
+ confined_pointer_unconfined_handler_t unconfined);
+
+void
+window_set_locked_pointer_motion_handler(
+ struct window *window, window_locked_pointer_motion_handler_t handler);
+
+void
window_set_title(struct window *window, const char *title);
const char *