diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-17 18:56:04 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-17 18:56:04 +0200 |
| commit | 5558e3509d020a0e021a77f0617044497b2f2aee (patch) | |
| tree | cd7b6cee9f7c327f9fae7ad9ac27602d1a97b222 /rsnix/src/ps2.rs | |
| parent | USB2/1.1 (EHCI/UHCI) drivers + real-hardware bring-up hardening (diff) | |
| download | rs-dos-5558e3509d020a0e021a77f0617044497b2f2aee.tar.gz rs-dos-5558e3509d020a0e021a77f0617044497b2f2aee.zip | |
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
Diffstat (limited to 'rsnix/src/ps2.rs')
| -rw-r--r-- | rsnix/src/ps2.rs | 20 |
1 files changed, 20 insertions, 0 deletions
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 { | |||
| 463 | pub middle: bool, | 463 | pub middle: bool, |
| 464 | } | 464 | } |
| 465 | 465 | ||
| 466 | /// What happened in a window-relative (GUI) mouse event. | ||
| 467 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| 468 | pub enum MouseKind { | ||
| 469 | Move, | ||
| 470 | Press, | ||
| 471 | Release, | ||
| 472 | } | ||
| 473 | |||
| 474 | /// A mouse event delivered to a focused GUI window: absolute coordinates | ||
| 475 | /// relative to the window's content top-left, the current button bitmask, | ||
| 476 | /// and the action (move / press / release). Unlike `MouseEvent` (relative | ||
| 477 | /// deltas), this is what an app's drawing loop consumes. | ||
| 478 | #[derive(Clone, Copy, Debug)] | ||
| 479 | pub struct AppMouseEvent { | ||
| 480 | pub x: i32, | ||
| 481 | pub y: i32, | ||
| 482 | pub buttons: u8, | ||
| 483 | pub kind: MouseKind, | ||
| 484 | } | ||
| 485 | |||
| 466 | /// Packet assembly state — lives in main context (consumer side), fed by | 486 | /// Packet assembly state — lives in main context (consumer side), fed by |
| 467 | /// the raw byte ring that the IRQ12 handler fills. | 487 | /// the raw byte ring that the IRQ12 handler fills. |
| 468 | struct MouseState { | 488 | struct MouseState { |
