diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-07-07 15:17:49 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-07-07 15:21:53 -0400 |
| commit | 402cf087cfcf69e0c38b027d2b8488d5cdcbed76 (patch) | |
| tree | 93159a8aa51f1aaaae973862403aed94164bb196 | |
| parent | 768f7c78465fb93936e5ca50a0ca712664fe54e7 (diff) | |
Add IL view type change UI context notification
| -rw-r--r-- | ui/uicontext.h | 17 | ||||
| -rw-r--r-- | ui/viewframe.h | 1 | ||||
| -rw-r--r-- | ui/xreflist.h | 7 |
3 files changed, 25 insertions, 0 deletions
diff --git a/ui/uicontext.h b/ui/uicontext.h index 82062040..501c4eeb 100644 --- a/ui/uicontext.h +++ b/ui/uicontext.h @@ -253,6 +253,22 @@ class BINARYNINJAUIAPI UIContextNotification } /*! + Callback when the ui changes IL view type + \param context Context changing address + \param frame ViewFrame which changed address + \param view Currently open View + \param viewType New view type + */ + virtual void OnILViewTypeChange( + UIContext* context, ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType) + { + (void)context; + (void)frame; + (void)view; + (void)viewType; + } + + /*! Callback to modify the displayed file name for a FileContext (eg in the window title or tab title) Note: Due to the out param &name, this is not usable from Python with PySide \param context Context which will display this name @@ -551,6 +567,7 @@ public: void NotifyOnViewChange(ViewFrame* frame, const QString& type); void NotifyOnAddressChange(ViewFrame* frame, View* view, const ViewLocation& location); + void NotifyOnILViewTypeChange(ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType); void updateCrossReferences(ViewFrame* frame, View* view, const SelectionInfoForXref& selection); void NotifyOnActionExecuted(UIActionHandler* handler, const QString& name, const UIActionContext& ctx, std::function<void(const UIActionContext&)>& action); void NotifyOnContextMenuCreated(View* view, Menu& menu); diff --git a/ui/viewframe.h b/ui/viewframe.h index a208154c..69f7a198 100644 --- a/ui/viewframe.h +++ b/ui/viewframe.h @@ -242,6 +242,7 @@ class BINARYNINJAUIAPI View QString viewType(); void updateCrossReferenceSelection(ViewFrame* frame = nullptr); + void notifyILViewTypeChanged(ViewFrame* frame = nullptr); void forceSyncFromView(ViewFrame* frame = nullptr); virtual void refreshContents() {} diff --git a/ui/xreflist.h b/ui/xreflist.h index 867ebef0..1785bc0a 100644 --- a/ui/xreflist.h +++ b/ui/xreflist.h @@ -329,6 +329,7 @@ struct CrossReferenceFunctionList void updateFunction(BinaryNinja::Function* func); std::optional<uint64_t> getFunctionVersion(BinaryNinja::Function* func) const; bool checkForUpdates(); + void invalidateCache(); }; /*! @@ -371,6 +372,7 @@ class BINARYNINJAUIAPI CrossReferenceTreeModel : public QAbstractItemModel size_t getMaxUIItems() const { return m_maxUIItems; } void setGraphType(const BinaryNinja::FunctionViewType& type); void notifyRefresh(); + void invalidateCache(); Q_SIGNALS: void needRepaint(); @@ -436,6 +438,7 @@ class BINARYNINJAUIAPI CrossReferenceTableModel : public QAbstractTableModel size_t getMaxUIItems() const { return m_maxUIItems; } void setGraphType(const BinaryNinja::FunctionViewType& type); void notifyRefresh(); + void invalidateCache(); Q_SIGNALS: void needRepaint(); @@ -575,6 +578,7 @@ public: void setGraphType(const BinaryNinja::FunctionViewType& type) { m_tree->setGraphType(type); } virtual void OnAnalysisFunctionUpdated(BinaryNinja::BinaryView* view, BinaryNinja::Function* func) override; void notifyRefresh(); + void invalidateCache(); Q_SIGNALS: void newSelection(); @@ -620,6 +624,7 @@ class BINARYNINJAUIAPI CrossReferenceTable : public QTableView, public CrossRefe void setGraphType(const BinaryNinja::FunctionViewType& type) { m_table->setGraphType(type); } virtual void OnAnalysisFunctionUpdated(BinaryNinja::BinaryView* view, BinaryNinja::Function* func) override; void notifyRefresh(); + void invalidateCache(); public Q_SLOTS: void doRepaint(); @@ -710,6 +715,8 @@ class BINARYNINJAUIAPI CrossReferenceWidget : public SidebarWidget, public UICon virtual void OnNewSelectionForXref( UIContext* context, ViewFrame* frame, View* view, const SelectionInfoForXref& selection) override; + void OnILViewTypeChange( + UIContext* context, ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType) override; virtual QWidget* headerWidget() override { return m_header; } virtual void setPrimaryOrientation(Qt::Orientation orientation) override; |
