Skip to content
Phosphor
/
API Reference
Search
PlasmaZones
Libraries
Guides
Brand
Palette
About
GitHub
Discord
Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ScrollEngineTypes.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 fuddlesworth
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
4
#pragma once
5
6
// The ScrollEngine's own public VALUE types: what a per-window open rule can
7
// say about an arriving window, and what one visible tile of a strip is.
8
// Split out of ScrollEngine.h at its file-size ceiling, the same hoist
9
// ScrollStashTypes.h made for the stash types. ScrollEngine.h includes this
10
// and aliases both tile types back into the class, so ScrollEngine::VisibleTile
11
// keeps naming ScrollVisibleTile for every existing consumer.
12
//
13
// ScrollTypes.h stays the STRIP MODEL's vocabulary (widths, heights, resolved
14
// columns). The types here describe the engine's API surface around that
15
// model, which is why they live apart from it.
16
17
// The one crossing into the strip model's vocabulary: a visible tile reports
18
// the tab indicator its column draws, and TabIndicatorPosition is that
19
// model's enum. Not re-declared here — a second spelling of the four edges
20
// is exactly the kind of parallel vocabulary the split above exists to avoid.
21
#include <
PhosphorScrollEngine/ScrollTypes.h
>
22
#include <
PhosphorScrollEngine/StripAxis.h
>
23
24
#include <QRect>
25
#include <QRectF>
26
#include <QString>
27
#include <QVector>
28
29
#include <optional>
30
31
namespace
PhosphorScrollEngine
{
32
37
struct
ScrollOpenParams
38
{
39
std::optional<qreal>
widthFraction
;
42
std::optional<qreal>
heightFraction
;
43
std::optional<bool>
tabbed
;
45
std::optional<bool>
consume
;
57
std::optional<bool>
maximized
;
62
std::optional<bool>
focused
;
68
std::optional<QString>
tabGroup
;
69
};
70
88
struct
ScrollVisibleTile
89
{
90
QString
windowId
;
96
int
columnIndex
= -1;
101
int
zoneNumber
= 0;
103
QRect
rect
;
115
int
tabCount
= 0;
119
int
activeTabIndex
= -1;
123
TabIndicatorPosition
tabIndicatorPosition
=
TabIndicatorPosition::Left
;
135
qreal
tabLengthProportion
= 0.0;
136
};
137
140
struct
ScrollVisibleTileWithRect
141
{
142
ScrollVisibleTile
tile
;
144
QRectF
relativeRect
;
145
};
146
155
struct
ScrollStripSnapshotTile
156
{
157
QString
windowId
;
168
QRectF
relRect
;
169
bool
minimized
=
false
;
172
bool
hidden
=
false
;
174
bool
activeTab
=
false
;
175
};
176
183
struct
ScrollStripSnapshotColumn
184
{
185
bool
tabbed
=
false
;
191
qreal
widthFraction
= 0.0;
193
QVector<ScrollStripSnapshotTile>
tiles
;
194
};
195
211
struct
ScrollStripSnapshot
212
{
213
QVector<ScrollStripSnapshotColumn>
columns
;
218
int
activeColumnIndex
= -1;
223
bool
valid
=
false
;
224
};
225
230
struct
ScrollStripModelTile
231
{
232
QString
windowId
;
238
int
crossPx
= 0;
239
bool
minimized
=
false
;
240
};
241
243
struct
ScrollStripModelColumn
244
{
246
int
index
= -1;
249
int
stripPosPx
= 0;
252
int
extentPx
= 0;
253
ColumnDisplay
display
=
ColumnDisplay::Normal
;
256
int
activeTile
= 0;
260
bool
maximized
=
false
;
261
QVector<ScrollStripModelTile>
tiles
;
262
};
263
271
struct
ScrollStripModel
272
{
273
StripAxis
axis
=
StripAxis::horizontal
();
277
int
viewOffsetPx
= 0;
279
int
viewportPx
= 0;
281
int
stripExtentPx
= 0;
283
int
activeColumn
= -1;
284
QVector<ScrollStripModelColumn>
columns
;
285
};
286
287
}
// namespace PhosphorScrollEngine
ScrollTypes.h
StripAxis.h
PhosphorScrollEngine::StripAxis
Coordinate mapping for one strip orientation: a pure value type, trivially copyable,...
Definition
StripAxis.h:35
PhosphorScrollEngine::StripAxis::horizontal
static constexpr StripAxis horizontal()
Definition
StripAxis.h:43
PhosphorScrollEngine
Definition
ScrollEngine.h:46
PhosphorScrollEngine::ColumnDisplay
ColumnDisplay
How a column presents its tiles (niri's column display).
Definition
ScrollTypes.h:246
PhosphorScrollEngine::ColumnDisplay::Normal
@ Normal
Tiles split the column's CROSS extent between them; all are visible.
Definition
ScrollTypes.h:248
PhosphorScrollEngine::TabIndicatorPosition
TabIndicatorPosition
Which side of the column the tab indicator runs along (niri's TabIndicatorPosition,...
Definition
ScrollTypes.h:287
PhosphorScrollEngine::TabIndicatorPosition::Left
@ Left
Definition
ScrollTypes.h:288
PhosphorScrollEngine::ScrollOpenParams
Per-window open-behaviour overrides resolved from window rules (openColumnWidth / openTabbed / openCo...
Definition
ScrollEngineTypes.h:38
PhosphorScrollEngine::ScrollOpenParams::widthFraction
std::optional< qreal > widthFraction
Definition
ScrollEngineTypes.h:39
PhosphorScrollEngine::ScrollOpenParams::maximized
std::optional< bool > maximized
True: the new column opens at the full work-area width (openMaximized rule).
Definition
ScrollEngineTypes.h:57
PhosphorScrollEngine::ScrollOpenParams::tabGroup
std::optional< QString > tabGroup
Named tab group (openTabGroup rule), trimmed and non-empty when engaged.
Definition
ScrollEngineTypes.h:68
PhosphorScrollEngine::ScrollOpenParams::heightFraction
std::optional< qreal > heightFraction
Work-area height fraction (openWindowHeight rule), committed as a Fixed pixel intent against the live...
Definition
ScrollEngineTypes.h:42
PhosphorScrollEngine::ScrollOpenParams::focused
std::optional< bool > focused
Per-window override of IScrollSettings::scrollingFocusNewWindows (openFocused rule).
Definition
ScrollEngineTypes.h:62
PhosphorScrollEngine::ScrollOpenParams::tabbed
std::optional< bool > tabbed
Definition
ScrollEngineTypes.h:43
PhosphorScrollEngine::ScrollOpenParams::consume
std::optional< bool > consume
True: join the focused column instead of opening a new one.
Definition
ScrollEngineTypes.h:45
PhosphorScrollEngine::ScrollStripModelColumn
One column of a strip model, in strip order.
Definition
ScrollEngineTypes.h:244
PhosphorScrollEngine::ScrollStripModelColumn::index
int index
Strip index, which is also the index focusColumnAtIndex takes.
Definition
ScrollEngineTypes.h:246
PhosphorScrollEngine::ScrollStripModelColumn::activeTile
int activeTile
Index into tiles of the column's active tile (the shown tab of a tabbed column).
Definition
ScrollEngineTypes.h:256
PhosphorScrollEngine::ScrollStripModelColumn::tiles
QVector< ScrollStripModelTile > tiles
Definition
ScrollEngineTypes.h:261
PhosphorScrollEngine::ScrollStripModelColumn::maximized
bool maximized
Column::maximizedToEdges, the declared state the compositor mirrors onto the maximize bit.
Definition
ScrollEngineTypes.h:260
PhosphorScrollEngine::ScrollStripModelColumn::display
ColumnDisplay display
Definition
ScrollEngineTypes.h:253
PhosphorScrollEngine::ScrollStripModelColumn::stripPosPx
int stripPosPx
The column's LEADING edge in strip coordinates (the first column's leading edge is 0),...
Definition
ScrollEngineTypes.h:249
PhosphorScrollEngine::ScrollStripModelColumn::extentPx
int extentPx
The column's resolved extent ALONG the strip, in pixels.
Definition
ScrollEngineTypes.h:252
PhosphorScrollEngine::ScrollStripModelTile
One tile of a strip MODEL (see ScrollStripModel).
Definition
ScrollEngineTypes.h:231
PhosphorScrollEngine::ScrollStripModelTile::minimized
bool minimized
Definition
ScrollEngineTypes.h:239
PhosphorScrollEngine::ScrollStripModelTile::windowId
QString windowId
Definition
ScrollEngineTypes.h:232
PhosphorScrollEngine::ScrollStripModelTile::crossPx
int crossPx
The tile's resolved extent ACROSS the strip, in pixels: its height on a horizontal strip,...
Definition
ScrollEngineTypes.h:238
PhosphorScrollEngine::ScrollStripModel
The whole strip of one screen as a renderer of a strip MAP needs it: every column with its strip posi...
Definition
ScrollEngineTypes.h:272
PhosphorScrollEngine::ScrollStripModel::viewOffsetPx
int viewOffsetPx
The viewport's leading edge in strip coordinates.
Definition
ScrollEngineTypes.h:277
PhosphorScrollEngine::ScrollStripModel::axis
StripAxis axis
Definition
ScrollEngineTypes.h:273
PhosphorScrollEngine::ScrollStripModel::activeColumn
int activeColumn
Strip index of the active column, -1 on an empty strip.
Definition
ScrollEngineTypes.h:283
PhosphorScrollEngine::ScrollStripModel::stripExtentPx
int stripExtentPx
Total strip extent: every non-minimized column plus the gaps between.
Definition
ScrollEngineTypes.h:281
PhosphorScrollEngine::ScrollStripModel::columns
QVector< ScrollStripModelColumn > columns
Definition
ScrollEngineTypes.h:284
PhosphorScrollEngine::ScrollStripModel::viewportPx
int viewportPx
The viewport's extent along the strip (the work area's main extent).
Definition
ScrollEngineTypes.h:279
PhosphorScrollEngine::ScrollStripSnapshotColumn
One column of a strip snapshot, in strip order.
Definition
ScrollEngineTypes.h:184
PhosphorScrollEngine::ScrollStripSnapshotColumn::widthFraction
qreal widthFraction
Resolved column extent ALONG THE STRIP as a fraction of the work area's extent on that same axis (eng...
Definition
ScrollEngineTypes.h:191
PhosphorScrollEngine::ScrollStripSnapshotColumn::tabbed
bool tabbed
Definition
ScrollEngineTypes.h:185
PhosphorScrollEngine::ScrollStripSnapshotColumn::tiles
QVector< ScrollStripSnapshotTile > tiles
MODEL tile order, minimized tiles included.
Definition
ScrollEngineTypes.h:193
PhosphorScrollEngine::ScrollStripSnapshotTile
One tile of a strip snapshot (see ScrollEngine::stripSnapshot).
Definition
ScrollEngineTypes.h:156
PhosphorScrollEngine::ScrollStripSnapshotTile::hidden
bool hidden
Non-active tab of a tabbed column.
Definition
ScrollEngineTypes.h:172
PhosphorScrollEngine::ScrollStripSnapshotTile::windowId
QString windowId
Definition
ScrollEngineTypes.h:157
PhosphorScrollEngine::ScrollStripSnapshotTile::relRect
QRectF relRect
Rect relative to the owning column's resolved bounds, 0..1 on x.
Definition
ScrollEngineTypes.h:168
PhosphorScrollEngine::ScrollStripSnapshotTile::minimized
bool minimized
Definition
ScrollEngineTypes.h:169
PhosphorScrollEngine::ScrollStripSnapshotTile::activeTab
bool activeTab
The column's active tile (for a tabbed column: the visible tab).
Definition
ScrollEngineTypes.h:174
PhosphorScrollEngine::ScrollStripSnapshot
A column-aware strip snapshot for drag-popup renderers.
Definition
ScrollEngineTypes.h:212
PhosphorScrollEngine::ScrollStripSnapshot::activeColumnIndex
int activeColumnIndex
Snapshot position of the strip's active column.
Definition
ScrollEngineTypes.h:218
PhosphorScrollEngine::ScrollStripSnapshot::columns
QVector< ScrollStripSnapshotColumn > columns
Definition
ScrollEngineTypes.h:213
PhosphorScrollEngine::ScrollStripSnapshot::valid
bool valid
False when the screen has no strip state or no valid work area — distinct from a valid,...
Definition
ScrollEngineTypes.h:223
PhosphorScrollEngine::ScrollVisibleTileWithRect
A tile paired with its screen-normalized rect, from ONE strip walk (see ScrollEngine::visibleTilesWit...
Definition
ScrollEngineTypes.h:141
PhosphorScrollEngine::ScrollVisibleTileWithRect::tile
ScrollVisibleTile tile
Definition
ScrollEngineTypes.h:142
PhosphorScrollEngine::ScrollVisibleTileWithRect::relativeRect
QRectF relativeRect
Same basis and fallback as ScrollEngine::visibleTileRectsRelative.
Definition
ScrollEngineTypes.h:144
PhosphorScrollEngine::ScrollVisibleTile
One visible tile of a strip: the unit of the scroll "zone number" space.
Definition
ScrollEngineTypes.h:89
PhosphorScrollEngine::ScrollVisibleTile::columnIndex
int columnIndex
Strip index of the owning column.
Definition
ScrollEngineTypes.h:96
PhosphorScrollEngine::ScrollVisibleTile::tabIndicatorPosition
TabIndicatorPosition tabIndicatorPosition
Which edge of the column the indicator runs along.
Definition
ScrollEngineTypes.h:123
PhosphorScrollEngine::ScrollVisibleTile::activeTabIndex
int activeTabIndex
Which tab of tabCount this tile is, 0-based, and -1 when the column draws no indicator.
Definition
ScrollEngineTypes.h:119
PhosphorScrollEngine::ScrollVisibleTile::tabCount
int tabCount
How many tabs the owning column's indicator shows, and 0 when it draws no indicator at all.
Definition
ScrollEngineTypes.h:115
PhosphorScrollEngine::ScrollVisibleTile::tabLengthProportion
qreal tabLengthProportion
How much of that edge the indicator covers, 0 to 1, centered on it (TabIndicatorParams::indicatorRect...
Definition
ScrollEngineTypes.h:135
PhosphorScrollEngine::ScrollVisibleTile::rect
QRect rect
Absolute pixel rect, clipped to the work area.
Definition
ScrollEngineTypes.h:103
PhosphorScrollEngine::ScrollVisibleTile::zoneNumber
int zoneNumber
The tile's 1-based zone number, stamped by the walk.
Definition
ScrollEngineTypes.h:101
PhosphorScrollEngine::ScrollVisibleTile::windowId
QString windowId
Definition
ScrollEngineTypes.h:90
phosphor-scroll-engine
include
PhosphorScrollEngine
ScrollEngineTypes.h
Generated by
1.15.0