|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
GUILLAUME follows Material 3 as implemented by react-native-paper v5. Every visual decision an entity makes — color, typography, shape, elevation, state feedback, motion, spacing — is read from the active Theme instead of being hardcoded. Changing a token changes every consumer.
The audit that motivated this layer is docs/audit/09-paper-parity.md.
Scheme holds one ExtendedColor per SchemeColorRole. All six schemes (Light, Dark and their medium/high-contrast variants) populate every role, including the surface containers, the fixed roles and three Paper-specific roles derived from OnSurface:
| Role | Value |
|---|---|
| SurfaceDisabled | OnSurface at 12% — disabled containers |
| OnSurfaceDisabled | OnSurface at 38% — disabled content |
| Backdrop | neutral-variant 20 at 40% — modal backdrops |
Every accessor below reads getActiveTheme(), which starts as a copy of defaultTheme. To ship your own tokens, copy a theme, change it and activate it before building a scene:
The active theme is process-wide: there is one per application, not one per scene.
theme::Typescale maps the 15 M3 roles plus Default to a TypeToken (family, weight, size, line height, letter spacing), with the Paper baseline values. theme::fontPath(weight) selects the bundled Roboto Regular or Medium file; TextRender and MeasureText use it, and MeasureText grows the bound to the role line height.
entities::Text resolves its role on every update, so changing a token restyles existing texts:
| Scale | Accessor | Contents |
|---|---|---|
| ShapeScale | getShapeRadius(ShapeRole) | None 0, ExtraSmall 4, Small 8, Medium 12, Large 16, ExtraLarge 28, Full (pill/circle); scaled by roundness (default 4) |
| ElevationScale | getElevationToken(level), getElevatedSurfaceColor(level) | Levels 0–5: tonal SurfaceTint opacity (0, 5, 8, 11, 12, 14%) and shadow spread/opacity |
| StateLayerScale | getStateLayerAlpha(StateLayer) | Hovered 8%, Focused 12%, Pressed 12%, Dragged 16%, DisabledContent 38%, DisabledContainer 12% |
| MotionScale | getMotionDuration(MotionDuration) | Short1–ExtraLong4 (50–1000 ms); enter()/exit()/standard() easings |
| SpacingScale | SpacingScale::get(n) | 4 dp grid, MinTouchTarget = 48, touchMargin(extent) |
| FocusRing | constants | 3 dp ring, 2 dp offset, Secondary color |
components::Elevation::setElevationLevel(level) resolves a shadow from the scale; level 0 paints nothing.
components::Accessibility is the semantic description of an entity: label, hint, AccessibilityRole, selected / checked (CheckedState) / expanded, range value, live region, focus order and focusability. The disabled state is not duplicated: it is read from StyleState.
systems::Focus keeps a per-entity focus flag, supports Tab / Shift-Tab traversal (positive focusOrder first, then tree order, wrapping), and drops the focus of an entity that becomes disabled. systems::FocusRingRender paints the focus indicator. Both are registered by Application::registerCoreSystems().