fn new_clipboard() &Clipboard
new_clipboard returns a new Clipboard
instance allocated on the heap. The Clipboard
resources can be released with free()
fn new_primary() &Clipboard
new_primary returns a new X11 PRIMARY
type Clipboard
instance allocated on the heap. Please note: new_primary only works on X11 based systems.
struct Clipboard {
display &C.Display
mut:
selection C.Atom
window C.Window
atoms []C.Atom
mutex &sync.Mutex
text string
got_text bool
is_owner bool
}
fn (cb &Clipboard) check_availability() bool
fn (mut cb Clipboard) free()
fn (mut cb Clipboard) clear()
fn (cb &Clipboard) has_ownership() bool
fn (mut cb Clipboard) set_text(text string) bool
set_text stores text
in the system clipboard.
fn (mut cb Clipboard) get_text() string