xwm: Add support for bridging Xdnd to wayaland DnD
diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h
index 1262afb..3927078 100644
--- a/src/xwayland/xwayland.h
+++ b/src/xwayland/xwayland.h
@@ -27,6 +27,9 @@
 
 #include "../compositor.h"
 
+#define SEND_EVENT_MASK (0x80)
+#define EVENT_TYPE(event) ((event)->response_type & ~SEND_EVENT_MASK)
+
 struct weston_xserver {
 	struct wl_display *wl_display;
 	struct wl_event_loop *loop;
@@ -78,6 +81,9 @@
 	int flush_property_on_delete;
 	struct wl_listener selection_listener;
 
+	xcb_window_t dnd_window;
+	xcb_window_t dnd_owner;
+
 	struct {
 		xcb_atom_t		 wm_protocols;
 		xcb_atom_t		 wm_normal_hints;
@@ -126,6 +132,15 @@
 		xcb_atom_t		 string;
 		xcb_atom_t		 text_plain_utf8;
 		xcb_atom_t		 text_plain;
+		xcb_atom_t		 xdnd_selection;
+		xcb_atom_t		 xdnd_aware;
+		xcb_atom_t		 xdnd_enter;
+		xcb_atom_t		 xdnd_leave;
+		xcb_atom_t		 xdnd_drop;
+		xcb_atom_t		 xdnd_status;
+		xcb_atom_t		 xdnd_finished;
+		xcb_atom_t		 xdnd_type_list;
+		xcb_atom_t		 xdnd_action_copy;
 	} atom;
 };
 
@@ -151,3 +166,9 @@
 
 struct weston_seat *
 weston_wm_pick_seat(struct weston_wm *wm);
+
+int
+weston_wm_handle_dnd_event(struct weston_wm *wm,
+			   xcb_generic_event_t *event);
+void
+weston_wm_dnd_init(struct weston_wm *wm);