summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2020-11-21 17:44:49 -0500
committerBrian Potchik <brian@vector35.com>2020-11-21 17:44:49 -0500
commit20b03bd36ec247b8c28dc1643f57b21ec94c8294 (patch)
tree276b6ffb75d62f256b75e2d19b773d9b6964fbe5
parentb24b2a197a2f39ef0f2c5e28253dd55f3c1fffb4 (diff)
Allow DockHandler::notifyOffset to provide notification that an IL view information has changed.
-rw-r--r--ui/dockhandler.h5
-rw-r--r--ui/viewframe.h23
2 files changed, 19 insertions, 9 deletions
diff --git a/ui/dockhandler.h b/ui/dockhandler.h
index a8e0cb51..4219a667 100644
--- a/ui/dockhandler.h
+++ b/ui/dockhandler.h
@@ -7,13 +7,12 @@
#include "binaryninjaapi.h"
#include "action.h"
+#include "viewframe.h"
#include "uitypes.h"
class ContextMenuManager;
class DockHandler;
class Menu;
-class View;
-class ViewFrame;
struct BINARYNINJAUIAPI DockProperties
@@ -101,7 +100,7 @@ class BINARYNINJAUIAPI DockHandler: public QObject
bool m_shouldResizeDocks = false;
std::map<Qt::DockWidgetArea, bool> m_enableHiddenGroupSave;
- uint64_t m_currentOffset = 0;
+ ViewLocation m_currentViewLocation;
friend class DockContextHandler;
std::map<QWidget*, DockContextHandler*> m_contexts;
diff --git a/ui/viewframe.h b/ui/viewframe.h
index fbab3b21..e0582a59 100644
--- a/ui/viewframe.h
+++ b/ui/viewframe.h
@@ -10,11 +10,11 @@
#include <stack>
#include <utility>
#include <vector>
-#include "dockhandler.h"
#include "filecontext.h"
#include "viewtype.h"
#include "action.h"
+
class BINARYNINJAUIAPI HistoryEntry: public BinaryNinja::RefCountObject
{
QString m_viewType;
@@ -26,12 +26,15 @@ public:
void setViewType(const QString& type) { m_viewType = type; }
};
+
class AssembleDialog;
class CompileDialog;
+class DockHandler;
class FeatureMap;
class StatusBarWidget;
class ViewNavigationMode;
+
class BINARYNINJAUIAPI View
{
protected:
@@ -158,7 +161,6 @@ class BINARYNINJAUIAPI ViewLocation
bool m_valid = false;
QString m_viewType;
uint64_t m_offset = 0;
- bool m_hasILViewType = false;
BNFunctionGraphType m_ilViewType = NormalFunctionGraph;
size_t m_instrIndex = BN_INVALID_EXPR;
@@ -166,21 +168,30 @@ public:
ViewLocation() { }
ViewLocation(const QString& viewType, uint64_t offset) : m_valid(true), m_viewType(viewType), m_offset(offset) { }
ViewLocation(const QString& viewType, uint64_t offset, BNFunctionGraphType ilViewType) : m_valid(true),
- m_viewType(viewType), m_offset(offset), m_hasILViewType(true), m_ilViewType(ilViewType) { }
+ m_viewType(viewType), m_offset(offset), m_ilViewType(ilViewType) { }
ViewLocation(const QString& viewType, uint64_t offset, BNFunctionGraphType ilViewType, size_t instrIndex) : m_valid(true),
- m_viewType(viewType), m_offset(offset), m_hasILViewType(true), m_ilViewType(ilViewType), m_instrIndex(instrIndex) { }
+ m_viewType(viewType), m_offset(offset), m_ilViewType(ilViewType), m_instrIndex(instrIndex) { }
bool isValid() const { return m_valid; }
QString getViewType() const { return m_viewType; }
uint64_t getOffset() const { return m_offset; }
- bool hasILViewType() const { return m_hasILViewType; }
BNFunctionGraphType getILViewType() const { return m_ilViewType; }
size_t getInstrIndex() const { return m_instrIndex; }
void setViewType(QString& viewType) { m_viewType = viewType; }
void setOffset(uint64_t offset) { m_offset = offset; }
- void setILViewType(BNFunctionGraphType ilViewType) { m_hasILViewType = true; m_ilViewType = ilViewType; }
+ void setILViewType(BNFunctionGraphType ilViewType) { m_ilViewType = ilViewType; }
void setInstrIndex(uint64_t index) { m_instrIndex = index; }
+
+ bool operator==(const ViewLocation& other) const
+ {
+ return (m_valid == other.m_valid) &&
+ (m_viewType == other.m_viewType) &&
+ (m_offset == other.m_offset) &&
+ (m_ilViewType == other.m_ilViewType) &&
+ (m_instrIndex == other.m_instrIndex);
+ }
+ bool operator!=(const ViewLocation& other) const { return !((*this) == other); }
};