Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorZones::AssignmentEntry Struct Reference

Explicit per-context assignment entry storing both mode fields. More...

#include <phosphor-zones/include/PhosphorZones/AssignmentEntry.h>

Public Types

enum  Mode { Snapping = 0 , Autotile = 1 }
 

Public Member Functions

QString activeLayoutId () const
 
bool isValid () const
 
bool operator== (const AssignmentEntry &other) const
 

Static Public Member Functions

static AssignmentEntry fromLayoutId (const QString &layoutId, const AssignmentEntry &existing)
 Update an existing AssignmentEntry from a layoutId, preserving the "other" field.
 
static AssignmentEntry fromLayoutId (const QString &layoutId)
 Create a fresh AssignmentEntry from a layoutId string.
 

Public Attributes

Mode mode = Snapping
 
QString snappingLayout
 
QString tilingAlgorithm
 

Detailed Description

Explicit per-context assignment entry storing both mode fields.

Each screen/desktop/activity context stores an explicit Mode, SnappingLayout (UUID), and PhosphorTiles::TilingAlgorithm. Toggling between modes only flips the mode field — the other field is preserved, eliminating the need for shadow assignments.

Member Enumeration Documentation

◆ Mode

Enumerator
Snapping 
Autotile 

Member Function Documentation

◆ activeLayoutId()

QString PhosphorZones::AssignmentEntry::activeLayoutId ( ) const
inline

◆ fromLayoutId() [1/2]

static AssignmentEntry PhosphorZones::AssignmentEntry::fromLayoutId ( const QString &  layoutId)
inlinestatic

Create a fresh AssignmentEntry from a layoutId string.

◆ fromLayoutId() [2/2]

static AssignmentEntry PhosphorZones::AssignmentEntry::fromLayoutId ( const QString &  layoutId,
const AssignmentEntry existing 
)
inlinestatic

Update an existing AssignmentEntry from a layoutId, preserving the "other" field.

Mode IS set from the layoutId type — batch operations from the KCM send a single layout ID per context, and that ID determines the active mode. The non-matching field is preserved for easy mode toggling.

◆ isValid()

bool PhosphorZones::AssignmentEntry::isValid ( ) const
inline

◆ operator==()

bool PhosphorZones::AssignmentEntry::operator== ( const AssignmentEntry other) const
inline

Member Data Documentation

◆ mode

Mode PhosphorZones::AssignmentEntry::mode = Snapping

◆ snappingLayout

QString PhosphorZones::AssignmentEntry::snappingLayout

◆ tilingAlgorithm

QString PhosphorZones::AssignmentEntry::tilingAlgorithm

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