1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Copyright 2025 the Xilem Authors
// SPDX-License-Identifier: Apache-2.0
// After you edit the crate's doc comment, run this command, then check README.md for any missing links
// cargo rdme --workspace-project=masonry_winit
//! This is the [Winit][winit] backend for the [Masonry][] GUI framework.
//!
//! See [Masonry's documentation][] for more details, examples and resources.
//!
//! # Example
//!
//! ```rust
//! use masonry::core::{ErasedAction, NewWidget, Widget, WidgetId, WidgetPod};
//! use masonry::dpi::LogicalSize;
//! use masonry::theme::default_property_set;
//! use masonry_winit::app::{AppDriver, DriverCtx, NewWindow, WindowId};
//! use masonry_winit::winit::window::Window;
//!
//! struct Driver {
//! // ...
//! }
//!
//! impl AppDriver for Driver {
//! fn on_action(
//! &mut self,
//! window_id: WindowId,
//! ctx: &mut DriverCtx<'_>,
//! widget_id: WidgetId,
//! action: ErasedAction,
//! ) {
//! // ...
//! }
//! }
//!
//! fn main() {
//! let main_widget = {
//! // ...
//! # masonry::widgets::Label::new("hello")
//! };
//!
//! let window_size = LogicalSize::new(400.0, 400.0);
//! let window_attributes = Window::default_attributes()
//! .with_title("My Masonry App")
//! .with_resizable(true)
//! .with_min_inner_size(window_size);
//!
//! let driver = Driver {
//! // ...
//! };
//! # return;
//! masonry_winit::app::run(
//! vec![NewWindow::new(
//! window_attributes,
//! NewWidget::new(main_widget).erased(),
//! )],
//! driver,
//! default_property_set(),
//! )
//! .unwrap();
//! }
//! ```
//!
//! (See the Masonry documentation for more detailed examples.)
//!
//! [Masonry's documentation]: https://docs.rs/masonry
//! [Masonry]: https://crates.io/crates/masonry
// LINEBENDER LINT SET - lib.rs - v5
// See https://linebender.org/wiki/canonical-lints/
// These lints shouldn't apply to examples.
// Targeting e.g. 32-bit means structs containing usize can give false positives for 64-bit.
// END LINEBENDER LINT SET
pub use winit;
/// Types needed for running a Masonry app.