diff -r 5cee4cb5ad79 -r 11f3bb408051 ui/gtk/dnd.c --- a/ui/gtk/dnd.c Wed Nov 22 09:49:26 2017 +0100 +++ b/ui/gtk/dnd.c Wed Nov 22 12:59:13 2017 +0100 @@ -31,6 +31,29 @@ #include #include "dnd.h" +#include "../../ucx/buffer.h" + +#ifdef UI_GTK2LEGACY +static gboolean selection_data_set_uris(GtkSelectionData *selection_data, char **uris) { + UcxBuffer *buf = ucx_buffer_new(NULL, 1024, UCX_BUFFER_AUTOEXTEND); + char *uri; + int i = 0; + while((uri = uris[i]) != NULL) { + ucx_buffer_puts(buf, uri); + ucx_buffer_puts(buf, "\r\n"); + } + GdkAtom type = gdk_atom_intern("text/uri-list", FALSE); + gtk_selection_data_set(selection_data, type, 8, (guchar*)buf->space, buf->pos); + ucx_buffer_free(buf); + return TRUE; +} +static char** selection_data_get_uris(GtkSelectionData *selection_data) { + // TODO: implement + return NULL; +} +#define gtk_selection_data_set_uris selection_data_set_uris +#define gtk_selection_data_get_uris selection_data_get_uris +#endif void ui_selection_settext(UiSelection *sel, char *str, int len) { if(!gtk_selection_data_set_text(sel->data, str, len));