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§
- Message
Header - Wayland message header (8 bytes on the wire)
- Wayland
Message - A fully parsed Wayland protocol message.
Enums§
- Argument
- Typed argument in a Wayland message.
- Wayland
Error - 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
WaylandMessageinto its wire-protocol byte representation.