@@ -199,6 +199,12 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ
199199 bool m_needFirstFocus;
200200 bool m_positionAware;
201201
202+ // Selection state
203+ size_t m_selectionStartLine;
204+ size_t m_selectionStartToken;
205+ bool m_hasSelection;
206+ bool m_isDragging;
207+
202208 // ! Bind and register all stack view actions.
203209 void setupActions ();
204210
@@ -213,9 +219,14 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ
213219 // ! Find the end of a stack void given a start offset.
214220 int64_t findVoidEnd (int64_t start) const ;
215221
222+ // ! Get the beginning of the current selection (min position)
223+ void getSelectionRange (size_t & startLine, size_t & startToken, size_t & endLine, size_t & endToken) const ;
224+
216225 protected:
217226 void paintEvent (QPaintEvent* event) override ;
218227 void mousePressEvent (QMouseEvent* event) override ;
228+ void mouseMoveEvent (QMouseEvent* event) override ;
229+ void mouseReleaseEvent (QMouseEvent* event) override ;
219230 void mouseDoubleClickEvent (QMouseEvent* event) override ;
220231
221232 public:
@@ -298,8 +309,10 @@ class BINARYNINJAUIAPI StackView : public QAbstractScrollArea, public View, publ
298309
299310 BinaryViewRef getData () override ;
300311 uint64_t getCurrentOffset () override ;
312+ bool canCopy () override { return selectedLine () != nullptr ; }
301313 bool canCopyAddress () override { return false ; };
302314 bool canPaste () override { return false ; };
315+ void copy (TransformRef xform = nullptr ) override ;
303316 void setSelectionOffsets (BNAddressRange range) override ;
304317 bool navigate (uint64_t offset) override ;
305318 QFont getFont () override ;
0 commit comments