diff options
author | 2022-02-16 19:20:26 -0300 | |
---|---|---|
committer | 2022-04-26 18:54:07 -0300 | |
commit | fed8da1c9078638a96ae57a9dd6edacb0a1936b3 (patch) | |
tree | 51caff4f4a688b477ebea21c3c50ba84a1eba659 | |
parent | 6e937131970d1e7b32204096e5f6c67de3fe6dfb (diff) | |
download | iced-fed8da1c9078638a96ae57a9dd6edacb0a1936b3.tar.gz iced-fed8da1c9078638a96ae57a9dd6edacb0a1936b3.tar.bz2 iced-fed8da1c9078638a96ae57a9dd6edacb0a1936b3.zip |
Add new `System` variant to `Action`
-rw-r--r-- | native/src/command/action.rs | 6 | ||||
-rw-r--r-- | native/src/lib.rs | 1 | ||||
-rw-r--r-- | native/src/system.rs | 3 | ||||
-rw-r--r-- | native/src/system/action.rs | 3 | ||||
-rw-r--r-- | winit/src/application.rs | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/native/src/command/action.rs b/native/src/command/action.rs index 5c7509c8..39536f7d 100644 --- a/native/src/command/action.rs +++ b/native/src/command/action.rs @@ -1,4 +1,5 @@ use crate::clipboard; +use crate::system; use crate::window; use iced_futures::MaybeSend; @@ -17,6 +18,9 @@ pub enum Action<T> { /// Run a window action. Window(window::Action), + + /// Run a system action. + System(system::Action), } impl<T> Action<T> { @@ -34,6 +38,7 @@ impl<T> Action<T> { Self::Future(future) => Action::Future(Box::pin(future.map(f))), Self::Clipboard(action) => Action::Clipboard(action.map(f)), Self::Window(window) => Action::Window(window), + Self::System(system) => Action::System(system), } } } @@ -46,6 +51,7 @@ impl<T> fmt::Debug for Action<T> { write!(f, "Action::Clipboard({:?})", action) } Self::Window(action) => write!(f, "Action::Window({:?})", action), + Self::System(action) => write!(f, "Action::System({:?})", action), } } } diff --git a/native/src/lib.rs b/native/src/lib.rs index 5c9c24c9..b8054169 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -48,6 +48,7 @@ pub mod program; pub mod renderer; pub mod subscription; pub mod svg; +pub mod system; pub mod text; pub mod touch; pub mod user_interface; diff --git a/native/src/system.rs b/native/src/system.rs new file mode 100644 index 00000000..e1a790bc --- /dev/null +++ b/native/src/system.rs @@ -0,0 +1,3 @@ +//! Access the native system. +mod action; +pub use action::Action; diff --git a/native/src/system/action.rs b/native/src/system/action.rs new file mode 100644 index 00000000..0d484957 --- /dev/null +++ b/native/src/system/action.rs @@ -0,0 +1,3 @@ +/// An operation to be performed on the system. +#[derive(Debug)] +pub enum Action {} diff --git a/winit/src/application.rs b/winit/src/application.rs index 6f2ea1a5..33f53315 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -573,6 +573,7 @@ pub fn run_command<Message: 'static + std::fmt::Debug + Send, E: Executor>( }); } }, + command::Action::System(_action) => {} } } } |