|
| | SnapNavigationTargetResolver (PhosphorEngine::IWindowTrackingService *service, PhosphorZones::LayoutRegistry *layoutManager, IZoneAdjacencyResolver *zoneAdjacency, FeedbackFn feedback) |
| | Construct the resolver with its pure dependencies.
|
| |
| void | setZoneAdjacencyResolver (IZoneAdjacencyResolver *resolver) |
| | Late setter for the zone adjacency resolver — it may not be available at construction time, so we allow nullptr and bind the pointer when it becomes available.
|
| |
| PhosphorProtocol::MoveTargetResult | getMoveTargetForWindow (const QString &windowId, const QString &direction, const QString &screenId) |
| |
| PhosphorProtocol::FocusTargetResult | getFocusTargetForWindow (const QString &windowId, const QString &direction, const QString &screenId) |
| |
| PhosphorProtocol::RestoreTargetResult | getRestoreForWindow (const QString &windowId, const QString &screenId) |
| |
| PhosphorProtocol::CycleTargetResult | getCycleTargetForWindow (const QString &windowId, bool forward, const QString &screenId) |
| |
| PhosphorProtocol::SwapTargetResult | getSwapTargetForWindow (const QString &windowId, const QString &direction, const QString &screenId) |
| |
| PhosphorProtocol::MoveTargetResult | getPushTargetForWindow (const QString &windowId, const QString &screenId) |
| |
| PhosphorProtocol::MoveTargetResult | getSnapToZoneByNumberTarget (const QString &windowId, int zoneNumber, const QString &screenId) |
| |
Pure snap-mode navigation target resolver.
Computes geometry targets for snap-mode keyboard navigation (move, focus, swap, push, snap-by-number, cycle, restore). Extracted from WindowTrackingAdaptor so that the adaptor's D-Bus surface no longer carries ~400 lines of snap-internal computation as member methods.
Separation of concerns:
- This class is pure compute. It holds const* references to WindowTrackingService / PhosphorZones::LayoutRegistry / IZoneAdjacencyResolver and reads from them. It does not mutate their state.
- It never touches D-Bus or Qt signals directly — navigation feedback (OSD data) is emitted through a std::function callback wired at construction time. The adaptor forwards that callback to its own navigationFeedback signal.
- Validation failures (empty windowId, empty direction) are considered pre-call contract violations and return an early noSnap-equivalent result; the adaptor's dispatcher is expected to catch these before they reach the resolver.
This class is deliberately not a QObject — it needs no signals of its own, and the absence of QObject machinery makes it trivially constructable for unit tests. The single dependency on Qt is the shared result-struct types (PhosphorProtocol::MoveTargetResult etc. from PhosphorProtocol/NavigationTypes.h).
All methods are intended to be called only for screens that the router (ScreenModeRouter) has confirmed are in Snapping mode. The resolver does not re-check mode — that's the dispatcher's job.