Zone data model, layout persistence, zone-detection, and the ILayoutSource adapter that publishes manual zone layouts to the daemon.
A zone is a named rectangular region of screen space with metadata: appearance, label, and quick-select slot. A layout is a collection of zones plus per-context (screen / desktop / activity) assignment rules. This library owns:
LayoutRegistry is the concrete counterpart to IZoneLayoutRegistry. The interface exists so consumers that only enumerate or look up layouts (read-only previews, settings UI thumbnails) depend on the smaller contract, which is also trivial to mock.
| Type | Purpose |
|---|---|
| PhosphorZones::Zone | Value type: rect, id, label, colors, appearance |
| PhosphorZones::Layout | Collection of zones plus app-rule auto-snap mappings |
| PhosphorZones::IZoneDetector | Abstract cursor-to-zone resolver |
| PhosphorZones::ZoneDetector | Concrete impl with adjacency-graph navigation |
| PhosphorZones::IZoneLayoutRegistry | Catalogue contract: enumerate, mutate, set active layout |
| PhosphorZones::LayoutRegistry | Concrete IZoneLayoutRegistry + per-context assignment store |
| PhosphorZones::ZonesLayoutSource | ILayoutSource adapter for manual layouts |
| PhosphorZones::ZonesLayoutSourceFactory | Provider-side factory; registers via LayoutSourceProviderRegistry |
| PhosphorZones::AssignmentEntry | Per-context layout assignment value type |
| PhosphorZones::LayoutAssignmentKey | (screenId, desktop, activity) key for assignment lookups |
| PhosphorZones::ZoneHighlighter | Overlay highlight state machine |
#include <PhosphorZones/LayoutRegistry.h>
#include <PhosphorZones/ZoneDetector.h>
using namespace PhosphorZones;
LayoutRegistry *registry = /* injected */;
Layout *current = registry->layoutForScreen(screenId, desktop, activity);
// Detect which zone the cursor is over
ZoneDetector det;
det.setLayout(current);
Zone *z = det.zoneAtPoint(cursorPos);
if (z) {
overlay.highlight(*z);
}