Expand description
An asynchronous window library in Rust for Windows
Example
#[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.
Modules
- Provides file dialogs.
- Event structures.
- An IME composition string and a candidate list.
- Provides raw input data.
- Provides windows and event receivers.
Structs
- Represents the style of the borderless window.
- Describes file dialog options.
- The dialog for opening a file or files.
- The dialog for saving a file.
- Describes a extension filter.
- Represents a inner window.
- The object that build a inner window.
- Describes a virtual key and a scan code.
- Logical coordinate.
- Descibes mouse buttons.
- Describes a mouse cursor position and mouse buttons.
- Physical coordinate.
- A generic position.
- A generic rectangle.
- Describes a scan code of a keyboard.
- Screen coordinate.
- A generic size.
- The thread for running window loop.
- Represents a window.
- The object that build a window.
- Represents the style of a window.
Enums
- Describes a mouse cursor icon.
- The error type for this crate.
- The list of window events.
- Describes a icon.
- Describes a state of a keyboard.
- Descibes a mouse button.
- Describes a mouse wheel axis.
- Describes the edge of the resizing window.
- Describes a key name of a keyboard.
Constants
- The value is an unit in logical coordinates. The value is 96.
Traits
- Converts to logical coordinate.
- Converts to physical coordinate.
Functions
- Get whether a key is pressed.
- Get pressed keys.
- Initialize
UiThread
.
Type Aliases
- Describes a state of a mouse button.
- Receive a window event.
- A position in logical coordinate.
- A rectangle in logical coordinate.
- A size in logical coordinate.
- A position in physical coordinate.
- A rectangle in physical coordinate.
- A size in physical coordinate.
- Receive a raw input event.
- A specialized
Result
type for this crate. - A position in screen coordinate.