mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -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:
@@ -88,11 +88,7 @@ namespace hex {
|
||||
/* Views */
|
||||
|
||||
View* ContentRegistry::Views::add(View *view) {
|
||||
auto &views = getEntries();
|
||||
|
||||
views.push_back(view);
|
||||
|
||||
return views.back();
|
||||
return getEntries().emplace_back(view);
|
||||
}
|
||||
|
||||
std::vector<View*>& ContentRegistry::Views::getEntries() {
|
||||
@@ -114,10 +110,24 @@ namespace hex {
|
||||
/* Data Inspector */
|
||||
|
||||
void ContentRegistry::DataInspector::add(std::string_view name, size_t requiredSize, ContentRegistry::DataInspector::GeneratorFunction function) {
|
||||
getEntries().push_back(Entry{ name.data(), requiredSize, function });
|
||||
getEntries().push_back({ name.data(), requiredSize, std::move(function) });
|
||||
}
|
||||
|
||||
std::vector<ContentRegistry::DataInspector::Entry>& ContentRegistry::DataInspector::getEntries() {
|
||||
return SharedData::dataInspectorEntries;
|
||||
}
|
||||
|
||||
/* Data Processor Nodes */
|
||||
|
||||
void ContentRegistry::DataProcessorNode::add(const Entry &entry) {
|
||||
getEntries().push_back(entry);
|
||||
}
|
||||
|
||||
void ContentRegistry::DataProcessorNode::addSeparator() {
|
||||
getEntries().push_back({ "", "", []{ return nullptr; } });
|
||||
}
|
||||
|
||||
std::vector<ContentRegistry::DataProcessorNode::Entry>& ContentRegistry::DataProcessorNode::getEntries() {
|
||||
return SharedData::dataProcessorNodes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user