#include "globals.hpp" #define private public #include #undef private #include #include #include "mode/ModeRotate.hpp" #include "mode/ModeTilt.hpp" #include "other/Shake.hpp" class CDynamicCursors { public: CDynamicCursors(); ~CDynamicCursors(); /* hook on onCursorMoved */ void onCursorMoved(CPointerManager* pointers); /* called on tick */ void onTick(CPointerManager* pointers); /* hook on renderSoftwareCursorsFor */ void renderSoftware(CPointerManager* pointers, SP pMonitor, timespec* now, CRegion& damage, std::optional overridePos); /* hook on damageIfSoftware*/ void damageSoftware(CPointerManager* pointers); /* hook on renderHWCursorBuffer */ wlr_buffer* renderHardware(CPointerManager* pointers, SP state, SP texture); /* hook on setHWCursorBuffer */ bool setHardware(CPointerManager* pointers, SP state, wlr_buffer* buf); private: SP tick; // current angle of the cursor in radiants double angle; // current zoom value of the cursor double zoom = 1; // whether we have already locked software for cursor zoom bool zoomSoftware = false; // modes CModeRotate rotate; CModeTilt tilt; /* returns the current mode, nullptr if none is selected */ IMode* currentMode(); // shake CShake shake; // calculates the current angle of the cursor, and changes the cursor shape void calculate(EModeUpdate type); }; inline std::unique_ptr g_pDynamicCursors;