Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorEngine::GapResolution Namespace Reference

Shared resolution of gap-override layers expressed as PerScreenKeys-shaped QVariantMaps (context-rule gap overrides, per-screen config overrides). More...

Functions

template<typename Normalize >
std::optional< int > gapFromOverrideMap (const QVariantMap &map, QLatin1String key, Normalize normalize)
 Single gap value from an override map, or nullopt when map lacks key.
 
template<typename Normalize >
std::optional<::PhosphorLayout::EdgeGapsouterGapsFromOverrideMap (const QVariantMap &map, int missingSideBase, Normalize normalize)
 Resolve the outer-gap portion of an override map as ONE atomic layer.
 

Detailed Description

Shared resolution of gap-override layers expressed as PerScreenKeys-shaped QVariantMaps (context-rule gap overrides, per-screen config overrides).

Both placement engines consume the same map shape: the snap-side geometry helpers (daemon GeometryUtils) and the autotile PerScreenConfigResolver previously each implemented this resolution with byte-identical layer semantics. This header is the single implementation; the normalize callable absorbs the one legitimate divergence (autotile clamps every map-sourced value to its gap range, snapping consumes raw values).

Function Documentation

◆ gapFromOverrideMap()

template<typename Normalize >
std::optional< int > PhosphorEngine::GapResolution::gapFromOverrideMap ( const QVariantMap &  map,
QLatin1String  key,
Normalize  normalize 
)

Single gap value from an override map, or nullopt when map lacks key.

normalize is applied to the map-sourced value.

◆ outerGapsFromOverrideMap()

template<typename Normalize >
std::optional<::PhosphorLayout::EdgeGaps > PhosphorEngine::GapResolution::outerGapsFromOverrideMap ( const QVariantMap &  map,
int  missingSideBase,
Normalize  normalize 
)

Resolve the outer-gap portion of an override map as ONE atomic layer.

Per-side values are honoured only when the map sets UsePerSideOuterGap, and if the layer yields any outer gap it wins wholesale — no per-key blending with lower-precedence layers. Missing sides in a partial per-side map fall back to the map's own uniform OuterGap or, failing that, missingSideBase (the caller's next-layer uniform value). Every consumed value — map-sourced or the missing-side base — goes through normalize, so a caller's clamp applies uniformly. Returns nullopt when the map carries no outer-gap info so the caller falls through to the next precedence layer.