Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorSnapEngine::IZoneAdjacencyResolver Class Referenceabstract

Narrow interface for zone-adjacency queries used by snap navigation. More...

#include <PhosphorSnapEngine/IZoneAdjacencyResolver.h>

Public Member Functions

 IZoneAdjacencyResolver ()=default
virtual ~IZoneAdjacencyResolver ()
virtual QString getAdjacentZone (const QString &currentZoneId, const QString &direction, const QString &screenId) const =0
 Find the zone adjacent to currentZoneId in direction.
virtual QString getFirstZoneInDirection (const QString &direction, const QString &screenId) const =0
 Find the edge zone in direction when no current zone exists.
virtual QString getAdjacentZoneOutside (const QStringList &zoneIds, const QString &direction, const QString &screenId) const
 The zone next to the span zoneIds (their union) in direction, never one of them.
virtual QString getFirstZoneInDirectionOnDesktop (const QString &direction, const QString &screenId, int desktop) const
 getFirstZoneInDirection on desktop's layout (<= 0: the desktop the screen shows).
 IZoneAdjacencyResolver (const IZoneAdjacencyResolver &)=delete
IZoneAdjacencyResolver & operator= (const IZoneAdjacencyResolver &)=delete

Detailed Description

Narrow interface for zone-adjacency queries used by snap navigation.

Snap navigation (SnapNavigationTargetResolver and the engine's cross-monitor crossing) needs directional zone lookups that live on the daemon's ZoneDetectionAdaptor:

  • getAdjacentZone (find the zone next to a given zone in a direction)
  • getAdjacentZoneOutside (the same for a span, never one of its zones)
  • getFirstZoneInDirection (find the edge zone when no current zone exists)
  • getFirstZoneInDirectionOnDesktop (the same on a given desktop's layout)

Rather than holding an opaque QObject* and dispatching through QMetaObject::invokeMethod, the resolver now depends on this typed interface. The daemon's ZoneDetectionAdaptor must implement (or wrap) IZoneAdjacencyResolver so that the engine receives a typed pointer.

Not a QObject — pure data queries with no lifecycle signals.

Constructor & Destructor Documentation

◆ IZoneAdjacencyResolver() [1/2]

PhosphorSnapEngine::IZoneAdjacencyResolver::IZoneAdjacencyResolver ( )
default

◆ ~IZoneAdjacencyResolver()

virtual PhosphorSnapEngine::IZoneAdjacencyResolver::~IZoneAdjacencyResolver ( )
virtual

◆ IZoneAdjacencyResolver() [2/2]

PhosphorSnapEngine::IZoneAdjacencyResolver::IZoneAdjacencyResolver ( const IZoneAdjacencyResolver & )
delete

Member Function Documentation

◆ getAdjacentZone()

virtual QString PhosphorSnapEngine::IZoneAdjacencyResolver::getAdjacentZone ( const QString & currentZoneId,
const QString & direction,
const QString & screenId ) const
pure virtual

Find the zone adjacent to currentZoneId in direction.

Parameters
currentZoneIdZone the window is currently snapped to
direction"left", "right", "up", or "down"
screenIdScreen context for multi-monitor layouts
Returns
Zone ID of the adjacent zone, or empty string if none exists

◆ getAdjacentZoneOutside()

virtual QString PhosphorSnapEngine::IZoneAdjacencyResolver::getAdjacentZoneOutside ( const QStringList & zoneIds,
const QString & direction,
const QString & screenId ) const
virtual

The zone next to the span zoneIds (their union) in direction, never one of them.

Appended. The default answers getAdjacentZone(zoneIds.first(), ...), the pre-span behaviour.

◆ getFirstZoneInDirection()

virtual QString PhosphorSnapEngine::IZoneAdjacencyResolver::getFirstZoneInDirection ( const QString & direction,
const QString & screenId ) const
pure virtual

Find the edge zone in direction when no current zone exists.

Used when a window is not yet snapped and the user presses a navigation key. Returns the zone at the layout edge in the given direction (e.g. leftmost zone for "left").

Parameters
direction"left", "right", "up", or "down"
screenIdScreen context for multi-monitor layouts
Returns
Zone ID of the edge zone, or empty string if none exists

◆ getFirstZoneInDirectionOnDesktop()

virtual QString PhosphorSnapEngine::IZoneAdjacencyResolver::getFirstZoneInDirectionOnDesktop ( const QString & direction,
const QString & screenId,
int desktop ) const
virtual

getFirstZoneInDirection on desktop's layout (<= 0: the desktop the screen shows).

Appended. The default ignores desktop.

◆ operator=()

IZoneAdjacencyResolver & PhosphorSnapEngine::IZoneAdjacencyResolver::operator= ( const IZoneAdjacencyResolver & )
delete

The documentation for this class was generated from the following file: