1#[cfg(android_platform)]
22pub mod android;
23
24#[cfg(ios_platform)]
25pub mod ios;
26
27#[cfg(macos_platform)]
28pub mod macos;
29
30#[cfg(orbital_platform)]
31pub mod orbital;
32
33#[cfg(x11_platform)]
34pub mod x11;
35
36#[cfg(wayland_platform)]
37pub mod wayland;
38
39#[cfg(windows)]
40pub mod windows;
41
42#[cfg(any(windows, x11_platform, wayland_platform))]
43pub mod run_return;
44
45cfg_if::cfg_if! {
46 if #[cfg(android_platform)] {
47 pub(crate) use android::PlatformSpecific;
48 } else if #[cfg(ios_platform)] {
49 pub(crate) use ios::PlatformSpecific;
50 } else if #[cfg(macos_platform)] {
51 pub(crate) use macos::PlatformSpecific;
52 } else if #[cfg(orbital_platform)] {
53 pub(crate) use orbital::PlatformSpecific;
54 } else if #[cfg(any(x11_platform, wayland_platform))] {
55 #[cfg(all(feature = "x11", not(feature = "wayland")))]
56 pub(crate) use x11::PlatformSpecific;
57
58 #[cfg(all(not(feature = "x11"), feature = "wayland"))]
59 pub(crate) use wayland::PlatformSpecific;
60
61 #[cfg(all(feature = "x11", feature = "wayland"))]
62 mod free_unix;
63 #[cfg(all(feature = "x11", feature = "wayland"))]
64 pub(crate) use free_unix::PlatformSpecific;
65 } else if #[cfg(windows)] {
66 pub(crate) use windows::PlatformSpecific;
67 }
68}
69
70mod __private {
71 use crate::event_loop::{EventLoop, EventLoopBuilder, EventLoopWindowTarget};
72 use crate::window::{Window, WindowBuilder};
73
74 #[doc(hidden)]
75 pub struct Internal(());
76
77 macro_rules! sealed_trait {
78 ($($name: ident $tname: ident)*) => {$(
79 #[doc(hidden)]
80 pub trait $tname {
81 fn __sealed_marker(i: Internal);
82 }
83
84 impl $tname for $name {
85 fn __sealed_marker(_: Internal) {}
86 }
87 )*}
88 }
89
90 macro_rules! sealed_trait_with_gen {
91 ($($name: ident $tname: ident)*) => {$(
92 #[doc(hidden)]
93 pub trait $tname {
94 fn __sealed_marker(i: Internal);
95 }
96
97 impl<TS: crate::sync::ThreadSafety> $tname for $name<TS> {
98 fn __sealed_marker(_: Internal) {}
99 }
100 )*}
101 }
102
103 sealed_trait! {
104 EventLoopBuilder EventLoopBuilderPrivate
105 WindowBuilder WindowBuilderPrivate
106 }
107
108 sealed_trait_with_gen! {
109 EventLoopWindowTarget EventLoopWindowTargetPrivate
110 EventLoop EventLoopPrivate
111 Window WindowPrivate
112 }
113}