diff options
| author | Jordan Wiens <github@psifertex.com> | 2025-10-07 16:46:26 -0400 |
|---|---|---|
| committer | Jordan Wiens <github@psifertex.com> | 2025-10-07 16:46:38 -0400 |
| commit | e6e4ebea5d0ea7842766c7e686e0dfd45cb54bb8 (patch) | |
| tree | 8df5b6b200d982728bc0fa989db112f5cddd2f78 /ui | |
| parent | f65d4fdaabeb045b3fca155e19f68a65b132e563 (diff) | |
copy supporrt for variable and stack sidebars
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/stackview.h | 13 | ||||
| -rw-r--r-- | ui/variablelist.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ui/stackview.h b/ui/stackview.h index 02e16b48..ec3b3d08 100644 --- a/ui/stackview.h +++ b/ui/stackview.h @@ -199,6 +199,12 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ bool m_needFirstFocus; bool m_positionAware; + // Selection state + size_t m_selectionStartLine; + size_t m_selectionStartToken; + bool m_hasSelection; + bool m_isDragging; + //! Bind and register all stack view actions. void setupActions(); @@ -213,9 +219,14 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ //! Find the end of a stack void given a start offset. int64_t findVoidEnd(int64_t start) const; + //! Get the beginning of the current selection (min position) + void getSelectionRange(size_t& startLine, size_t& startToken, size_t& endLine, size_t& endToken) const; + protected: void paintEvent(QPaintEvent* event) override; void mousePressEvent(QMouseEvent* event) override; + void mouseMoveEvent(QMouseEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; void mouseDoubleClickEvent(QMouseEvent* event) override; public: @@ -298,8 +309,10 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ BinaryViewRef getData() override; uint64_t getCurrentOffset() override; + bool canCopy() override { return selectedLine() != nullptr; } bool canCopyAddress() override { return false; }; bool canPaste() override { return false; }; + void copy(TransformRef xform = nullptr) override; void setSelectionOffsets(BNAddressRange range) override; bool navigate(uint64_t offset) override; QFont getFont() override; diff --git a/ui/variablelist.h b/ui/variablelist.h index 0d419cea..93e2cf7a 100644 --- a/ui/variablelist.h +++ b/ui/variablelist.h @@ -251,6 +251,9 @@ class BINARYNINJAUIAPI VariableList : public SidebarWidget, public FilterTarget //! Remove UIDF for the selected variable void resetSelectedVariableValue(); + //! Copy selected variables to clipboard + void copy(); + virtual void setFilter(const std::string& filter) override; virtual void scrollToFirstItem() override; virtual void scrollToCurrentItem() override; |
