windowrules: allow incrementing window props (#9566)

This commit is contained in:
MightyPlaza
2025-04-15 23:00:40 +00:00
committed by GitHub
parent 8b7b169043
commit ffd6cf65e4
21 changed files with 191 additions and 102 deletions

View File

@@ -4,21 +4,19 @@
#include <typeindex>
#include <hyprlang.hpp>
#include "../macros.hpp"
#include "ConfigManager.hpp"
// giga hack to avoid including configManager here
// NOLINTNEXTLINE
void local__configValuePopulate(void* const** p, const std::string& val);
std::type_index local__configValueTypeIdx(const std::string& val);
template <typename T>
class CConfigValue {
public:
CConfigValue(const std::string& val) {
const auto PVHYPRLANG = g_pConfigManager->getHyprlangConfigValuePtr(val);
// NOLINTNEXTLINE
p_ = PVHYPRLANG->getDataStaticPtr();
#ifdef HYPRLAND_DEBUG
// verify type
const auto ANY = PVHYPRLANG->getValue();
const auto TYPE = std::type_index(ANY.type());
const auto TYPE = local__configValueTypeIdx(val);
// exceptions
const bool STRINGEX = (typeid(T) == typeid(std::string) && TYPE == typeid(Hyprlang::STRING));
@@ -26,6 +24,8 @@ class CConfigValue {
RASSERT(typeid(T) == TYPE || STRINGEX || CUSTOMEX, "Mismatched type in CConfigValue<T>, got {} but has {}", typeid(T).name(), TYPE.name());
#endif
local__configValuePopulate(&p_, val);
}
T* ptr() const {