summaryrefslogtreecommitdiff
path: root/src/desktop/WindowRule.hpp
blob: 9af3909aa09daeacb49ea9fbbf73de0f54a9e81d (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once

#include <string>
#include <cstdint>
#include "Rule.hpp"

class CWindowRule {
  public:
    CWindowRule(const std::string& rule, const std::string& value, bool isV2 = false, bool isExecRule = false);

    enum eRuleType : uint8_t {
        RULE_INVALID = 0,
        RULE_FLOAT,
        RULE_FULLSCREEN,
        RULE_MAXIMIZE,
        RULE_NOINITIALFOCUS,
        RULE_PIN,
        RULE_STAYFOCUSED,
        RULE_TILE,
        RULE_RENDERUNFOCUSED,
        RULE_ANIMATION,
        RULE_BORDERCOLOR,
        RULE_CENTER,
        RULE_FULLSCREENSTATE,
        RULE_GROUP,
        RULE_IDLEINHIBIT,
        RULE_MAXSIZE,
        RULE_MINSIZE,
        RULE_MONITOR,
        RULE_MOVE,
        RULE_OPACITY,
        RULE_PLUGIN,
        RULE_PSEUDO,
        RULE_SIZE,
        RULE_SUPPRESSEVENT,
        RULE_TAG,
        RULE_WORKSPACE,
        RULE_PROP,
        RULE_CONTENT,
        RULE_PERSISTENTSIZE,
        RULE_NOCLOSEFOR,
    };

    eRuleType         m_ruleType = RULE_INVALID;

    const std::string m_value;
    const std::string m_rule;
    const bool        m_v2       = false;
    const bool        m_execRule = false;

    std::string       m_title;
    std::string       m_class;
    std::string       m_initialTitle;
    std::string       m_initialClass;
    std::string       m_tag;
    int               m_X11             = -1; // -1 means "ANY"
    int               m_floating        = -1;
    int               m_fullscreen      = -1;
    int               m_pinned          = -1;
    int               m_focus           = -1;
    std::string       m_fullscreenState = ""; // empty means any
    std::string       m_onWorkspace     = ""; // empty means any
    std::string       m_workspace       = ""; // empty means any
    std::string       m_contentType     = ""; // empty means any
    std::string       m_xdgTag          = ""; // empty means any

    // precompiled regexes
    CRuleRegexContainer m_titleRegex;
    CRuleRegexContainer m_classRegex;
    CRuleRegexContainer m_initialTitleRegex;
    CRuleRegexContainer m_initialClassRegex;
    CRuleRegexContainer m_v1Regex;
};