2024-07-10 16:17:39 +02:00
|
|
|
// Brief introduction to the internals of the Web backend:
|
|
|
|
|
// The Web backend used to support both wasm-bindgen and stdweb as methods of binding to the
|
|
|
|
|
// environment. Because they are both supporting the same underlying APIs, the actual Web bindings
|
2020-01-25 19:04:03 -05:00
|
|
|
// are cordoned off into backend abstractions, which present the thinnest unifying layer possible.
|
|
|
|
|
//
|
|
|
|
|
// When adding support for new events or interactions with the browser, first consult trusted
|
|
|
|
|
// documentation (such as MDN) to ensure it is well-standardised and supported across many browsers.
|
2024-07-10 16:17:39 +02:00
|
|
|
// Once you have decided on the relevant Web APIs, add support to both backends.
|
2020-01-25 19:04:03 -05:00
|
|
|
//
|
|
|
|
|
// The backend is used by the rest of the module to implement Winit's business logic, which forms
|
2024-07-10 16:17:39 +02:00
|
|
|
// the rest of the code. 'device', 'error', 'monitor', and 'window' define Web-specific structures
|
2020-01-25 19:04:03 -05:00
|
|
|
// for winit's cross-platform structures. They are all relatively simple translations.
|
|
|
|
|
//
|
|
|
|
|
// The event_loop module handles listening for and processing events. 'Proxy' implements
|
2024-01-31 17:29:59 +04:00
|
|
|
// EventLoopProxy and 'WindowTarget' implements ActiveEventLoop. WindowTarget also handles
|
2020-01-25 19:04:03 -05:00
|
|
|
// registering the event handlers. The 'Execution' struct in the 'runner' module handles taking
|
|
|
|
|
// incoming events (from the registered handlers) and ensuring they are passed to the user in a
|
|
|
|
|
// compliant way.
|
|
|
|
|
|
2024-05-03 22:24:54 +02:00
|
|
|
// TODO: FP, remove when <https://github.com/rust-lang/rust-clippy/issues/12377> is fixed.
|
|
|
|
|
#![allow(clippy::empty_docs)]
|
2024-02-26 09:46:12 +01:00
|
|
|
|
2023-06-05 02:44:54 +02:00
|
|
|
mod r#async;
|
2023-12-16 22:02:17 +02:00
|
|
|
mod cursor;
|
2019-06-25 03:15:34 +02:00
|
|
|
mod error;
|
2024-08-08 00:36:36 +02:00
|
|
|
mod event;
|
2019-06-25 03:15:34 +02:00
|
|
|
mod event_loop;
|
2023-05-28 20:02:59 +02:00
|
|
|
mod keyboard;
|
2024-07-23 17:05:55 +02:00
|
|
|
mod lock;
|
2023-12-26 01:22:10 +01:00
|
|
|
mod main_thread;
|
2019-06-25 03:15:34 +02:00
|
|
|
mod monitor;
|
2024-06-24 03:57:48 +02:00
|
|
|
mod web_sys;
|
2019-06-25 03:15:34 +02:00
|
|
|
mod window;
|
|
|
|
|
|
2025-03-13 17:18:37 +03:00
|
|
|
pub(crate) use cursor::CustomCursorFuture;
|
2024-07-07 18:38:50 +02:00
|
|
|
|
2022-02-16 22:09:03 +01:00
|
|
|
pub(crate) use self::event_loop::{
|
2024-11-13 15:29:05 +03:00
|
|
|
ActiveEventLoop, EventLoop, PlatformSpecificEventLoopAttributes,
|
2019-06-25 03:15:34 +02:00
|
|
|
};
|
2024-07-23 20:33:10 +02:00
|
|
|
pub(crate) use self::monitor::{
|
|
|
|
|
HasMonitorPermissionFuture, MonitorHandle, MonitorPermissionFuture, OrientationLockFuture,
|
|
|
|
|
};
|
2024-06-24 22:40:49 +02:00
|
|
|
use self::web_sys as backend;
|
2024-10-08 15:29:40 +02:00
|
|
|
pub use self::window::{PlatformSpecificWindowAttributes, Window};
|