Remove inconsistent `input` module in `iced_native`

This commit is contained in:
Héctor Ramón Jiménez 2020-04-30 05:04:45 +02:00
parent 137664ca88
commit bb9ccc4f62
20 changed files with 27 additions and 45 deletions

View File

@ -1,7 +1,4 @@
use crate::{ use crate::{keyboard, mouse, window};
input::{keyboard, mouse},
window,
};
/// A user interface event. /// A user interface event.
/// ///

View File

@ -1,3 +0,0 @@
//! Map your system events into input events that the runtime can understand.
pub mod keyboard;
pub mod mouse;

View File

@ -39,8 +39,9 @@
#![deny(unused_results)] #![deny(unused_results)]
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)] #![forbid(rust_2018_idioms)]
pub mod input; pub mod keyboard;
pub mod layout; pub mod layout;
pub mod mouse;
pub mod renderer; pub mod renderer;
pub mod subscription; pub mod subscription;
pub mod widget; pub mod widget;

View File

@ -1,6 +1,4 @@
use crate::{ use crate::{layout, mouse, Clipboard, Element, Event, Layout, Point, Size};
input::mouse, layout, Clipboard, Element, Event, Layout, Point, Size,
};
use std::hash::Hasher; use std::hash::Hasher;

View File

@ -5,8 +5,8 @@
//! [`Button`]: struct.Button.html //! [`Button`]: struct.Button.html
//! [`State`]: struct.State.html //! [`State`]: struct.State.html
use crate::{ use crate::{
input::mouse, layout, Clipboard, Element, Event, Hasher, Layout, Length, layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Point, Rectangle, Widget, Rectangle, Widget,
}; };
use std::hash::Hash; use std::hash::Hash;

View File

@ -2,7 +2,7 @@
use std::hash::Hash; use std::hash::Hash;
use crate::{ use crate::{
input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher, layout, mouse, row, text, Align, Clipboard, Element, Event, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text, HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget, VerticalAlignment, Widget,
}; };

View File

@ -22,9 +22,8 @@ pub use split::Split;
pub use state::{Focus, State}; pub use state::{Focus, State};
use crate::{ use crate::{
input::{keyboard, mouse}, keyboard, layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length,
layout, Clipboard, Element, Event, Hasher, Layout, Length, Point, Size, Point, Size, Widget,
Widget,
}; };
/// A collection of panes distributed using either vertical or horizontal splits /// A collection of panes distributed using either vertical or horizontal splits

View File

@ -1,5 +1,5 @@
use crate::{ use crate::{
input::keyboard, keyboard,
pane_grid::{node::Node, Axis, Direction, Pane, Split}, pane_grid::{node::Node, Axis, Direction, Pane, Split},
Hasher, Point, Rectangle, Size, Hasher, Point, Rectangle, Size,
}; };

View File

@ -1,6 +1,6 @@
//! Create choices using radio buttons. //! Create choices using radio buttons.
use crate::{ use crate::{
input::mouse, layout, row, text, Align, Clipboard, Element, Event, Hasher, layout, mouse, row, text, Align, Clipboard, Element, Event, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text, HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Text,
VerticalAlignment, Widget, VerticalAlignment, Widget,
}; };

View File

@ -1,7 +1,7 @@
//! Navigate an endless amount of content with a scrollbar. //! Navigate an endless amount of content with a scrollbar.
use crate::{ use crate::{
column, input::mouse, layout, Align, Clipboard, Column, Element, Event, column, layout, mouse, Align, Clipboard, Column, Element, Event, Hasher,
Hasher, Layout, Length, Point, Rectangle, Size, Widget, Layout, Length, Point, Rectangle, Size, Widget,
}; };
use std::{f32, hash::Hash, u32}; use std::{f32, hash::Hash, u32};

View File

@ -5,8 +5,8 @@
//! [`Slider`]: struct.Slider.html //! [`Slider`]: struct.Slider.html
//! [`State`]: struct.State.html //! [`State`]: struct.State.html
use crate::{ use crate::{
input::mouse, layout, Clipboard, Element, Event, Hasher, Layout, Length, layout, mouse, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Point, Rectangle, Size, Widget, Rectangle, Size, Widget,
}; };
use std::{hash::Hash, ops::RangeInclusive}; use std::{hash::Hash, ops::RangeInclusive};

View File

@ -15,12 +15,10 @@ pub use value::Value;
use editor::Editor; use editor::Editor;
use crate::{ use crate::{
input::{ keyboard, layout,
keyboard, mouse::{self, click},
mouse::{self, click}, Clipboard, Element, Event, Font, Hasher, Layout, Length, Point, Rectangle,
}, Size, Widget,
layout, Clipboard, Element, Event, Font, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
}; };
use std::u32; use std::u32;
@ -739,7 +737,7 @@ fn find_cursor_position<Renderer: self::Renderer>(
} }
mod platform { mod platform {
use crate::input::keyboard; use crate::keyboard;
pub fn is_jump_modifier_pressed( pub fn is_jump_modifier_pressed(
modifiers: keyboard::ModifiersState, modifiers: keyboard::ModifiersState,

View File

@ -1,6 +1,2 @@
//! Listen and react to keyboard events. //! Listen and react to keyboard events.
#[cfg(not(target_arch = "wasm32"))] pub use crate::runtime::keyboard::{Event, KeyCode, ModifiersState};
pub use iced_winit::input::keyboard::{KeyCode, ModifiersState};
#[cfg(target_arch = "wasm32")]
pub use iced_web::keyboard::{KeyCode, ModifiersState};

View File

@ -1,3 +1,2 @@
//! Listen and react to mouse events. //! Listen and react to mouse events.
#[cfg(not(target_arch = "wasm32"))] pub use crate::runtime::mouse::{Button, Event, ScrollDelta};
pub use iced_winit::input::mouse::{Button, Event, ScrollDelta};

View File

@ -74,8 +74,8 @@ pub use dodrio;
pub use element::Element; pub use element::Element;
pub use hasher::Hasher; pub use hasher::Hasher;
pub use iced_core::{ pub use iced_core::{
keyboard, Align, Background, Color, Font, HorizontalAlignment, Length, keyboard, mouse, Align, Background, Color, Font, HorizontalAlignment,
MouseCursor, Point, Rectangle, Size, Vector, VerticalAlignment, Length, MouseCursor, Point, Rectangle, Size, Vector, VerticalAlignment,
}; };
pub use iced_futures::{executor, futures, Command}; pub use iced_futures::{executor, futures, Command};
pub use subscription::Subscription; pub use subscription::Subscription;

View File

@ -1,4 +1,4 @@
use iced_native::input::mouse; use iced_native::mouse;
#[derive(Debug, Clone, Copy, PartialEq)] #[derive(Debug, Clone, Copy, PartialEq)]
pub enum Event { pub enum Event {

View File

@ -3,11 +3,8 @@
//! [`winit`]: https://github.com/rust-windowing/winit //! [`winit`]: https://github.com/rust-windowing/winit
//! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native //! [`iced_native`]: https://github.com/hecrj/iced/tree/master/native
use crate::{ use crate::{
input::{ keyboard::{self, KeyCode, ModifiersState},
keyboard::{self, KeyCode, ModifiersState}, mouse, window, Event, Mode, MouseCursor,
mouse,
},
window, Event, Mode, MouseCursor,
}; };
/// Converts a winit window event into an iced event. /// Converts a winit window event into an iced event.