| 3 | #include <hyprland/src/plugins/PluginAPI.hpp> |
| 4 | |
| 5 | void 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 | |
| 25 | void IFocusAnimation::onWindowFocus(CWindow* pWindow, HANDLE pHandle) { |
| 26 | m_sFocusInAnimConfig.internalBezier = HyprlandAPI::getConfigValue(pHandle, configPrefix() + "in_bezier")->strValue; |
nothing calls this directly
no outgoing calls
no test coverage detected