witas 0.11.2

An asynchronous window library in Rust for Windows
Documentation
//! An asynchronous window library in Rust for Windows
//!
//! # Example
//!
//! ```no_run
//! #[tokio::main]
//! async fn main() {
//!     let mut rx = witas::EventReceiver::new();
//!     let _window = witas::Window::builder()
//!         .title("witas hello")
//!         .inner_size(witas::LogicalSize::new(640, 480))
//!         .set_receiver(&rx)
//!         .await
//!         .unwrap();
//!     loop {
//!         let (event, _) = rx.recv().await;
//!         println!("{:?}", event);
//!         if let witas::Event::Closed = event {
//!             break;
//!         }
//!     }
//! }
//! ```
//!
//! # Note
//!
//! witas use `WM_APP`. Don't post directly `WM_APP` to witas's UI thread.
//!

mod context;
mod device;
mod error;
pub mod events;
mod geometry;
pub mod ime;
mod procedure;
pub mod raw_input;
mod resources;
mod ui_thread;
mod utility;
pub mod window;

#[cfg(feature = "dialog")]
#[cfg_attr(docsrs, doc(cfg(feature = "dialog")))]
pub mod dialog;

use context::Context;

pub use device::*;
pub use error::{Error, Result};
#[doc(inline)]
pub use events::{Event, ResizingEdge};
pub use geometry::*;
pub use resources::*;
pub use ui_thread::UiThread;
#[doc(inline)]
pub use window::{
    BorderlessStyle, EventReceiver, InnerWindow, InnerWindowBuilder, RawInputEventRecevier, Window,
    WindowBuilder, WindowKind, WindowStyle,
};

#[cfg(feature = "dialog")]
#[doc(inline)]
pub use dialog::{FileDialogOptions, FileOpenDialog, FileSaveDialog, FilterSpec};

/// Initialize `UiThread`.
#[inline]
pub fn init() {
    ui_thread::UiThread::init();
}