Skip to main content

euv_core/platform/info/
enum.rs

1/// All supported execution targets across Web, Mobile, Tablet, Desktop, and Headless.
2#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub enum PlatformKind {
4    /// Browser WebAssembly platform using HTML5 Canvas / WebGL2 / WebGPU.
5    Web,
6    /// Android native platform using Android NDK (`ANativeWindow` / `AInput` / Vulkan / GLES).
7    Android,
8    /// iOS phone native platform using UIKit / CoreGraphics / Metal.
9    Ios,
10    /// iPadOS tablet native platform using UIKit / Stage Manager / Apple Pencil / Metal.
11    IpadOs,
12    /// macOS desktop native platform using Cocoa AppKit / CoreGraphics / Metal.
13    MacOs,
14    /// Windows desktop native platform using Win32 / GDI32 / DWM / Direct3D.
15    Windows,
16    /// Linux desktop native platform using X11 / Wayland / Vulkan.
17    Linux,
18    /// Deterministic offscreen headless platform for automated parity tests and benchmarks.
19    #[default]
20    Headless,
21}
22
23/// Physical device form factor used for adaptive layout and input affordances.
24#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub enum DeviceFormFactor {
26    /// Multi-window desktop workstation.
27    #[default]
28    Desktop,
29    /// Large-screen touch + stylus + optional keyboard tablet (e.g. iPadOS).
30    Tablet,
31    /// Compact handheld phone (iOS / Android).
32    Phone,
33    /// Web browser viewport.
34    Browser,
35    /// Offscreen headless test host.
36    Headless,
37}
38
39/// Zero-dependency ABI-stable native OS window handle for GPU surface creation.
40#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
41pub enum RawWindowHandle {
42    /// macOS AppKit handle carrying `(ns_window, ns_view, ca_metal_layer)` pointers.
43    AppKit {
44        /// Pointer to `NSWindow`.
45        ns_window: usize,
46        /// Pointer to `NSView`.
47        ns_view: usize,
48        /// Pointer to `CAMetalLayer`.
49        metal_layer: usize,
50    },
51    /// iOS / iPadOS UIKit handle carrying `(ui_window, ui_view, ca_metal_layer, is_ipad)`.
52    UiKit {
53        /// Pointer to `UIWindow`.
54        ui_window: usize,
55        /// Pointer to `UIView`.
56        ui_view: usize,
57        /// Pointer to `CAMetalLayer`.
58        metal_layer: usize,
59        /// True when running on iPadOS tablet idiom.
60        is_ipad: bool,
61    },
62    /// Windows Win32 handle carrying `(hwnd, hinstance)`.
63    Win32 {
64        /// Win32 `HWND` window handle.
65        hwnd: usize,
66        /// Win32 `HINSTANCE` module handle.
67        hinstance: usize,
68    },
69    /// Linux X11 Xlib handle carrying `(window, display)`.
70    Xlib {
71        /// X11 `Window` identifier.
72        window: u64,
73        /// X11 `Display*` pointer.
74        display: usize,
75    },
76    /// Linux Wayland handle carrying `(wl_surface, wl_display)`.
77    Wayland {
78        /// Pointer to `wl_surface`.
79        surface: usize,
80        /// Pointer to `wl_display`.
81        display: usize,
82    },
83    /// Android NDK handle carrying `ANativeWindow*`.
84    AndroidNdk {
85        /// Pointer to `ANativeWindow`.
86        native_window: usize,
87    },
88    /// Web browser canvas element identifier.
89    WebCanvas {
90        /// Canvas registration identifier.
91        canvas_id: u32,
92    },
93    /// Offscreen headless surface with no OS window handle.
94    #[default]
95    Headless,
96}