Efficient zone detection for window snapping. More...
#include <phosphor-zones/include/PhosphorZones/ZoneDetector.h>
Public Member Functions | |
| ZoneDetector (QObject *parent=nullptr) | |
| ~ZoneDetector () override | |
| Layout * | layout () const override |
| void | setLayout (Layout *layout) override |
| void | setAdjacentThreshold (int px) |
| Set the adjacency threshold used by detectMultiZone / areZonesAdjacent. | |
| int | adjacentThreshold () const |
| ZoneDetectionResult | detectZone (const QPointF &cursorPos) const override |
| ZoneDetectionResult | detectMultiZone (const QPointF &cursorPos) const override |
| QVector< Zone * > | expandPaintedZonesToRect (const QVector< Zone * > &seedZones) const override |
| Expand painted zones to include all zones that intersect the bounding rect. | |
| Zone * | zoneAtPoint (const QPointF &point) const override |
| Zone * | nearestZone (const QPointF &point) const override |
| void | highlightZone (Zone *zone) override |
| void | highlightZones (const QVector< Zone * > &zones) override |
| void | clearHighlights () override |
Public Member Functions inherited from PhosphorZones::IZoneDetector | |
| IZoneDetector (QObject *parent=nullptr) | |
| ~IZoneDetector () override | |
Public Member Functions inherited from PhosphorZones::IZoneDetection | |
| IZoneDetection ()=default | |
| virtual | ~IZoneDetection () |
Additional Inherited Members | |
Signals inherited from PhosphorZones::IZoneDetector | |
| void | layoutChanged () |
| void | zoneHighlighted (Zone *zone) |
| void | highlightsCleared () |
Protected Member Functions inherited from PhosphorZones::IZoneDetection | |
| IZoneDetection (const IZoneDetection &)=default | |
| IZoneDetection & | operator= (const IZoneDetection &)=default |
Efficient zone detection for window snapping.
The ZoneDetector provides optimized algorithms for determining which zone(s) a window should snap to based on cursor position. It supports:
Note: This class does NOT use the singleton pattern. Create instances where needed and pass via dependency injection.
|
explicit |
|
override |
|
inline |
|
overridevirtual |
Implements PhosphorZones::IZoneDetector.
|
overridevirtual |
Implements PhosphorZones::IZoneDetection.
|
overridevirtual |
Implements PhosphorZones::IZoneDetection.
|
overridevirtual |
Expand painted zones to include all zones that intersect the bounding rect.
Uses the same raycasting/intersection algorithm as detectMultiZone and the editor. When user paints over zones 1 and 2, this returns zones 1,2,3,4 if 3 and 4 also intersect the minimal rectangle spanning the painted zones.
Implements PhosphorZones::IZoneDetection.
|
overridevirtual |
Implements PhosphorZones::IZoneDetector.
|
overridevirtual |
Implements PhosphorZones::IZoneDetector.
|
inlineoverridevirtual |
Implements PhosphorZones::IZoneDetection.
|
overridevirtual |
Implements PhosphorZones::IZoneDetection.
|
inline |
Set the adjacency threshold used by detectMultiZone / areZonesAdjacent.
Zones whose edges are within px pixels of each other are treated as adjacent for multi-zone selection. The daemon typically wires this to the live Settings value (via the adjacentThresholdChanged signal) so users can tune detection sensitivity without reconstructing the detector. Fine-grained injection of the int, rather than a whole ISettings pointer, keeps ZoneDetector independent of the settings layer — prerequisite for moving it into a standalone phosphor-zones library.
|
overridevirtual |
Implements PhosphorZones::IZoneDetector.
|
overridevirtual |
Implements PhosphorZones::IZoneDetection.