winit-core: drop broken docs

Generally, winit-core doesn't know about underlying platforms, though,
some general information which will true for any implementation was
left in place.
This commit is contained in:
Kirill Chibisov 2025-05-03 21:25:22 +09:00
parent 276597e009
commit cf5e422dc8
10 changed files with 29 additions and 100 deletions

View file

@ -618,17 +618,8 @@ pub enum DeviceEvent {
/// ## Platform-specific
///
/// **Web:** Only returns raw data, not OS accelerated, if [`CursorGrabMode::Locked`] is used
/// and browser support is available, see
#[cfg_attr(
web_platform,
doc = "[`ActiveEventLoopExtWeb::is_cursor_lock_raw()`][crate::platform::web::ActiveEventLoopExtWeb::is_cursor_lock_raw()]."
)]
#[cfg_attr(
not(web_platform),
doc = "`ActiveEventLoopExtWeb::is_cursor_lock_raw()`."
)]
/// and browser support is available.
///
#[rustfmt::skip]
/// [`CursorGrabMode::Locked`]: crate::window::CursorGrabMode::Locked
PointerMotion {
/// (x, y) change in position in unspecified units.

View file

@ -46,12 +46,7 @@ pub trait ActiveEventLoop: AsAny + fmt::Debug {
///
/// ## Platform-specific
///
/// **Web:** Only returns the current monitor without
#[cfg_attr(
web_platform,
doc = "[detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = "detailed monitor permissions.")]
/// **Web:** Only returns the current monitor without `detailed monitor permissions`.
fn available_monitors(&self) -> Box<dyn Iterator<Item = MonitorHandle>>;
/// Returns the primary monitor of the system.
@ -61,12 +56,7 @@ pub trait ActiveEventLoop: AsAny + fmt::Debug {
/// ## Platform-specific
///
/// - **Wayland:** Always returns `None`.
/// - **Web:** Always returns `None` without
#[cfg_attr(
web_platform,
doc = " [detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = " detailed monitor permissions.")]
/// - **Web:** Always returns `None` without `detailed monitor permissions`.
fn primary_monitor(&self) -> Option<MonitorHandle>;
/// Change if or when [`DeviceEvent`]s are captured.

View file

@ -29,20 +29,9 @@ use crate::as_any::{impl_dyn_casting, AsAny};
///
/// ## Platform-specific
///
/// **Web:** A [`MonitorHandle`] created without
#[cfg_attr(
web_platform,
doc = "[detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = "detailed monitor permissions.")]
/// **Web:** A [`MonitorHandle`] created without `detailed monitor permissions`
/// will always represent the current monitor the browser window is in instead of a specific
/// monitor. See
#[cfg_attr(
web_platform,
doc = "[`MonitorHandleExtWeb::is_detailed()`][crate::platform::web::MonitorHandleExtWeb::is_detailed]"
)]
#[cfg_attr(not(web_platform), doc = "`MonitorHandleExtWeb::is_detailed()`")]
/// to check.
/// monitor.
///
/// [`Window`]: crate::window::Window
#[derive(Debug, Clone)]
@ -88,14 +77,10 @@ pub trait MonitorHandleProvider: AsAny + fmt::Debug + Send + Sync {
///
/// Returns `None` if the monitor doesn't exist anymore or the name couldn't be obtained.
///
///
/// ## Platform-specific
///
/// **Web:** Always returns [`None`] without
#[cfg_attr(
web_platform,
doc = "[detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = "detailed monitor permissions.")]
/// **Web:** Always returns [`None`] without `detailed monitor permissions`.
fn name(&self) -> Option<Cow<'_, str>>;
/// Returns the top-left corner position of the monitor in desktop coordinates.
@ -106,12 +91,7 @@ pub trait MonitorHandleProvider: AsAny + fmt::Debug + Send + Sync {
///
/// ## Platform-specific
///
/// **Web:** Always returns [`None`] without
#[cfg_attr(
web_platform,
doc = "[detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = "detailed monitor permissions.")]
/// **Web:** Always returns [`None`] without `detailed monitor permissions`.
fn position(&self) -> Option<PhysicalPosition<i32>>;
/// Returns the scale factor of the underlying monitor. To map logical pixels to physical
@ -119,19 +99,9 @@ pub trait MonitorHandleProvider: AsAny + fmt::Debug + Send + Sync {
///
/// See the [`dpi`] module for more information.
///
/// ## Platform-specific
///
/// - **X11:** Can be overridden using the `WINIT_X11_SCALE_FACTOR` environment variable.
/// - **Wayland:** May differ from [`Window::scale_factor`].
/// - **Android:** Always returns 1.0.
/// - **Web:** Always returns `0.0` without
#[cfg_attr(
web_platform,
doc = " [detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = " detailed monitor permissions.")]
/// - **Web:** Always returns `0.0` without `detailed_monitor_permissions`.
///
#[rustfmt::skip]
/// [`Window::scale_factor`]: crate::window::Window::scale_factor
fn scale_factor(&self) -> f64;

View file

@ -624,7 +624,7 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug {
///
/// This may also be useful for figuring out the size of the window's decorations (such as
/// buttons, title, etc.), but may also not correspond to that (e.g. if the title bar is made
/// transparent using [`with_titlebar_transparent`] on macOS, or your are drawing window
/// transparent on macOS, or your are drawing window
/// decorations yourself).
///
/// This may be negative.
@ -633,15 +633,6 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug {
/// as the window itself, this simply returns `(0, 0)`.
///
/// [`outer_position`]: Self::outer_position
#[cfg_attr(
macos_platform,
doc = "[`with_titlebar_transparent`]: \
crate::platform::macos::WindowAttributesExtMacOS::with_titlebar_transparent"
)]
#[cfg_attr(
not(macos_platform),
doc = "[`with_titlebar_transparent`]: #only-available-on-macos"
)]
fn surface_position(&self) -> PhysicalPosition<i32>;
/// The position of the top-left hand corner of the window relative to the top-left hand corner
@ -1004,14 +995,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug {
/// The dock and the menu bar are disabled in exclusive fullscreen mode.
/// - **Wayland:** Does not support exclusive fullscreen mode and will no-op a request.
/// - **Windows:** Screen saver is disabled in fullscreen mode.
/// - **Android / Orbital:** Unsupported.
/// - **Web:** Passing a [`MonitorHandle`] or [`VideoMode`] that was not created with
#[cfg_attr(
web_platform,
doc = " [detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]"
)]
#[cfg_attr(not(web_platform), doc = " detailed monitor permissions")]
/// or calling without a [transient activation] does nothing.
/// - **Web:** Passing a [`MonitorHandle`] or [`VideoMode`] that was not created with detailed
/// monitor permissions or calling without a [transient activation] does nothing.
///
/// [transient activation]: https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation
/// [`VideoMode`]: crate::monitor::VideoMode
@ -1333,17 +1318,6 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug {
/// This is the same as [`ActiveEventLoop::available_monitors`], and is provided for
/// convenience.
///
///
/// ## Platform-specific
///
/// **Web:** Only returns the current monitor without
#[cfg_attr(
web_platform,
doc = "[detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(any(web_platform,)), doc = "detailed monitor permissions.")]
///
#[rustfmt::skip]
/// [`ActiveEventLoop::available_monitors`]: crate::event_loop::ActiveEventLoop::available_monitors
fn available_monitors(&self) -> Box<dyn Iterator<Item = MonitorHandle>>;
@ -1356,14 +1330,7 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug {
/// ## Platform-specific
///
/// - **Wayland:** Always returns `None`.
/// - **Web:** Always returns `None` without
#[cfg_attr(
web_platform,
doc = " [detailed monitor permissions][crate::platform::web::ActiveEventLoopExtWeb::request_detailed_monitor_permission]."
)]
#[cfg_attr(not(web_platform), doc = " detailed monitor permissions.")]
///
#[rustfmt::skip]
/// [`ActiveEventLoop::primary_monitor`]: crate::event_loop::ActiveEventLoop::primary_monitor
fn primary_monitor(&self) -> Option<MonitorHandle>;