Skip to content

Commit 402cf08

Browse files
committed
Add IL view type change UI context notification
1 parent 768f7c7 commit 402cf08

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

ui/uicontext.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,22 @@ class BINARYNINJAUIAPI UIContextNotification
252252
(void)location;
253253
}
254254

255+
/*!
256+
Callback when the ui changes IL view type
257+
\param context Context changing address
258+
\param frame ViewFrame which changed address
259+
\param view Currently open View
260+
\param viewType New view type
261+
*/
262+
virtual void OnILViewTypeChange(
263+
UIContext* context, ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType)
264+
{
265+
(void)context;
266+
(void)frame;
267+
(void)view;
268+
(void)viewType;
269+
}
270+
255271
/*!
256272
Callback to modify the displayed file name for a FileContext (eg in the window title or tab title)
257273
Note: Due to the out param &name, this is not usable from Python with PySide
@@ -551,6 +567,7 @@ class BINARYNINJAUIAPI UIContext
551567

552568
void NotifyOnViewChange(ViewFrame* frame, const QString& type);
553569
void NotifyOnAddressChange(ViewFrame* frame, View* view, const ViewLocation& location);
570+
void NotifyOnILViewTypeChange(ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType);
554571
void updateCrossReferences(ViewFrame* frame, View* view, const SelectionInfoForXref& selection);
555572
void NotifyOnActionExecuted(UIActionHandler* handler, const QString& name, const UIActionContext& ctx, std::function<void(const UIActionContext&)>& action);
556573
void NotifyOnContextMenuCreated(View* view, Menu& menu);

ui/viewframe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class BINARYNINJAUIAPI View
242242
QString viewType();
243243

244244
void updateCrossReferenceSelection(ViewFrame* frame = nullptr);
245+
void notifyILViewTypeChanged(ViewFrame* frame = nullptr);
245246
void forceSyncFromView(ViewFrame* frame = nullptr);
246247
virtual void refreshContents() {}
247248

ui/xreflist.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ struct CrossReferenceFunctionList
329329
void updateFunction(BinaryNinja::Function* func);
330330
std::optional<uint64_t> getFunctionVersion(BinaryNinja::Function* func) const;
331331
bool checkForUpdates();
332+
void invalidateCache();
332333
};
333334

334335
/*!
@@ -371,6 +372,7 @@ class BINARYNINJAUIAPI CrossReferenceTreeModel : public QAbstractItemModel
371372
size_t getMaxUIItems() const { return m_maxUIItems; }
372373
void setGraphType(const BinaryNinja::FunctionViewType& type);
373374
void notifyRefresh();
375+
void invalidateCache();
374376

375377
Q_SIGNALS:
376378
void needRepaint();
@@ -436,6 +438,7 @@ class BINARYNINJAUIAPI CrossReferenceTableModel : public QAbstractTableModel
436438
size_t getMaxUIItems() const { return m_maxUIItems; }
437439
void setGraphType(const BinaryNinja::FunctionViewType& type);
438440
void notifyRefresh();
441+
void invalidateCache();
439442

440443
Q_SIGNALS:
441444
void needRepaint();
@@ -575,6 +578,7 @@ class BINARYNINJAUIAPI CrossReferenceTree : public QTreeView, public CrossRefere
575578
void setGraphType(const BinaryNinja::FunctionViewType& type) { m_tree->setGraphType(type); }
576579
virtual void OnAnalysisFunctionUpdated(BinaryNinja::BinaryView* view, BinaryNinja::Function* func) override;
577580
void notifyRefresh();
581+
void invalidateCache();
578582

579583
Q_SIGNALS:
580584
void newSelection();
@@ -620,6 +624,7 @@ class BINARYNINJAUIAPI CrossReferenceTable : public QTableView, public CrossRefe
620624
void setGraphType(const BinaryNinja::FunctionViewType& type) { m_table->setGraphType(type); }
621625
virtual void OnAnalysisFunctionUpdated(BinaryNinja::BinaryView* view, BinaryNinja::Function* func) override;
622626
void notifyRefresh();
627+
void invalidateCache();
623628

624629
public Q_SLOTS:
625630
void doRepaint();
@@ -710,6 +715,8 @@ class BINARYNINJAUIAPI CrossReferenceWidget : public SidebarWidget, public UICon
710715

711716
virtual void OnNewSelectionForXref(
712717
UIContext* context, ViewFrame* frame, View* view, const SelectionInfoForXref& selection) override;
718+
void OnILViewTypeChange(
719+
UIContext* context, ViewFrame* frame, View* view, const BinaryNinja::FunctionViewType& viewType) override;
713720

714721
virtual QWidget* headerWidget() override { return m_header; }
715722
virtual void setPrimaryOrientation(Qt::Orientation orientation) override;

0 commit comments

Comments
 (0)