Implement the new dnd/selection protocol
The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.
diff --git a/clients/window.h b/clients/window.h
index bad1e60..d285bb1 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -57,6 +57,9 @@
struct wl_shell *
display_get_shell(struct display *display);
+struct wl_data_source *
+display_create_data_source(struct display *display);
+
#ifdef EGL_NO_DISPLAY
EGLDisplay
display_get_egl_display(struct display *d);
@@ -100,11 +103,6 @@
int *hotspot_x, int *hotspot_y);
void
-display_add_drag_listener(struct display *display,
- const struct wl_drag_listener *drag_listener,
- void *data);
-
-void
display_defer(struct display *display, struct task *task);
void
@@ -157,6 +155,16 @@
int32_t x, int32_t y,
int32_t sx, int32_t sy, void *data);
+typedef void (*window_data_handler_t)(struct window *window,
+ struct input *input, uint32_t time,
+ int32_t x, int32_t y,
+ const char **types,
+ void *data);
+
+typedef void (*window_drop_handler_t)(struct window *window,
+ struct input *input,
+ int32_t x, int32_t y, void *data);
+
typedef void (*window_item_focus_handler_t)(struct window *window,
struct item *focus, void *data);
@@ -174,6 +182,9 @@
typedef void (*item_func_t)(struct item *item, void *data);
+typedef void (*data_func_t)(void *data, size_t len,
+ int32_t x, int32_t y, void *user_data);
+
void
window_for_each_item(struct window *window, item_func_t func, void *data);
@@ -286,18 +297,19 @@
window_item_focus_handler_t handler);
void
+window_set_data_handler(struct window *window,
+ window_data_handler_t handler);
+
+void
+window_set_drop_handler(struct window *window,
+ window_drop_handler_t handler);
+
+void
window_set_title(struct window *window, const char *title);
const char *
window_get_title(struct window *window);
-struct wl_drag *
-window_create_drag(struct window *window);
-
-void
-window_activate_drag(struct wl_drag *drag, struct window *window,
- struct input *input, uint32_t time);
-
void
item_get_allocation(struct item *item, struct rectangle *allocation);
@@ -309,6 +321,9 @@
item_get_user_data(struct item *item);
void
+input_set_pointer_image(struct input *input, uint32_t time, int pointer);
+
+void
input_get_position(struct input *input, int32_t *x, int32_t *y);
uint32_t
@@ -317,10 +332,24 @@
struct wl_input_device *
input_get_input_device(struct input *input);
-int
-input_offers_mime_type(struct input *input, const char *type);
+struct wl_data_device *
+input_get_data_device(struct input *input);
+
void
-input_receive_mime_type(struct input *input, const char *type, int fd);
+input_set_selection(struct input *input,
+ struct wl_data_source *source, uint32_t time);
+
+void
+input_accept(struct input *input, uint32_t time, const char *type);
+
+
+void
+input_receive_drag_data(struct input *input, const char *mime_type,
+ data_func_t func, void *user_data);
+
+int
+input_receive_selection_data(struct input *input, const char *mime_type,
+ data_func_t func, void *data);
enum {
CONFIG_KEY_INTEGER,