2024-03-07 04:19:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "internalSharedTypes.hpp"
|
|
|
|
#include <optional>
|
|
|
|
#include <cairo/cairo.h>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
struct SLoadedCursorImage {
|
|
|
|
~SLoadedCursorImage() {
|
|
|
|
if (data)
|
|
|
|
delete[] (char*)data;
|
2024-03-07 15:50:48 +01:00
|
|
|
if (artificialData)
|
|
|
|
delete[] (char*)artificialData;
|
|
|
|
if (cairoSurface)
|
|
|
|
cairo_surface_destroy(cairoSurface);
|
2024-03-07 04:19:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// read stuff
|
|
|
|
size_t readNeedle = 0;
|
|
|
|
void* data = nullptr;
|
|
|
|
size_t dataLen = 0;
|
|
|
|
|
|
|
|
cairo_surface_t* cairoSurface = nullptr;
|
|
|
|
int side = 0;
|
2024-03-07 17:01:45 +01:00
|
|
|
int delay = 0;
|
2024-03-07 15:50:48 +01:00
|
|
|
|
|
|
|
// means this was created by resampling
|
|
|
|
void* artificialData = nullptr;
|
|
|
|
bool artificial = false;
|
2024-03-07 04:19:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SLoadedCursorShape {
|
|
|
|
std::vector<std::unique_ptr<SLoadedCursorImage>> images;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CHyprcursorImplementation {
|
|
|
|
public:
|
|
|
|
std::string themeName;
|
|
|
|
std::string themeFullDir;
|
|
|
|
|
|
|
|
SCursorTheme theme;
|
|
|
|
|
|
|
|
//
|
|
|
|
std::unordered_map<SCursorShape*, SLoadedCursorShape> loadedShapes;
|
|
|
|
|
|
|
|
//
|
|
|
|
std::optional<std::string> loadTheme();
|
|
|
|
};
|