Module clipboard.x11 stdlib

clipboard.x11
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
4
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

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

Structs

#struct Clipboard

heap
pub struct Clipboard {
	display &C.Display = unsafe { nil }
mut:
	selection Atom // the selection atom
	window    Window
	atoms     []Atom
	mutex     &sync.Mutex = unsafe { nil }
	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 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 (&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) take_ownership

fn (cb &Clipboard) take_ownership()

#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

#fn (&Clipboard) transmit_selection

fn (mut cb &Clipboard) transmit_selection(xse &C.XSelectionEvent) bool

transmit_selection is crucial to handling all the different data types.

If we ever support other mimetypes they should be handled here.

#fn (&Clipboard) start_listener

fn (mut cb &Clipboard) start_listener()

#fn (&Clipboard) intern_atoms

fn (mut cb &Clipboard) intern_atoms()

intern_atoms initializes all the atoms we need.

#fn (&Clipboard) pick_target

fn (cb &Clipboard) pick_target(prop Property) Atom

pick_target finds the best target given a local copy of a property.

#fn (&Clipboard) get_atoms

fn (cb &Clipboard) get_atoms(types []AtomType) []Atom

#fn (&Clipboard) get_atom

fn (cb &Clipboard) get_atom(typ AtomType) Atom

#fn (&Clipboard) is_supported_target

fn (cb &Clipboard) is_supported_target(target Atom) bool

#fn (&Clipboard) get_target_index

fn (cb &Clipboard) get_target_index(target Atom) int

#fn (&Clipboard) get_supported_targets

fn (cb &Clipboard) get_supported_targets() []Atom

Interfaces

This section is empty.

Enums

This section is empty.