Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ScrollTypes.h File Reference
#include <PhosphorScrollEngine/StripAxis.h>
#include <QList>
#include <QRect>
#include <QSize>
#include <QString>
#include <QVector>
#include <functional>
#include <optional>

Go to the source code of this file.

Classes

struct  PhosphorScrollEngine::ScrollBlueprintProgress
 How far a screen has worked through its context template's seed blueprint. More...
struct  PhosphorScrollEngine::TabIndicatorParams
 The tab indicator's GEOMETRY inputs — the subset of the Scrolling.TabIndicator family that changes resolved rects, so it has to live in the layout params rather than staying with the paint half. More...
struct  PhosphorScrollEngine::ColumnWidth
 Column width INTENT — the source of truth the strip stores. More...
struct  PhosphorScrollEngine::WindowHeight
 Tile height INTENT within a column (its extent ACROSS the strip). More...
struct  PhosphorScrollEngine::Tile
 One window in a column. More...
struct  PhosphorScrollEngine::Column
 One column: a stack of tiles ACROSS the strip (vertical on a horizontal strip, horizontal on a vertical one). More...
struct  PhosphorScrollEngine::ScrollLayoutParams
 Inputs a relayout resolves pixel rects against. More...
struct  PhosphorScrollEngine::ResolvedTile
 One tile's resolved output for a relayout pass. More...
struct  PhosphorScrollEngine::ResolvedColumn
 One column's resolved output. More...
struct  PhosphorScrollEngine::ResolvedStrip
 A full relayout pass over one strip. More...

Namespaces

namespace  PhosphorScrollEngine
namespace  PhosphorScrollEngine::ScrollPerScreenKeys
 Per-screen override-map keys for ScrollEngine::applyPerScreenConfig.

Enumerations

enum class  PhosphorScrollEngine::CenterFocusedColumn : int { PhosphorScrollEngine::Never = 0 , PhosphorScrollEngine::Always = 1 , PhosphorScrollEngine::OnOverflow = 2 }
 Persistent view-centering policy for the focused column (niri's center-focused-column). More...
enum class  PhosphorScrollEngine::ColumnDisplay : int { PhosphorScrollEngine::Normal = 0 , PhosphorScrollEngine::Tabbed = 1 }
 How a column presents its tiles (niri's column display). More...
enum class  PhosphorScrollEngine::TabIndicatorPosition : int { PhosphorScrollEngine::Left = 0 , PhosphorScrollEngine::Right = 1 , PhosphorScrollEngine::Top = 2 , PhosphorScrollEngine::Bottom = 3 }
 Which side of the column the tab indicator runs along (niri's TabIndicatorPosition, same declaration order). More...
enum class  PhosphorScrollEngine::DefaultWidthKind : int { PhosphorScrollEngine::Proportion = 0 , PhosphorScrollEngine::Fixed = 1 , PhosphorScrollEngine::ClientDecides = 2 , PhosphorScrollEngine::Preset = 3 }
 Wire vocabulary of the DEFAULT-column-width KIND setting (IScrollSettings::scrollingDefaultColumnWidthKind). More...
enum class  PhosphorScrollEngine::DefaultHeightKind : int { PhosphorScrollEngine::Auto = 0 , PhosphorScrollEngine::Fixed = 1 , PhosphorScrollEngine::Preset = 2 , PhosphorScrollEngine::ClientDecides = 3 }
 Wire vocabulary of the DEFAULT-window-height KIND setting. More...
enum class  PhosphorScrollEngine::ScrollInsertPosition : int {
  PhosphorScrollEngine::RightOfActive = 0 , PhosphorScrollEngine::LeftOfActive = 1 , PhosphorScrollEngine::First = 2 , PhosphorScrollEngine::Last = 3 ,
  PhosphorScrollEngine::IntoActiveColumn = 4
}
 Where a fresh-opened window's new column enters the strip (config default; the openColumnPlacement window rule outranks it). More...

Functions

QString PhosphorScrollEngine::ScrollPerScreenKeys::centerFocusedColumn ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::stripAxis ()
 SHARED key: which way this screen's strip runs, as the TRI-STATE intent (0 auto, 1 horizontal, 2 vertical) — not the resolved two-valued PhosphorProtocol::ScrollAxis, whose Horizontal is 0.
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultColumnWidth ()
 RULE channel: a bare work-area fraction (SetScrollDefaultColumnWidth).
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultColumnDisplay ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultColumnWidthKind ()
 SETTINGS channel: the per-screen override map mirrors the config's kind-aware width trio so a monitor can pin Fixed pixels or a preset index, which the rule channel's bare fraction cannot express.
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultColumnWidthValue ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultColumnWidthPresetIndex ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultWindowHeight ()
 RULE channel for the default window height: a bare work-area fraction (resolved against the live work area at relayout, committed as Fixed).
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultWindowHeightKind ()
 SETTINGS channel height trio (kind / fixed px / preset index).
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultWindowHeightValue ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::defaultWindowHeightPresetIndex ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::insertPosition ()
 RULE channel (SetScrollInsertPosition); the settings store deliberately does not write it — insert position is app-wide config, per-context only via rules, matching the tiling siblings' exposure.
QString PhosphorScrollEngine::ScrollPerScreenKeys::alwaysCenterSingleColumn ()
 RULE channel for the scrolling BEHAVIOUR toggles (SetScrollAlwaysCenter- SingleColumn / …CenterShortColumns / …RespectMinimumSize / …CropStraddlers / …FocusNewWindows / …SmartGaps / …StickyWindowHandling).
QString PhosphorScrollEngine::ScrollPerScreenKeys::centerShortColumns ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::respectMinimumSize ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::cropStraddlers ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::focusNewWindows ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::smartGaps ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::stickyWindowHandling ()
 StickyWindowHandling ints (treatAsNormal 0 / restoreOnly 1 / ignoreAll 2).
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorEnabled ()
 RULE channel for the tab indicator's GEOMETRY half, one key per property so independent rules cascade per-property the way the width trio does.
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorHideWhenSingleTab ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorPlaceWithinColumn ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorGap ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorWidth ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorLengthProportion ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::tabIndicatorPosition ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::presetColumnWidths ()
 TEMPLATE channel: preset lists from the screen's assigned scrolling template, as a QVariantList of doubles.
QString PhosphorScrollEngine::ScrollPerScreenKeys::presetWindowHeights ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::templateColumns ()
 TEMPLATE channel: the template's seed BLUEPRINT as a QVariantList of {width (double fraction), display (int ColumnDisplay)} maps, ordered along the strip.
QString PhosphorScrollEngine::ScrollPerScreenKeys::templateColumnWidth ()
QString PhosphorScrollEngine::ScrollPerScreenKeys::templateColumnDisplay ()
bool PhosphorScrollEngine::isVerticalTabIndicator (TabIndicatorPosition position)
 True when position puts the indicator on a vertical edge, so its long axis is the column's HEIGHT and its thickness eats the column's WIDTH.
int PhosphorScrollEngine::nearestPresetIndex (const QList< qreal > &presets, qreal fraction)
 Shared nearest-entry resolution for the fraction anchors above — the ONE implementation behind preset resolution, cycling, and height-fraction probes (it replaced three per-site variants).
qreal PhosphorScrollEngine::nearestPresetValue (const QList< qreal > &presets, qreal fraction, qreal fallback=0.5)
 The nearest entry's VALUE.
int PhosphorScrollEngine::proportionalPx (qreal proportion, int workExtent, int gap)
 A proportion resolves against the work extent PLUS one gap so that proportions summing to 1 tile edge-to-edge with the gaps between them (0.5 + 0.5 across a 1000px area with a 10px gap → 495 + 10 + 495).
template<typename Resolver>
int PhosphorScrollEngine::cyclePresetIndexByExtent (int count, int currentPx, int delta, Resolver resolve)
 The vocabulary index a preset CYCLE press lands on, given what the target currently measures on screen.
QVector< const ResolvedColumn * > PhosphorScrollEngine::visibleColumnsOf (const ResolvedStrip &resolved, const QRect &workArea)
 The columns of resolved that intersect workArea, in strip order.

Variables

constexpr qreal PhosphorScrollEngine::MinColumnWidthFraction = 0.05
 The narrowest column width this engine will accept as a proportion of the work area.
constexpr qreal PhosphorScrollEngine::MinWindowHeightFraction = 0.05
 The shortest tile height this engine will accept as a proportion of the work area.