SDL_SetClipboardData - Offer clipboard data to the OS.
Contents
Availability
This function is available since SDL 3.2.0.
Description
Tell the operating system that the application is offering clipboard data for each of the provided mime-
types. Once another application requests the data the callback function will be called, allowing it to
generate and respond with the data for the requested mime-type.
The size of text data does not include any terminator, and the text does not need to be null-terminated
(e.g., you can directly copy a portion of a document).
Function Parameters
callback
a function pointer to the function that provides the clipboard data.
cleanup
a function pointer to the function that cleans up the clipboard data.
userdata
an opaque pointer that will be forwarded to the callbacks.
mime_types
a list of mime-types that are being offered. SDL copies the given list.
num_mime_types
the number of mime-types in the mime_types list.
Name
SDL_SetClipboardData - Offer clipboard data to the OS.
Return Value
for more information.
See Also
SDL_ClearClipboardData(3), SDL_GetClipboardData(3), SDL_HasClipboardData(3) Simple Directmedia Layer SDL 3.2.20 SDL_SetClipboardData(3)
Synopsis
#include<SDL3/SDL_clipboard.h>boolSDL_SetClipboardData(SDL_ClipboardDataCallbackcallback,SDL_ClipboardCleanupCallbackcleanup,void*userdata,constchar**mime_types,size_tnum_mime_types);
Thread Safety
This function should only be called on the main thread.
