11#pragma once
22
33#include < unordered_map>
4+ #include < unordered_set>
45
56#include " WindowRuleEffectContainer.hpp"
67#include " ../../DesktopTypes.hpp"
@@ -29,10 +30,11 @@ namespace Desktop::Rule {
2930 CWindowRuleApplicator (CWindowRuleApplicator&) = delete ;
3031 CWindowRuleApplicator (CWindowRuleApplicator&&) = delete ;
3132
32- void propertiesChanged (std::underlying_type_t <eRuleProperty> props);
33- void resetProps (std::underlying_type_t <eRuleProperty> props, Types::eOverridePriority prio = Types::PRIORITY_WINDOW_RULE);
34- void readStaticRules ();
35- void applyStaticRules ();
33+ void propertiesChanged (std::underlying_type_t <eRuleProperty> props);
34+ std::unordered_set<CWindowRuleEffectContainer::storageType> resetProps (std::underlying_type_t <eRuleProperty> props,
35+ Types::eOverridePriority prio = Types::PRIORITY_WINDOW_RULE);
36+ void readStaticRules ();
37+ void applyStaticRules ();
3638
3739 // static props
3840 struct {
@@ -69,7 +71,7 @@ namespace Desktop::Rule {
6971 } m_otherProps;
7072
7173#define COMMA ,
72- #define DEFINE_PROP (type, name, def ) \
74+ #define DEFINE_PROP (type, name, def, eff ) \
7375 private: \
7476 std::pair<Types::COverridableVar<type>, std::underlying_type_t <eRuleProperty>> m_##name = {def, RULE_PROP_NONE}; \
7577 \
@@ -79,54 +81,57 @@ namespace Desktop::Rule {
7981 } \
8082 void name##Override(const Types::COverridableVar<type>& other) { \
8183 m_##name.first = other; \
84+ } \
85+ eWindowRuleEffect name##Effect() { \
86+ return eff; \
8287 }
8388
8489 // dynamic props
85- DEFINE_PROP (Types::SAlphaValue, alpha, Types::SAlphaValue{})
86- DEFINE_PROP (Types::SAlphaValue, alphaInactive, Types::SAlphaValue{})
87- DEFINE_PROP (Types::SAlphaValue, alphaFullscreen, Types::SAlphaValue{})
88-
89- DEFINE_PROP (bool , allowsInput, false )
90- DEFINE_PROP (bool , decorate, true )
91- DEFINE_PROP (bool , focusOnActivate, false )
92- DEFINE_PROP (bool , keepAspectRatio, false )
93- DEFINE_PROP (bool , nearestNeighbor, false )
94- DEFINE_PROP (bool , noAnim, false )
95- DEFINE_PROP (bool , noBlur, false )
96- DEFINE_PROP (bool , noDim, false )
97- DEFINE_PROP (bool , noFocus, false )
98- DEFINE_PROP (bool , noMaxSize, false )
99- DEFINE_PROP (bool , noShadow, false )
100- DEFINE_PROP (bool , noShortcutsInhibit, false )
101- DEFINE_PROP (bool , opaque, false )
102- DEFINE_PROP (bool , dimAround, false )
103- DEFINE_PROP (bool , RGBX, false )
104- DEFINE_PROP (bool , syncFullscreen, true )
105- DEFINE_PROP (bool , tearing, false )
106- DEFINE_PROP (bool , xray, false )
107- DEFINE_PROP (bool , renderUnfocused, false )
108- DEFINE_PROP (bool , noFollowMouse, false )
109- DEFINE_PROP (bool , noScreenShare, false )
110- DEFINE_PROP (bool , noVRR, false )
111- DEFINE_PROP (bool , persistentSize, false )
112- DEFINE_PROP (bool , stayFocused, false )
113-
114- DEFINE_PROP (int , idleInhibitMode, false )
115-
116- DEFINE_PROP (Hyprlang::INT, borderSize, {std::string (" general:border_size" ) COMMA sc<Hyprlang::INT>(0 ) COMMA std::nullopt })
117- DEFINE_PROP (Hyprlang::INT, rounding, {std::string (" decoration:rounding" ) COMMA sc<Hyprlang::INT>(0 ) COMMA std::nullopt })
118-
119- DEFINE_PROP (Hyprlang::FLOAT, roundingPower, {std::string (" decoration:rounding_power" )})
120- DEFINE_PROP (Hyprlang::FLOAT, scrollMouse, {std::string (" input:scroll_factor" )})
121- DEFINE_PROP (Hyprlang::FLOAT, scrollTouchpad, {std::string (" input:touchpad:scroll_factor" )})
122-
123- DEFINE_PROP (std::string, animationStyle, std::string(" " ))
124-
125- DEFINE_PROP (Vector2D, maxSize, Vector2D{})
126- DEFINE_PROP (Vector2D, minSize, Vector2D{})
127-
128- DEFINE_PROP (CGradientValueData, activeBorderColor, {})
129- DEFINE_PROP (CGradientValueData, inactiveBorderColor, {})
90+ DEFINE_PROP (Types::SAlphaValue, alpha, Types::SAlphaValue{}, WINDOW_RULE_EFFECT_OPACITY )
91+ DEFINE_PROP (Types::SAlphaValue, alphaInactive, Types::SAlphaValue{}, WINDOW_RULE_EFFECT_OPACITY )
92+ DEFINE_PROP (Types::SAlphaValue, alphaFullscreen, Types::SAlphaValue{}, WINDOW_RULE_EFFECT_OPACITY )
93+
94+ DEFINE_PROP (bool , allowsInput, false , WINDOW_RULE_EFFECT_ALLOWS_INPUT )
95+ DEFINE_PROP (bool , decorate, true , WINDOW_RULE_EFFECT_DECORATE )
96+ DEFINE_PROP (bool , focusOnActivate, false , WINDOW_RULE_EFFECT_FOCUS_ON_ACTIVATE )
97+ DEFINE_PROP (bool , keepAspectRatio, false , WINDOW_RULE_EFFECT_KEEP_ASPECT_RATIO )
98+ DEFINE_PROP (bool , nearestNeighbor, false , WINDOW_RULE_EFFECT_NEAREST_NEIGHBOR )
99+ DEFINE_PROP (bool , noAnim, false , WINDOW_RULE_EFFECT_NO_ANIM )
100+ DEFINE_PROP (bool , noBlur, false , WINDOW_RULE_EFFECT_NO_BLUR )
101+ DEFINE_PROP (bool , noDim, false , WINDOW_RULE_EFFECT_NO_DIM )
102+ DEFINE_PROP (bool , noFocus, false , WINDOW_RULE_EFFECT_NO_FOCUS )
103+ DEFINE_PROP (bool , noMaxSize, false , WINDOW_RULE_EFFECT_NO_MAX_SIZE )
104+ DEFINE_PROP (bool , noShadow, false , WINDOW_RULE_EFFECT_NO_SHADOW )
105+ DEFINE_PROP (bool , noShortcutsInhibit, false , WINDOW_RULE_EFFECT_NO_SHORTCUTS_INHIBIT )
106+ DEFINE_PROP (bool , opaque, false , WINDOW_RULE_EFFECT_OPAQUE )
107+ DEFINE_PROP (bool , dimAround, false , WINDOW_RULE_EFFECT_DIM_AROUND )
108+ DEFINE_PROP (bool , RGBX, false , WINDOW_RULE_EFFECT_FORCE_RGBX )
109+ DEFINE_PROP (bool , syncFullscreen, true , WINDOW_RULE_EFFECT_SYNC_FULLSCREEN )
110+ DEFINE_PROP (bool , tearing, false , WINDOW_RULE_EFFECT_IMMEDIATE )
111+ DEFINE_PROP (bool , xray, false , WINDOW_RULE_EFFECT_XRAY )
112+ DEFINE_PROP (bool , renderUnfocused, false , WINDOW_RULE_EFFECT_RENDER_UNFOCUSED )
113+ DEFINE_PROP (bool , noFollowMouse, false , WINDOW_RULE_EFFECT_NO_FOLLOW_MOUSE )
114+ DEFINE_PROP (bool , noScreenShare, false , WINDOW_RULE_EFFECT_NO_SCREEN_SHARE )
115+ DEFINE_PROP (bool , noVRR, false , WINDOW_RULE_EFFECT_NO_VRR )
116+ DEFINE_PROP (bool , persistentSize, false , WINDOW_RULE_EFFECT_PERSISTENT_SIZE )
117+ DEFINE_PROP (bool , stayFocused, false , WINDOW_RULE_EFFECT_STAY_FOCUSED )
118+
119+ DEFINE_PROP (int , idleInhibitMode, false , WINDOW_RULE_EFFECT_IDLE_INHIBIT )
120+
121+ DEFINE_PROP (Hyprlang::INT, borderSize, {std::string (" general:border_size" ) COMMA sc<Hyprlang::INT>(0 ) COMMA std::nullopt }, WINDOW_RULE_EFFECT_BORDER_SIZE )
122+ DEFINE_PROP (Hyprlang::INT, rounding, {std::string (" decoration:rounding" ) COMMA sc<Hyprlang::INT>(0 ) COMMA std::nullopt }, WINDOW_RULE_EFFECT_ROUNDING )
123+
124+ DEFINE_PROP (Hyprlang::FLOAT, roundingPower, {std::string (" decoration:rounding_power" )}, WINDOW_RULE_EFFECT_ROUNDING_POWER )
125+ DEFINE_PROP (Hyprlang::FLOAT, scrollMouse, {std::string (" input:scroll_factor" )}, WINDOW_RULE_EFFECT_SCROLL_MOUSE )
126+ DEFINE_PROP (Hyprlang::FLOAT, scrollTouchpad, {std::string (" input:touchpad:scroll_factor" )}, WINDOW_RULE_EFFECT_SCROLL_TOUCHPAD )
127+
128+ DEFINE_PROP (std::string, animationStyle, std::string(" " ), WINDOW_RULE_EFFECT_ANIMATION )
129+
130+ DEFINE_PROP (Vector2D, maxSize, Vector2D{}, WINDOW_RULE_EFFECT_MAX_SIZE )
131+ DEFINE_PROP (Vector2D, minSize, Vector2D{}, WINDOW_RULE_EFFECT_MIN_SIZE )
132+
133+ DEFINE_PROP (CGradientValueData, activeBorderColor, {}, WINDOW_RULE_EFFECT_BORDER_COLOR )
134+ DEFINE_PROP (CGradientValueData, inactiveBorderColor, {}, WINDOW_RULE_EFFECT_BORDER_COLOR )
130135
131136 std::vector<std::pair<std::string, std::underlying_type_t <eRuleProperty>>> m_dynamicTags;
132137 CTagKeeper m_tagKeeper;
0 commit comments