mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
chore: more abstraction and other refactors
This commit is contained in:
parent
4f0a765aa7
commit
fa7cab8717
9 changed files with 263 additions and 175 deletions
19
src/mode/Mode.hpp
Normal file
19
src/mode/Mode.hpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <hyprutils/math/Vector2D.hpp>
|
||||
|
||||
using namespace Hyprutils::Math;
|
||||
|
||||
/* specifies when a mode wants to be updated */
|
||||
enum EModeUpdate {
|
||||
MOVE, // on mouse move
|
||||
TICK // on tick (i.e. every frame)
|
||||
};
|
||||
|
||||
class IMode {
|
||||
public:
|
||||
/* returns the desired updating strategy for the given mode */
|
||||
virtual EModeUpdate strategy() = 0;
|
||||
/* updates the calculations and returns the new angle */
|
||||
virtual double update(Vector2D pos) = 0;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue