/
SDL_clipboard.h.go
43 lines (36 loc) · 1.1 KB
/
SDL_clipboard.h.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Machine-generated file.
// See http://winterdrache.de/bindings for details.
package sdl
// #include "includes.h"
import "C"
import "unsafe"
// Include file for SDL clipboard handling
// Put UTF-8 text into the clipboard.
//
// See also: SDL_GetClipboardText()
//
// ↪ https://wiki.libsdl.org/SDL_SetClipboardText
func SetClipboardText(text string) (retval int) {
tmp_text := C.CString(text); defer C.free(unsafe.Pointer(tmp_text))
retval = int(C.SDL_SetClipboardText((*C.char)(tmp_text)))
return
}
// Get UTF-8 text from the clipboard, which must be freed with SDL_free()
//
// See also: SDL_SetClipboardText()
//
// ↪ https://wiki.libsdl.org/SDL_GetClipboardText
func GetClipboardText() (retval string) {
retval = freeGoString(C.SDL_GetClipboardText())
return
}
// Returns a flag indicating whether the clipboard exists and contains a
// text string that is non-empty.
//
// See also: SDL_GetClipboardText()
//
// ↪ https://wiki.libsdl.org/SDL_HasClipboardText
func HasClipboardText() (retval bool) {
retval = C.SDL_TRUE==(C.SDL_HasClipboardText())
return
}