2024-06-21 14:32:42 +02:00
|
|
|
#include "globals.hpp"
|
2024-06-22 15:01:47 +02:00
|
|
|
#define private public
|
2024-06-21 14:32:42 +02:00
|
|
|
#include <hyprland/src/managers/PointerManager.hpp>
|
2024-06-22 15:01:47 +02:00
|
|
|
#undef private
|
2024-06-21 14:32:42 +02:00
|
|
|
#include <hyprutils/math/Vector2D.hpp>
|
|
|
|
|
|
|
|
class CDynamicCursors;
|
|
|
|
|
|
|
|
class CDynamicCursors {
|
|
|
|
public:
|
2024-06-22 15:01:47 +02:00
|
|
|
/* hook on onCursorMoved */
|
|
|
|
void onCursorMoved(CPointerManager* pointers);
|
|
|
|
|
2024-06-21 16:06:55 +02:00
|
|
|
/* hook on renderSoftwareCursorsFor */
|
2024-06-21 16:36:10 +02:00
|
|
|
void renderSoftware(CPointerManager* pointers, SP<CMonitor> pMonitor, timespec* now, CRegion& damage, std::optional<Vector2D> overridePos);
|
|
|
|
/* hook on damageIfSoftware*/
|
|
|
|
void damageSoftware(CPointerManager* pointers);
|
2024-06-22 15:01:47 +02:00
|
|
|
/* hook on renderHWCursorBuffer */
|
|
|
|
wlr_buffer* renderHardware(CPointerManager* pointers, SP<CPointerManager::SMonitorPointerState> state, SP<CTexture> texture);
|
|
|
|
/* hook on setHWCursorBuffer */
|
|
|
|
bool setHardware(CPointerManager* pointers, SP<CPointerManager::SMonitorPointerState> state, wlr_buffer* buf);
|
2024-06-21 14:32:42 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// calculates the current angle of the cursor
|
|
|
|
double calculate(Vector2D* pos);
|
|
|
|
// this is the end of the virtual stick
|
|
|
|
Vector2D end;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CDynamicCursors> g_pDynamicCursors;
|