summaryrefslogtreecommitdiff
path: root/flowgraph.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-07-13 18:43:34 -0400
committerRusty Wagner <rusty@vector35.com>2018-07-13 18:43:34 -0400
commitc5c93fc82b8929d04f62d241ca50228de60fa5f4 (patch)
treee9456e0921d0706ab839cf4ca96eba18afec96a4 /flowgraph.cpp
parentdfe5d28f0aaee75ccad8c733e23879676ed77c37 (diff)
Add ability to update custom flow graphs
Diffstat (limited to 'flowgraph.cpp')
-rw-r--r--flowgraph.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/flowgraph.cpp b/flowgraph.cpp
index 4bacee81..c779db0c 100644
--- a/flowgraph.cpp
+++ b/flowgraph.cpp
@@ -78,6 +78,16 @@ void FlowGraph::CompleteLayoutCallback(void* ctxt)
}
+BNFlowGraph* FlowGraph::UpdateCallback(void* ctxt)
+{
+ FlowGraph* graph = (FlowGraph*)ctxt;
+ Ref<FlowGraph> result = graph->Update();
+ if (!result)
+ return nullptr;
+ return BNNewFlowGraphReference(result->GetGraphObject());
+}
+
+
void FlowGraph::FinishPrepareForLayout()
{
BNFinishPrepareForLayout(m_graph);
@@ -313,3 +323,23 @@ void FlowGraph::Show(const string& title)
{
ShowGraphReport(title, this);
}
+
+
+Ref<FlowGraph> FlowGraph::Update()
+{
+ return nullptr;
+}
+
+
+CoreFlowGraph::CoreFlowGraph(BNFlowGraph* graph): FlowGraph(graph)
+{
+}
+
+
+Ref<FlowGraph> CoreFlowGraph::Update()
+{
+ BNFlowGraph* graph = BNUpdateFlowGraph(GetGraphObject());
+ if (!graph)
+ return nullptr;
+ return new CoreFlowGraph(graph);
+}