summaryrefslogtreecommitdiff
path: root/plugins/gtkui/fileman.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-30 22:10:09 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-30 22:10:09 +0100
commit576b8419ed5b8d4e586151d8965d1d5f89624ee1 (patch)
treeee6ee3407ef4ed1b78b2c57cd0ff45b86789a8c3 /plugins/gtkui/fileman.c
parent2181dcac0261f9036f0efec4390d47639fe6aa10 (diff)
ported filemanager dnd into gtkui
Diffstat (limited to 'plugins/gtkui/fileman.c')
-rw-r--r--plugins/gtkui/fileman.c27
1 files changed, 27 insertions, 0 deletions
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 <gtk/gtk.h>
+#include <stdlib.h>
#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);
+}