Skip to content

clipboard.x11 #

fn new_clipboard #

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 #

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 C.Display #

@[typedef]
struct C.Display {}

X11

struct C.XDestroyWindowEvent #

@[typedef]
struct C.XDestroyWindowEvent {
mut:
	window Window
}

struct C.XSelectionClearEvent #

@[typedef]
struct C.XSelectionClearEvent {
mut:
	window    Window
	selection Atom
}

struct C.XSelectionEvent #

@[typedef]
struct C.XSelectionEvent {
mut:
	type      int
	display   &C.Display = unsafe { nil } // Display the event was read from
	requestor Window
	selection Atom
	target    Atom
	property  Atom
	time      int
}

struct C.XSelectionRequestEvent #

@[typedef]
struct C.XSelectionRequestEvent {
mut:
	display   &C.Display = unsafe { nil } // Display the event was read from
	owner     Window
	requestor Window
	selection Atom
	target    Atom
	property  Atom
	time      int
}

struct Clipboard #

@[heap]
struct Clipboard {
	display &C.Display = unsafe { nil }
mut:
	selection Atom // the selection atom
	window    Window
	atoms     []Atom
	mutex     &sync.Mutex = sync.new_mutex()
	text      string // text data sent or received
	got_text  bool   // used to confirm that we have got the text
	is_owner  bool   // to save selection owner state
}

fn (Clipboard) check_availability #

fn (cb &Clipboard) check_availability() bool

fn (Clipboard) free #

fn (mut cb Clipboard) free()

fn (Clipboard) clear #

fn (mut cb Clipboard) clear()

fn (Clipboard) has_ownership #

fn (cb &Clipboard) has_ownership() bool

fn (Clipboard) set_text #

fn (mut cb Clipboard) set_text(text string) bool

set_text stores text in the system clipboard.

fn (Clipboard) get_text #

fn (mut cb Clipboard) get_text() string