docs / architecture
gru · 0.7.0
Architecture
Core model for the public engine. Full chapters are on GitHub; this page is the map.
Core model
- Retained mode · widgets live in a
Nodetree across frames. Mutate them; do not rebuild the tree every paint. - Phases · each frame is strictly
Update→Layout(if dirty) →Draw. Do not layout from draw. - Document · owns
Root, logical size, chrome insets, focus, andQueueMain/DrainQueue. - Dirty flags · layout and redraw run when needed; clean frames blit the last supersampled frame.
- Signals · typical UI state is
Signal[T]; writes mark dependents dirty. - Chrome · undecorated window + engine
TitleBar; content sits belowChromeTop.
Frame loop
DrainQueue
Update (title bar + Root)
Layout if Root dirty
Draw into SSAA if NeedsRedraw, else blit cache
Present + overlays
[WebView: sync hosts after Layout; present after EndDrawing]
Chapter map
| # | Chapter | Contents |
|---|---|---|
| 1 | overview | Retained mode, frame loop, dirty flags, Document |
| 2 | window-chrome | Undecorated window, TitleBar, drag, double-click, DWM |
| 3 | layout | Chrome insets, flex, Viewport vs fill-height |
| 4 | rendering | SSAA, overlay render targets, idle / wake |
| 5 | webview | HWND vs GL (see also WebView guide) |
| 6 | input-focus | Pointer routing, overlays, WebView focus handoff |
Index: docs/architecture/README.md.
Next: Composition · Widgets · Start