comparison include/SDL_clipboard.h @ 4495:dbbfdb9ea716

Simplified clipboard API for sanity's sake. A complete clipboard implementation would support multiple formats that could be queried at runtime, events for when the clipboard contents changed, support for HTML, images, etc. We're not going that crazy, at least for now. :)
author Sam Lantinga <slouken@libsdl.org>
date Wed, 07 Jul 2010 23:54:03 -0700
parents 621dc91c7a04
children b577f47379f3
comparison
equal deleted inserted replaced
4494:621dc91c7a04 4495:dbbfdb9ea716
28 28
29 #ifndef _SDL_clipboard_h 29 #ifndef _SDL_clipboard_h
30 #define _SDL_clipboard_h 30 #define _SDL_clipboard_h
31 31
32 #include "SDL_stdinc.h" 32 #include "SDL_stdinc.h"
33 #include "SDL_surface.h"
34 33
35 #include "begin_code.h" 34 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */ 35 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus 36 #ifdef __cplusplus
38 /* *INDENT-OFF* */ 37 /* *INDENT-OFF* */
41 #endif 40 #endif
42 41
43 /* Function prototypes */ 42 /* Function prototypes */
44 43
45 /** 44 /**
46 * \brief Put text into the clipboard 45 * \brief Put UTF-8 text into the clipboard
47 * 46 *
48 * \sa SDL_GetClipboardText() 47 * \sa SDL_GetClipboardText()
49 */ 48 */
50 extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 49 extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
51 50
52 /** 51 /**
53 * \brief Get text from the clipboard, which must be freed with SDL_free() 52 * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
54 * 53 *
55 * \sa SDL_SetClipboardText() 54 * \sa SDL_SetClipboardText()
56 */ 55 */
57 extern DECLSPEC char * SDLCALL SDL_GetClipboardText(); 56 extern DECLSPEC char * SDLCALL SDL_GetClipboardText();
58 57
60 * \brief Returns whether the clipboard has text 59 * \brief Returns whether the clipboard has text
61 * 60 *
62 * \sa SDL_GetClipboardText() 61 * \sa SDL_GetClipboardText()
63 */ 62 */
64 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(); 63 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText();
65
66 /**
67 * \brief Put an image into the clipboard
68 *
69 * \sa SDL_GetClipboardImage()
70 */
71 extern DECLSPEC int SDLCALL SDL_SetClipboardImage(SDL_Surface *image);
72
73 /**
74 * \brief Get image from the clipboard, which must be freed with SDL_FreeSurface()
75 *
76 * \sa SDL_SetClipboard()
77 */
78 extern DECLSPEC SDL_Surface * SDLCALL SDL_GetClipboardImage();
79
80 /**
81 * \brief Returns whether the clipboard has data in the specified format
82 *
83 * \sa SDL_GetClipboardImage()
84 */
85 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardImage();
86
87 /**
88 * \brief Set the data in the clipboard in the specified format
89 *
90 * \sa SDL_GetClipboard()
91 */
92 extern DECLSPEC int SDLCALL SDL_SetClipboard(Uint32 format, void *data, size_t length);
93
94 /**
95 * \brief Get the data in the clipboard in the specified format, which must be
96 * freed with SDL_free()
97 *
98 * \sa SDL_SetClipboard()
99 */
100 extern DECLSPEC int SDLCALL SDL_GetClipboard(Uint32 format, void **data, size_t *length);
101
102 /**
103 * \brief Returns whether the clipboard has data in the specified format
104 *
105 * \sa SDL_GetClipboard()
106 */
107 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardFormat(Uint32 format);
108
109 /**
110 * \brief Clear any data out of the clipboard, if possible.
111 */
112 extern DECLSPEC void SDLCALL SDL_ClearClipboard(void);
113 64
114 65
115 /* Ends C function definitions when using C++ */ 66 /* Ends C function definitions when using C++ */
116 #ifdef __cplusplus 67 #ifdef __cplusplus
117 /* *INDENT-OFF* */ 68 /* *INDENT-OFF* */