hyprlock/src/renderer/widgets/IWidget.hpp
bvr-yr 066e0ae88f
core: force update labels on SIGUSR2 (#169)
* core: force update labels on `SIGUSR2`

* allow 0ms and force
2024-03-10 21:38:01 +00:00

25 lines
709 B
C++

#pragma once
#include "../../helpers/Vector2D.hpp"
#include <string>
class IWidget {
public:
struct SRenderData {
float opacity = 1;
};
virtual bool draw(const SRenderData& data) = 0;
virtual Vector2D posFromHVAlign(const Vector2D& viewport, const Vector2D& size, const Vector2D& offset, const std::string& halign, const std::string& valign);
struct SFormatResult {
std::string formatted;
float updateEveryMs = 0; // 0 means don't (static)
bool alwaysUpdate = false;
bool cmd = false;
bool allowForceUpdate = false;
};
virtual SFormatResult formatString(std::string in);
};