diff --git a/Cargo.toml b/Cargo.toml index 7c222fbb2d..fec808fbdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,8 @@ categories = ["gui"] resolver = "2" [features] -default = ["wgpu"] +default = ["wgpu", "application"] +application = ["iced_winit/application"] # Enables the `iced_wgpu` renderer wgpu = ["iced_wgpu"] # Enables the `Image` widget diff --git a/native/src/lib.rs b/native/src/lib.rs index 6d98f7d145..d7e6fc5d03 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -92,5 +92,5 @@ pub use renderer::Renderer; pub use runtime::Runtime; pub use shell::Shell; pub use subscription::Subscription; -pub use user_interface::UserInterface; +pub use user_interface::{Cache, UserInterface}; pub use widget::Widget; diff --git a/src/lib.rs b/src/lib.rs index c8047d7f3f..acfd439690 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -180,10 +180,13 @@ #![forbid(unsafe_code)] #![forbid(rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg))] + +#[cfg(feature = "application")] mod application; mod element; mod error; mod result; +#[cfg(feature = "application")] mod sandbox; pub mod clipboard; @@ -210,11 +213,13 @@ use iced_glow as renderer; #[doc(no_inline)] pub use widget::*; +#[cfg(feature = "application")] pub use application::Application; pub use element::Element; pub use error::Error; pub use executor::Executor; pub use result::Result; +#[cfg(feature = "application")] pub use sandbox::Sandbox; pub use settings::Settings; diff --git a/winit/Cargo.toml b/winit/Cargo.toml index f723224820..bc8e1af3e7 100644 --- a/winit/Cargo.toml +++ b/winit/Cargo.toml @@ -12,6 +12,7 @@ categories = ["gui"] [features] debug = ["iced_native/debug"] +application = [] [dependencies] window_clipboard = "0.2" diff --git a/winit/src/lib.rs b/winit/src/lib.rs index b31adf6e62..86a702ed91 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -27,6 +27,7 @@ pub use iced_native::*; pub use winit; +#[cfg(feature = "application")] pub mod application; pub mod clipboard; pub mod conversion; @@ -38,6 +39,7 @@ mod mode; mod position; mod proxy; +#[cfg(feature = "application")] pub use application::Application; pub use clipboard::Clipboard; pub use error::Error;