From c5c93fc82b8929d04f62d241ca50228de60fa5f4 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 13 Jul 2018 18:43:34 -0400 Subject: Add ability to update custom flow graphs --- flowgraph.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'flowgraph.cpp') 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 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::Update() +{ + return nullptr; +} + + +CoreFlowGraph::CoreFlowGraph(BNFlowGraph* graph): FlowGraph(graph) +{ +} + + +Ref CoreFlowGraph::Update() +{ + BNFlowGraph* graph = BNUpdateFlowGraph(GetGraphObject()); + if (!graph) + return nullptr; + return new CoreFlowGraph(graph); +} -- cgit v1.3.1