+static void HandleDropFileEventExt(char *filename)
+{
+ Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename);
+
+ // check and extract dropped zip files into correct user data directory
+ if (strSuffixLower(filename, ".zip"))
+ {
+ int tree_type = GetZipFileTreeType(filename);
+ char *directory = TREE_USERDIR(tree_type);
+
+ if (directory == NULL)
+ {
+ Error(ERR_WARN, "zip file '%s' has invalid content!", filename);
+
+ return;
+ }
+
+ char *top_dir = ExtractZipFileIntoDirectory(filename, directory, tree_type);
+
+ if (top_dir != NULL)
+ AddUserTreeSetToTreeInfo(top_dir, tree_type);
+ }
+}
+
+static void HandleDropTextEventExt(char *text)
+{
+ Error(ERR_DEBUG, "DROP TEXT EVENT: '%s'", text);
+}
+
+void HandleDropFileEvent(Event *event)
+{
+ HandleDropFileEventExt(event->drop.file);
+
+ SDL_free(event->drop.file);
+}
+
+void HandleDropTextEvent(Event *event)
+{
+ HandleDropTextEventExt(event->drop.file);
+
+ SDL_free(event->drop.file);
+}
+