From c08ddcab02433cb5078b6cfea11bf972e47b3169 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 2 Jun 2021 11:27:24 -0400 Subject: Add sidebar and move some dock widgets to it --- ui/viewframe.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'ui/viewframe.h') diff --git a/ui/viewframe.h b/ui/viewframe.h index 1a87e7af..016ccc20 100644 --- a/ui/viewframe.h +++ b/ui/viewframe.h @@ -19,6 +19,7 @@ #include "filecontext.h" #include "viewtype.h" #include "action.h" +#include "sidebar.h" // this struct is used to pass selection information for cross references struct SelectionInfoForXref @@ -221,6 +222,8 @@ public: QString viewType(); + void updateCrossReferenceSelection(ViewFrame* frame = nullptr); + static void registerActions(); }; @@ -307,7 +310,7 @@ private: ClickableStateLabel* m_fileContentsLockStatus; BinaryViewRef m_data; DockHandler* m_docks; - QWidget* m_view; + QWidget* m_view = nullptr; QWidget* m_viewContainer; QVBoxLayout* m_viewLayout; std::map>> m_extViewCache; @@ -349,6 +352,7 @@ public: std::vector getAvailableTypes() const; QString getCurrentView() const; + BinaryViewRef getCurrentBinaryView() const; QString getCurrentDataType() const; uint64_t getCurrentOffset() const; BNAddressRange getSelectionOffsets() const; @@ -369,6 +373,20 @@ public: QWidget* getExtendedView(const QString& name, bool create = false); + Sidebar* getSidebar(); + + template + T* getSidebarWidget(const QString& name) + { + Sidebar* sidebar = getSidebar(); + if (!sidebar) + return (T*)nullptr; + QWidget* widget = sidebar->widget(name); + if (!widget) + return (T*)nullptr; + return qobject_cast(widget); + } + bool navigate(const QString& type, uint64_t offset, bool updateInfo = true, bool addHistoryEntry = true); bool navigate(const QString& type, const std::function& handler, bool updateInfo = true, bool addHistoryEntry = true); bool navigate(BinaryViewRef data, uint64_t offset, bool updateInfo = true, bool addHistoryEntry = true); @@ -412,12 +430,11 @@ public: void setCurrentFunction(FunctionRef func); void updateCrossReferences(); - void showCrossReferences(); + void updateCrossReferenceSelection(); void showPinnedCrossReferences(); void nextCrossReference(); void prevCrossReference(); - void showTags(); void editTag(TagRef tag); void nextTag(); void prevTag(); -- cgit v1.3.1