diff options
author | 2021-10-21 22:42:14 +0300 | |
---|---|---|
committer | 2022-01-28 21:37:14 +0700 | |
commit | bdca20fc4a3e8f6bd8ffb59de75e6ca0f8a94b6a (patch) | |
tree | 8ea0d2ff0a0d780ff763d7491fc67878f549a615 /winit/src/clipboard.rs | |
parent | c75ed37148b019358b0297171cf31b2577eeb9ae (diff) | |
download | iced-bdca20fc4a3e8f6bd8ffb59de75e6ca0f8a94b6a.tar.gz iced-bdca20fc4a3e8f6bd8ffb59de75e6ca0f8a94b6a.tar.bz2 iced-bdca20fc4a3e8f6bd8ffb59de75e6ca0f8a94b6a.zip |
Experimental wgpu WebGL backend support
- Added missing `draw_cache_align_4x4` call for `brush_glyph` on wasm32 target
- Added WebGL support to `integratio_wgpu` example
- Fixed test.yml CI workflow
- Removed spir-v shader in `integration_wgpu`; Fixed formatting
- Removed redundant `BoxStream` typedef
Diffstat (limited to '')
-rw-r--r-- | winit/src/clipboard.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/winit/src/clipboard.rs b/winit/src/clipboard.rs index 1b92b28d..197d32b3 100644 --- a/winit/src/clipboard.rs +++ b/winit/src/clipboard.rs @@ -6,15 +6,40 @@ use crate::command::{self, Command}; /// A buffer for short-term storage and transfer within and between /// applications. #[allow(missing_debug_implementations)] +#[cfg(target_arch = "wasm32")] +pub struct Clipboard; + +#[cfg(target_arch = "wasm32")] +impl Clipboard { + /// Creates a new [`Clipboard`] for the given window. + pub fn connect(_window: &winit::window::Window) -> Clipboard { + Clipboard + } + + /// Reads the current content of the [`Clipboard`] as text. + pub fn read(&self) -> Option<String> { + None + } + + /// Writes the given text contents to the [`Clipboard`]. + pub fn write(&mut self, _contents: String) {} +} + +/// A buffer for short-term storage and transfer within and between +/// applications. +#[allow(missing_debug_implementations)] +#[cfg(not(target_arch = "wasm32"))] pub struct Clipboard { state: State, } +#[cfg(not(target_arch = "wasm32"))] enum State { Connected(window_clipboard::Clipboard), Unavailable, } +#[cfg(not(target_arch = "wasm32"))] impl Clipboard { /// Creates a new [`Clipboard`] for the given window. pub fn connect(window: &winit::window::Window) -> Clipboard { |