mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-12 22:38:13 +00:00
Reimplement clipboard text in terms of clipboard data
This will simplify the X11 and Wayland implementations, which were doing that under the hood, and makes application interaction between the two APIs consistent.
This commit is contained in:
@@ -1848,7 +1848,15 @@ static const void *SDLTest_ScreenShotClipboardProvider(void *context, const char
|
||||
{
|
||||
SDLTest_ClipboardData *data = (SDLTest_ClipboardData *)context;
|
||||
|
||||
SDL_Log("Providing screenshot image data to clipboard!\n");
|
||||
if (SDL_strncmp(mime_type, "text", 4) == 0) {
|
||||
SDL_Log("Providing screenshot title to clipboard!\n");
|
||||
|
||||
/* Return "Test screenshot" */
|
||||
*size = 15;
|
||||
return "Test screenshot (but this isn't part of it)";
|
||||
}
|
||||
|
||||
SDL_Log("Providing screenshot image to clipboard!\n");
|
||||
|
||||
if (!data->image) {
|
||||
SDL_RWops *file;
|
||||
@@ -1884,6 +1892,7 @@ static void SDLTest_CopyScreenShot(SDL_Renderer *renderer)
|
||||
SDL_Rect viewport;
|
||||
SDL_Surface *surface;
|
||||
const char *image_formats[] = {
|
||||
"text/plain;charset=utf-8",
|
||||
"image/bmp"
|
||||
};
|
||||
SDLTest_ClipboardData *clipboard_data;
|
||||
|
Reference in New Issue
Block a user