sdlHasClipboardData function
Query whether there is data in the clipboard for the provided mime type.
\param mime_type the mime type to check for data for. \returns true if there exists data in clipboard for the provided mime type, false if it does not.
\threadsafety This function should only be called on the main thread.
\since This function is available since SDL 3.1.3.
\sa SDL_SetClipboardData \sa SDL_GetClipboardData
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type)
Implementation
bool sdlHasClipboardData(String? mimeType) {
final sdlHasClipboardDataLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Pointer<Utf8> mimeType),
int Function(Pointer<Utf8> mimeType)>('SDL_HasClipboardData');
final mimeTypePointer = mimeType != null ? mimeType.toNativeUtf8() : nullptr;
final result = sdlHasClipboardDataLookupFunction(mimeTypePointer) == 1;
calloc.free(mimeTypePointer);
return result;
}