SDL_clipboard.h File Reference
`#include "SDL_stdinc.h"`
`#include "begin_code.h"`
`#include "close_code.h"`
Include dependency graph for SDL_clipboard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

int | SDL_SetClipboardText (const char *text)
char * | SDL_GetClipboardText (void)
SDL_bool | SDL_HasClipboardText (void)
int | SDL_SetPrimarySelectionText (const char *text)
char * | SDL_GetPrimarySelectionText (void)
SDL_bool | SDL_HasPrimarySelectionText (void)

## Function Documentation

## SDL_GetClipboardText()

char * SDL_GetClipboardText | ( | void |  | ) |

extern

Get UTF-8 text from the clipboard, which must be freed with SDL_free().

This functions returns empty string if there was 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. Caller must call SDL_free() on the returned pointer when done with it (even if there was an error).

Since
  This function is available since SDL 2.0.0.

See also
  SDL_HasClipboardText
  SDL_SetClipboardText

## SDL_GetPrimarySelectionText()

char * SDL_GetPrimarySelectionText | ( | void |  | ) |

extern

Get UTF-8 text from the primary selection, which must be freed with SDL_free().

This functions returns empty string if there was 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. Caller must call SDL_free() on the returned pointer when done with it (even if there was an error).

Since
  This function is available since SDL 2.26.0.

See also
  SDL_HasPrimarySelectionText
  SDL_SetPrimarySelectionText

## SDL_HasClipboardText()

SDL_bool SDL_HasClipboardText | ( | void |  | ) |

extern

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

Returns
  SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.

Since
  This function is available since SDL 2.0.0.

See also
  SDL_GetClipboardText
  SDL_SetClipboardText

## SDL_HasPrimarySelectionText()

SDL_bool SDL_HasPrimarySelectionText | ( | void |  | ) |

extern

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

Returns
  SDL_TRUE if the primary selection has text, or SDL_FALSE if it does not.

Since
  This function is available since SDL 2.26.0.

See also
  SDL_GetPrimarySelectionText
  SDL_SetPrimarySelectionText

## SDL_SetClipboardText()

int SDL_SetClipboardText | ( | const char * | text | ) |

extern

# CategoryClipboard

Include file for SDL clipboard handling Put UTF-8 text into the clipboard.

Parameters

  text | the text to store in the clipboard.

Returns
  0 on success or a negative error code on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 2.0.0.

See also
  SDL_GetClipboardText
  SDL_HasClipboardText

## SDL_SetPrimarySelectionText()

int SDL_SetPrimarySelectionText | ( | const char * | text | ) |

extern

Put UTF-8 text into the primary selection.

Parameters

  text | the text to store in the primary selection.

Returns
  0 on success or a negative error code on failure; call SDL_GetError() for more information.

Since
  This function is available since SDL 2.26.0.

See also
  SDL_GetPrimarySelectionText
  SDL_HasPrimarySelectionText