From 4aa0d7a13a6fbf04e3fa24c444d562c2f1085b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 28 May 2020 02:57:03 +0200 Subject: [PATCH] Write documentation for `iced_glutin` --- glutin/src/application.rs | 8 +++++++- glutin/src/lib.rs | 16 ++++++++++++---- native/src/program.rs | 2 +- winit/src/application.rs | 4 +++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 2e6f34af..c777a13b 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -1,12 +1,18 @@ +//! Create interactive, native cross-platform applications. use crate::{mouse, Executor, Runtime, Size}; use iced_graphics::window; use iced_graphics::Viewport; use iced_winit::application; use iced_winit::conversion; -use iced_winit::{program, Clipboard, Debug, Proxy, Settings}; +use iced_winit::{Clipboard, Debug, Proxy, Settings}; pub use iced_winit::Application; +pub use iced_winit::{program, Program}; +/// Runs an [`Application`] with an executor, compositor, and the provided +/// settings. +/// +/// [`Application`]: trait.Application.html pub fn run( settings: Settings, compositor_settings: C::Settings, diff --git a/glutin/src/lib.rs b/glutin/src/lib.rs index 829fe02a..b0e0bdd4 100644 --- a/glutin/src/lib.rs +++ b/glutin/src/lib.rs @@ -1,15 +1,23 @@ -//#![deny(missing_docs)] +//! A windowing shell for [`iced`], on top of [`glutin`]. +//! +//! [`iced`]: https://github.com/hecrj/iced +//! [`glutin`]: https://github.com/rust-windowing/glutin +#![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(unused_results)] #![deny(unsafe_code)] #![forbid(rust_2018_idioms)] +pub use glutin; #[doc(no_inline)] pub use iced_native::*; pub mod application; -pub use application::Application; - -pub use iced_winit::settings::{self, Settings}; +pub use iced_winit::settings; pub use iced_winit::Mode; + +#[doc(no_inline)] +pub use application::Application; +#[doc(no_inline)] +pub use settings::Settings; diff --git a/native/src/program.rs b/native/src/program.rs index a28ff2a3..14afcd84 100644 --- a/native/src/program.rs +++ b/native/src/program.rs @@ -5,7 +5,7 @@ mod state; pub use state::State; -/// An interactive, native cross-platform program. +/// The core of a user interface application following The Elm Architecture. pub trait Program: Sized { /// The graphics backend to use to draw the [`Program`]. /// diff --git a/winit/src/application.rs b/winit/src/application.rs index df6e4eec..73ac72b2 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -18,6 +18,8 @@ use iced_native::program::{self, Program}; /// /// When using an [`Application`] with the `debug` feature enabled, a debug view /// can be toggled by pressing `F12`. +/// +/// [`Application`]: trait.Application.html pub trait Application: Program { /// The data needed to initialize your [`Application`]. /// @@ -36,7 +38,7 @@ pub trait Application: Program { /// /// [`Application`]: trait.Application.html /// [`run`]: #method.run.html - /// [`Settings`]: struct.Settings.html + /// [`Settings`]: ../settings/struct.Settings.html fn new(flags: Self::Flags) -> (Self, Command); /// Returns the current title of the [`Application`].