From 5558e3509d020a0e021a77f0617044497b2f2aee Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 17 Aug 2026 18:56:04 +0200 Subject: Windowed GUI: wm module, input routing, and the paint app - Add the wm window-manager facility per ADR 0004: overlapping pixel-surface windows, damage-rectangle compositing, WM-drawn title bar, focus/minimize/close, and F1-F4 keybindings - Add gop shadow compositing primitives and vt::repaint_region so the console stays layer 0 beneath windows - Route mouse (absolute coords, press/release edges) and keyboard (focus-aware input pump) to the focused window - Add the rspaint drawing-program crate (pen, 8 colors, clear) and shell draw/windows/restore commands - Extend TaskMsg with AppMouse/Focus/Close and document the design in CONTEXT.md + ADR 0004 --- rsnix/src/ps2.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'rsnix/src/ps2.rs') diff --git a/rsnix/src/ps2.rs b/rsnix/src/ps2.rs index 965e4a0..cac476f 100644 --- a/rsnix/src/ps2.rs +++ b/rsnix/src/ps2.rs @@ -463,6 +463,26 @@ pub struct MouseEvent { pub middle: bool, } +/// What happened in a window-relative (GUI) mouse event. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum MouseKind { + Move, + Press, + Release, +} + +/// A mouse event delivered to a focused GUI window: absolute coordinates +/// relative to the window's content top-left, the current button bitmask, +/// and the action (move / press / release). Unlike `MouseEvent` (relative +/// deltas), this is what an app's drawing loop consumes. +#[derive(Clone, Copy, Debug)] +pub struct AppMouseEvent { + pub x: i32, + pub y: i32, + pub buttons: u8, + pub kind: MouseKind, +} + /// Packet assembly state — lives in main context (consumer side), fed by /// the raw byte ring that the IRQ12 handler fills. struct MouseState { -- cgit v1.2.3