tomato-testing/src/sdl_clipboard_utils.cpp

24 lines
409 B
C++
Raw Normal View History

2023-07-30 15:10:26 +02:00
#include "./sdl_clipboard_utils.hpp"
#include <SDL3/SDL.h>
#include <vector>
const char* clipboardHasImage(void) {
const static std::vector<const char*> image_mime_types {
"image/png",
"image/webp",
2023-07-30 15:10:26 +02:00
"image/gif",
"image/jpeg",
"image/bmp",
};
for (const char* mime_type : image_mime_types) {
if (SDL_HasClipboardData(mime_type) == SDL_TRUE) {
return mime_type;
}
}
return nullptr;
}