Classes | |
| struct | Cell |
| One cell of the placement map, in work-area fractions. More... | |
| struct | Occupant |
| One non-floating window on a screen, for applyOccupancy: the zones it fills and whether it demands attention. More... | |
| struct | WindowMeta |
| WindowTracking.getWindowMetadata, reduced to what a label needs. More... | |
| struct | ScreenState |
| One screen's row of LayoutRegistry.getScreenStates. More... | |
| struct | TileRect |
| A tile from a Tiling.windowsTileRequested batch, reduced to what the map needs so the parser stays free of the D-Bus wire types. More... | |
| struct | StripParse |
| The scrolling parse: the visible columns as cells plus the lens band. More... | |
Functions | |
| PHOSPHORSHELL_EXPORT qreal | hueFor (const QRectF &rect) |
| Hue for a cell rect: its horizontal centre, clamped to 0..1. | |
| PHOSPHORSHELL_EXPORT QList< Cell > | parseSnappingLayout (const QString &layoutJson, const QSize &workAreaSize, qreal deviceScale=0.0) |
| Parse a LayoutRegistry.getLayout JSON document into cells. | |
| PHOSPHORSHELL_EXPORT QList< Cell > | parseTileBatch (const QList< TileRect > &tiles, const QString &screenId, const QRect &workArea) |
| Normalise a tile batch for one screen against the work area. | |
| PHOSPHORSHELL_EXPORT StripParse | parseVisibleStrip (const QString &stripJson) |
| Parse Scrolling.visibleStripJson into cells plus the lens. | |
| PHOSPHORSHELL_EXPORT StripParse | parseStripModel (const QString &modelJson) |
| Parse Scrolling.stripModelJson into cells plus the lens. | |
| PHOSPHORSHELL_EXPORT QList< TileRect > | tileRectsFromJson (const QString &tilesJson) |
| Read a Tiling.currentTilesJson array into tile rects. | |
| PHOSPHORSHELL_EXPORT QList< Cell > | stackedColumns (const QStringList &windowIds) |
| Equal columns for a desktop whose tiles cannot be replayed. | |
| PHOSPHORSHELL_EXPORT QList< Cell > | parseCurrentTiles (const QString &tilesJson, const QString &screenId, const QRect &workArea) |
| parseTileBatch(tileRectsFromJson(tilesJson), screenId, workArea). | |
| PHOSPHORSHELL_EXPORT void | applyOccupancy (QList< Cell > &cells, const QHash< QString, QStringList > &occupancy, const QString &focusedWindowId={}) |
| Mark cells occupied from a window → zone-ids map. | |
| PHOSPHORSHELL_EXPORT void | applyOccupancy (QList< Cell > &cells, const QList< Occupant > &occupants, const QString &focusedWindowId={}) |
| Mark cells occupied from an ordered occupant list. | |
| PHOSPHORSHELL_EXPORT void | applyMetadata (QList< Cell > &cells, const QHash< QString, WindowMeta > &meta) |
| Fill appId / title from meta for every cell with a window id the table knows. | |
| PHOSPHORSHELL_EXPORT void | applyUrgency (QList< Cell > &cells, const QSet< QString > &urgent) |
| Mark the cells whose windowId is in urgent. | |
| PHOSPHORSHELL_EXPORT void | applyFocusByWindowId (QList< Cell > &cells, const QString &windowId) |
| Mark the cell whose id equals windowId focused (tiling cells are keyed by window id). | |
| PHOSPHORSHELL_EXPORT QVariantList | toVariantList (const QList< Cell > &cells) |
| The QML-facing shape: one QVariantMap per cell with the documented keys (id, x, y, w, h, t, occupied, focused, label, zoneNumber, stack, stripT, columnIndex, windowId, appId, title, urgent). | |
| PHOSPHORSHELL_EXPORT QVariantMap | lensToVariant (const QRectF &lens, bool vertical=false) |
| {x, y, w, h, vertical} for a lens band, or an empty map for a null rect. | |
| PHOSPHORSHELL_EXPORT int | modeForScreen (const QString &statesJson, const QString &screenId) |
| Look up one screen's mode in a getScreenStates JSON array. | |
| PHOSPHORSHELL_EXPORT ScreenState | screenStateFor (const QString &statesJson, const QString &screenId) |
| One screen's full row of a getScreenStates JSON array: the mode plus the resolved layout / algorithm / template ids and the daemon's own (desktop, activity) for the screen. | |
| PHOSPHORSHELL_EXPORT QString | dropProxyJson (const QRect &rect, const QVariantList &cells) |
| Build the WindowDrag.registerDropProxy payload. | |
| PHOSPHORSHELL_EXPORT void PhosphorShell::PlacementMapParser::applyFocusByWindowId | ( | QList< Cell > & | cells, |
| const QString & | windowId ) |
Mark the cell whose id equals windowId focused (tiling cells are keyed by window id).
No-op when nothing matches.
| PHOSPHORSHELL_EXPORT void PhosphorShell::PlacementMapParser::applyMetadata | ( | QList< Cell > & | cells, |
| const QHash< QString, WindowMeta > & | meta ) |
Fill appId / title from meta for every cell with a window id the table knows.
Cells without an entry keep empty labels.
| PHOSPHORSHELL_EXPORT void PhosphorShell::PlacementMapParser::applyOccupancy | ( | QList< Cell > & | cells, |
| const QHash< QString, QStringList > & | occupancy, | ||
| const QString & | focusedWindowId = {} ) |
Mark cells occupied from a window → zone-ids map.
occupancy is windowId → the zone ids that window fills (a multi-zone span lists every zone it covers). Floating windows must already be filtered out by the caller. A cell whose id appears for focusedWindowId is also marked focused.
| PHOSPHORSHELL_EXPORT void PhosphorShell::PlacementMapParser::applyOccupancy | ( | QList< Cell > & | cells, |
| const QList< Occupant > & | occupants, | ||
| const QString & | focusedWindowId = {} ) |
Mark cells occupied from an ordered occupant list.
Like the map overload, and additionally sets each occupied cell's windowId to its topmost occupant (the last one listed, or the focused window when it is among them, since focus raises) and urgent when any occupant demands attention.
| PHOSPHORSHELL_EXPORT void PhosphorShell::PlacementMapParser::applyUrgency | ( | QList< Cell > & | cells, |
| const QSet< QString > & | urgent ) |
Mark the cells whose windowId is in urgent.
Tiling and scrolling cells key on their window; snapping cells are marked by the occupant overload of applyOccupancy instead and are left alone here.
| PHOSPHORSHELL_EXPORT QString PhosphorShell::PlacementMapParser::dropProxyJson | ( | const QRect & | rect, |
| const QVariantList & | cells ) |
Build the WindowDrag.registerDropProxy payload.
rect is the miniature's rect in screen-local pixels and cells a list of {id, x, y, w, h} maps, one per zone cell, in the same space. The document is {"rect":[x,y,w,h],"cells":[{"id":..,"rect":[x,y,w,h]},..]}. Entries without an id or with an empty rect are dropped.
| PHOSPHORSHELL_EXPORT qreal PhosphorShell::PlacementMapParser::hueFor | ( | const QRectF & | rect | ) |
Hue for a cell rect: its horizontal centre, clamped to 0..1.
| PHOSPHORSHELL_EXPORT QVariantMap PhosphorShell::PlacementMapParser::lensToVariant | ( | const QRectF & | lens, |
| bool | vertical = false ) |
{x, y, w, h, vertical} for a lens band, or an empty map for a null rect.
| PHOSPHORSHELL_EXPORT int PhosphorShell::PlacementMapParser::modeForScreen | ( | const QString & | statesJson, |
| const QString & | screenId ) |
Look up one screen's mode in a getScreenStates JSON array.
Returns -1 when the screen is not listed or the document is malformed.
| PHOSPHORSHELL_EXPORT QList< Cell > PhosphorShell::PlacementMapParser::parseCurrentTiles | ( | const QString & | tilesJson, |
| const QString & | screenId, | ||
| const QRect & | workArea ) |
parseTileBatch(tileRectsFromJson(tilesJson), screenId, workArea).
| PHOSPHORSHELL_EXPORT QList< Cell > PhosphorShell::PlacementMapParser::parseSnappingLayout | ( | const QString & | layoutJson, |
| const QSize & | workAreaSize, | ||
| qreal | deviceScale = 0.0 ) |
Parse a LayoutRegistry.getLayout JSON document into cells.
Relative zones (relativeGeometry) map straight through. Fixed-mode zones (geometryMode 1 with fixedGeometry in px) are scaled by the work-area size; when that size is unknown (empty) they are dropped, since there is nothing to scale against. Zones with a degenerate rect are dropped as well.
A layout with fixedGeometryInDevicePixels set counts its fixed zones in the output's device pixels, and deviceScale is that output's logical scale (the daemon's Screen.getScreenInfo devicePixelRatio, not the QScreen ratio, which is the integer buffer scale on Wayland). Its fixed zones are divided by the scale before the work area normalises them, and dropped while the scale is unknown (0, the default). The scale is ignored for every other layout.
| PHOSPHORSHELL_EXPORT StripParse PhosphorShell::PlacementMapParser::parseStripModel | ( | const QString & | modelJson | ) |
Parse Scrolling.stripModelJson into cells plus the lens.
One cell per column, keyed by the column's first tile window id, with stack the tile count and focused for activeColumn. The rect's strip axis is the column's position relative to the VIEWPORT window ([viewOffsetPx, viewOffsetPx + viewportPx] maps to 0..1, and the cross axis is the full 0..1), so a column straddling an edge is cut and a column wholly outside is dropped and counted in overflowLeft / overflowRight. t and stripT are the column's start over the whole strip extent, the structure axis of A2 §1.2. The lens is {0, 1} when the whole strip fits the viewport and the viewport's fraction of the strip otherwise. axis 1 (vertical) puts the strip axis on y. An empty object ({}, the daemon's answer for a screen that is not scrolling) or a malformed document parses to nothing.
| PHOSPHORSHELL_EXPORT QList< Cell > PhosphorShell::PlacementMapParser::parseTileBatch | ( | const QList< TileRect > & | tiles, |
| const QString & | screenId, | ||
| const QRect & | workArea ) |
Normalise a tile batch for one screen against the work area.
Entries naming another screen and floating entries are dropped. monocle entries collapse into one cell (the first window's id) whose stack is the number of windows sharing it. Every tiling cell is occupied by definition.
| PHOSPHORSHELL_EXPORT StripParse PhosphorShell::PlacementMapParser::parseVisibleStrip | ( | const QString & | stripJson | ) |
Parse Scrolling.visibleStripJson into cells plus the lens.
The payload only carries the visible cut (0..1 rects with zoneNumber), so the lens is the whole band and the hue axis is the visible cut. That is the fallback for a daemon without stripModelJson.
| PHOSPHORSHELL_EXPORT ScreenState PhosphorShell::PlacementMapParser::screenStateFor | ( | const QString & | statesJson, |
| const QString & | screenId ) |
One screen's full row of a getScreenStates JSON array: the mode plus the resolved layout / algorithm / template ids and the daemon's own (desktop, activity) for the screen.
mode is -1 when the screen is not listed or the document is malformed.
| PHOSPHORSHELL_EXPORT QList< Cell > PhosphorShell::PlacementMapParser::stackedColumns | ( | const QStringList & | windowIds | ) |
Equal columns for a desktop whose tiles cannot be replayed.
A tiling or scrolling desktop that is not current has no engine batch or strip to read, so its map shows what IS known: the desktop's window count, as windowIds.size() equal columns across the work area, each occupied, keyed by its window id and hued at its centre. Empty ids are dropped. An empty list is an empty map.
| PHOSPHORSHELL_EXPORT QList< TileRect > PhosphorShell::PlacementMapParser::tileRectsFromJson | ( | const QString & | tilesJson | ) |
Read a Tiling.currentTilesJson array into tile rects.
Entries are {windowId, x, y, width, height, screenId, monocle, floating, zoneId} in screen pixels, the same shape as a windowsTileRequested batch. Entries without a window id are dropped; nothing else is filtered here so the result can stand in for a batch.
| PHOSPHORSHELL_EXPORT QVariantList PhosphorShell::PlacementMapParser::toVariantList | ( | const QList< Cell > & | cells | ) |
The QML-facing shape: one QVariantMap per cell with the documented keys (id, x, y, w, h, t, occupied, focused, label, zoneNumber, stack, stripT, columnIndex, windowId, appId, title, urgent).