Skip to main content

Crate lumen_os_clipboard

Crate lumen_os_clipboard 

Source
Expand description

OS clipboard host for Lumen.

Wraps arboard 3.x behind the shared MimePayload abstraction (QMimeData / GdkContentProvider analog). Carved out of lumen-input per the OS plan section 469 + W6.1.

  • ClipboardHost - read / write / clear for the standard system clipboard. Owns an arboard::Clipboard behind a Mutex.
  • [set_rgba8_image] / [get_rgba8_image] preserved for backwards-compatible image round-trips used by lumenc’s copy_image / save_clipboard_image Rhai builtins.

arboard::Clipboard is !Send on Linux/Wayland - store as a NonSend ECS resource (see [InstallExt::install_clipboard_host]).

On wasm32 the clipboard is the page’s navigator.clipboard, text only. ClipboardHost::try_new finds it wherever the page has one (a secure context: https or localhost) and reports it unavailable otherwise. A page reads the clipboard asynchronously and only with the visitor’s permission, so a read goes through ClipboardHost::read_text_then; the synchronous readers and images answer as an absent clipboard does.

Re-exports§

pub use lumen_os_mime as mime;

Structs§

ClipboardHost
Single-process clipboard host. Wraps arboard::Clipboard behind a Mutex - the underlying handle is !Send on Linux/Wayland so this type stays !Sync by virtue of Mutex<arboard::Clipboard> having the same restriction.