MCPcopy Create free account
hub / github.com/VortexCoyote/hyprfocus / init

Method init

src/IFocusAnimation.cpp:5–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <hyprland/src/plugins/PluginAPI.hpp>
4
5void IFocusAnimation::init(HANDLE pHandle, std::string animationName) {
6 m_szAnimationName = animationName;
7
8 HyprlandAPI::addConfigValue(pHandle, configPrefix() + "in_bezier", SConfigValue{.strValue = "default"});
9 HyprlandAPI::addConfigValue(pHandle, configPrefix() + "out_bezier", SConfigValue{.strValue = "default"});
10
11 HyprlandAPI::addConfigValue(pHandle, configPrefix() + "in_speed", SConfigValue{.floatValue = 1.f});
12 HyprlandAPI::addConfigValue(pHandle, configPrefix() + "out_speed", SConfigValue{.floatValue = 5.f});
13
14 m_sFocusInAnimConfig = *(g_pConfigManager->getAnimationPropertyConfig("global"));
15 m_sFocusInAnimConfig.internalEnabled = 1;
16 m_sFocusInAnimConfig.internalStyle = std::string("hyprfocus_") + animationName + std::string("_in");
17 m_sFocusInAnimConfig.pValues = &m_sFocusInAnimConfig;
18
19 m_sFocusOutAnimConfig = *(g_pConfigManager->getAnimationPropertyConfig("global"));
20 m_sFocusOutAnimConfig.internalEnabled = 1;
21 m_sFocusOutAnimConfig.internalStyle = std::string("hyprfocus_") + animationName + std::string("_out");
22 m_sFocusOutAnimConfig.pValues = &m_sFocusOutAnimConfig;
23}
24
25void IFocusAnimation::onWindowFocus(CWindow* pWindow, HANDLE pHandle) {
26 m_sFocusInAnimConfig.internalBezier = HyprlandAPI::getConfigValue(pHandle, configPrefix() + "in_bezier")->strValue;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected