summaryrefslogtreecommitdiff
path: root/src/managers/PointerManager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/PointerManager.hpp')
-rw-r--r--src/managers/PointerManager.hpp47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/managers/PointerManager.hpp b/src/managers/PointerManager.hpp
index 4b8ec65a..0109268b 100644
--- a/src/managers/PointerManager.hpp
+++ b/src/managers/PointerManager.hpp
@@ -60,10 +60,34 @@ class CPointerManager {
//
Vector2D position();
+ Vector2D hotspot();
Vector2D cursorSizeLogical();
void recheckEnteredOutputs();
+ // returns the thing in global coords
+ CBox getCursorBoxGlobal();
+
+ struct SCursorImage {
+ SP<Aquamarine::IBuffer> pBuffer;
+ SP<CTexture> bufferTex;
+ WP<Desktop::View::CWLSurface> surface;
+
+ Vector2D hotspot;
+ Vector2D size;
+ float scale = 1.F;
+
+ CHyprSignalListener destroySurface;
+ CHyprSignalListener commitSurface;
+ };
+
+ const SCursorImage& currentCursorImage();
+ SP<CTexture> getCurrentCursorTexture();
+
+ struct {
+ CSignalT<> cursorChanged;
+ } m_events;
+
private:
void recheckPointerPosition();
void onMonitorLayoutChange();
@@ -79,13 +103,9 @@ class CPointerManager {
// returns the thing in device coordinates. Is NOT offset by the hotspot, relies on set_cursor with hotspot.
Vector2D getCursorPosForMonitor(PHLMONITOR pMonitor);
// returns the thing in logical coordinates of the monitor
- CBox getCursorBoxLogicalForMonitor(PHLMONITOR pMonitor);
- // returns the thing in global coords
- CBox getCursorBoxGlobal();
-
- Vector2D transformedHotspot(PHLMONITOR pMonitor);
+ CBox getCursorBoxLogicalForMonitor(PHLMONITOR pMonitor);
- SP<CTexture> getCurrentCursorTexture();
+ Vector2D transformedHotspot(PHLMONITOR pMonitor);
struct SPointerListener {
CHyprSignalListener destroy;
@@ -137,20 +157,9 @@ class CPointerManager {
std::vector<CBox> monitorBoxes;
} m_currentMonitorLayout;
- struct {
- SP<Aquamarine::IBuffer> pBuffer;
- SP<CTexture> bufferTex;
- WP<Desktop::View::CWLSurface> surface;
-
- Vector2D hotspot;
- Vector2D size;
- float scale = 1.F;
-
- CHyprSignalListener destroySurface;
- CHyprSignalListener commitSurface;
- } m_currentCursorImage; // TODO: support various sizes per-output so we can have pixel-perfect cursors
+ SCursorImage m_currentCursorImage; // TODO: support various sizes per-output so we can have pixel-perfect cursors
- Vector2D m_pointerPos = {0, 0};
+ Vector2D m_pointerPos = {0, 0};
struct SMonitorPointerState {
SMonitorPointerState(const PHLMONITOR& m) : monitor(m) {}