diff options
author | 2022-01-27 11:27:12 -0600 | |
---|---|---|
committer | 2022-01-28 21:37:15 +0700 | |
commit | 908259663de60ae62723a73c3e93159c4bd22586 (patch) | |
tree | 8fb385ba031937dd9b5b05d39309afb3071ee385 /winit | |
parent | 9f47ac8d3158ba8a54730dddea5b58a9926b6e1b (diff) | |
download | iced-908259663de60ae62723a73c3e93159c4bd22586.tar.gz iced-908259663de60ae62723a73c3e93159c4bd22586.tar.bz2 iced-908259663de60ae62723a73c3e93159c4bd22586.zip |
Remove wasm-specific clipboard
Diffstat (limited to 'winit')
-rw-r--r-- | winit/Cargo.toml | 4 | ||||
-rw-r--r-- | winit/src/clipboard.rs | 28 |
2 files changed, 2 insertions, 30 deletions
diff --git a/winit/Cargo.toml b/winit/Cargo.toml index e0581b00..984a9316 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -16,6 +16,7 @@ debug = ["iced_native/debug"] [dependencies] log = "0.4" thiserror = "1.0" +window_clipboard = "0.2" [dependencies.winit] version = "0.26" @@ -36,6 +37,3 @@ path = "../futures" [target.'cfg(target_os = "windows")'.dependencies.winapi] version = "0.3.6" - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies.window_clipboard] -version = "0.2" diff --git a/winit/src/clipboard.rs b/winit/src/clipboard.rs index 197d32b3..559b3521 100644 --- a/winit/src/clipboard.rs +++ b/winit/src/clipboard.rs @@ -3,43 +3,17 @@ pub use iced_native::clipboard::Action; use crate::command::{self, Command}; -/// A buffer for short-term storage and transfer within and between -/// applications. +#[allow(missing_docs)] #[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 { |