blob: 944614ce6d21810168d70c45b7c69674a8db27f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#pragma once
#include "../Rule.hpp"
#include "../../DesktopTypes.hpp"
#include "WindowRuleEffectContainer.hpp"
#include "../../../helpers/math/Math.hpp"
#include <unordered_set>
namespace Desktop::Rule {
constexpr const char* EXEC_RULE_ENV_NAME = "HL_EXEC_RULE_TOKEN";
std::optional<Vector2D> parseRelativeVector(PHLWINDOW w, const std::string& s);
class CWindowRule : public IRule {
private:
using storageType = CWindowRuleEffectContainer::storageType;
public:
CWindowRule(const std::string& name = "");
virtual ~CWindowRule() = default;
static SP<CWindowRule> buildFromExecString(std::string&&);
virtual eRuleType type();
void addEffect(storageType e, const std::string& result);
const std::vector<std::pair<storageType, std::string>>& effects();
const std::unordered_set<storageType>& effectsSet();
bool matches(PHLWINDOW w, bool allowEnvLookup = false);
private:
std::vector<std::pair<storageType, std::string>> m_effects;
std::unordered_set<storageType> m_effectSet;
};
};
|