mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
There seems to be many PRs relating to this issue, but they don't include all platforms and for some reason lost steam. This PR again tries to make this feature happen, and does it for all desktop platforms (x11, wayland, macos, windows, web). I think the best user of this feature and the reason I'm doing this is Bevy and game engines in general. There non laggy hardware cursors with custom images are very important. Game devs also like their PNGs so supporting platform native cursor files is not that important, but I guess could be added too. Co-authored-by: daxpedda <daxpedda@gmail.com> Co-authored-by: Mads Marquart <mads@marquart.dk> Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
44 lines
2.0 KiB
Rust
44 lines
2.0 KiB
Rust
// 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
|
|
// 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.
|
|
|
|
mod r#async;
|
|
mod cursor;
|
|
mod device;
|
|
mod error;
|
|
mod event_loop;
|
|
mod keyboard;
|
|
mod monitor;
|
|
mod window;
|
|
|
|
#[path = "web_sys/mod.rs"]
|
|
mod backend;
|
|
|
|
pub use self::device::DeviceId;
|
|
pub use self::error::OsError;
|
|
pub(crate) use self::event_loop::{
|
|
EventLoop, EventLoopProxy, EventLoopWindowTarget, PlatformSpecificEventLoopAttributes,
|
|
};
|
|
pub use self::monitor::{MonitorHandle, VideoMode};
|
|
pub use self::window::{PlatformSpecificWindowBuilderAttributes, Window, WindowId};
|
|
|
|
pub(crate) use self::keyboard::KeyEventExtra;
|
|
pub(crate) use crate::icon::NoIcon as PlatformIcon;
|
|
pub(crate) use crate::platform_impl::Fullscreen;
|
|
pub(crate) use cursor::WebCustomCursor as PlatformCustomCursor;
|