#include "core/style.hpp" #include #include "core/registry.hpp" namespace effector { std::vector styleSpecs(const std::string& kind) { std::vector specs; if (kind.empty()) return specs; for (const auto& effect : effects()) { if (effect->styleKind() != kind) continue; for (const auto& spec : effect->params()) { if (!spec.inStyle) continue; const bool known = std::any_of(specs.begin(), specs.end(), [&](const ParamSpec& seen) { return seen.key == spec.key; }); if (!known) specs.push_back(spec); } } return specs; } ParamValues styleDefaults(const std::string& kind) { ParamValues values; for (const auto& spec : styleSpecs(kind)) values[spec.key] = paramDefault(spec); return values; } const Style* findStyle(const StyleSet& styles, const std::string& kind, const std::string& name) { if (kind.empty() || name.empty()) return nullptr; for (const auto& style : styles) { if (style.kind == kind && style.name == name) return &style; } return nullptr; } } // namespace effector