Write documentation for new iced_winit
API
This commit is contained in:
parent
508128436c
commit
ef28347f1c
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(missing_docs)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Debug;
|
pub struct Debug;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//! Create interactive, native cross-platform applications.
|
||||||
use crate::{
|
use crate::{
|
||||||
conversion, mouse, Clipboard, Command, Debug, Executor, Mode, Proxy,
|
conversion, mouse, Clipboard, Command, Debug, Executor, Mode, Proxy,
|
||||||
Runtime, Settings, Size, Subscription,
|
Runtime, Settings, Size, Subscription,
|
||||||
@ -72,6 +73,10 @@ pub trait Application: Program {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Runs an [`Application`] with an executor, compositor, and the provided
|
||||||
|
/// settings.
|
||||||
|
///
|
||||||
|
/// [`Application`]: trait.Application.html
|
||||||
pub fn run<A, E, C>(
|
pub fn run<A, E, C>(
|
||||||
settings: Settings<A::Flags>,
|
settings: Settings<A::Flags>,
|
||||||
compositor_settings: C::Settings,
|
compositor_settings: C::Settings,
|
||||||
@ -254,6 +259,8 @@ pub fn run<A, E, C>(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Handles a `WindowEvent` and mutates the provided control flow, keyboard
|
||||||
|
/// modifiers, viewport, and resized flag accordingly.
|
||||||
pub fn handle_window_event(
|
pub fn handle_window_event(
|
||||||
event: &winit::event::WindowEvent<'_>,
|
event: &winit::event::WindowEvent<'_>,
|
||||||
window: &winit::window::Window,
|
window: &winit::window::Window,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
//! [`winit`]: https://github.com/rust-windowing/winit
|
//! [`winit`]: https://github.com/rust-windowing/winit
|
||||||
//! [`Application`]: trait.Application.html
|
//! [`Application`]: trait.Application.html
|
||||||
//! [`conversion`]: conversion
|
//! [`conversion`]: conversion
|
||||||
//#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
#![deny(missing_debug_implementations)]
|
#![deny(missing_debug_implementations)]
|
||||||
#![deny(unused_results)]
|
#![deny(unused_results)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
@ -5,6 +5,7 @@ use iced_native::futures::{
|
|||||||
};
|
};
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
/// An event loop proxy that implements `Sink`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Proxy<Message: 'static> {
|
pub struct Proxy<Message: 'static> {
|
||||||
raw: winit::event_loop::EventLoopProxy<Message>,
|
raw: winit::event_loop::EventLoopProxy<Message>,
|
||||||
@ -19,6 +20,9 @@ impl<Message: 'static> Clone for Proxy<Message> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<Message: 'static> Proxy<Message> {
|
impl<Message: 'static> Proxy<Message> {
|
||||||
|
/// Creates a new [`Proxy`] from an `EventLoopProxy`.
|
||||||
|
///
|
||||||
|
/// [`Proxy`]: struct.Proxy.html
|
||||||
pub fn new(raw: winit::event_loop::EventLoopProxy<Message>) -> Self {
|
pub fn new(raw: winit::event_loop::EventLoopProxy<Message>) -> Self {
|
||||||
Self { raw }
|
Self { raw }
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ pub struct Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
|
/// Converts the window settings into a `WindowBuilder` from `winit`.
|
||||||
pub fn into_builder(
|
pub fn into_builder(
|
||||||
self,
|
self,
|
||||||
title: &str,
|
title: &str,
|
||||||
|
Loading…
Reference in New Issue
Block a user