mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
Added Data Processor using Nodes (#152)
* Added imnodes * Added basic data processor view. Still needs to be cleaned up * Make sure all attached links get properly removed when a Node is deleted * Cleanup and API exposing * Added data provider overlays and integrate them with the data processor * Optimized data processing * Node UI enhancements * Added support for all themes to the nodes editor * Improved data processor context menus * Fixed data processor context menu showing up everywhere * Make hex editor context menu behave the same as data processor one * Add different node pin types and prevent incompatible ones from being connected * Don't require explicitly marking node as end node * Fixed plugin copying * Added some more nodes
This commit is contained in:
@@ -17,6 +17,7 @@ namespace hex {
|
||||
class View;
|
||||
namespace lang { class ASTNode; }
|
||||
namespace lang { class Evaluator; }
|
||||
namespace dp { class Node; }
|
||||
|
||||
/*
|
||||
The Content Registry is the heart of all features in ImHex that are in some way extendable by Plugins.
|
||||
@@ -144,6 +145,26 @@ namespace hex {
|
||||
|
||||
static std::vector<Entry>& getEntries();
|
||||
};
|
||||
|
||||
struct DataProcessorNode {
|
||||
using CreatorFunction = std::function<dp::Node*()>;
|
||||
struct Entry {
|
||||
std::string category;
|
||||
std::string name;
|
||||
CreatorFunction creatorFunction;
|
||||
};
|
||||
|
||||
template<hex::derived_from<dp::Node> T, typename ... Args>
|
||||
static void add(std::string_view category, std::string_view name, Args&& ... args) {
|
||||
add(Entry{ category.data(), name.data(), [args...]{ return new T(std::forward<Args>(args)...); } });
|
||||
}
|
||||
|
||||
static void addSeparator();
|
||||
|
||||
static std::vector<Entry>& getEntries();
|
||||
private:
|
||||
static void add(const Entry &entry);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user