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

Auto-tiling algorithm defaults. More...

Functions

constexpr bool isNumericMetaType (int typeId)
 Returns true if typeId is a numeric QMetaType (Double, Float, Int, UInt, LongLong, ULongLong).

Variables

constexpr qreal DefaultSplitRatio = 0.5
 50/50 split when nothing else specified
constexpr int DefaultMasterCount = 1
 Single master window.
constexpr int DefaultMaxWindows = 5
 Maximum tiled windows before overflow.
constexpr int ScriptedDefaultMaxWindows = 6
 Window cap for a scripted algorithm whose metadata omits defaultMaxWindows.
constexpr QLatin1String DefaultAlgorithmId {"bsp"}
 Default tiling algorithm.
constexpr qreal DefaultSplitRatioStep = 0.05
constexpr qreal MinSplitRatioStep = 0.01
constexpr qreal MaxSplitRatioStep = 0.25
constexpr qreal MinSplitRatio = 0.1
constexpr qreal MaxSplitRatio = 0.9
constexpr int MinMasterCount = 1
constexpr int MaxMasterCount = 5
constexpr int DefaultInnerGap = 8
constexpr int DefaultOuterGap = 8
constexpr int MinGap = 0
constexpr int MaxGap = 200
constexpr int MinRectSizePx = 50
 Smallest rect the tiling primitives will emit on either axis.
constexpr int GapEdgeThresholdPx = 5
constexpr int ResizeEdgeMoveThresholdPx = 5
 Minimum pixel movement of a window edge during an interactive resize before it is treated as an intentional resize (vs.
constexpr int MinMaxWindows = 1
constexpr int MaxMaxWindows = 12
 Bounds the CONFIG-sourced window cap (the settings spin box, the per-screen override, and AutotileConfig::fromJson).
constexpr int UnlimitedMaxWindowsSentinel = std::numeric_limits<int>::max() / 2
constexpr int MaxZones = 256
 Ceiling on zones in one LAYOUT.
constexpr int MaxRuntimeTreeDepth = 50
 Maximum recursion depth for split tree operations.
constexpr int ScriptStateMaxBytes = 64 * 1024
 Max compact-JSON size of the bag.
constexpr int ScriptStateMaxDepth = 16
 Max object/array nesting depth.
constexpr int ScriptStateMaxKeys = 4096
 Max total object keys across the bag.
constexpr qreal SplitRatioHysteresis = 0.05
 Band within which algorithm-switch ratio reset is suppressed.
constexpr int MinMetadataWindows = 1
constexpr int MaxMetadataWindows = 100
constexpr qint64 MaxScriptSizeBytes = 1024 * 1024
 Largest algorithm script the engine will load.
constexpr QLatin1String ScriptIdPrefix {"script:"}
 Prefix of the id a scripted algorithm gets when its metadata declares none: this plus the file's base name.
constexpr int MinInsertPosition = 0
constexpr int MaxInsertPosition = 2
constexpr int MinOverflowBehavior = 0
constexpr int MaxOverflowBehavior = 1
constexpr int ScriptWatchdogTimeoutMs = 100
 Watchdog deadline for a single Luau call (tile / lifecycle hook) issued via LuauEngine::callModule.

Detailed Description

Auto-tiling algorithm defaults.

Min/max constraints used by the tiling algorithms themselves. These are algorithm-layer concerns — independent of any user-facing default values the application config layer may surface.

Function Documentation

◆ isNumericMetaType()

bool PhosphorTiles::AutotileDefaults::isNumericMetaType ( int typeId)
constexpr

Returns true if typeId is a numeric QMetaType (Double, Float, Int, UInt, LongLong, ULongLong).

Two uses: gating untrusted Luau metadata/override returns before they are accepted as numbers (the primary use since the finiteNumber validation), and fuzzy-comparing QVariant values after JSON round-trip type drift.

Variable Documentation

◆ DefaultAlgorithmId

QLatin1String PhosphorTiles::AutotileDefaults::DefaultAlgorithmId {"bsp"}
inlineconstexpr

Default tiling algorithm.

◆ DefaultInnerGap

int PhosphorTiles::AutotileDefaults::DefaultInnerGap = 8
constexpr

◆ DefaultMasterCount

int PhosphorTiles::AutotileDefaults::DefaultMasterCount = 1
constexpr

Single master window.

◆ DefaultMaxWindows

int PhosphorTiles::AutotileDefaults::DefaultMaxWindows = 5
constexpr

Maximum tiled windows before overflow.

◆ DefaultOuterGap

int PhosphorTiles::AutotileDefaults::DefaultOuterGap = 8
constexpr

◆ DefaultSplitRatio

qreal PhosphorTiles::AutotileDefaults::DefaultSplitRatio = 0.5
constexpr

50/50 split when nothing else specified

◆ DefaultSplitRatioStep

qreal PhosphorTiles::AutotileDefaults::DefaultSplitRatioStep = 0.05
constexpr

◆ GapEdgeThresholdPx

int PhosphorTiles::AutotileDefaults::GapEdgeThresholdPx = 5
constexpr

◆ MaxGap

int PhosphorTiles::AutotileDefaults::MaxGap = 200
constexpr

◆ MaxInsertPosition

int PhosphorTiles::AutotileDefaults::MaxInsertPosition = 2
constexpr

◆ MaxMasterCount

int PhosphorTiles::AutotileDefaults::MaxMasterCount = 5
constexpr

◆ MaxMaxWindows

int PhosphorTiles::AutotileDefaults::MaxMaxWindows = 12
constexpr

Bounds the CONFIG-sourced window cap (the settings spin box, the per-screen override, and AutotileConfig::fromJson).

It is NOT a system-wide ceiling: a scripted algorithm's own defaultMaxWindows metadata is bounded by the MinMetadataWindows / MaxMetadataWindows pair below instead, so a script may declare, and resolve to, a cap above this one.

◆ MaxMetadataWindows

int PhosphorTiles::AutotileDefaults::MaxMetadataWindows = 100
constexpr

◆ MaxOverflowBehavior

int PhosphorTiles::AutotileDefaults::MaxOverflowBehavior = 1
constexpr

◆ MaxRuntimeTreeDepth

int PhosphorTiles::AutotileDefaults::MaxRuntimeTreeDepth = 50
constexpr

Maximum recursion depth for split tree operations.

◆ MaxScriptSizeBytes

qint64 PhosphorTiles::AutotileDefaults::MaxScriptSizeBytes = 1024 * 1024
constexpr

Largest algorithm script the engine will load.

LuauTileAlgorithm refuses anything bigger, so a writer that lands a larger file on disk leaves the user an algorithm that never appears. Shared so the settings app's import can reject it up front instead.

◆ MaxSplitRatio

qreal PhosphorTiles::AutotileDefaults::MaxSplitRatio = 0.9
constexpr

◆ MaxSplitRatioStep

qreal PhosphorTiles::AutotileDefaults::MaxSplitRatioStep = 0.25
constexpr

◆ MaxZones

int PhosphorTiles::AutotileDefaults::MaxZones = 256
constexpr

Ceiling on zones in one LAYOUT.

Distinct from, and larger than, the overlay shader's PhosphorRendering::MaxZones (64), which bounds a UBO array rather than the layout; the zone shader item clamps to that one independently and warns once when a layout overruns it. Reachable only in Unlimited overflow mode, since MaxMaxWindows is far smaller.

◆ MinGap

int PhosphorTiles::AutotileDefaults::MinGap = 0
constexpr

◆ MinInsertPosition

int PhosphorTiles::AutotileDefaults::MinInsertPosition = 0
constexpr

◆ MinMasterCount

int PhosphorTiles::AutotileDefaults::MinMasterCount = 1
constexpr

◆ MinMaxWindows

int PhosphorTiles::AutotileDefaults::MinMaxWindows = 1
constexpr

◆ MinMetadataWindows

int PhosphorTiles::AutotileDefaults::MinMetadataWindows = 1
constexpr

◆ MinOverflowBehavior

int PhosphorTiles::AutotileDefaults::MinOverflowBehavior = 0
constexpr

◆ MinRectSizePx

int PhosphorTiles::AutotileDefaults::MinRectSizePx = 50
constexpr

Smallest rect the tiling primitives will emit on either axis.

DUPLICATED, not shared: PhosphorGeometry::GeometryDefaults::MinRectSizePx backs the daemon's enforceMinSizes and MIN_ZONE_SIZE in libs/phosphor-tiles/src/pluau/pluau.luau backs the Luau-side guard. All three must move together — phosphor-tiles does not link phosphor-geometry, and the Luau copy is a literal by design (locale-safe float parsing).

◆ MinSplitRatio

qreal PhosphorTiles::AutotileDefaults::MinSplitRatio = 0.1
constexpr

◆ MinSplitRatioStep

qreal PhosphorTiles::AutotileDefaults::MinSplitRatioStep = 0.01
constexpr

◆ ResizeEdgeMoveThresholdPx

int PhosphorTiles::AutotileDefaults::ResizeEdgeMoveThresholdPx = 5
constexpr

Minimum pixel movement of a window edge during an interactive resize before it is treated as an intentional resize (vs.

fractional-scale rounding residue or sub-pixel jitter). A separate constant from GapEdgeThresholdPx (currently the same value) so it can be tuned for 1.5×/1.75× fractional scaling later without perturbing gap snapping.

◆ ScriptedDefaultMaxWindows

int PhosphorTiles::AutotileDefaults::ScriptedDefaultMaxWindows = 6
constexpr

Window cap for a scripted algorithm whose metadata omits defaultMaxWindows.

Scripted layouts carry more windows comfortably than the built-in default of 5, so they resolve to this instead. Shared with the settings app's blank scaffold, which writes this value into every algorithm it generates.

◆ ScriptIdPrefix

QLatin1String PhosphorTiles::AutotileDefaults::ScriptIdPrefix {"script:"}
inlineconstexpr

Prefix of the id a scripted algorithm gets when its metadata declares none: this plus the file's base name.

Shared because the loader builds that id for the registry while LuauTileAlgorithm builds its own and strips this back off for the display-name fallback, and the two must agree on the spelling.

◆ ScriptStateMaxBytes

int PhosphorTiles::AutotileDefaults::ScriptStateMaxBytes = 64 * 1024
constexpr

Max compact-JSON size of the bag.

◆ ScriptStateMaxDepth

int PhosphorTiles::AutotileDefaults::ScriptStateMaxDepth = 16
constexpr

Max object/array nesting depth.

◆ ScriptStateMaxKeys

int PhosphorTiles::AutotileDefaults::ScriptStateMaxKeys = 4096
constexpr

Max total object keys across the bag.

◆ ScriptWatchdogTimeoutMs

int PhosphorTiles::AutotileDefaults::ScriptWatchdogTimeoutMs = 100
constexpr

Watchdog deadline for a single Luau call (tile / lifecycle hook) issued via LuauEngine::callModule.

Generous enough for ARM / slow systems where first-call warmup can take tens of milliseconds. Exposed here so operators tuning for their target hardware don't need to recompile the binding TU.

◆ SplitRatioHysteresis

qreal PhosphorTiles::AutotileDefaults::SplitRatioHysteresis = 0.05
constexpr

Band within which algorithm-switch ratio reset is suppressed.

◆ UnlimitedMaxWindowsSentinel

int PhosphorTiles::AutotileDefaults::UnlimitedMaxWindowsSentinel = std::numeric_limits<int>::max() / 2
constexpr