blob: d82289b1d0e6c674d5bd701e9dc44a3ecd11d67a (
plain)
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
|
module clipboard
// new returns a new `Clipboard` instance allocated on the heap.
// The `Clipboard` resources can be released with `free()`
pub fn new() &Clipboard {
return new_clipboard()
}
// copy copies `text` into the clipboard.
pub fn (mut cb Clipboard) copy(text string) bool {
return cb.set_text(text)
}
// paste returns current entry as a `string` from the clipboard.
pub fn (mut cb Clipboard) paste() string {
return cb.get_text()
}
// clear_all clears the clipboard.
pub fn (mut cb Clipboard) clear_all() {
cb.clear()
}
// destroy destroys the clipboard and free it's resources.
pub fn (mut cb Clipboard) destroy() {
cb.free()
}
// check_ownership returns `true` if the `Clipboard` has the content ownership.
pub fn (cb Clipboard) check_ownership() bool {
return cb.has_ownership()
}
// is_available returns `true` if the clipboard is available for use.
pub fn (cb &Clipboard) is_available() bool {
return cb.check_availability()
}
|