144 return m_layouts.size();
165 return QStringLiteral(
" (Copy)");
170 return m_activeLayout;
179 return m_layoutDirectory;
323 std::function<std::optional<int>(
const QString& screenId,
int virtualDesktop,
const QString& activity)>
447 return m_previousLayout;
451 Q_INVOKABLE
void assignLayoutById(
const QString& screenId,
int virtualDesktop,
const QString& activity,
452 const QString& layoutId);
468 const QString& templateId);
475 const QString& activity)
const override;
482 m_scrollingTemplateStore = store;
486 return m_scrollingTemplateStore;
496 m_defaultScrollingTemplateProvider = std::move(provider);
512 const QString& activity = QString())
const override;
552 const QString& mode = QString())
const override;
560 bool resolveContextLocked(
const QString& screenId,
int virtualDesktop,
const QString& activity)
const override;
572 const QString& activity)
const;
586 const QString& activity)
const;
606 const QString& activity)
const override;
616 const QString& activity)
const override;
627 const QString& activity)
const;
638 const QString& activity)
const;
716 if (m_screenPixelSizeProvider) {
717 if (
const auto size = m_screenPixelSizeProvider(screenId); size && !size->isEmpty()) {
723 if (m_screenOrientationProvider) {
724 if (
const auto token = m_screenOrientationProvider(screenId)) {
779 if (m_colorSchemeProvider) {
780 if (
const auto token = m_colorSchemeProvider()) {
825 + QString::number(shape.
pixelSize->height())
840 return (tiledCount ? (QLatin1String(
"twc:") + QString::number(*tiledCount)) : QString())
855 QString escaped = component;
856 escaped.replace(QLatin1Char(
'%'), QLatin1String(
"%25"));
857 escaped.replace(QLatin1Char(
'|'), QLatin1String(
"%7C"));
862 const QString& activity = QString());
872 const QString& activity = QString())
const;
910 const QString& activity = QString())
const override;
922 const QString& activity = QString())
const;
942 const QString& activity = QString())
const;
945 const QString& activity = QString())
const;
960 const QString& activity = QString())
const override;
974 const QString& activity = QString())
const;
987 const QString& activity = QString())
const;
989 const QString& activity = QString())
const override;
997 const QString& activity = QString())
const;
1004 const QString& activity)
const override;
1094 return m_quickLayoutSlots[slotIndexFor(mode)];
1134 return m_currentVirtualDesktop;
1138 return m_currentActivity;
1142 m_currentVirtualDesktop = desktop;
1151 if (m_currentVirtualDesktopProvider) {
1152 if (
const auto desktop = m_currentVirtualDesktopProvider(screenId); desktop && *desktop >= 1) {
1156 return m_currentVirtualDesktop;
1163 m_currentVirtualDesktopProvider = std::move(provider);
1167 m_currentActivity = activity;
1192 return static_cast<int>(m_contextResolveCache.size());
1211 void ensureLayoutDirectory();
1212 void loadLayoutsFromDirectory(
const QString& directory);
1213 Layout* restoreSystemLayout(
const QUuid&
id,
const QString& systemPath);
1214 QString layoutFilePath(
const QUuid&
id)
const;
1215 QString quickLayoutsFilePath()
const;
1216 QString layoutSettingsFilePath()
const;
1217 void readQuickLayouts();
1218 void writeQuickLayouts();
1235 Layout* cycleLayoutImpl(
const QString& screenId,
int direction);
1236 bool shouldSkipLayoutAssignment(
const QString& layoutId,
const QString& context)
const;
1237 void emitLayoutAssigned(
const QString& screenId,
int virtualDesktop,
const QString& layoutId);
1258 bool applyLayoutToScreen(
const QString& screenId, Layout* layout);
1261 void migrateLegacyAutotileOverrides();
1311 std::optional<AssignmentEntry> resolveAssignmentEntry(
const QString& screenId,
int virtualDesktop,
1312 const QString& activity,
const ScreenShape& shape,
1313 const std::optional<int>& tiledCount)
const;
1325 std::optional<int> tiledWindowCount(
const QString& screenId,
int virtualDesktop,
const QString& activity)
const;
1332 QString assignmentIdForScreen(
const QString& screenId,
int virtualDesktop,
const QString& activity,
1333 const ScreenShape& shape,
const std::optional<int>& tiledCount)
const;
1334 ScrollingTemplate scrollingTemplateForContext(
const QString& screenId,
int virtualDesktop,
const QString& activity,
1335 const ScreenShape& shape,
const std::optional<int>& tiledCount)
const;
1336 QString rulesVisibleActiveLayoutId(
const QString& screenId,
int virtualDesktop,
const QString& activity,
1337 const ScreenShape& shape,
const std::optional<int>& tiledCount)
const;
1344 bool hasExactContextRule(
const QString& screenId,
int virtualDesktop,
const QString& activity)
const;
1362 const PhosphorRules::Rule* findExactContextRule(
const QString& screenId,
int virtualDesktop,
1363 const QString& activity)
const;
1370 bool hasExplicitSnappingModePin(
const QString& screenId,
int virtualDesktop,
const QString& activity,
1371 const AssignmentEntry& entry)
const;
1381 std::optional<QString> resolveStoredAssignmentId(
const QString& screenId,
int virtualDesktop,
1382 const QString& activity,
const ScreenShape& shape,
1383 const std::optional<int>& tiledCount)
const;
1387 QUuid exactContextRuleId(
const QString& screenId,
int virtualDesktop,
const QString& activity)
const;
1406 bool upsertAssignmentRule(
const QString& screenId,
int virtualDesktop,
const QString& activity,
1407 const AssignmentEntry& entry);
1411 bool removeAssignmentRule(
const QString& screenId,
int virtualDesktop,
const QString& activity);
1426 template<
typename KeyT,
typename DecodeFn,
typename Val
idFn,
typename FamilyFn>
1427 void applyBatchAssignments(
const QHash<KeyT, QString>& assignments, DecodeFn decode, ValidFn valid,
1428 FamilyFn familyMatches,
int emitDesktop,
const char* label);
1442 AssignmentEntry resolveDefaultAssignmentEntryRaw()
const;
1450 AssignmentEntry resolveDefaultAssignmentEntry()
const;
1461 AssignmentEntry resolveDefaultAssignmentEntryForContext(
const QString& screenId,
int virtualDesktop,
1462 const QString& activity,
const ScreenShape& shape)
const;
1467 std::optional<bool> resolveContextDefaultAssignment(
const QString& screenId,
int virtualDesktop,
1468 const QString& activity,
const ScreenShape& shape)
const;
1479 bool hasMatchingAssignmentRule(
const QString& screenId,
int virtualDesktop,
const QString& activity)
const;
1501 template<
typename V,
typename ComputeFn>
1502 V resolveCachedContext(QHash<ContextResolveKey, V>& cache, quint64& cacheRevision,
const QString& screenId,
1503 int virtualDesktop,
const QString& activity,
const QString& mode, ComputeFn&& compute)
const
1505 const quint64 revision = m_ruleStore->ruleSet().revision();
1506 if (revision != cacheRevision) {
1508 cacheRevision = revision;
1510 const ContextResolveKey key{screenId, virtualDesktop, activity, mode};
1511 const auto cached = cache.constFind(key);
1512 if (cached != cache.constEnd()) {
1513 return cached.value();
1515 V value = compute();
1516 constexpr qsizetype kMaxEntries = 256;
1517 if (cache.size() >= kMaxEntries) {
1520 cache.insert(key, value);
1530 mutable QHash<ContextResolveKey, std::optional<RuleSlotResolution>> m_contextResolveCache;
1534 mutable quint64 m_contextResolveCacheRevision = 0;
1542 mutable QHash<ContextResolveKey, ContextGapOverride> m_contextGapCache;
1543 mutable quint64 m_contextGapCacheRevision = 0;
1550 mutable QHash<ContextResolveKey, bool> m_contextLockCache;
1551 mutable quint64 m_contextLockCacheRevision = 0;
1559 mutable QHash<ContextResolveKey, std::optional<bool>> m_contextDefaultAssignmentCache;
1560 mutable quint64 m_contextDefaultAssignmentCacheRevision = 0;
1570 std::optional<bool> resolveContextBoolSlot(QHash<ContextResolveKey, std::optional<bool>>& cache,
1571 quint64& cacheRevision, QLatin1StringView actionType,
1572 const QString& screenId,
int virtualDesktop,
1573 const QString& activity)
const;
1581 mutable QHash<ContextResolveKey, std::optional<bool>> m_contextOsdCache;
1582 mutable quint64 m_contextOsdCacheRevision = 0;
1590 mutable QHash<ContextResolveKey, std::optional<bool>> m_contextDragSelectorCache;
1591 mutable quint64 m_contextDragSelectorCacheRevision = 0;
1598 mutable QHash<ContextResolveKey, ContextOverlayOverride> m_contextOverlayCache;
1599 mutable quint64 m_contextOverlayCacheRevision = 0;
1601 std::function<QString()> m_defaultLayoutIdProvider;
1607 std::function<QString()> m_defaultAutotileAlgorithmProvider;
1612 std::function<std::optional<int>(
const QString& screenId,
int virtualDesktop,
const QString& activity)>
1613 m_tiledWindowCountProvider;
1618 std::function<std::optional<QString>(
const QString& screenId)> m_screenOrientationProvider;
1620 std::function<std::optional<QString>()> m_colorSchemeProvider;
1624 ScrollingTemplateStore* m_scrollingTemplateStore =
nullptr;
1628 std::function<QString()> m_defaultScrollingTemplateProvider;
1633 std::function<bool()> m_snappingPreferredProvider;
1638 std::function<bool()> m_defaultAssignmentSuppressedProvider;
1642 PhosphorRules::RuleStore* m_ruleStore =
nullptr;
1644 std::unique_ptr<PhosphorRules::RuleEvaluator> m_evaluator;
1645 QString m_layoutSubdirectory;
1646 QString m_layoutDirectory;
1647 QVector<Layout*> m_layouts;
1648 Layout* m_activeLayout =
nullptr;
1649 Layout* m_previousLayout =
nullptr;
1655 QHash<int, QString> m_quickLayoutSlots[3];
1659 LayoutSettingsStore m_layoutSettings;
1660 int m_currentVirtualDesktop = 1;
1665 std::function<std::optional<int>(
const QString&)> m_currentVirtualDesktopProvider;
1666 QString m_currentActivity;
1670 std::function<std::optional<QSize>(
const QString& screenId)> m_screenPixelSizeProvider;
The single evaluation model — resolves a WindowQuery against a RuleSet.
Definition RuleEvaluator.h:143
Persistent store for the unified Rule set.
Definition RuleStore.h:48
IZoneLayoutRegistry(QObject *parent=nullptr)
bool removeLayoutById(const QUuid &id) override
AssignmentEntry::Mode modeForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
static constexpr QLatin1String QuickSlotsSnappingKey
quicklayouts.json top-level keys: one nested slot object per slot ARRAY ("snapping",...
Definition LayoutRegistry.h:1074
bool applyScrollingTemplateToScreen(const QString &screenId, const QString &templateId)
Commit templateId as screenId's scrolling template on the screen's OWN desktop (the template twin of ...
QString layoutDirectory() const
Definition LayoutRegistry.h:177
void applyQuickLayout(AssignmentEntry::Mode mode, int number, const QString &screenId)
void setAllDesktopAssignments(const QHash< QPair< QString, int >, QString > &assignments)
LayoutRegistry(PhosphorRules::RuleStore *ruleStore, QString layoutSubdirectory, QObject *parent=nullptr)
std::optional< bool > resolveContextDragSelectorEnabled(const QString &screenId, int virtualDesktop, const QString &activity) const override
Resolve a per-context override of the drag selector popup — the edge-triggered zone / strip picker of...
QString assignmentIdForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const override
Raw assignment id for a (screen, desktop, activity) context.
QString snappingLayoutForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
Per-field cascade readers — return the named field from the first entry in the cascade where it is no...
Layout * importLayout(const QString &filePath)
Load a layout from filePath and add it to the registry.
void setDefaultScrollingTemplateProvider(std::function< QString()> provider)
Provider for the DEFAULT scrolling template id (a config setting the daemon owns): consulted when a S...
Definition LayoutRegistry.h:494
int currentVirtualDesktop() const override
Definition LayoutRegistry.h:1132
QHash< int, QString > quickLayoutSlots(AssignmentEntry::Mode mode) const
Definition LayoutRegistry.h:1092
void setColorSchemeProvider(std::function< std::optional< QString >()> provider)
Inject a callback that reports the system colour scheme ("light" / "dark"), or std::nullopt when it i...
Layout * duplicateLayout(Layout *source) override
int layoutCount() const override
Definition LayoutRegistry.h:142
QString storedAssignmentIdForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
Like assignmentIdForScreen, but WITHOUT the level-1 global default fallback: resolves the same per-co...
static void applyScreenShape(PhosphorRules::WindowQuery &query, const ScreenShape &shape)
Write shape into query's screen-shape context fields, deriving the aspect-ratio token from the size h...
Definition LayoutRegistry.h:736
void setActiveLayoutById(const QUuid &id) override
void assignScrollingTemplate(const QString &screenId, int virtualDesktop, const QString &activity, const QString &templateId)
Assign templateId as the context's scrolling TEMPLATE (the native ScrollingTemplate whose vocabularie...
Layout * layoutForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const override
Cascade-resolve the manual layout for screenId.
QString rulesVisibleActiveLayoutId(const QString &screenId, int virtualDesktop, const QString &activity) const
The RULES-VISIBLE ActiveLayout value the context resolvers stamp onto their windowless queries: the a...
void setAssignmentEntryDirect(const QString &screenId, int virtualDesktop, const QString &activity, const AssignmentEntry &entry)
Store a full entry directly (from KCM via D-Bus).
void cycleToNextLayout(const QString &screenId)
static QString contextCacheKeyToken(const QString &modeToken, const QString &activeLayoutId, const ScreenShape &shape, const QString &colorSchemeToken)
Compose the extra cache-key token a daemon-facing context resolver (gap / lock / overlay / default-as...
Definition LayoutRegistry.h:809
void setAllActivityAssignments(const QHash< QPair< QString, QString >, QString > &assignments)
static QString duplicateNameSuffix()
The literal suffix duplicateLayout appends to the source layout's name.
Definition LayoutRegistry.h:163
static QString assignmentCacheKeyToken(const std::optional< int > &tiledCount, const ScreenShape &shape, const QString &colorSchemeToken)
The resolveAssignmentEntry cache's own extra token.
Definition LayoutRegistry.h:837
static constexpr int QuickSlotCount
How many quick-layout slots one mode carries, i.e.
Definition LayoutRegistry.h:1086
void setAllScreenAssignments(const QHash< QString, QString > &assignments)
Batch setters - clear existing, set new, save once at end.
Layout * resolveLayoutForScreen(const QString &screenId) const override
Resolve layout for screenId using the current desktop/activity context.
Definition LayoutRegistry.h:518
static QString escapeKeyComponent(const QString &component)
Make a cache-key component unambiguous under concatenation.
Definition LayoutRegistry.h:853
Layout * activeLayout() const override
Definition LayoutRegistry.h:168
bool hasExplicitAssignment(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
True iff a context-assignment rule whose match is exactly this (screen, desktop, activity) tuple's sh...
void cycleToPreviousLayout(const QString &screenId)
void addLayout(Layout *layout) override
Layout * layout(int index) const override
ContextOverlayOverride resolveContextOverlay(const QString &screenId, int virtualDesktop, const QString &activity) const override
Resolve the per-context overlay-property override (shader / style) for (screen, desktop,...
void setLayoutDirectory(const QString &directory)
void setCurrentVirtualDesktopProvider(std::function< std::optional< int >(const QString &screenId)> provider)
Inject the per-screen desktop resolver above.
Definition LayoutRegistry.h:1161
void saveAutotileOverrides(const QString &algorithmId, const QJsonObject &overrides)
void setQuickLayoutSlot(AssignmentEntry::Mode mode, int number, const QString &layoutId)
static std::optional< RuleSlotResolution > resolveRuleSlots(const PhosphorRules::RuleEvaluator &evaluator, const PhosphorRules::WindowQuery &query)
The assignment cascade's rule walk for one windowless context query: the highest-priority admitted ru...
ContextScrollingParams resolveContextScrollingParams(const QString &screenId, int virtualDesktop, const QString &activity) const
Resolve the per-context scrolling parameter overrides (default column width / focused-column centerin...
~LayoutRegistry() override
void assignLayoutById(const QString &screenId, int virtualDesktop, const QString &activity, const QString &layoutId)
static bool isLayoutJsonValid(const QJsonObject &json, const QString &context)
Validate json against the bundled layout schema — the single gate every untrusted layout document pas...
ScrollingTemplateStore * scrollingTemplateStore() const override
The native scrolling-template store wired into this registry, or null when none is (lightweight stubs...
Definition LayoutRegistry.h:484
Layout * previousLayout() const
Get the previous active layout (before the most recent setActiveLayout).
Definition LayoutRegistry.h:445
void setSnappingPreferredProvider(std::function< bool()> provider)
Inject a callback that returns true when Snapping is the user's preferred default mode (regardless of...
int currentVirtualDesktopForScreen(const QString &screenId) const override
This screen's current virtual desktop, resolved through the injected provider (the daemon wires it to...
Definition LayoutRegistry.h:1149
void setCurrentActivity(const QString &activity)
Definition LayoutRegistry.h:1165
void stampScreenShape(PhosphorRules::WindowQuery &query, const QString &screenId) const
Read screenId's shape and stamp it onto query.
Definition LayoutRegistry.h:761
Layout * defaultLayout() const override
Resolve the effective default layout.
static const PhosphorRules::Rule * resolveLockRule(const PhosphorRules::RuleEvaluator &evaluator, const PhosphorRules::WindowQuery &query)
The lock resolver's rule walk for one windowless context query: the highest-priority admitted rule ca...
bool exactContextDeclaresEngineMode(const QString &screenId, int virtualDesktop, const QString &activity) const
Whether the exact-context rule for this tuple DECLARES an engine mode, rather than merely being defau...
void clearAssignment(const QString &screenId, int virtualDesktop=0, const QString &activity=QString())
void setScreenPixelSizeProvider(std::function< std::optional< QSize >(const QString &screenId)> provider)
Inject a callback that returns a screen's size in DEVICE pixels (its mode, as the display settings re...
std::optional< bool > resolveContextOsdEnabled(const QString &screenId, int virtualDesktop, const QString &activity) const
Resolve a per-context override of the OSD toggles for the (screen, desktop, activity) context by eval...
int contextResolveCacheSize() const
Current entry count in the resolveAssignmentEntry hot-path cache.
Definition LayoutRegistry.h:1190
bool isContextActiveLayoutSuppressed(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const override
True iff the context has NO active layout specifically because the default assignment is suppressed —...
void clearAutotileAssignments()
Flip mode to Snapping for every entry currently in Autotile (preserves snappingLayout + tilingAlgorit...
void setCurrentVirtualDesktop(int desktop)
Definition LayoutRegistry.h:1140
bool snappingPreferred() const
True when the snapping-preferred provider is wired AND reports true — i.e.
AssignmentEntry assignmentEntryForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
Full entry for a (screen, desktop, activity) context.
void stampColorScheme(PhosphorRules::WindowQuery &query) const
Stamp the colour-scheme token onto query from m_colorSchemeProvider (a no-op when unset).
Definition LayoutRegistry.h:793
Layout * layoutByName(const QString &name) const override
Layout * layoutById(const QUuid &id) const override
Resolve a layout by its stable UUID.
void setAllQuickLayoutSlots(AssignmentEntry::Mode mode, const QHash< int, QString > &slots)
bool resolveContextLocked(const QString &screenId, int virtualDesktop, const QString &activity) const override
Resolve whether a context rule locks the active layout for the (screen, desktop, activity) context by...
QHash< QPair< QString, QString >, AssignmentEntry > activityAssignments() const
ContextTilingParams resolveContextTilingParams(const QString &screenId, int virtualDesktop, const QString &activity) const
Resolve the per-context autotile parameter overrides (max windows / split ratio / master count) for (...
QString colorSchemeToken() const
The colour-scheme token from m_colorSchemeProvider ("light" / "dark"), or an empty string when the pr...
Definition LayoutRegistry.h:777
bool removeLayout(Layout *layout) override
ContextGapOverride resolveContextGaps(const QString &screenId, int virtualDesktop, const QString &activity, const QString &mode=QString()) const override
Resolve the per-context gap override for (screen, desktop, activity) by evaluating a windowless Windo...
void setScreenOrientationProvider(std::function< std::optional< QString >(const QString &screenId)> provider)
Inject a callback that returns a screen's orientation token ("portrait" / "landscape"),...
QHash< CombinedAssignmentKey, AssignmentEntry > combinedAssignments() const
Strict Combined-context reader.
AssignmentEntry exactContextEntry(const QString &screenId, int virtualDesktop, const QString &activity) const
The EXPLICIT assignment entry pinned by this exact context tuple's rule, or a default entry when none...
static constexpr QLatin1String QuickSlotsScrollingKey
Definition LayoutRegistry.h:1076
bool purgeLayoutIdFromAssignments(const QString &layoutId)
Drop id from every assignment rule's SetSnappingLayout and SetScrollingTemplate actions,...
void setScrollingTemplateStore(ScrollingTemplateStore *store)
Wire the native template store (borrowed, post-construction like the other injected collaborators; pa...
Definition LayoutRegistry.h:480
std::optional< bool > resolveContextDefaultAssignment(const QString &screenId, int virtualDesktop, const QString &activity) const
Resolve a per-context override of the global default-layout-assignment baseline for the (screen,...
static QString screenShapeKeyToken(const ScreenShape &shape)
The screen-shape component of both cache-key formats, "|or:<token>|sz:WxH": the orientation and the d...
Definition LayoutRegistry.h:821
QString currentActivity() const override
Definition LayoutRegistry.h:1136
void seedDefaultLayoutSettingsIfFresh(const QJsonObject &defaults)
Seed curated default picker visibility into the sidecar, but ONLY on a fresh install — when neither l...
Layout * layoutForShortcut(AssignmentEntry::Mode mode, int number) const
void setDefaultLayoutIdProvider(std::function< QString()> provider)
Inject a callback that returns the user-configured default layout id (or empty if unset).
ScrollingTemplate scrollingTemplateForContext(const QString &screenId, int virtualDesktop, const QString &activity) const override
The resolved ScrollingTemplate for a scrolling context, by value — invalid when the cascade has no Sc...
void setDefaultAssignmentSuppressedProvider(std::function< bool()> provider)
Inject a callback that returns true when the user has opted to suppress the synthesized level-1 defau...
ScreenShape screenShape(const QString &screenId) const
Read screenId's ScreenShape from the providers, once.
Definition LayoutRegistry.h:713
void layoutDirectoryChanged()
QString scrollingTemplateLayoutForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
Raw template-field sibling of the two getters above: NOT mode-gated, so a dormant template preserved ...
void setDefaultAutotileAlgorithmProvider(std::function< QString()> provider)
Inject a callback that returns the user-configured default autotile algorithm id (or empty if autotil...
QJsonObject loadAutotileOverrides(const QString &algorithmId) const override
Per-algorithm autotile settings (gaps, shader, hiddenFromSelector, …) stored in the unified layout-se...
bool scrollingTemplateExplicitlyNone(const QString &screenId, int virtualDesktop, const QString &activity) const override
Mode-gated like scrollingTemplateForContext rather than like the raw getter above: a token preserved ...
QString tilingAlgorithmForScreen(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const override
Raw id of the tiling algorithm active for the (screenId, virtualDesktop, activity) context,...
void saveLayout(Layout *layout)
QVector< Layout * > builtInLayouts() const
QHash< QPair< QString, int >, AssignmentEntry > desktopAssignments() const
The three projection readers return the FULL AssignmentEntry per context (mode + all three payload fi...
void setTiledWindowCountProvider(std::function< std::optional< int >(const QString &screenId, int virtualDesktop, const QString &activity)> provider)
Inject a callback that returns the tiled-window count for a screen, or std::nullopt when the screen i...
void setActiveLayout(Layout *layout) override
void assignLayout(const QString &screenId, int virtualDesktop, const QString &activity, Layout *layout)
bool exportLayout(Layout *layout, const QString &filePath)
Write layout to filePath as a standalone layout document.
int restoreAutotileAssignments()
Reverse direction of clearAutotileAssignments FOR THE ASSIGNMENT RULES (the quick-layout slots were n...
static constexpr QLatin1String QuickSlotsAutotileKey
Definition LayoutRegistry.h:1075
void createBuiltInLayouts()
bool isDefaultAssignmentSuppressedForContext(const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
True iff the SYNTHESIZED default (the level-1 provider layout / autotile algorithm) is suppressed for...
void setAllCombinedAssignments(const QHash< CombinedAssignmentKey, QString > &assignments)
Combined-context (screen + desktop + activity) batch setter — the triple-axis sibling of the Activity...
QVector< Layout * > layouts() const override
Enumerate every known layout.
Definition LayoutRegistry.h:146
Represents a collection of zones that form a layout.
Definition Layout.h:42
constexpr QLatin1StringView Layout
Definition ActionSlots.h:21
QString aspectRatioTokenFor(int width, int height)
The Field::ScreenAspectRatio token for a width x height screen: the vocabulary entry whose ratio is n...
Definition MatchTypes.h:153
QString orientationTokenFor(int width, int height)
The Field::ScreenOrientation token for a width x height screen: "portrait" when it is taller than wid...
Definition MatchTypes.h:176
Definition IWindowTrackingService.h:24
size_t qHash(const LayoutAssignmentKey &key, size_t seed=0)
Definition AssignmentEntry.h:87
One rule — { id, name, enabled, priority, match, actions, managed }.
Definition Rule.h:106
The evaluation input — an attribute bag matched against a MatchExpression.
Definition WindowQuery.h:37
std::optional< int > screenHeight
Definition WindowQuery.h:105
QString screenOrientation
"portrait" / "landscape" of the resolving screen; empty = unknown (no geometry provider)
Definition WindowQuery.h:81
QString colorScheme
"light" / "dark" system colour scheme; empty = unknown (no provider)
Definition WindowQuery.h:84
std::optional< int > screenWidth
The resolving screen's size in DEVICE pixels (its mode, not the scaled logical size).
Definition WindowQuery.h:104
QString screenAspectRatio
nearest common aspect ratio of the resolving screen ("16:9", "32:9", …); empty = the size is unknown
Definition WindowQuery.h:95
Explicit per-context assignment entry storing every mode's payload.
Definition AssignmentEntry.h:203
Mode
Per-context engine selection.
Definition AssignmentEntry.h:213
@ Scrolling
The niri-style scrolling engine (PhosphorScrollEngine): windows form columns on an endless strip per ...
Definition AssignmentEntry.h:226
@ Autotile
Definition AssignmentEntry.h:215
Triple-axis key for the Combined-context batch API.
Definition LayoutRegistry.h:45
int virtualDesktop
Definition LayoutRegistry.h:47
QString activity
Definition LayoutRegistry.h:48
QString screenId
Definition LayoutRegistry.h:46
bool operator==(const CombinedAssignmentKey &other) const
Definition LayoutRegistry.h:50
Per-context gap override resolved from rules.
Definition AssignmentEntry.h:363
Per-context overlay-property overrides resolved from window-rule actions.
Definition AssignmentEntry.h:401
Lookup key for the LayoutRegistry context-resolver caches.
Definition ContextResolveKey.h:17
Per-context scrolling parameter overrides resolved from context rules.
Definition AssignmentEntry.h:488
Per-context autotile parameter overrides resolved from context rules.
Definition AssignmentEntry.h:441
The rule-derived slot resolution of the assignment cascade, as resolveRuleSlots produces it and resol...
Definition LayoutRegistry.h:659
std::optional< QString > snappingLayout
Definition LayoutRegistry.h:661
std::optional< AssignmentEntry > modeEntry
Definition LayoutRegistry.h:660
std::optional< QString > tilingAlgorithm
Definition LayoutRegistry.h:662
std::optional< QString > scrollingTemplate
Definition LayoutRegistry.h:663
The geometry-derived context facts of one screen: its orientation token ("portrait" / "landscape") an...
Definition LayoutRegistry.h:700
QString orientation
Definition LayoutRegistry.h:701
std::optional< QSize > pixelSize
Definition LayoutRegistry.h:702