euv-core 0.48.3

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
/// Wayland `wl_shm` 32-bit ARGB8888 pixel format code (little-endian `[B, G, R, A]`).
pub const WL_SHM_FORMAT_ARGB8888: u32 = 0;

/// Wayland `wl_shm` 32-bit XRGB8888 pixel format code (little-endian `[B, G, R, 0xFF]`).
pub const WL_SHM_FORMAT_XRGB8888: u32 = 1;

/// Shared library name for Linux X11 client runtime.
pub(crate) const LINUX_LIB_X11: &str = "libX11.so.6\0";

/// Shared library name for Linux Wayland client runtime.
pub(crate) const LINUX_LIB_WAYLAND: &str = "libwayland-client.so.0\0";

/// Shared library name for Linux XRandR extension runtime.
pub(crate) const LINUX_LIB_XRANDR: &str = "libXrandr.so.2\0";

/// Shared library name for Linux MIT-SHM Xext extension runtime.
pub(crate) const LINUX_LIB_XEXT: &str = "libXext.so.6\0";

/// Shared library name for Linux Vulkan loader (probed for `VK_KHR_wayland_surface` WSI).
pub(crate) const LINUX_LIB_VULKAN: &str = "libvulkan.so.1\0";

/// Environment variable detecting an active native Wayland compositor socket.
pub(crate) const LINUX_WAYLAND_DISPLAY_ENV: &str = "WAYLAND_DISPLAY";

/// Optional environment variable forcing legacy X11 over native Wayland when set to `"1"`.
pub(crate) const LINUX_FORCE_X11_ENV: &str = "EUV_LINUX_FORCE_X11";

/// Dynamic symbol for `XShmQueryExtension`.
pub(crate) const SYM_XSHM_QUERY_EXTENSION: &str = "XShmQueryExtension\0";

/// Dynamic symbol for `XShmCreateImage`.
pub(crate) const SYM_XSHM_CREATE_IMAGE: &str = "XShmCreateImage\0";

/// Dynamic symbol for `XShmAttach`.
pub(crate) const SYM_XSHM_ATTACH: &str = "XShmAttach\0";

/// Dynamic symbol for `XShmDetach`.
pub(crate) const SYM_XSHM_DETACH: &str = "XShmDetach\0";

/// Dynamic symbol for `XShmPutImage`.
pub(crate) const SYM_XSHM_PUT_IMAGE: &str = "XShmPutImage\0";

/// Dynamic symbol for `wl_display_dispatch_pending`.
pub(crate) const SYM_WL_DISPLAY_DISPATCH_PENDING: &str = "wl_display_dispatch_pending\0";

/// Dynamic symbol for `wl_display_dispatch`.
pub(crate) const SYM_WL_DISPLAY_DISPATCH: &str = "wl_display_dispatch\0";

/// Dynamic symbol for `wl_display_flush`.
pub(crate) const SYM_WL_DISPLAY_FLUSH: &str = "wl_display_flush\0";

/// Dynamic symbol for `wl_display_roundtrip`.
pub(crate) const SYM_WL_DISPLAY_ROUNDTRIP: &str = "wl_display_roundtrip\0";

/// Dynamic symbol for `wl_display_disconnect`.
pub(crate) const SYM_WL_DISPLAY_DISCONNECT: &str = "wl_display_disconnect\0";

/// Dynamic symbol for `vkCreateWaylandSurfaceKHR` in `libvulkan.so.1`.
pub(crate) const SYM_VK_CREATE_WAYLAND_SURFACE: &str = "vkCreateWaylandSurfaceKHR\0";

/// Dynamic symbol for `XRRGetScreenInfo`.
pub(crate) const SYM_XRR_GET_SCREEN_INFO: &str = "XRRGetScreenInfo\0";

/// Dynamic symbol for `XRRConfigCurrentRate`.
pub(crate) const SYM_XRR_CONFIG_CURRENT_RATE: &str = "XRRConfigCurrentRate\0";

/// Dynamic symbol for `XRRFreeScreenConfigInfo`.
pub(crate) const SYM_XRR_FREE_SCREEN_CONFIG_INFO: &str = "XRRFreeScreenConfigInfo\0";

/// Environment variable overriding detected display refresh rate in Hertz on Linux.
pub(crate) const LINUX_REFRESH_ENV_VAR: &str = "EUV_REFRESH_RATE_HZ";

/// Dynamic symbol for `XOpenDisplay`.
pub(crate) const SYM_X_OPEN_DISPLAY: &str = "XOpenDisplay\0";

/// Dynamic symbol for `XDefaultScreen`.
pub(crate) const SYM_X_DEFAULT_SCREEN: &str = "XDefaultScreen\0";

/// Dynamic symbol for `XRootWindow`.
pub(crate) const SYM_X_ROOT_WINDOW: &str = "XRootWindow\0";

/// Dynamic symbol for `XCreateSimpleWindow`.
pub(crate) const SYM_X_CREATE_SIMPLE_WINDOW: &str = "XCreateSimpleWindow\0";

/// Dynamic symbol for `XStoreName`.
pub(crate) const SYM_X_STORE_NAME: &str = "XStoreName\0";

/// Dynamic symbol for `XMapWindow`.
pub(crate) const SYM_X_MAP_WINDOW: &str = "XMapWindow\0";

/// Dynamic symbol for `XResizeWindow`.
pub(crate) const SYM_X_RESIZE_WINDOW: &str = "XResizeWindow\0";

/// Dynamic symbol for `XDestroyWindow`.
pub(crate) const SYM_X_DESTROY_WINDOW: &str = "XDestroyWindow\0";

/// Dynamic symbol for `XFlush`.
pub(crate) const SYM_X_FLUSH: &str = "XFlush\0";

/// Dynamic symbol for `XDefaultGC`.
pub(crate) const SYM_X_DEFAULT_GC: &str = "XDefaultGC\0";

/// Dynamic symbol for `XDefaultVisual`.
pub(crate) const SYM_X_DEFAULT_VISUAL: &str = "XDefaultVisual\0";

/// Dynamic symbol for `XDefaultDepth`.
pub(crate) const SYM_X_DEFAULT_DEPTH: &str = "XDefaultDepth\0";

/// Dynamic symbol for `XCreateImage`.
pub(crate) const SYM_X_CREATE_IMAGE: &str = "XCreateImage\0";

/// Dynamic symbol for `XPutImage`.
pub(crate) const SYM_X_PUT_IMAGE: &str = "XPutImage\0";

/// Dynamic symbol for `XFree`.
pub(crate) const SYM_X_FREE: &str = "XFree\0";

/// Dynamic symbol for `XSelectInput`.
pub(crate) const SYM_X_SELECT_INPUT: &str = "XSelectInput\0";

/// Dynamic symbol for `XInternAtom`.
pub(crate) const SYM_X_INTERN_ATOM: &str = "XInternAtom\0";

/// Dynamic symbol for `XSetWMProtocols`.
pub(crate) const SYM_X_SET_WM_PROTOCOLS: &str = "XSetWMProtocols\0";

/// Dynamic symbol for `XPending`.
pub(crate) const SYM_X_PENDING: &str = "XPending\0";

/// Dynamic symbol for `XNextEvent`.
pub(crate) const SYM_X_NEXT_EVENT: &str = "XNextEvent\0";

/// Dynamic symbol for `XLookupString`.
pub(crate) const SYM_X_LOOKUP_STRING: &str = "XLookupString\0";

/// Dynamic symbol for `XResourceManagerString`.
pub(crate) const SYM_X_RESOURCE_MANAGER_STRING: &str = "XResourceManagerString\0";

/// Dynamic symbol for `wl_display_connect`.
pub(crate) const SYM_WL_DISPLAY_CONNECT: &str = "wl_display_connect\0";

/// ICCCM atom name for window manager close requests.
pub(crate) const ATOM_WM_DELETE_WINDOW: &str = "WM_DELETE_WINDOW\0";

/// Environment variable names inspected for HiDPI scale overrides on Linux.
pub(crate) const LINUX_DPI_ENV_VARS: [&str; 3] =
    ["EUV_SCALE_FACTOR", "GDK_SCALE", "QT_SCALE_FACTOR"];

/// Xrdb resource key specifying logical DPI on Linux X11 desktops.
pub(crate) const XFT_DPI_PREFIX: &str = "Xft.dpi:";

/// Standard 96 DPI baseline for X11 scale conversion.
pub(crate) const X11_DEFAULT_DPI: f32 = 96.0;

/// POSIX `RTLD_LAZY` flag for `dlopen`.
pub(crate) const RTLD_LAZY: i32 = 1;

/// X11 `ZPixmap` image format identifier.
pub(crate) const X11_Z_PIXMAP: i32 = 2;

/// Combined X11 input mask (`KeyPress | KeyRelease | ButtonPress | ButtonRelease | PointerMotion | Exposure | VisibilityChange | StructureNotify | FocusChange`).
pub(crate) const X11_EVENT_MASK: isize = 0x0023_804F;

/// X11 `KeyPress` event type.
pub(crate) const X11_KEY_PRESS: i32 = 2;

/// X11 `KeyRelease` event type.
pub(crate) const X11_KEY_RELEASE: i32 = 3;

/// X11 `ButtonPress` event type.
pub(crate) const X11_BUTTON_PRESS: i32 = 4;

/// X11 `ButtonRelease` event type.
pub(crate) const X11_BUTTON_RELEASE: i32 = 5;

/// X11 `MotionNotify` event type.
pub(crate) const X11_MOTION_NOTIFY: i32 = 6;

/// X11 `FocusIn` event type.
pub(crate) const X11_FOCUS_IN: i32 = 9;

/// X11 `FocusOut` event type.
pub(crate) const X11_FOCUS_OUT: i32 = 10;

/// X11 `Expose` event type.
pub(crate) const X11_EXPOSE: i32 = 12;

/// X11 `DestroyNotify` event type.
pub(crate) const X11_DESTROY_NOTIFY: i32 = 17;

/// X11 `UnmapNotify` event type.
pub(crate) const X11_UNMAP_NOTIFY: i32 = 18;

/// X11 `MapNotify` event type.
pub(crate) const X11_MAP_NOTIFY: i32 = 19;

/// X11 `ConfigureNotify` event type.
pub(crate) const X11_CONFIGURE_NOTIFY: i32 = 22;

/// X11 `ClientMessage` event type.
pub(crate) const X11_CLIENT_MESSAGE: i32 = 33;

/// X11 modifier mask for Shift.
pub(crate) const X11_SHIFT_MASK: u32 = 1;

/// X11 modifier mask for Control.
pub(crate) const X11_CTRL_MASK: u32 = 4;

/// X11 modifier mask for Alt (`Mod1`).
pub(crate) const X11_ALT_MASK: u32 = 8;

/// X11 modifier mask for Super/Meta (`Mod4`).
pub(crate) const X11_META_MASK: u32 = 64;

/// Error message when neither Wayland nor X11 display server is reachable.
pub(crate) const ERR_LINUX_NO_DISPLAY: &str = "neither X11 nor Wayland display server available";

/// Dynamic symbol for `wl_display_get_error`.
pub(crate) const SYM_WL_DISPLAY_GET_ERROR: &str = "wl_display_get_error\0";

/// Dynamic symbol for `wl_proxy_marshal_flags`.
pub(crate) const SYM_WL_PROXY_MARSHAL_FLAGS: &str = "wl_proxy_marshal_flags\0";

/// Dynamic symbol for `wl_proxy_add_listener`.
pub(crate) const SYM_WL_PROXY_ADD_LISTENER: &str = "wl_proxy_add_listener\0";

/// Dynamic symbol for `wl_proxy_destroy`.
pub(crate) const SYM_WL_PROXY_DESTROY: &str = "wl_proxy_destroy\0";

/// Dynamic symbol for `wl_proxy_get_version`.
pub(crate) const SYM_WL_PROXY_GET_VERSION: &str = "wl_proxy_get_version\0";

/// Exported Wayland protocol descriptor symbol for `wl_registry_interface`.
pub(crate) const SYM_WL_REGISTRY_INTERFACE: &str = "wl_registry_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_compositor_interface`.
pub(crate) const SYM_WL_COMPOSITOR_INTERFACE: &str = "wl_compositor_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_surface_interface`.
pub(crate) const SYM_WL_SURFACE_INTERFACE: &str = "wl_surface_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_shm_interface`.
pub(crate) const SYM_WL_SHM_INTERFACE: &str = "wl_shm_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_shm_pool_interface`.
pub(crate) const SYM_WL_SHM_POOL_INTERFACE: &str = "wl_shm_pool_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_buffer_interface`.
pub(crate) const SYM_WL_BUFFER_INTERFACE: &str = "wl_buffer_interface\0";

/// Dynamic symbol for `vkCreateXlibSurfaceKHR` in `libvulkan.so.1`.
pub(crate) const SYM_VK_CREATE_XLIB_SURFACE: &str = "vkCreateXlibSurfaceKHR\0";

/// Dynamic libc symbol for anonymous Linux shared memory (`memfd_create`).
pub(crate) const SYM_MEMFD_CREATE: &str = "memfd_create\0";

/// Wayland registry global interface name for `wl_compositor`.
pub(crate) const WL_IFACE_COMPOSITOR: &str = "wl_compositor";

/// Wayland registry global interface name for `wl_shm`.
pub(crate) const WL_IFACE_SHM: &str = "wl_shm";

/// Anonymous `memfd_create` buffer name for Wayland software presentation.
pub(crate) const WL_MEMFD_NAME: &str = "euv-wayland-shm\0";

/// Fallback `/dev/shm` directory prefix when `memfd_create` is unavailable.
pub(crate) const LINUX_DEV_SHM_PREFIX: &str = "/dev/shm/euv-wl-shm";

/// Wayland `wl_display.get_registry` request opcode.
pub(crate) const WL_OPCODE_DISPLAY_GET_REGISTRY: u32 = 1;

/// Wayland `wl_registry.bind` request opcode.
pub(crate) const WL_OPCODE_REGISTRY_BIND: u32 = 0;

/// Wayland `wl_compositor.create_surface` request opcode.
pub(crate) const WL_OPCODE_COMPOSITOR_CREATE_SURFACE: u32 = 0;

/// Wayland `wl_shm.create_pool` request opcode.
pub(crate) const WL_OPCODE_SHM_CREATE_POOL: u32 = 0;

/// Wayland `wl_shm_pool.create_buffer` request opcode.
pub(crate) const WL_OPCODE_SHM_POOL_CREATE_BUFFER: u32 = 0;

/// Wayland `wl_shm_pool.destroy` request opcode.
pub(crate) const WL_OPCODE_SHM_POOL_DESTROY: u32 = 1;

/// Wayland `wl_buffer.destroy` request opcode.
pub(crate) const WL_OPCODE_BUFFER_DESTROY: u32 = 0;

/// Wayland `wl_surface.attach` request opcode.
pub(crate) const WL_OPCODE_SURFACE_ATTACH: u32 = 1;

/// Wayland `wl_surface.damage` request opcode (surface version < 4 fallback).
pub(crate) const WL_OPCODE_SURFACE_DAMAGE: u32 = 2;

/// Wayland `wl_surface.commit` request opcode.
pub(crate) const WL_OPCODE_SURFACE_COMMIT: u32 = 6;

/// Wayland `wl_surface.damage_buffer` request opcode (surface version >= 4).
pub(crate) const WL_OPCODE_SURFACE_DAMAGE_BUFFER: u32 = 9;

/// Wayland `WL_MARSHAL_FLAG_DESTROY` flag destroying a client proxy on marshal.
pub(crate) const WL_MARSHAL_FLAG_DESTROY: u32 = 1;

/// Maximum `wl_compositor` protocol version bound for `wl_surface.damage_buffer` support.
pub(crate) const WL_COMPOSITOR_MAX_VERSION: u32 = 4;

/// Maximum `wl_shm` protocol version bound for software pool creation.
pub(crate) const WL_SHM_MAX_VERSION: u32 = 1;

/// POSIX `PROT_READ | PROT_WRITE` protection mask for `mmap`.
pub(crate) const LINUX_MMAP_PROT_RW: i32 = 3;

/// POSIX `MAP_SHARED` flag for `mmap`.
pub(crate) const LINUX_MMAP_SHARED: i32 = 1;

/// Linux `MFD_CLOEXEC` flag for `memfd_create`.
pub(crate) const LINUX_MFD_CLOEXEC: u32 = 1;

/// POSIX `O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC` open flags on Linux (`2 | 64 | 128 | 524288`).
pub(crate) const LINUX_SHM_OPEN_FLAGS: i32 = 524_482;

/// POSIX file mode `0o600` for fallback `/dev/shm` files.
pub(crate) const LINUX_SHM_FILE_MODE: u32 = 0o600;

/// Number of double-buffered Wayland `wl_shm` slots per window.
pub(crate) const WL_SHM_SLOT_COUNT: usize = 2;

/// Error message when Wayland software presentation lacks a live display, surface, or `wl_shm` global.
pub(crate) const ERR_LINUX_WL_SURFACE_MISSING: &str =
    "wayland software presentation missing wl_display, wl_surface, or wl_shm";

/// Error message when POSIX shared-memory allocation (`memfd_create` / `mmap`) fails.
pub(crate) const ERR_LINUX_WL_SHM_ALLOC: &str = "failed to allocate Wayland wl_shm memory mapping";

/// Error message when `wl_shm_pool` or `wl_buffer` creation fails.
pub(crate) const ERR_LINUX_WL_BUFFER_CREATE: &str =
    "failed to create Wayland wl_shm_pool or wl_buffer";

/// Error message when all double-buffered Wayland shm slots are still busy awaiting `wl_buffer.release`.
pub(crate) const ERR_LINUX_WL_NO_FREE_BUFFER: &str =
    "no free Wayland wl_shm buffer slot available (all buffers busy)";

/// Error message when `wl_display_flush` or `wl_display_get_error` reports a compositor failure.
pub(crate) const ERR_LINUX_WL_DISPLAY_FLUSH: &str =
    "wayland surface commit or wl_display_flush failed";

/// Error message when framebuffer pixel dimensions or backing slice are invalid for presentation.
pub(crate) const ERR_LINUX_INVALID_FRAMEBUFFER: &str =
    "invalid framebuffer dimensions or truncated pixel buffer";

/// Error message when X11 presentation lacks a valid `Display*`, `Window`, `GC`, or `Visual*`.
pub(crate) const ERR_LINUX_X11_SURFACE_MISSING: &str =
    "X11 presentation missing Display, Window, GC, Visual, or XPutImage symbols";

/// Error message when direct GPU presentation is requested without available Vulkan WSI surface support.
pub(crate) const ERR_LINUX_GPU_DIRECT_UNAVAILABLE: &str =
    "Linux direct GPU presentation requires active Vulkan WSI surface support";