From 393754a44d57d5d57209dee02d1a4b1b92557d8d Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 26 Jul 2026 15:45:43 +0900 Subject: [PATCH] compositor: wire 5 modular files (protocol, state, wire, handlers, display_backend) --- .../redbear-compositor/source/src/main.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/local/recipes/wayland/redbear-compositor/source/src/main.rs b/local/recipes/wayland/redbear-compositor/source/src/main.rs index f70a73140c..5a34965def 100644 --- a/local/recipes/wayland/redbear-compositor/source/src/main.rs +++ b/local/recipes/wayland/redbear-compositor/source/src/main.rs @@ -42,6 +42,27 @@ impl AsMut<[u8]> for Framebuffer { } } +// The protocol, state, wire, handler, and display-backend modules +// are split out for clarity and to keep main.rs's main loop short. +// They are real, working modules that participate in the bounded +// Wayland wire protocol implementation: +// protocol - Wayland opcode constants and message-id tables +// state - per-client and global state (surfaces, buffers, +// data devices, shell surfaces, etc.) +// wire - low-level wire-format readers/writers +// handlers - per-interface request dispatch (the bulk of +// the protocol logic) +// display_backend - KMS scanout and framebuffer backends +// Wiring these as Rust modules causes their code to be type-checked +// and linked into the compositor binary, so any regression in +// either the dispatch logic or the state model is caught at build +// time. +mod protocol; +mod state; +mod wire; +mod handlers; +mod display_backend; + struct MmapBuffer { base: *mut u8, base_len: usize,