One screen's view of the placement engine, in work-area fractions. More...
#include <PhosphorShell/PlacementMap.h>
Public Types | |
| enum | Mode { None = -1 , Snapping = 0 , Tiling = 1 , Scrolling = 2 } |
Signals | |
| void | screenIdChanged () |
| void | modeChanged () |
| void | layoutsAvailableChanged () |
| void | aspectChanged () |
| void | workAreaChanged () |
| void | cellsChanged () |
| void | windowsChanged () |
| void | lensChanged () |
| void | overflowChanged () |
| void | stripExtentChanged () |
| void | desktopCountChanged () |
| void | currentDesktopChanged () |
| void | urgentChanged () |
| void | menuModelChanged () |
| void | changed () |
| Coalesced: once per event-loop turn after any of the above. | |
Public Member Functions | |
| PlacementMapScreen (const QString &screenName, PlacementMap *parent) | |
| PlacementMapScreen (const QString &screenName, int desktopIndex, PlacementMap *parent) | |
| A screen pinned to the 0-based desktopIndex (placementmap_desktop.cpp). | |
| ~PlacementMapScreen () override | |
| int | pinnedDesktop () const |
| bool | isPinned () const |
| QString | screenName () const |
| QString | screenId () const |
| int | mode () const |
| bool | layoutsAvailable () const |
| qreal | aspect () const |
| QRect | workArea () const |
| QVariantList | cells () const |
| QVariantList | windows () const |
| void | activateNavigationWindow (const QString &windowId) |
| Activate a window from the complete navigation model. | |
| void | moveNavigationWindowToDesktop (const QString &windowId, int index) |
| Move any window in the navigation model, including offscreen columns. | |
| void | placeNavigationWindowInZone (const QString &windowId, const QString &zoneId) |
| QVariantMap | lens () const |
| int | overflowLeft () const |
| int | overflowRight () const |
| int | stripExtentPx () const |
| int | desktopCount () const |
| int | currentDesktop () const |
| bool | isUrgent () const |
| QVariantList | menuModel () const |
| QRect | cellRect (const QString &id) const |
| The cell's rect in this screen's logical coordinates, origin at its top-left (work-area fractions scaled onto workArea), or a null rect for an unknown id. | |
| QString | focusedCellId () const |
| The id of the cell holding the focused window, or empty. | |
| void | activate (const QString &id) |
| Click on a cell. | |
| void | moveCell (const QString &fromId, const QString &toId) |
| Drag of one cell onto another (A2 §1.5). | |
| void | toggleFloat (const QString &id) |
| Middle-click: float the cell's window. | |
| void | moveToDesktop (const QString &id, int index) |
| Move the cell's window to the desktop at this 0-based row of Workspaces.model (WindowTracking.moveWindowToDesktop, 1-based on the wire). | |
| void | registerDropProxy (const QRect &miniatureScreenRect, const QVariantList &cellScreenRects) |
| Register the miniature as a drop proxy for the compositor's own window drag (WindowDrag.registerDropProxy). | |
| void | unregisterDropProxy () |
| Withdraw the drop proxy, if one is registered. | |
| void | refreshMenu () |
| Re-fetch menuModel for the current mode. | |
| void | setPlacementMode (int mode) |
| void | applyMenuChoice (const QString &kind, const QString &id) |
| Apply one menuModel entry: assign the layout / algorithm / template to this screen and desktop, or run the verb. | |
| void | scrollView (int delta) |
| Wheel over the map. | |
| void | scrollViewByPx (int px) |
| Drag of the lens: pan the strip's view by px in strip space (Scrolling.scrollViewByPx). | |
| void | switchDesktop (int index) |
| Switch to the desktop at this 0-based row of Workspaces.model. | |
| void | reseed () |
| Forget everything and re-resolve from the daemon. | |
| void | serviceLost () |
| The daemon left the bus: mode -1, no cells. | |
| void | refreshMode () |
| Re-read the mode for the current (screen, desktop, activity). | |
| void | refreshGeometry () |
| Re-read the work area, the screen origin and the output's scale. | |
| void | occupancyChanged () |
| Occupancy (snapping) or focus (any mode) changed upstream. | |
| void | tileBatchReceived (const QList< PlacementMapParser::TileRect > &tiles) |
| A windowsTileRequested batch arrived; ignored unless it names us. | |
| void | tilingChanged () |
| Tiling.tilingChanged for this screen. | |
| void | windowStatesChanged () |
| WindowTracking.windowStateChanged landed in the singleton's table (or the table was re-seeded). | |
| void | stripChanged () |
| Scrolling.stripChanged / stripContextChanged for this screen. | |
| void | focusedWindowChanged (const QString &windowId) |
| Tiling.focusedWindowChanged for this screen: the engine's own focus, which supersedes the singleton's focus-request proxy. | |
| void | desktopsChanged () |
One screen's view of the placement engine, in work-area fractions.
Vended by PlacementMap.forScreen(name) and owned by that singleton; QML never constructs one. Every property has its own NOTIFY, and changed() fires once per event-loop turn after any burst of updates, so a painter can bind the properties and repaint on changed.
mode is 0 snapping, 1 tiling, 2 scrolling, and -1 when the daemon is absent or does not list this screen. cells is a list of maps with id, x, y, w, h, t, occupied, focused, label, zoneNumber, stack, stripT, columnIndex, windowId, appId, title, urgent, where the rect is 0..1 of the work area and t is the hue axis (A2 §1.2). lens is {x, w} in scrolling mode and empty otherwise; stripExtentPx is the strip's length in scrolling mode (0 against a daemon without stripModelJson). urgent is true while any cell demands attention (the rail thickening of A2 §3.3).
menuModel is the right-click menu (A2 §1.5): after refreshMenu() it holds one {kind, id, name, current} map per choice for this mode (kind "layout", "algorithm" or "template") followed by {kind: "verb", id} entries (snapping: editLayout, snapAll; tiling: retile, promoteToMaster; scrolling: toggleMaximizeColumn). applyMenuChoice assigns the choice for this screen and desktop, or runs the verb. promoteToMaster and toggleMaximizeColumn act on the screen's own daemon-reported focus, and do nothing without one or on a pinned screen.
workArea and cellRect(id) are in this screen's logical coordinates, origin at the screen's top-left, so a full-screen surface on the screen can place an item on a cell directly (the OSD and toast bands, A3 §3–§4).
currentDesktop and switchDesktop(index) are both 0-based, matching the row index of Workspaces.model.
pinnedDesktop is -1 for the live screen (forScreen) and the 0-based desktop for a screen vended by forScreenDesktop: a view of that desktop's placement whether or not it is current (A3 §7, the dashboard's grid). A pinned screen reads its mode and snapping layout per desktop (getModeForScreenDesktop, getLayoutForScreenDesktop) and its occupancy from WindowTracking.getWindowStatesForDesktop; it never follows the engine's focus or a tile batch, both of which are the current desktop's. See placementmap_desktop.cpp.
| PhosphorShell::PlacementMapScreen::PlacementMapScreen | ( | const QString & | screenName, |
| PlacementMap * | parent ) |
| PhosphorShell::PlacementMapScreen::PlacementMapScreen | ( | const QString & | screenName, |
| int | desktopIndex, | ||
| PlacementMap * | parent ) |
A screen pinned to the 0-based desktopIndex (placementmap_desktop.cpp).
|
override |
| void PhosphorShell::PlacementMapScreen::activate | ( | const QString & | id | ) |
Click on a cell.
Snapping: activate the zone's topmost window (WindowTracking.activateWindow), or snap the focused window into an empty zone. Tiling: activate that window. Scrolling: Scrolling.focusColumnAt, stepping one column at a time toward the cell on a daemon without it.
| void PhosphorShell::PlacementMapScreen::activateNavigationWindow | ( | const QString & | windowId | ) |
Activate a window from the complete navigation model.
| void PhosphorShell::PlacementMapScreen::applyMenuChoice | ( | const QString & | kind, |
| const QString & | id ) |
Apply one menuModel entry: assign the layout / algorithm / template to this screen and desktop, or run the verb.
|
nodiscard |
|
signal |
| QRect PhosphorShell::PlacementMapScreen::cellRect | ( | const QString & | id | ) | const |
The cell's rect in this screen's logical coordinates, origin at its top-left (work-area fractions scaled onto workArea), or a null rect for an unknown id.
|
nodiscard |
|
signal |
|
signal |
Coalesced: once per event-loop turn after any of the above.
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorShell::PlacementMapScreen::desktopsChanged | ( | ) |
| QString PhosphorShell::PlacementMapScreen::focusedCellId | ( | ) | const |
The id of the cell holding the focused window, or empty.
| void PhosphorShell::PlacementMapScreen::focusedWindowChanged | ( | const QString & | windowId | ) |
Tiling.focusedWindowChanged for this screen: the engine's own focus, which supersedes the singleton's focus-request proxy.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
|
nodiscard |
|
signal |
| void PhosphorShell::PlacementMapScreen::moveCell | ( | const QString & | fromId, |
| const QString & | toId ) |
Drag of one cell onto another (A2 §1.5).
Snapping: Snap.swapWindowsById when the target is occupied, else Snap.moveWindowToZone. Tiling: Autotile.swapWindows. Scrolling: Scrolling.moveColumnTo, inert on a daemon without it.
| void PhosphorShell::PlacementMapScreen::moveNavigationWindowToDesktop | ( | const QString & | windowId, |
| int | index ) |
Move any window in the navigation model, including offscreen columns.
| void PhosphorShell::PlacementMapScreen::moveToDesktop | ( | const QString & | id, |
| int | index ) |
Move the cell's window to the desktop at this 0-based row of Workspaces.model (WindowTracking.moveWindowToDesktop, 1-based on the wire).
Inert on a daemon without it.
| void PhosphorShell::PlacementMapScreen::occupancyChanged | ( | ) |
Occupancy (snapping) or focus (any mode) changed upstream.
|
signal |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| void PhosphorShell::PlacementMapScreen::placeNavigationWindowInZone | ( | const QString & | windowId, |
| const QString & | zoneId ) |
| void PhosphorShell::PlacementMapScreen::refreshGeometry | ( | ) |
Re-read the work area, the screen origin and the output's scale.
| void PhosphorShell::PlacementMapScreen::refreshMenu | ( | ) |
Re-fetch menuModel for the current mode.
Async; menuModelChanged fires when the list is in.
| void PhosphorShell::PlacementMapScreen::refreshMode | ( | ) |
Re-read the mode for the current (screen, desktop, activity).
| void PhosphorShell::PlacementMapScreen::registerDropProxy | ( | const QRect & | miniatureScreenRect, |
| const QVariantList & | cellScreenRects ) |
Register the miniature as a drop proxy for the compositor's own window drag (WindowDrag.registerDropProxy).
miniatureScreenRect is the miniature's rect and cellScreenRects one {id, x, y, w, h} map per cell, both in this screen's logical coordinates with its top-left as origin, as the daemon reads them. Snapping only; a no-op otherwise and on a daemon without it. Change-gated: re-sent only when the payload differs.
| void PhosphorShell::PlacementMapScreen::reseed | ( | ) |
Forget everything and re-resolve from the daemon.
Called by the singleton when the service (re)appears.
|
nodiscard |
|
signal |
|
nodiscard |
| void PhosphorShell::PlacementMapScreen::scrollView | ( | int | delta | ) |
Wheel over the map.
Scrolling pans the strip; snapping and tiling move focus one cell in reading order.
| void PhosphorShell::PlacementMapScreen::scrollViewByPx | ( | int | px | ) |
Drag of the lens: pan the strip's view by px in strip space (Scrolling.scrollViewByPx).
Scrolling only.
| void PhosphorShell::PlacementMapScreen::serviceLost | ( | ) |
The daemon left the bus: mode -1, no cells.
| void PhosphorShell::PlacementMapScreen::setPlacementMode | ( | int | mode | ) |
| void PhosphorShell::PlacementMapScreen::stripChanged | ( | ) |
Scrolling.stripChanged / stripContextChanged for this screen.
|
signal |
|
nodiscard |
| void PhosphorShell::PlacementMapScreen::switchDesktop | ( | int | index | ) |
Switch to the desktop at this 0-based row of Workspaces.model.
| void PhosphorShell::PlacementMapScreen::tileBatchReceived | ( | const QList< PlacementMapParser::TileRect > & | tiles | ) |
A windowsTileRequested batch arrived; ignored unless it names us.
| void PhosphorShell::PlacementMapScreen::tilingChanged | ( | ) |
Tiling.tilingChanged for this screen.
| void PhosphorShell::PlacementMapScreen::toggleFloat | ( | const QString & | id | ) |
Middle-click: float the cell's window.
Snapping: Snap.toggleFloatForWindow. Tiling and scrolling: WindowTracking.setWindowFloatingForScreen, falling back to the Snap verb on a daemon without it.
| void PhosphorShell::PlacementMapScreen::unregisterDropProxy | ( | ) |
Withdraw the drop proxy, if one is registered.
|
signal |
|
nodiscard |
|
signal |
| void PhosphorShell::PlacementMapScreen::windowStatesChanged | ( | ) |
WindowTracking.windowStateChanged landed in the singleton's table (or the table was re-seeded).
The live screen rebuilds from it; a pinned screen re-reads its desktop's states instead.
|
nodiscard |
|
signal |