hyprlock/src/renderer/widgets/IWidget.hpp

26 lines
709 B
C++
Raw Normal View History

2024-02-19 00:08:03 +01:00
#pragma once
2024-02-19 23:45:59 +01:00
#include "../../helpers/Vector2D.hpp"
#include <string>
2024-02-19 00:08:03 +01:00
class IWidget {
public:
2024-02-19 17:26:08 +01:00
struct SRenderData {
float opacity = 1;
};
2024-02-19 23:45:59 +01:00
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);
2024-02-20 01:11:19 +01:00
struct SFormatResult {
std::string formatted;
float updateEveryMs = 0; // 0 means don't (static)
bool alwaysUpdate = false;
bool cmd = false;
bool allowForceUpdate = false;
2024-02-20 01:11:19 +01:00
};
virtual SFormatResult formatString(std::string in);
};