summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-10 00:34:21 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-10 00:34:21 +0200
commitb8e5693a3089d728b4f8d4b3b0b7197202ebd732 (patch)
tree79a9f84f9920525657fbe03d53ce33bab09053d7 /runtime
parent956512338905bac0b156fdaf16fe3c3e07e97a84 (diff)
parenta3489e4af960388e9f73988b88df361022a654a4 (diff)
downloadiced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.tar.gz
iced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.tar.bz2
iced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.zip
Merge branch 'master' into explicit-text-caching
Diffstat (limited to 'runtime')
-rw-r--r--runtime/Cargo.toml28
-rw-r--r--runtime/src/lib.rs30
-rw-r--r--runtime/src/overlay/nested.rs4
-rw-r--r--runtime/src/program/state.rs2
-rw-r--r--runtime/src/user_interface.rs4
-rw-r--r--runtime/src/window.rs5
6 files changed, 26 insertions, 47 deletions
diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml
index 9fbe4be7..d19aedd3 100644
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -1,23 +1,21 @@
[package]
name = "iced_runtime"
-version = "0.1.1"
-authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
-edition = "2021"
-description = "A renderer-agnostic runtime for Iced"
-license = "MIT"
-repository = "https://github.com/iced-rs/iced"
+description = "A renderer-agnostic runtime for iced"
+version.workspace = true
+edition.workspace = true
+authors.workspace = true
+license.workspace = true
+repository.workspace = true
+homepage.workspace = true
+categories.workspace = true
+keywords.workspace = true
[features]
debug = []
[dependencies]
-thiserror = "1"
+iced_core.workspace = true
+iced_futures.workspace = true
+iced_futures.features = ["thread-pool"]
-[dependencies.iced_core]
-version = "0.10"
-path = "../core"
-
-[dependencies.iced_futures]
-version = "0.7"
-path = "../futures"
-features = ["thread-pool"]
+thiserror.workspace = true
diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs
index 59c70ff7..c3261cca 100644
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -2,35 +2,13 @@
//!
//! ![The native path of the Iced ecosystem](https://github.com/iced-rs/iced/raw/improvement/update-ecosystem-and-roadmap/docs/graphs/native.png)
//!
-//! `iced_native` takes [`iced_core`] and builds a native runtime on top of it,
-//! featuring:
-//!
-//! - A custom layout engine, greatly inspired by [`druid`]
-//! - Event handling for all the built-in widgets
-//! - A renderer-agnostic API
-//!
-//! To achieve this, it introduces a couple of reusable interfaces:
-//!
-//! - 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.
-//!
-//! # Usage
-//! The strategy to use this crate depends on your particular use case. If you
-//! want to:
-//! - Implement a custom shell or integrate it in your own system, check out the
-//! [`UserInterface`] type.
-//! - Build a new renderer, see the [renderer] module.
-//! - Build a custom widget, start at the [`Widget`] trait.
+//! `iced_runtime` takes [`iced_core`] and builds a native runtime on top of it.
//!
//! [`iced_core`]: https://github.com/iced-rs/iced/tree/0.10/core
-//! [`iced_winit`]: https://github.com/iced-rs/iced/tree/0.10/winit
-//! [`druid`]: https://github.com/xi-editor/druid
-//! [`raw-window-handle`]: https://github.com/rust-windowing/raw-window-handle
-//! [renderer]: crate::renderer
#![doc(
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
)]
+#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(
missing_debug_implementations,
missing_docs,
@@ -39,9 +17,9 @@
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
- clippy::useless_conversion
+ clippy::useless_conversion,
+ rustdoc::broken_intra_doc_links
)]
-#![forbid(unsafe_code, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod clipboard;
pub mod command;
diff --git a/runtime/src/overlay/nested.rs b/runtime/src/overlay/nested.rs
index b729f769..21b6f7c1 100644
--- a/runtime/src/overlay/nested.rs
+++ b/runtime/src/overlay/nested.rs
@@ -6,7 +6,7 @@ use crate::core::renderer;
use crate::core::widget;
use crate::core::{Clipboard, Event, Layout, Point, Rectangle, Shell, Size};
-/// An [`Overlay`] container that displays nested overlays
+/// An overlay container that displays nested overlays
#[allow(missing_debug_implementations)]
pub struct Nested<'a, Message, Renderer> {
overlay: overlay::Element<'a, Message, Renderer>,
@@ -27,6 +27,8 @@ where
}
/// Returns the layout [`Node`] of the [`Nested`] overlay.
+ ///
+ /// [`Node`]: layout::Node
pub fn layout(
&mut self,
renderer: &Renderer,
diff --git a/runtime/src/program/state.rs b/runtime/src/program/state.rs
index 35df6078..9aa2d550 100644
--- a/runtime/src/program/state.rs
+++ b/runtime/src/program/state.rs
@@ -175,7 +175,7 @@ where
(uncaptured_events, command)
}
- /// Applies [`widget::Operation`]s to the [`State`]
+ /// Applies [`Operation`]s to the [`State`]
pub fn operate(
&mut self,
renderer: &mut P::Renderer,
diff --git a/runtime/src/user_interface.rs b/runtime/src/user_interface.rs
index b684fbde..dae9e0ac 100644
--- a/runtime/src/user_interface.rs
+++ b/runtime/src/user_interface.rs
@@ -361,7 +361,7 @@ where
/// It returns the current [`mouse::Interaction`]. You should update the
/// icon of the mouse cursor accordingly in your system.
///
- /// [`Renderer`]: crate::Renderer
+ /// [`Renderer`]: crate::core::Renderer
///
/// # Example
/// We can finally draw our [counter](index.html#usage) by
@@ -624,7 +624,7 @@ pub enum State {
/// The [`UserInterface`] is up-to-date and can be reused without
/// rebuilding.
Updated {
- /// The [`Instant`] when a redraw should be performed.
+ /// The [`window::RedrawRequest`] when a redraw should be performed.
redraw_request: Option<window::RedrawRequest>,
},
}
diff --git a/runtime/src/window.rs b/runtime/src/window.rs
index 5219fbfd..41816967 100644
--- a/runtime/src/window.rs
+++ b/runtime/src/window.rs
@@ -10,7 +10,8 @@ use crate::command::{self, Command};
use crate::core::time::Instant;
use crate::core::window::{Event, Icon, Level, Mode, UserAttention};
use crate::core::Size;
-use crate::futures::subscription::{self, Subscription};
+use crate::futures::event;
+use crate::futures::Subscription;
/// Subscribes to the frames of the window of the running application.
///
@@ -21,7 +22,7 @@ use crate::futures::subscription::{self, Subscription};
/// In any case, this [`Subscription`] is useful to smoothly draw application-driven
/// animations without missing any frames.
pub fn frames() -> Subscription<Instant> {
- subscription::raw_events(|event, _status| match event {
+ event::listen_raw(|event, _status| match event {
iced_core::Event::Window(Event::RedrawRequested(at)) => Some(at),
_ => None,
})