38 lines
902 B
C++
38 lines
902 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
class QMenu;
|
|
|
|
namespace Xybrid::Data {
|
|
class Node;
|
|
class Graph;
|
|
}
|
|
|
|
namespace Xybrid::Config {
|
|
class PluginInfo {
|
|
public:
|
|
std::string id;
|
|
std::vector<std::string> oldIds;
|
|
std::string displayName;
|
|
std::string category;
|
|
std::function<std::shared_ptr<Data::Node>()> createInstance;
|
|
bool hidden = false;
|
|
|
|
PluginInfo() = default;
|
|
virtual ~PluginInfo() = default;
|
|
};
|
|
|
|
namespace PluginRegistry {
|
|
bool enqueueRegistration(std::function<void()>);
|
|
void registerPlugin(std::shared_ptr<PluginInfo>);
|
|
void init();
|
|
|
|
std::shared_ptr<Data::Node> createInstance(const std::string& id);
|
|
void populatePluginMenu(QMenu*, std::function<void(std::shared_ptr<Data::Node>)>, Data::Graph* = nullptr);
|
|
}
|
|
}
|