clipboard: SDL_GetPrimarySelectionText() now follows the SDL_GetStringRule.

Reference Issue #10229.
This commit is contained in:
Ryan C. Gordon
2024-07-15 14:07:33 -04:00
parent 158fc459f1
commit d40b89dff6
5 changed files with 12 additions and 16 deletions

View File

@@ -101,23 +101,22 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
/**
* Get UTF-8 text from the primary selection, which must be freed with
* SDL_free().
* Get UTF-8 text from the primary selection.
*
* This functions returns empty string if there was not enough memory left for
* a copy of the primary selection's content.
*
* The returned string follows the SDL_GetStringRule.
*
* \returns the primary selection text on success or an empty string on
* failure; call SDL_GetError() for more information. Caller must
* call SDL_free() on the returned pointer when done with it (even if
* there was an error).
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasPrimarySelectionText
* \sa SDL_SetPrimarySelectionText
*/
extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
extern SDL_DECLSPEC const char * SDLCALL SDL_GetPrimarySelectionText(void);
/**
* Query whether the primary selection exists and contains a non-empty text