sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Clipboard.FunPtr

Synopsis

Documentation

sDL_SetClipboardText :: FunPtr (PtrConst CChar -> IO CBool) Source #

C declaration
SDL_SetClipboardText, defined at SDL3/SDL_clipboard.h 104:34

sDL_GetClipboardText :: FunPtr (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 :: FunPtr (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 :: FunPtr (PtrConst CChar -> IO CBool) Source #

Put UTF-8 text into the primary selection.

text
the text to store in 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 :: FunPtr (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 :: FunPtr (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 :: FunPtr (SDL_ClipboardDataCallback -> SDL_ClipboardCleanupCallback -> Ptr Void -> PtrConst (PtrConst CChar) -> CSize -> IO CBool) Source #

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

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.
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 :: FunPtr (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 :: FunPtr (PtrConst CChar -> Ptr CSize -> IO (Ptr Void)) Source #

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.

mime_type
the mime type to read from the clipboard.
size
a pointer filled in with the length of the returned data.
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 :: FunPtr (PtrConst CChar -> IO CBool) Source #

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

mime_type
the mime type to check for data.
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 :: FunPtr (Ptr CSize -> IO (Ptr (Ptr CChar))) Source #

Retrieve the list of mime types available in the clipboard.

num_mime_types
a pointer filled with the number of mime types, may be NULL.
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