summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-11 23:54:59 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-11 23:54:59 +0100
commit1db11ba69a3183924a1f4cae91031f4c5051b6dc (patch)
treec0f06dfb1a8c40601270abce69bd26ddceb36287 /native
parent73811c394a39c3816c67bffd2cf7d7a93c8803a9 (diff)
downloadiced-1db11ba69a3183924a1f4cae91031f4c5051b6dc.tar.gz
iced-1db11ba69a3183924a1f4cae91031f4c5051b6dc.tar.bz2
iced-1db11ba69a3183924a1f4cae91031f4c5051b6dc.zip
Introduce `event::Status` in `iced_native`
Diffstat (limited to 'native')
-rw-r--r--native/src/event.rs23
-rw-r--r--native/src/lib.rs2
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;