2022-09-21 10:04:28 +02:00
|
|
|
use crate::monitor::{MonitorHandle as RootMonitorHandle, VideoMode as RootVideoMode};
|
|
|
|
|
use crate::window::Fullscreen as RootFullscreen;
|
2019-02-05 10:30:33 -05:00
|
|
|
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(windows_platform)]
|
2019-06-03 22:51:01 -07:00
|
|
|
#[path = "windows/mod.rs"]
|
2019-02-05 10:30:33 -05:00
|
|
|
mod platform;
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(any(x11_platform, wayland_platform))]
|
2019-06-03 22:51:01 -07:00
|
|
|
#[path = "linux/mod.rs"]
|
2019-02-05 10:30:33 -05:00
|
|
|
mod platform;
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(macos_platform)]
|
2019-06-03 22:51:01 -07:00
|
|
|
#[path = "macos/mod.rs"]
|
2019-02-05 10:30:33 -05:00
|
|
|
mod platform;
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(android_platform)]
|
2019-06-03 22:51:01 -07:00
|
|
|
#[path = "android/mod.rs"]
|
2019-02-05 10:30:33 -05:00
|
|
|
mod platform;
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(ios_platform)]
|
2019-06-03 22:51:01 -07:00
|
|
|
#[path = "ios/mod.rs"]
|
2019-02-05 10:30:33 -05:00
|
|
|
mod platform;
|
2022-12-25 09:57:27 +02:00
|
|
|
#[cfg(wasm_platform)]
|
2019-06-25 03:15:34 +02:00
|
|
|
#[path = "web/mod.rs"]
|
2019-02-12 20:47:31 -05:00
|
|
|
mod platform;
|
2023-01-05 06:58:08 -07:00
|
|
|
#[cfg(orbital_platform)]
|
|
|
|
|
#[path = "orbital/mod.rs"]
|
|
|
|
|
mod platform;
|
2019-02-05 10:30:33 -05:00
|
|
|
|
2022-09-21 10:04:28 +02:00
|
|
|
pub use self::platform::*;
|
|
|
|
|
|
|
|
|
|
/// Helper for converting between platform-specific and generic VideoMode/MonitorHandle
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
|
|
|
pub(crate) enum Fullscreen {
|
|
|
|
|
Exclusive(VideoMode),
|
|
|
|
|
Borderless(Option<MonitorHandle>),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl From<RootFullscreen> for Fullscreen {
|
|
|
|
|
fn from(f: RootFullscreen) -> Self {
|
|
|
|
|
match f {
|
|
|
|
|
RootFullscreen::Exclusive(mode) => Self::Exclusive(mode.video_mode),
|
|
|
|
|
RootFullscreen::Borderless(Some(handle)) => Self::Borderless(Some(handle.inner)),
|
|
|
|
|
RootFullscreen::Borderless(None) => Self::Borderless(None),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl From<Fullscreen> for RootFullscreen {
|
|
|
|
|
fn from(f: Fullscreen) -> Self {
|
|
|
|
|
match f {
|
|
|
|
|
Fullscreen::Exclusive(video_mode) => Self::Exclusive(RootVideoMode { video_mode }),
|
|
|
|
|
Fullscreen::Borderless(Some(inner)) => {
|
|
|
|
|
Self::Borderless(Some(RootMonitorHandle { inner }))
|
|
|
|
|
}
|
|
|
|
|
Fullscreen::Borderless(None) => Self::Borderless(None),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-03 22:51:01 -07:00
|
|
|
#[cfg(all(
|
2022-12-25 09:57:27 +02:00
|
|
|
not(ios_platform),
|
|
|
|
|
not(windows_platform),
|
|
|
|
|
not(macos_platform),
|
|
|
|
|
not(android_platform),
|
|
|
|
|
not(x11_platform),
|
|
|
|
|
not(wayland_platform),
|
|
|
|
|
not(wasm_platform),
|
2023-01-05 06:58:08 -07:00
|
|
|
not(orbital_platform),
|
2019-06-03 22:51:01 -07:00
|
|
|
))]
|
2019-02-05 10:30:33 -05:00
|
|
|
compile_error!("The platform you're compiling for is not supported by winit");
|