mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
input: add insert-next support for drag-and-drop
This commit adds a DND_INSERT_NEXT action option for drag-and-drop, allows for selecting it through the --drag-and-drop=insert-next option, and adds the necessary plumbing to make that happen when something is dragged onto the player.
This commit is contained in:
committed by
Dudemanguy
parent
432256e5d2
commit
a8a314b829
@@ -24,16 +24,17 @@ struct input_ctx;
|
||||
enum mp_dnd_action {
|
||||
DND_REPLACE,
|
||||
DND_APPEND,
|
||||
DND_INSERT_NEXT,
|
||||
};
|
||||
|
||||
// Enqueue files for playback after drag and drop
|
||||
void mp_event_drop_files(struct input_ctx *ictx, int num_files, char **files,
|
||||
enum mp_dnd_action append);
|
||||
enum mp_dnd_action action);
|
||||
|
||||
// Drop data in a specific format (identified by the mimetype).
|
||||
// Returns <0 on error, ==0 if data was ok but empty, >0 on success.
|
||||
int mp_event_drop_mime_data(struct input_ctx *ictx, const char *mime_type,
|
||||
bstr data, enum mp_dnd_action append);
|
||||
bstr data, enum mp_dnd_action action);
|
||||
|
||||
// Many drag & drop APIs support multiple mime types, and this function returns
|
||||
// whether a type is preferred (higher integer score), or supported (scores
|
||||
|
||||
Reference in New Issue
Block a user