#pragma once #include #include #include #include #include #include #include "helpers/memory/Memory.hpp" // gangsta bootleg XCursor impl. adidas balkanized struct SXCursorImage { Hyprutils::Math::Vector2D size; Hyprutils::Math::Vector2D hotspot; std::vector pixels; // XPixel is a u32 uint32_t delay; // animation delay to next frame (ms) }; struct SXCursors { std::vector images; std::string shape; }; class CXCursorManager { public: CXCursorManager(); ~CXCursorManager() = default; void loadTheme(const std::string& name, int size, float scale); SP getShape(std::string const& shape, int size, float scale); void syncGsettings(); private: SP createCursor(std::string const& shape, void* /* XcursorImages* */ xImages); std::set themePaths(std::string const& theme); std::string getLegacyShapeName(std::string const& shape); std::vector> loadStandardCursors(std::string const& name, int size); std::vector> loadAllFromDir(std::string const& path, int size); int m_lastLoadSize = 0; float m_lastLoadScale = 0; std::string m_themeName = ""; SP m_defaultCursor; SP m_hyprCursor; std::vector> m_cursors; };