2019-11-22 19:36:57 +01:00
|
|
|
//! A renderer-agnostic native GUI runtime.
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2021-12-23 09:34:37 +02:00
|
|
|
//! 
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2019-11-22 19:36:57 +01:00
|
|
|
//! `iced_native` takes [`iced_core`] and builds a native runtime on top of it,
|
|
|
|
|
//! featuring:
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2019-11-22 19:36:57 +01:00
|
|
|
//! - A custom layout engine, greatly inspired by [`druid`]
|
|
|
|
|
//! - Event handling for all the built-in widgets
|
|
|
|
|
//! - A renderer-agnostic API
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2020-05-28 21:30:33 +02:00
|
|
|
//! To achieve this, it introduces a couple of reusable interfaces:
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2019-11-22 19:36:57 +01:00
|
|
|
//! - A [`Widget`] trait, which is used to implement new widgets: from layout
|
|
|
|
|
//! requirements to event and drawing logic.
|
|
|
|
|
//! - A bunch of `Renderer` traits, meant to keep the crate renderer-agnostic.
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2019-11-22 19:36:57 +01:00
|
|
|
//! # Usage
|
2019-11-22 22:21:37 +01:00
|
|
|
//! The strategy to use this crate depends on your particular use case. If you
|
|
|
|
|
//! want to:
|
2020-03-19 09:30:54 +01:00
|
|
|
//! - Implement a custom shell or integrate it in your own system, check out the
|
|
|
|
|
//! [`UserInterface`] type.
|
2019-11-22 22:21:37 +01:00
|
|
|
//! - Build a new renderer, see the [renderer] module.
|
|
|
|
|
//! - Build a custom widget, start at the [`Widget`] trait.
|
2019-09-20 19:15:31 +02:00
|
|
|
//!
|
2021-12-23 09:34:37 +02:00
|
|
|
//! [`iced_core`]: https://github.com/iced-rs/iced/tree/master/core
|
|
|
|
|
//! [`iced_winit`]: https://github.com/iced-rs/iced/tree/master/winit
|
2019-11-22 19:36:57 +01:00
|
|
|
//! [`druid`]: https://github.com/xi-editor/druid
|
|
|
|
|
//! [`raw-window-handle`]: https://github.com/rust-windowing/raw-window-handle
|
2020-11-25 07:11:27 +01:00
|
|
|
//! [renderer]: crate::renderer
|
2021-12-08 08:04:46 +01:00
|
|
|
#![doc(
|
2021-12-09 15:10:38 +07:00
|
|
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
2021-12-08 08:04:46 +01:00
|
|
|
)]
|
2022-01-12 11:22:57 +07:00
|
|
|
#![deny(missing_docs)]
|
2021-09-13 11:20:54 +07:00
|
|
|
#![deny(missing_debug_implementations)]
|
2019-09-20 19:15:31 +02:00
|
|
|
#![deny(unused_results)]
|
2020-01-20 10:52:06 +01:00
|
|
|
#![forbid(unsafe_code)]
|
|
|
|
|
#![forbid(rust_2018_idioms)]
|
2021-03-10 01:59:02 +01:00
|
|
|
pub mod clipboard;
|
2021-09-01 19:21:49 +07:00
|
|
|
pub mod command;
|
2020-11-11 23:54:59 +01:00
|
|
|
pub mod event;
|
2021-10-31 16:20:50 +07:00
|
|
|
pub mod image;
|
2020-04-30 05:04:45 +02:00
|
|
|
pub mod keyboard;
|
2019-11-10 01:55:32 +01:00
|
|
|
pub mod layout;
|
2020-04-30 05:04:45 +02:00
|
|
|
pub mod mouse;
|
2020-05-23 01:07:59 +02:00
|
|
|
pub mod overlay;
|
2020-05-21 04:27:31 +02:00
|
|
|
pub mod program;
|
2019-09-20 19:15:31 +02:00
|
|
|
pub mod renderer;
|
2019-12-08 08:21:26 +01:00
|
|
|
pub mod subscription;
|
2021-10-31 16:24:31 +07:00
|
|
|
pub mod svg;
|
2021-10-31 16:13:03 +07:00
|
|
|
pub mod text;
|
2020-12-15 06:13:19 +01:00
|
|
|
pub mod touch;
|
2022-01-11 13:47:43 +07:00
|
|
|
pub mod user_interface;
|
2019-09-20 19:15:31 +02:00
|
|
|
pub mod widget;
|
2020-01-10 01:28:45 +01:00
|
|
|
pub mod window;
|
2019-09-20 19:15:31 +02:00
|
|
|
|
|
|
|
|
mod element;
|
|
|
|
|
mod hasher;
|
2020-01-20 04:47:36 +01:00
|
|
|
mod runtime;
|
2021-11-29 16:22:01 +07:00
|
|
|
mod shell;
|
2019-09-20 19:15:31 +02:00
|
|
|
|
2020-05-21 04:27:31 +02:00
|
|
|
// We disable debug capabilities on release builds unless the `debug` feature
|
|
|
|
|
// is explicitly enabled.
|
|
|
|
|
#[cfg(feature = "debug")]
|
|
|
|
|
#[path = "debug/basic.rs"]
|
|
|
|
|
mod debug;
|
|
|
|
|
#[cfg(not(feature = "debug"))]
|
|
|
|
|
#[path = "debug/null.rs"]
|
|
|
|
|
mod debug;
|
|
|
|
|
|
2021-09-20 15:09:55 +07:00
|
|
|
pub use iced_core::alignment;
|
2022-01-28 17:20:40 +07:00
|
|
|
pub use iced_core::time;
|
2019-10-08 03:13:41 +02:00
|
|
|
pub use iced_core::{
|
2021-09-20 15:09:55 +07:00
|
|
|
Alignment, Background, Color, Font, Length, Padding, Point, Rectangle,
|
|
|
|
|
Size, Vector,
|
2019-10-08 03:13:41 +02:00
|
|
|
};
|
2021-09-01 19:21:49 +07:00
|
|
|
pub use iced_futures::{executor, futures};
|
2020-01-20 04:47:36 +01:00
|
|
|
|
|
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use executor::Executor;
|
2019-09-20 19:15:31 +02:00
|
|
|
|
2019-12-18 07:45:49 +01:00
|
|
|
pub use clipboard::Clipboard;
|
2021-09-01 19:21:49 +07:00
|
|
|
pub use command::Command;
|
2020-05-21 04:27:31 +02:00
|
|
|
pub use debug::Debug;
|
2019-09-20 19:15:31 +02:00
|
|
|
pub use element::Element;
|
|
|
|
|
pub use event::Event;
|
|
|
|
|
pub use hasher::Hasher;
|
|
|
|
|
pub use layout::Layout;
|
2020-04-14 12:11:10 +02:00
|
|
|
pub use overlay::Overlay;
|
2020-05-21 04:27:31 +02:00
|
|
|
pub use program::Program;
|
2019-10-05 03:56:18 +02:00
|
|
|
pub use renderer::Renderer;
|
2020-01-19 10:17:08 +01:00
|
|
|
pub use runtime::Runtime;
|
2021-11-29 16:22:01 +07:00
|
|
|
pub use shell::Shell;
|
2019-12-08 08:21:26 +01:00
|
|
|
pub use subscription::Subscription;
|
2022-01-11 13:47:43 +07:00
|
|
|
pub use user_interface::UserInterface;
|
2021-10-31 15:35:12 +07:00
|
|
|
pub use widget::Widget;
|