⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module protocol

Module protocol 

Source
Expand description

Wayland Wire Protocol Parser/Serializer

Implements the Wayland wire protocol message format for kernel-side protocol handling. Messages use a fixed header followed by typed arguments.

Wire format: [object_id: u32][size_opcode: u32][arguments...]

  • size = upper 16 bits of second word (total message size in bytes)
  • opcode = lower 16 bits of second word

Constants and error variants define the complete Wayland core protocol surface area. Items not yet wired into dispatch are retained for protocol completeness.

Structs§

MessageHeader
Wayland message header (8 bytes on the wire)
WaylandMessage
A fully parsed Wayland protocol message.

Enums§

Argument
Typed argument in a Wayland message.
WaylandError
Wayland protocol-specific error

Constants§

WL_COMPOSITOR_CREATE_REGION
create_region
WL_COMPOSITOR_CREATE_SURFACE
create_surface
WL_DISPLAY_DELETE_ID
Server events: delete_id
WL_DISPLAY_ERROR
Server events: error
WL_DISPLAY_GET_REGISTRY
Client requests: get_registry
WL_DISPLAY_ID
wl_display interface – object ID 1 is always the display
WL_DISPLAY_SYNC
Client requests: sync
WL_REGISTRY_BIND
Client binds a global
WL_REGISTRY_GLOBAL
Registry announces a global
WL_REGISTRY_GLOBAL_REMOVE
Registry removes a global
WL_SHM_CREATE_POOL
create_pool
WL_SHM_FORMAT
format announcement
WL_SHM_FORMAT_ARGB8888
ARGB8888 format code
WL_SHM_FORMAT_XRGB8888
XRGB8888 format code
WL_SHM_POOL_CREATE_BUFFER
create_buffer
WL_SHM_POOL_DESTROY
destroy
WL_SURFACE_ATTACH
attach
WL_SURFACE_COMMIT
commit
WL_SURFACE_DAMAGE
damage
WL_SURFACE_DESTROY
destroy
WL_SURFACE_ENTER
enter output
WL_SURFACE_FRAME
frame

Functions§

build_callback_done
Build a wl_callback.done event (for sync and frame callbacks).
build_display_delete_id
Build a wl_display.delete_id event.
build_display_error
Build a wl_display.error event.
build_registry_global
Build a wl_registry.global event.
build_shm_format
Build a wl_shm.format event.
parse_args
Parse a typed argument list from raw payload bytes according to a format string where each character describes one argument: i = Int, u = Uint, f = Fixed, s = String, o = Object, n = NewId, a = Array, h = Fd
parse_message
Parse a single Wayland wire-protocol message from the front of data.
serialize_message
Serialize a WaylandMessage into its wire-protocol byte representation.