From 576b8419ed5b8d4e586151d8965d1d5f89624ee1 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Mon, 30 Nov 2009 22:10:09 +0100 Subject: ported filemanager dnd into gtkui --- plugins/gtkui/fileman.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'plugins/gtkui/fileman.c') diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c index 14bfddca..8b08f466 100644 --- a/plugins/gtkui/fileman.c +++ b/plugins/gtkui/fileman.c @@ -1,5 +1,6 @@ #include "../../deadbeef.h" #include +#include #include "gtkui.h" #include "gtkplaylist.h" @@ -37,3 +38,29 @@ gtkui_open_files (struct _GSList *lst) { deadbeef->pl_free (); deadbeef->thread_start (open_files_worker, lst); } + +struct fmdrop_data { + char *mem; + int length; + int drop_y; +}; + +static void +fmdrop_worker (void *ctx) { + struct fmdrop_data *data = (struct fmdrop_data *)ctx; + gtkpl_add_fm_dropped_files (&main_playlist, data->mem, data->length, data->drop_y); + free (data); +} + +void +gtkui_receive_fm_drop (char *mem, int length, int drop_y) { + struct fmdrop_data *data = malloc (sizeof (struct fmdrop_data)); + if (!data) { + fprintf (stderr, "gtkui_receive_fm_drop: malloc failed\n"); + return; + } + data->mem = mem; + data->length = length; + data->drop_y = drop_y; + deadbeef->thread_start (fmdrop_worker, data); +} -- cgit v1.2.3