euv-core 0.48.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
use super::*;

/// Low-level Wayland `wl_shm` / `wl_surface` commit transport enabling both native `libwayland-client` calls and deterministic unit tests.
pub trait WaylandShmCommitOps {
    /// Creates a `wl_shm_pool` and `wl_buffer` described by `desc`, attaching the compositor release callback.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Mutable Wayland transport.
    /// - `WaylandShmBufferDescriptor` - Shared-memory descriptor with FD, geometry, format, and release flag pointer.
    ///
    /// # Returns
    ///
    /// - `Result<(usize, usize), PlatformError>` - `(wl_shm_pool*, wl_buffer*)` handles on success.
    fn create_pool_and_buffer(
        &mut self,
        desc: WaylandShmBufferDescriptor,
    ) -> Result<(usize, usize), PlatformError>;

    /// Attaches `buffer`, marks every damaged sub-rectangle via `wl_surface_damage_buffer`, commits the surface, and flushes `wl_display`.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Mutable Wayland transport.
    /// - `usize` - Native `wl_buffer*` handle to attach.
    /// - `&[(i32, i32, i32, i32)]` - Non-empty list of `(x, y, width, height)` buffer-space damage rectangles.
    ///
    /// # Returns
    ///
    /// - `Result<(), PlatformError>` - `Ok(())` only when attach, damage, commit, and `wl_display_flush` all succeeded.
    fn attach_damage_commit_flush(
        &mut self,
        buffer: usize,
        damage_rects: &[(i32, i32, i32, i32)],
    ) -> Result<(), PlatformError>;

    /// Dispatches any pending incoming Wayland events (such as `wl_buffer.release`) without blocking.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Mutable Wayland transport.
    ///
    /// # Returns
    ///
    /// - `Result<(), PlatformError>` - `Err` when the Wayland display connection has a protocol or I/O error.
    fn dispatch_pending(&mut self) -> Result<(), PlatformError>;

    /// Destroys a previously created `(wl_shm_pool*, wl_buffer*)` pair.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Mutable Wayland transport.
    /// - `usize` - Native `wl_shm_pool*` handle (`0` if none).
    /// - `usize` - Native `wl_buffer*` handle (`0` if none).
    fn destroy_pool_and_buffer(&mut self, pool: usize, buffer: usize);
}