diff options
| author | Brian Potchik <brian@vector35.com> | 2019-05-01 22:25:23 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2019-05-01 22:25:23 -0400 |
| commit | 08f25e6bf61122058049a400f991a0c3e1534d1e (patch) | |
| tree | 163893bfd5799991e545ee52c25f3aa1834d0100 | |
| parent | 37e5d8f3ab4d12a55ca7e38d13ecd4220308bae1 (diff) | |
DockWidget interface updates to better support UI plugins.
| -rw-r--r-- | ui/dockhandler.h | 11 | ||||
| -rw-r--r-- | ui/featuremap.h | 6 | ||||
| -rw-r--r-- | ui/functionsview.h | 2 | ||||
| -rw-r--r-- | ui/logview.h | 5 | ||||
| -rw-r--r-- | ui/scriptingconsole.h | 4 | ||||
| -rw-r--r-- | ui/viewframe.h | 2 | ||||
| -rw-r--r-- | ui/xreflist.h | 2 |
7 files changed, 18 insertions, 14 deletions
diff --git a/ui/dockhandler.h b/ui/dockhandler.h index c4ec1a56..bdce1c6f 100644 --- a/ui/dockhandler.h +++ b/ui/dockhandler.h @@ -61,11 +61,12 @@ public: QWidget* getParentWindow() { return m_parentWindow; } - virtual void focusInput() { }; + virtual void notifyFontChanged() { }; + virtual void notifyOffsetChanged(uint64_t /*offset*/) { }; + virtual void notifyThemeChanged() { }; virtual void notifyViewChanged(ViewFrame* /*frame*/) { }; + virtual void notifyVisibilityChanged(bool /*visible*/) { }; virtual bool shouldBeVisible(ViewFrame* /*frame*/) { return true; }; - virtual void updateFonts() { }; - virtual void updateTheme() { }; }; class BINARYNINJAUIAPI DockHandler: public QObject @@ -84,7 +85,7 @@ class BINARYNINJAUIAPI DockHandler: public QObject // TODO friend class DockContextHandler; std::map<QString, DockContextHandler*> m_dockContexts; - DockContextHandler* getDockContextHandler(const QString&, QWidget* widget); + DockContextHandler* getDockContextHandler(const QString&, QWidget* widget, bool viewSensitive = false); public: explicit DockHandler(QObject* parent, int windowIndex); @@ -107,6 +108,8 @@ public: bool shouldResizeDocks(); void updateFonts(); + void updateOffset(uint64_t offset); + void updateTheme(); void addActionOnShow(const QString& name, const std::function<void()>& action); static DockHandler* getActiveDockHandler(); diff --git a/ui/featuremap.h b/ui/featuremap.h index eb8970d3..beff9ccb 100644 --- a/ui/featuremap.h +++ b/ui/featuremap.h @@ -69,10 +69,10 @@ public: View* getBinaryDataNavigableView(bool preferGraphView = false); void backgroundRefresh(); - std::pair<uint64_t, bool> getOffsetForAddress(uint64_t addr); - void setCurrentLocation(uint64_t address); + std::pair<uint64_t, bool> getLinearOffsetForAddress(uint64_t addr); - virtual void updateTheme() override; + virtual void notifyOffsetChanged(uint64_t offset) override; + virtual void notifyThemeChanged() override; void renderDataVariable(const BinaryNinja::DataVariable& var, bool ignoreString = false); diff --git a/ui/functionsview.h b/ui/functionsview.h index 02164079..4ca9a4a3 100644 --- a/ui/functionsview.h +++ b/ui/functionsview.h @@ -33,8 +33,8 @@ public: protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; + virtual void notifyFontChanged() override; virtual bool shouldBeVisible(ViewFrame* frame) override; - virtual void updateFonts() override; private Q_SLOTS: void updateTimerEvent(); diff --git a/ui/logview.h b/ui/logview.h index 5546db8a..a83d36b2 100644 --- a/ui/logview.h +++ b/ui/logview.h @@ -127,9 +127,10 @@ public: protected: void contextMenuEvent(QContextMenuEvent* event) override; - void focusInput() override; + void notifyFontChanged() override; + void notifyThemeChanged() override; void notifyViewChanged(ViewFrame* frame) override; - void updateFonts() override; + void notifyVisibilityChanged(bool visible) override; Q_SIGNALS: void notifyUiStatus(); diff --git a/ui/scriptingconsole.h b/ui/scriptingconsole.h index 4059df2a..a2c5c199 100644 --- a/ui/scriptingconsole.h +++ b/ui/scriptingconsole.h @@ -91,8 +91,8 @@ private Q_SLOTS: protected: void customEvent(QEvent* event) override; - void focusInput() override; - void updateFonts() override; + void notifyFontChanged() override; + void notifyVisibilityChanged(bool visible) override; public: ScriptingConsole(QWidget* parent, const QString& providerName, const QString& instanceName, ScriptingInstanceRef instance); diff --git a/ui/viewframe.h b/ui/viewframe.h index c2849fbc..8abb63fa 100644 --- a/ui/viewframe.h +++ b/ui/viewframe.h @@ -227,6 +227,7 @@ public: void closing(); void updateFonts(); + void updateOffset(uint64_t offset); void updateTheme(); void addHistoryEntry(); void back(); @@ -238,7 +239,6 @@ public: uint64_t currentAddress, const QString& title = "Go to Address", const QString& msg = "Address:"); void setCurrentFunction(FunctionRef func); - void updateFeatureMapLocation(View* view); void updateCrossReferences(); void showCrossReferences(); void nextCrossReference(); diff --git a/ui/xreflist.h b/ui/xreflist.h index 63faf21a..148161e0 100644 --- a/ui/xreflist.h +++ b/ui/xreflist.h @@ -71,8 +71,8 @@ protected: virtual void keyPressEvent(QKeyEvent* e) override; virtual void mouseMoveEvent(QMouseEvent* e) override; virtual void mousePressEvent(QMouseEvent* e) override; + virtual void notifyFontChanged() override; virtual bool shouldBeVisible(ViewFrame* frame) override; - virtual void updateFonts() override; virtual void wheelEvent(QWheelEvent* e) override; void goToReference(const QModelIndex& idx); |
