sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Clipboard.Safe

Synopsis

Documentation

sDL_SetClipboardText Source #

Arguments

:: PtrConst CChar
C declaration
text
-> IO CBool 
C declaration
SDL_SetClipboardText, defined at SDL3/SDL_clipboard.h 104:34

sDL_GetClipboardText :: IO (Ptr CChar) Source #

Get UTF-8 text from the clipboard.

This function returns an empty string if there is not enough memory left for a copy of the clipboard's content.

Returns
the clipboard text on success or an empty string on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
Thread safety
This function should only be called on the main thread.
See also
sDL_HasClipboardText, sDL_SetClipboardText
C declaration
SDL_GetClipboardText, defined at SDL3/SDL_clipboard.h 123:36

Since: 3.2.0

sDL_HasClipboardText :: IO CBool Source #

Query whether the clipboard exists and contains a non-empty text string.

Returns
true if the clipboard has text, or false if it does not.
Thread safety
This function should only be called on the main thread.
See also
sDL_GetClipboardText, sDL_SetClipboardText
C declaration
SDL_HasClipboardText, defined at SDL3/SDL_clipboard.h 137:34

Since: 3.2.0

sDL_SetPrimarySelectionText Source #

Arguments

:: PtrConst CChar
text
the text to store in the primary selection.
-> IO CBool 

Put UTF-8 text into the primary selection.

Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function should only be called on the main thread.
See also
sDL_GetPrimarySelectionText, sDL_HasPrimarySelectionText
C declaration
SDL_SetPrimarySelectionText, defined at SDL3/SDL_clipboard.h 153:34

Since: 3.2.0

sDL_GetPrimarySelectionText :: IO (Ptr CChar) Source #

Get UTF-8 text from the primary selection.

This function returns an empty string if there is not enough memory left for a copy of the primary selection's content.

Returns
the primary selection text on success or an empty string on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
Thread safety
This function should only be called on the main thread.
See also
sDL_HasPrimarySelectionText, sDL_SetPrimarySelectionText
C declaration
SDL_GetPrimarySelectionText, defined at SDL3/SDL_clipboard.h 172:36

Since: 3.2.0

sDL_HasPrimarySelectionText :: IO CBool Source #

Query whether the primary selection exists and contains a non-empty text string.

Returns
true if the primary selection has text, or false if it does not.
Thread safety
This function should only be called on the main thread.
See also
sDL_GetPrimarySelectionText, sDL_SetPrimarySelectionText
C declaration
SDL_HasPrimarySelectionText, defined at SDL3/SDL_clipboard.h 187:34

Since: 3.2.0

sDL_SetClipboardData Source #

Arguments

:: SDL_ClipboardDataCallback
callback
a function pointer to the function that provides the clipboard data.
-> SDL_ClipboardCleanupCallback
cleanup
a function pointer to the function that cleans up the clipboard data.
-> Ptr Void
userdata
an opaque pointer that will be forwarded to the callbacks.
-> PtrConst (PtrConst CChar)
mime_types
a list of mime-types that are being offered. SDL copies the given list.
-> CSize
num_mime_types
the number of mime-types in the mime_types list.
-> IO CBool 

Offer clipboard data to the OS.

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).

Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function should only be called on the main thread.
See also
sDL_ClearClipboardData, sDL_GetClipboardData, sDL_HasClipboardData
C declaration
SDL_SetClipboardData, defined at SDL3/SDL_clipboard.h 255:34

Since: 3.2.0

sDL_ClearClipboardData :: IO CBool Source #

Clear the clipboard data.

Returns
true on success or false on failure; call SDL_GetError() for more information.
Thread safety
This function should only be called on the main thread.
See also
sDL_SetClipboardData
C declaration
SDL_ClearClipboardData, defined at SDL3/SDL_clipboard.h 269:34

Since: 3.2.0

sDL_GetClipboardData Source #

Arguments

:: PtrConst CChar
mime_type
the mime type to read from the clipboard.
-> Ptr CSize
size
a pointer filled in with the length of the returned data.
-> IO (Ptr Void) 

Get the data from the clipboard for a given mime type.

The size of text data does not include the terminator, but the text is guaranteed to be null-terminated.

Returns
the retrieved data buffer or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
Thread safety
This function should only be called on the main thread.
See also
sDL_HasClipboardData, sDL_SetClipboardData
C declaration
SDL_GetClipboardData, defined at SDL3/SDL_clipboard.h 290:36

Since: 3.2.0

sDL_HasClipboardData Source #

Arguments

:: PtrConst CChar
mime_type
the mime type to check for data.
-> IO CBool 

Query whether there is data in the clipboard for the provided mime type.

Returns
true if data exists in the clipboard for the provided mime type, false if it does not.
Thread safety
This function should only be called on the main thread.
See also
sDL_SetClipboardData, sDL_GetClipboardData
C declaration
SDL_HasClipboardData, defined at SDL3/SDL_clipboard.h 306:34

Since: 3.2.0

sDL_GetClipboardMimeTypes Source #

Arguments

:: Ptr CSize
num_mime_types
a pointer filled with the number of mime types, may be NULL.
-> IO (Ptr (Ptr CChar)) 

Retrieve the list of mime types available in the clipboard.

Returns
a null-terminated array of strings with mime types, or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.
Thread safety
This function should only be called on the main thread.
See also
sDL_SetClipboardData
C declaration
SDL_GetClipboardMimeTypes, defined at SDL3/SDL_clipboard.h 323:37

Since: 3.2.0