Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorShellPatterns Namespace Reference

Shell UI patterns. More...

Enumerations

enum class  Edge : int { Top = 0 , Bottom = 1 , Left = 2 , Right = 3 }
 Screen edge a Panel anchors to. More...
 
enum class  Corner : int { TopLeft = 0 , TopRight = 1 , BottomLeft = 2 , BottomRight = 3 }
 Screen corner a Toast anchors to. More...
 

Functions

PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::RoleWallpaper ()
 Wallpaper.
 
PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::RoleHud ()
 Heads-up display.
 
PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::RoleModal ()
 Modal dialog.
 
PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::RoleFloating ()
 Free-floating overlay.
 
PHOSPHORSHELLPATTERNS_EXPORT PhosphorLayer::Role Panel (Edge edge)
 Panel anchored to a screen edge, reserving space via exclusive zone, keyboard-on-demand (clicking gives focus).
 
PHOSPHORSHELLPATTERNS_EXPORT PhosphorLayer::Role Toast (Corner corner)
 Transient corner-anchored display.
 

Detailed Description

Shell UI patterns.

The axis-2 vocabulary on top of the wlr-layer-shell primitives in PhosphorLayer::Role.

A Pattern is a UI concept ("a panel reserves screen space", "a toast appears in a corner") realised as a PhosphorLayer::Role bundle. Each Pattern is orthogonal to:

  • axis 1 (compositor primitive: Layer, Anchors, ...). Those live on PhosphorLayer::Role.
  • axis 3 (application role: what the consumer uses it for). Those live in consumer-side role files (e.g. PlasmaZones' pz_roles.h).

This library is the seam between protocol primitives and consumer app-roles, so any Phosphor shell (PZ today, Phosphor-as-standalone tomorrow) composes its public roles from these recipes without having to know the wlr-layer-shell wire details.

The four fixed presets (Wallpaper, Hud, Modal, Floating) are exposed as accessor functions returning const Role&. Each accessor wraps a Meyers-style function-local static so the Role value is constructed on first access regardless of dynamic-initialization order across translation units. Consumers can safely take the result by reference and store derived Roles in their own inline const globals.

Enumeration Type Documentation

◆ Corner

enum class PhosphorShellPatterns::Corner : int
strong

Screen corner a Toast anchors to.

Enumerator
TopLeft 
TopRight 
BottomLeft 
BottomRight 

◆ Edge

enum class PhosphorShellPatterns::Edge : int
strong

Screen edge a Panel anchors to.

Enumerator
Top 
Bottom 
Left 
Right 

Function Documentation

◆ Floating()

PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::Role & PhosphorShellPatterns::Floating ( )

Free-floating overlay.

Overlay layer, no anchors, no keyboard. Position is supplied by the consumer (e.g. shader previews, tear-off windows).

◆ Hud()

PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::Role & PhosphorShellPatterns::Hud ( )

Heads-up display.

Overlay layer, anchors all edges, click-through, no exclusive zone (drawn on top of panels). Typical for drag indicators, zone highlights, focus rings.

◆ Modal()

PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::Role & PhosphorShellPatterns::Modal ( )

Modal dialog.

Top layer, no anchors (centred by the compositor), exclusive keyboard grab. Typical for confirmation prompts, pickers.

◆ Panel()

PHOSPHORSHELLPATTERNS_EXPORT PhosphorLayer::Role PhosphorShellPatterns::Panel ( Edge  edge)

Panel anchored to a screen edge, reserving space via exclusive zone, keyboard-on-demand (clicking gives focus).

The returned PhosphorLayer::Role has the scope prefix "pl-{edge}-panel".

◆ Toast()

PHOSPHORSHELLPATTERNS_EXPORT PhosphorLayer::Role PhosphorShellPatterns::Toast ( Corner  corner)

Transient corner-anchored display.

Click-through, no exclusive zone. Typical for short-lived OSDs, snack-bars, success indicators. The returned PhosphorLayer::Role has the scope prefix "pl-{corner}-toast".

◆ Wallpaper()

PHOSPHORSHELLPATTERNS_EXPORT const PhosphorLayer::Role & PhosphorShellPatterns::Wallpaper ( )

Wallpaper.

Background layer, anchors all edges, exclusive-zone 0 so panels and other layer surfaces render on top. No keyboard.