diff options
Diffstat (limited to 'native/src')
-rw-r--r-- | native/src/event.rs | 23 | ||||
-rw-r--r-- | native/src/lib.rs | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/native/src/event.rs b/native/src/event.rs index 606a71d6..160b5ce7 100644 --- a/native/src/event.rs +++ b/native/src/event.rs @@ -1,3 +1,4 @@ +//! Handle events of a user interface. use crate::{keyboard, mouse, window}; /// A user interface event. @@ -6,7 +7,7 @@ use crate::{keyboard, mouse, window}; /// additional events, feel free to [open an issue] and share your use case!_ /// /// [open an issue]: https://github.com/hecrj/iced/issues -#[derive(PartialEq, Clone, Debug)] +#[derive(Debug, Clone, PartialEq)] pub enum Event { /// A keyboard event Keyboard(keyboard::Event), @@ -17,3 +18,23 @@ pub enum Event { /// A window event Window(window::Event), } + +/// The status of an [`Event`] after being processed by a [`UserInterface`]. +/// +/// [`Event`]: enum.Event.html +/// [`UserInterface`]: ../struct.UserInterface.html +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Status { + /// The [`Event`] was _NOT_ handled by any widget in the [`UserInterface`]. + /// + /// [`Event`]: enum.Event.html + /// [`UserInterface`]: ../struct.UserInterface.html + Ignored, + + /// The [`Event`] was handled and processed by a widget in the + /// [`UserInterface`]. + /// + /// [`Event`]: enum.Event.html + /// [`UserInterface`]: ../struct.UserInterface.html + Captured, +} diff --git a/native/src/lib.rs b/native/src/lib.rs index 067e3c0a..d1252eaf 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -35,6 +35,7 @@ #![deny(unused_results)] #![forbid(unsafe_code)] #![forbid(rust_2018_idioms)] +pub mod event; pub mod keyboard; pub mod layout; pub mod mouse; @@ -47,7 +48,6 @@ pub mod window; mod clipboard; mod element; -mod event; mod hasher; mod runtime; mod user_interface; |