comparison include/SDL_clipboard.h @ 4493:f0b7c8d169f5

First pass at clipboard API, still very much in progress
author Sam Lantinga <slouken@libsdl.org>
date Wed, 07 Jul 2010 23:24:04 -0700
parents
children 621dc91c7a04
comparison
equal deleted inserted replaced
4492:bff93336121e 4493:f0b7c8d169f5
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 /**
24 * \file SDL_clipboard.h
25 *
26 * Include file for SDL clipboard handling
27 */
28
29 #ifndef _SDL_clipboard_h
30 #define _SDL_clipboard_h
31
32 #include "SDL_stdinc.h"
33 #include "SDL_surface.h"
34
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 /* *INDENT-OFF* */
39 extern "C" {
40 /* *INDENT-ON* */
41 #endif
42
43 /* Function prototypes */
44
45 /**
46 * \brief Put text into the clipboard
47 *
48 * \sa SDL_GetClipboardText()
49 */
50 extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
51
52 /**
53 * \brief Get text from the clipboard, which must be freed with SDL_free()
54 *
55 * \sa SDL_SetClipboardText()
56 */
57 extern DECLSPEC char * SDLCALL SDL_GetClipboardText();
58
59 /**
60 * \brief Returns whether the clipboard has text
61 *
62 * \sa SDL_GetClipboardText()
63 */
64 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
114
115 /* Ends C function definitions when using C++ */
116 #ifdef __cplusplus
117 /* *INDENT-OFF* */
118 }
119 /* *INDENT-ON* */
120 #endif
121 #include "close_code.h"
122
123 #endif /* _SDL_clipboard_h */
124
125 /* vi: set ts=4 sw=4 expandtab: */