Copy to pasteboard support for MacOS

This commit is contained in:
Thomas BERNARD
2019-01-05 00:04:37 +01:00
parent d556df556d
commit 379dc4a092
5 changed files with 91 additions and 5 deletions

View File

@@ -88,6 +88,7 @@ extern Window X11_window;
#if defined(__macosx__)
const void * get_tiff_paste_board(unsigned long * size);
int set_tiff_paste_board(const void * tiff, unsigned long size);
#endif
@@ -1583,6 +1584,18 @@ static void Save_ClipBoard_Image(T_IO_Context * context)
}
}
CloseClipboard();
#elif defined(__macosx__)
void * tiff = NULL;
unsigned long size = 0;
Save_TIFF_to_memory(context, &tiff, &size);
if (File_error == 0 && tiff != NULL)
{
if(!set_tiff_paste_board(tiff, size))
File_error = 1;
}
free(tiff);
#elif defined(USE_X11) || (defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11))
Atom selection;
#if defined(SDL_VIDEO_DRIVER_X11)