2020-01-25 19:04:03 -05:00
|
|
|
// Brief introduction to the internals of the web backend:
|
2021-05-24 19:06:21 +02:00
|
|
|
// The web backend used to support both wasm-bindgen and stdweb as methods of binding to the
|
2020-01-25 19:04:03 -05:00
|
|
|
// environment. Because they are both supporting the same underlying APIs, the actual web bindings
|
|
|
|
|
// 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.
|
|
|
|
|
// Once you have decided on the relevant web APIs, add support to both backends.
|
|
|
|
|
//
|
|
|
|
|
// The backend is used by the rest of the module to implement Winit's business logic, which forms
|
|
|
|
|
// the rest of the code. 'device', 'error', 'monitor', and 'window' define web-specific structures
|
|
|
|
|
// for winit's cross-platform structures. They are all relatively simple translations.
|
|
|
|
|
//
|
|
|
|
|
// The event_loop module handles listening for and processing events. 'Proxy' implements
|
|
|
|
|
// EventLoopProxy and 'WindowTarget' implements EventLoopWindowTarget. WindowTarget also handles
|
|
|
|
|
// 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.
|
|
|
|
|
|
2019-06-25 03:15:34 +02:00
|
|
|
mod device;
|
|
|
|
|
mod error;
|
|
|
|
|
mod event_loop;
|
2023-05-28 20:02:59 +02:00
|
|
|
mod keyboard;
|
2019-06-25 03:15:34 +02:00
|
|
|
mod monitor;
|
|
|
|
|
mod window;
|
|
|
|
|
|
|
|
|
|
#[path = "web_sys/mod.rs"]
|
|
|
|
|
mod backend;
|
|
|
|
|
|
2022-03-18 14:09:39 +01:00
|
|
|
pub use self::device::DeviceId;
|
2019-06-25 03:15:34 +02:00
|
|
|
pub use self::error::OsError;
|
2022-02-16 22:09:03 +01:00
|
|
|
pub(crate) use self::event_loop::{
|
2022-03-18 14:09:39 +01:00
|
|
|
EventLoop, EventLoopProxy, EventLoopWindowTarget, PlatformSpecificEventLoopAttributes,
|
2019-06-25 03:15:34 +02:00
|
|
|
};
|
2022-03-18 14:09:39 +01:00
|
|
|
pub use self::monitor::{MonitorHandle, VideoMode};
|
|
|
|
|
pub use self::window::{PlatformSpecificWindowBuilderAttributes, Window, WindowId};
|
2020-03-07 19:42:21 +00:00
|
|
|
|
2023-05-28 20:02:59 +02:00
|
|
|
pub(crate) use self::keyboard::KeyEventExtra;
|
2020-03-07 19:42:21 +00:00
|
|
|
pub(crate) use crate::icon::NoIcon as PlatformIcon;
|
2022-09-21 10:04:28 +02:00
|
|
|
pub(self) use crate::platform_impl::Fullscreen;
|
2020-08-30 21:15:44 +08:00
|
|
|
|
|
|
|
|
#[derive(Clone, Copy)]
|
|
|
|
|
pub(crate) struct ScaleChangeArgs {
|
|
|
|
|
old_scale: f64,
|
|
|
|
|
new_scale: f64,
|
|
|
|
|
}
|