Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorRules::ResolvedActions Class Reference

The output of a resolution — the first action filling each slot. More...

#include <PhosphorRules/RuleEvaluator.h>

Public Member Functions

bool hasSlot (const QString &slot) const
 True if slot was filled by some matching rule.
std::optional< RuleAction > slot (const QString &slot) const
 The action that filled slot, or nullopt if the slot is unfilled.
bool isExcluded () const
 True if an in-scope terminal exclusion action matched — the window is excluded from the resolving consumer's concern.
bool isEmpty () const
 True if no slot was filled and no terminal action matched.
QStringList filledSlots () const
 All filled slot ids — for tests / introspection.
bool fillSlot (const QString &slot, const RuleAction &action)
 Records action into slot iff the slot is currently unfilled.
void markExcluded ()
 Marks the result excluded (an in-scope terminal exclusion matched).
bool operator== (const ResolvedActions &other) const

Detailed Description

The output of a resolution — the first action filling each slot.

Conflict resolution is first-matching-rule-wins per slot: as the evaluator walks rules in descending priority, the first action it sees for a given slot fills that slot and later actions for the same slot are ignored. Actions in different slots stack.

Critically, a slot is recorded as filled the moment an action lands in it — even if that action's params are empty. slot(...) returns a present-but-empty value, distinguishable from a never-filled slot (std::nullopt). The animation engaged-empty effectId sentinel ("a rule matched and deliberately blocks the shader" vs "no rule matched") depends on exactly this distinction.

Member Function Documentation

◆ filledSlots()

QStringList PhosphorRules::ResolvedActions::filledSlots ( ) const
inline

All filled slot ids — for tests / introspection.

Returned sorted so tests can compare against a stable list; without the sort, QHash::keys() order is unspecified and varies across runs (Qt hash seeds are randomised per-process). Callers are not expected to be on a hot path.

◆ fillSlot()

bool PhosphorRules::ResolvedActions::fillSlot ( const QString & slot,
const RuleAction & action )

Records action into slot iff the slot is currently unfilled.

Returns true if it filled the slot, false if the slot was already filled.

◆ hasSlot()

bool PhosphorRules::ResolvedActions::hasSlot ( const QString & slot) const
inline

True if slot was filled by some matching rule.

◆ isEmpty()

bool PhosphorRules::ResolvedActions::isEmpty ( ) const
inline

True if no slot was filled and no terminal action matched.

◆ isExcluded()

bool PhosphorRules::ResolvedActions::isExcluded ( ) const
inline

True if an in-scope terminal exclusion action matched — the window is excluded from the resolving consumer's concern.

◆ markExcluded()

void PhosphorRules::ResolvedActions::markExcluded ( )
inline

Marks the result excluded (an in-scope terminal exclusion matched).

◆ operator==()

bool PhosphorRules::ResolvedActions::operator== ( const ResolvedActions & other) const
inline

◆ slot()

std::optional< RuleAction > PhosphorRules::ResolvedActions::slot ( const QString & slot) const

The action that filled slot, or nullopt if the slot is unfilled.

A filled slot may carry an action with empty params — that is NOT the same as an unfilled slot.


The documentation for this class was generated from the following file: