#pragma once #include "Common.hpp" #include "ChromeConfig.hpp" #include class ChromeDecoration; struct GlobalState { ChromeConfig config; std::vector> decorations; GlobalState(HANDLE plugin) { config = ChromeConfig{ .enabled = makeShared( "plugin:hyprchrome:enabled", "Whether the border decoration is enabled", true), .extent = makeShared( "plugin:hyprchrome:extent", "How far the border extends past each window edge, in pixels", 12), .followHyprlandBorderColor = makeShared( "plugin:hyprchrome:follow_hyprland_border_color", "Whether the border tracks Hyprland's own active/inactive border color instead of active_color/inactive_color", true), .activeColor = makeShared( "plugin:hyprchrome:active_color", "Color (or gradient) of the border on the focused window, used when follow_hyprland_border_color is false", CHyprColor{RGBAToARGB(0xFFD063FF)}), .inactiveColor = makeShared( "plugin:hyprchrome:inactive_color", "Color (or gradient) of the border on unfocused windows, used when follow_hyprland_border_color is false", CHyprColor{RGBAToARGB(0x6C6C6CFF)}), .glowSize = makeShared( "plugin:hyprchrome:glow_size", "How far the border's glow bleeds inward over the window, in pixels (0 disables it)", 0, IntValueOptions{.min = 0}), .glowStrength = makeShared( "plugin:hyprchrome:glow_strength", "Peak opacity of the inward glow at the window edge, 0-1", 0.35F, FloatValueOptions{.min = 0.F, .max = 1.F}), .outlineSize = makeShared( "plugin:hyprchrome:outline_size", "Thickness of the solid outline tracing the frame's edges, in pixels (0 disables it)", 0, IntValueOptions{.min = 0}), .outlineColor = makeShared( "plugin:hyprchrome:outline_color", "Color of the outline tracing the frame's edges", RGBAToARGB(0xFFFFFFFF)), .shadowSize = makeShared( "plugin:hyprchrome:shadow_size", "How far the frame's drop shadow reaches past its outline, in pixels (0 disables it)", 0, IntValueOptions{.min = 0}), .shadowColor = makeShared( "plugin:hyprchrome:shadow_color", "Color of the frame's drop shadow; its alpha is the shadow's opacity", RGBAToARGB(0x000000B3)), .shadowOffset = makeShared( "plugin:hyprchrome:shadow_offset", "How far the shadow is displaced from the frame, in pixels (positive is right/down)", Config::VEC2{0.F, 0.F}), .titlebarHeight = makeShared( "plugin:hyprchrome:titlebar_height", "Height of the title bar hanging off the floating top-border cutout, in pixels", 8), .titlebarTextSize = makeShared( "plugin:hyprchrome:titlebar_text_size", "Font size of the title bar's text, in pixels", 12), .titlebarFont = makeShared( "plugin:hyprchrome:titlebar_font", "Font family of the title bar's text", "sans-serif"), }; HyprlandAPI::addConfigValueV2(plugin, config.enabled); HyprlandAPI::addConfigValueV2(plugin, config.extent); HyprlandAPI::addConfigValueV2(plugin, config.followHyprlandBorderColor); HyprlandAPI::addConfigValueV2(plugin, config.activeColor); HyprlandAPI::addConfigValueV2(plugin, config.inactiveColor); HyprlandAPI::addConfigValueV2(plugin, config.glowSize); HyprlandAPI::addConfigValueV2(plugin, config.glowStrength); HyprlandAPI::addConfigValueV2(plugin, config.outlineSize); HyprlandAPI::addConfigValueV2(plugin, config.outlineColor); HyprlandAPI::addConfigValueV2(plugin, config.shadowSize); HyprlandAPI::addConfigValueV2(plugin, config.shadowColor); HyprlandAPI::addConfigValueV2(plugin, config.shadowOffset); HyprlandAPI::addConfigValueV2(plugin, config.titlebarHeight); HyprlandAPI::addConfigValueV2(plugin, config.titlebarTextSize); HyprlandAPI::addConfigValueV2(plugin, config.titlebarFont); } };