1 /* 2 * This file is part of mpv. 3 * 4 * mpv is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * mpv is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with mpv. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 #ifndef MP_INPUT_EVENT_H_ 18 #define MP_INPUT_EVENT_H_ 19 20 #include "misc/bstr.h" 21 22 struct input_ctx; 23 24 enum mp_dnd_action { 25 DND_REPLACE, 26 DND_APPEND, 27 }; 28 29 // Enqueue files for playback after drag and drop 30 void mp_event_drop_files(struct input_ctx *ictx, int num_files, char **files, 31 enum mp_dnd_action append); 32 33 // Drop data in a specific format (identified by the mimetype). 34 // Returns <0 on error, ==0 if data was ok but empty, >0 on success. 35 int mp_event_drop_mime_data(struct input_ctx *ictx, const char *mime_type, 36 bstr data, enum mp_dnd_action append); 37 38 // Many drag & drop APIs support multiple mime types, and this function returns 39 // whether a type is preferred (higher integer score), or supported (scores 40 // below 0 indicate unsupported types). 41 int mp_event_get_mime_type_score(struct input_ctx *ictx, const char *mime_type); 42 43 #endif 44