euv-core 0.51.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// Win32 window class name registered for euv native windows.
pub(crate) const WIN32_CLASS_NAME: &str = "EuvNativeWindowClass";

/// Win32 `user32.dll` module name for dynamic Per-Monitor DPI awareness lookup.
pub(crate) const WIN32_DLL_USER32: &str = "user32.dll";

/// Win32 dynamic symbol name for `SetProcessDpiAwarenessContext`.
pub(crate) const WIN32_SYM_SET_DPI_CONTEXT: &str = "SetProcessDpiAwarenessContext\0";

/// Win32 `DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2` sentinel (`(HANDLE)-4`).
pub(crate) const DPI_AWARENESS_CONTEXT_PER_MONITOR_V2: isize = -4;

/// Win32 standard overlapped window style (`WS_OVERLAPPEDWINDOW`).
pub(crate) const WS_OVERLAPPEDWINDOW: u32 = 0x00CF_0000;

/// Win32 popup borderless window style (`WS_POPUP`).
pub(crate) const WS_POPUP: u32 = 0x8000_0000;

/// Win32 `SW_SHOW` command constant.
pub(crate) const SW_SHOW: i32 = 5;

/// Win32 `SW_HIDE` command constant.
pub(crate) const SW_HIDE: i32 = 0;

/// Win32 `HWND_TOPMOST` sentinel.
pub(crate) const HWND_TOPMOST: isize = -1;

/// Win32 `HWND_NOTOPMOST` sentinel.
pub(crate) const HWND_NOTOPMOST: isize = -2;

/// Win32 `SWP_NOMOVE | SWP_NOSIZE` flags.
pub(crate) const SWP_NOMOVE_NOSIZE: u32 = 0x0003;

/// Win32 `SWP_NOMOVE | SWP_NOZORDER` flags.
pub(crate) const SWP_NOMOVE_NOZORDER: u32 = 0x0006;

/// Win32 `SWP_NOZORDER | SWP_NOACTIVATE` flags honoring `WM_DPICHANGED` suggested rectangles.
pub(crate) const SWP_NOZORDER_NOACTIVATE: u32 = 0x0014;

/// Win32 `BI_RGB` uncompressed bitmap compression constant.
pub(crate) const BI_RGB: u32 = 0;

/// Win32 `DIB_RGB_COLORS` color table usage constant.
pub(crate) const DIB_RGB_COLORS: u32 = 0;

/// Win32 `SRCCOPY` raster operation code.
pub(crate) const SRCCOPY: u32 = 0x00CC_0020;

/// Win32 `HALFTONE` high-quality stretch blit mode for GDI `SetStretchBltMode`.
pub(crate) const STRETCH_HALFTONE: i32 = 4;

/// Win32 GDI `GetDeviceCaps` index for vertical display refresh rate in Hertz (`VREFRESH`).
pub(crate) const GDI_VREFRESH: i32 = 116;

/// Win32 `PM_REMOVE` flag for `PeekMessageW`.
pub(crate) const PM_REMOVE: u32 = 0x0001;

/// Win32 `WM_DESTROY` message constant.
pub(crate) const WM_DESTROY: u32 = 0x0002;

/// Win32 `WM_SIZE` message constant.
pub(crate) const WM_SIZE: u32 = 0x0005;

/// Win32 `SIZE_MINIMIZED` `w_param` value for `WM_SIZE`.
pub(crate) const SIZE_MINIMIZED: usize = 1;

/// Win32 `WM_SETFOCUS` message constant.
pub(crate) const WM_SETFOCUS: u32 = 0x0007;

/// Win32 `WM_KILLFOCUS` message constant.
pub(crate) const WM_KILLFOCUS: u32 = 0x0008;

/// Win32 `WM_PAINT` message constant.
pub(crate) const WM_PAINT: u32 = 0x000F;

/// Win32 `WM_CLOSE` message constant.
pub(crate) const WM_CLOSE: u32 = 0x0010;

/// Win32 `WM_SETTINGCHANGE` message constant.
pub(crate) const WM_SETTINGCHANGE: u32 = 0x001A;

/// Win32 `WM_ACTIVATEAPP` message constant.
pub(crate) const WM_ACTIVATEAPP: u32 = 0x001C;

/// Win32 `WM_CANCELMODE` message constant sent when OS dialogs or mode transitions cancel active pointer drags.
pub(crate) const WM_CANCELMODE: u32 = 0x001F;

/// Win32 `WM_CAPTURECHANGED` message constant sent when mouse capture is lost during a drag.
pub(crate) const WM_CAPTURECHANGED: u32 = 0x0215;

/// Win32 `WM_POWERBROADCAST` message constant.
pub(crate) const WM_POWERBROADCAST: u32 = 0x0218;

/// Win32 `PBT_POWERSTATUSCHANGE` `w_param` value for `WM_POWERBROADCAST`.
pub(crate) const PBT_POWERSTATUSCHANGE: usize = 0x000A;

/// Win32 `WM_THEMECHANGED` message constant.
pub(crate) const WM_THEMECHANGED: u32 = 0x031A;

/// Win32 `WM_CLIPBOARDUPDATE` message constant.
pub(crate) const WM_CLIPBOARDUPDATE: u32 = 0x031D;

/// Win32 `WM_KEYDOWN` message constant.
pub(crate) const WM_KEYDOWN: u32 = 0x0100;

/// Win32 `WM_KEYUP` message constant.
pub(crate) const WM_KEYUP: u32 = 0x0101;

/// Win32 `WM_CHAR` message constant.
pub(crate) const WM_CHAR: u32 = 0x0102;

/// Win32 `WM_MOUSEMOVE` message constant.
pub(crate) const WM_MOUSEMOVE: u32 = 0x0200;

/// Win32 `WM_LBUTTONDOWN` message constant.
pub(crate) const WM_LBUTTONDOWN: u32 = 0x0201;

/// Win32 `WM_LBUTTONUP` message constant.
pub(crate) const WM_LBUTTONUP: u32 = 0x0202;

/// Win32 `WM_RBUTTONDOWN` message constant.
pub(crate) const WM_RBUTTONDOWN: u32 = 0x0204;

/// Win32 `WM_RBUTTONUP` message constant.
pub(crate) const WM_RBUTTONUP: u32 = 0x0205;

/// Win32 `WM_MBUTTONDOWN` message constant.
pub(crate) const WM_MBUTTONDOWN: u32 = 0x0207;

/// Win32 `WM_MBUTTONUP` message constant.
pub(crate) const WM_MBUTTONUP: u32 = 0x0208;

/// Win32 `WM_MOUSEWHEEL` message constant.
pub(crate) const WM_MOUSEWHEEL: u32 = 0x020A;

/// Win32 `WM_DPICHANGED` message constant.
pub(crate) const WM_DPICHANGED: u32 = 0x02E0;

/// Win32 `VK_SHIFT` virtual key code.
pub(crate) const VK_SHIFT: i32 = 0x10;

/// Win32 `VK_CONTROL` virtual key code.
pub(crate) const VK_CONTROL: i32 = 0x11;

/// Win32 `VK_MENU` (Alt) virtual key code.
pub(crate) const VK_MENU: i32 = 0x12;

/// Win32 `VK_LWIN` virtual key code.
pub(crate) const VK_LWIN: i32 = 0x5B;

/// Win32 `VK_RWIN` virtual key code.
pub(crate) const VK_RWIN: i32 = 0x5C;

/// Win32 default 96 DPI baseline.
pub(crate) const WIN32_DEFAULT_DPI: f32 = 96.0;

/// Win32 `dxgi.dll` module name for dynamic DXGI 1.5/1.6 waitable swapchain & tearing probe.
pub(crate) const WIN32_DLL_DXGI: &str = "dxgi.dll";

/// Win32 dynamic symbol name for `CreateDXGIFactory1` in `dxgi.dll`.
pub(crate) const WIN32_SYM_CREATE_DXGI_FACTORY1: &str = "CreateDXGIFactory1\0";

/// Win32 `SWP_NOOWNERZORDER | SWP_FRAMECHANGED` flags for borderless fullscreen transition.
pub(crate) const SWP_FULLSCREEN_ENTER: u32 = 0x0220;

/// Win32 `SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED` flags for fullscreen restore.
pub(crate) const SWP_FULLSCREEN_EXIT: u32 = 0x0227;

/// Win32 `GWL_STYLE` index (`-16`).
pub(crate) const GWL_STYLE: i32 = -16;

/// Win32 `MONITOR_DEFAULTTONEAREST` flag (`2`) for `MonitorFromWindow`.
pub(crate) const MONITOR_DEFAULTTONEAREST: u32 = 2;

/// Win32 `ENUM_CURRENT_SETTINGS` sentinel (`u32::MAX`) for `EnumDisplaySettingsW`.
pub(crate) const ENUM_CURRENT_SETTINGS: u32 = u32::MAX;

/// Win32 `WM_DISPLAYCHANGE` message constant (`0x007E`).
pub(crate) const WM_DISPLAYCHANGE: u32 = 0x007E;

/// Win32 `CREATE_WAITABLE_TIMER_HIGH_RESOLUTION` flag (`0x0000_0002`, Windows 10 1803+) breaking the 15.625ms sleep cap.
pub(crate) const CREATE_WAITABLE_TIMER_HIGH_RESOLUTION: u32 = 0x0000_0002;

/// Win32 `TIMER_ALL_ACCESS` desired access mask (`0x001F_0003`) for `CreateWaitableTimerExW`.
pub(crate) const TIMER_ALL_ACCESS: u32 = 0x001F_0003;

/// Win32 `INFINITE` wait timeout (`u32::MAX`) for `WaitForSingleObject`.
pub(crate) const WIN32_WAIT_INFINITE: u32 = u32::MAX;

/// DXGI `DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT` (`0x0040`).
pub(crate) const DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT: u32 = 0x0040;

/// DXGI `DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING` (`0x0800`).
pub(crate) const DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING: u32 = 0x0800;

/// DXGI `DXGI_PRESENT_ALLOW_TEARING` (`0x0200`) flag for low-latency VRR / unlocked high-Hz presentation.
pub(crate) const DXGI_PRESENT_ALLOW_TEARING: u32 = 0x0200;

/// Win32 `CW_USEDEFAULT` position sentinel.
pub(crate) const CW_USEDEFAULT: i32 = -2_147_483_648;

/// Win32 `QS_ALLINPUT` wake mask (`0x04FF`) for blocking `MsgWaitForMultipleObjects`.
pub(crate) const WIN32_QS_ALLINPUT: u32 = 0x04FF;

/// Null-terminated ASCII `dxgi.dll` library name for `LoadLibraryA`.
pub(crate) const WIN32_DLL_DXGI_ASCII: &str = "dxgi.dll\0";

/// Null-terminated ASCII `d3d11.dll` library name for `LoadLibraryA`.
pub(crate) const WIN32_DLL_D3D11_ASCII: &str = "d3d11.dll\0";

/// Null-terminated ASCII `d3dcompiler_47.dll` library name for `LoadLibraryA`.
pub(crate) const WIN32_DLL_D3DCOMPILER_ASCII: &str = "d3dcompiler_47.dll\0";

/// Null-terminated ASCII symbol name for `D3D11CreateDevice`.
pub(crate) const WIN32_SYM_D3D11_CREATE_DEVICE: &str = "D3D11CreateDevice\0";

/// Null-terminated ASCII symbol name for `D3DCompile`.
pub(crate) const WIN32_SYM_D3D_COMPILE: &str = "D3DCompile\0";

/// Null-terminated HLSL vertex shader entry point matching `HLSL_UI_SHADER`.
pub(crate) const WIN32_HLSL_ENTRY_VS: &str = "VSMain\0";

/// Null-terminated HLSL pixel shader entry point matching `HLSL_UI_SHADER`.
pub(crate) const WIN32_HLSL_ENTRY_PS: &str = "PSMain\0";

/// Null-terminated HLSL shader model 5.0 vertex profile.
pub(crate) const WIN32_HLSL_TARGET_VS: &str = "vs_5_0\0";

/// Null-terminated HLSL shader model 5.0 pixel profile.
pub(crate) const WIN32_HLSL_TARGET_PS: &str = "ps_5_0\0";

/// `DXGI_FORMAT_UNKNOWN` (`0`) for structured buffer SRVs.
pub(crate) const DXGI_FORMAT_UNKNOWN: u32 = 0;

/// `DXGI_FORMAT_R8G8B8A8_UNORM` (`28`) for swapchain backbuffers and RGBA8 textures.
pub(crate) const DXGI_FORMAT_R8G8B8A8_UNORM: u32 = 28;

/// `DXGI_FORMAT_R8_UNORM` (`61`) for monochrome R8 glyph atlases.
pub(crate) const DXGI_FORMAT_R8_UNORM: u32 = 61;

/// `DXGI_USAGE_RENDER_TARGET_OUTPUT` (`0x20`).
pub(crate) const DXGI_USAGE_RENDER_TARGET_OUTPUT: u32 = 0x0020;

/// `DXGI_SWAP_EFFECT_FLIP_DISCARD` (`4`) for modern DXGI 1.6 flip-model presentation.
pub(crate) const DXGI_SWAP_EFFECT_FLIP_DISCARD: u32 = 4;

/// `DXGI_SCALING_NONE` (`1`) preserving exact 1:1 physical pixels without DWM stretch.
pub(crate) const DXGI_SCALING_NONE: u32 = 1;

/// `DXGI_ALPHA_MODE_IGNORE` (`3`).
pub(crate) const DXGI_ALPHA_MODE_IGNORE: u32 = 3;

/// `D3D_DRIVER_TYPE_HARDWARE` (`1`).
pub(crate) const D3D_DRIVER_TYPE_HARDWARE: u32 = 1;

/// `D3D_FEATURE_LEVEL_11_0` (`0xB000`).
pub(crate) const D3D_FEATURE_LEVEL_11_0: u32 = 0xB000;

/// `D3D11_SDK_VERSION` (`7`).
pub(crate) const D3D11_SDK_VERSION: u32 = 7;

/// `D3D11_USAGE_DEFAULT` (`0`).
pub(crate) const D3D11_USAGE_DEFAULT: u32 = 0;

/// `D3D11_USAGE_DYNAMIC` (`2`).
pub(crate) const D3D11_USAGE_DYNAMIC: u32 = 2;

/// `D3D11_BIND_CONSTANT_BUFFER` (`0x0004`).
pub(crate) const D3D11_BIND_CONSTANT_BUFFER: u32 = 0x0004;

/// `D3D11_BIND_SHADER_RESOURCE` (`0x0008`).
pub(crate) const D3D11_BIND_SHADER_RESOURCE: u32 = 0x0008;

/// `D3D11_CPU_ACCESS_WRITE` (`0x0001_0000`).
pub(crate) const D3D11_CPU_ACCESS_WRITE: u32 = 0x0001_0000;

/// `D3D11_RESOURCE_MISC_BUFFER_STRUCTURED` (`0x0040`).
pub(crate) const D3D11_RESOURCE_MISC_BUFFER_STRUCTURED: u32 = 0x0040;

/// `D3D11_MAP_WRITE_DISCARD` (`4`).
pub(crate) const D3D11_MAP_WRITE_DISCARD: u32 = 4;

/// `D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST` (`4`).
pub(crate) const D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST: u32 = 4;

/// `D3D11_SRV_DIMENSION_BUFFER` (`1`).
pub(crate) const D3D11_SRV_DIMENSION_BUFFER: u32 = 1;

/// `D3D11_SRV_DIMENSION_TEXTURE2D` (`4`).
pub(crate) const D3D11_SRV_DIMENSION_TEXTURE2D: u32 = 4;

/// `D3D11_FILL_SOLID` (`3`).
pub(crate) const D3D11_FILL_SOLID: u32 = 3;

/// `D3D11_CULL_NONE` (`1`).
pub(crate) const D3D11_CULL_NONE: u32 = 1;

/// `D3D11_BLEND_ONE` (`2`).
pub(crate) const D3D11_BLEND_ONE: u32 = 2;

/// `D3D11_BLEND_SRC_ALPHA` (`5`).
pub(crate) const D3D11_BLEND_SRC_ALPHA: u32 = 5;

/// `D3D11_BLEND_INV_SRC_ALPHA` (`6`).
pub(crate) const D3D11_BLEND_INV_SRC_ALPHA: u32 = 6;

/// `D3D11_BLEND_OP_ADD` (`1`).
pub(crate) const D3D11_BLEND_OP_ADD: u32 = 1;

/// `D3D11_COLOR_WRITE_ENABLE_ALL` (`0x0F`).
pub(crate) const D3D11_COLOR_WRITE_ENABLE_ALL: u8 = 0x0F;

/// `D3D11_FILTER_MIN_MAG_MIP_LINEAR` (`0x15`).
pub(crate) const D3D11_FILTER_MIN_MAG_MIP_LINEAR: u32 = 0x15;

/// `D3D11_TEXTURE_ADDRESS_CLAMP` (`3`).
pub(crate) const D3D11_TEXTURE_ADDRESS_CLAMP: u32 = 3;

/// `D3D11_COMPARISON_NEVER` (`1`).
pub(crate) const D3D11_COMPARISON_NEVER: u32 = 1;

/// COM IID for `IDXGIFactory2` (`{50c83a1c-e072-4c48-87b0-3630fa36a6d0}`).
pub(crate) const IID_IDXGI_FACTORY2: [u8; 16] = [
    0x1C, 0x3A, 0xC8, 0x50, 0x72, 0xE0, 0x48, 0x4C, 0x87, 0xB0, 0x36, 0x30, 0xFA, 0x36, 0xA6, 0xD0,
];

/// COM IID for `IDXGISwapChain2` (`{a8be2ac4-199f-4946-b331-79599fb98de7}`).
pub(crate) const IID_IDXGI_SWAP_CHAIN2: [u8; 16] = [
    0xC4, 0x2A, 0xBE, 0xA8, 0x9F, 0x19, 0x46, 0x49, 0xB3, 0x31, 0x79, 0x59, 0x9F, 0xB9, 0x8D, 0xE7,
];

/// COM IID for `ID3D11Texture2D` (`{6f15aaf2-d208-4e89-9ab4-489535d34f9c}`).
pub(crate) const IID_ID3D11_TEXTURE2D: [u8; 16] = [
    0xF2, 0xAA, 0x15, 0x6F, 0x08, 0xD2, 0x89, 0x4E, 0x9A, 0xB4, 0x48, 0x95, 0x35, 0xD3, 0x4F, 0x9C,
];

/// Error text emitted when Windows D3D11/DXGI direct GPU presentation cannot be initialized.
pub(crate) const ERR_WIN32_D3D11_PRESENT: &str =
    "Windows D3D11/DXGI direct GPU presentation unavailable";

/// Error message when `CreateWindowExW` returns a null `HWND`.
pub(crate) const ERR_WIN32_CREATE_WINDOW: &str = "CreateWindowExW returned null HWND";

/// Error message when native DXGI/D3D11 direct GPU swapchain presentation is requested without DXGI availability.
pub(crate) const ERR_WIN32_DXGI_UNAVAILABLE: &str =
    "Windows direct GPU presentation requires DXGI swapchain availability and live HWND";

/// Error message when GDI software presentation lacks a valid `HWND` or device context (`HDC`).
pub(crate) const ERR_WIN32_GDI_SURFACE_MISSING: &str =
    "Windows GDI software presentation requires a live HWND and device context";