summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2024-05-03 13:09:43 +0800
committerXusheng <xusheng@vector35.com>2024-05-10 11:46:56 +0800
commit015314d34d073a8ebbd958edf8150a81381f12c2 (patch)
tree98dd544f958493d7a9f0012f6c16439f18bc581c
parent31d5bacf152bcda5468632da99edfa45d66ec10a (diff)
Add actions to quickly adjust the selection in linear and hex view
-rw-r--r--ui/hexeditor.h23
-rw-r--r--ui/linearview.h21
2 files changed, 43 insertions, 1 deletions
diff --git a/ui/hexeditor.h b/ui/hexeditor.h
index 1a485be9..0a6a4484 100644
--- a/ui/hexeditor.h
+++ b/ui/hexeditor.h
@@ -51,7 +51,6 @@ class BINARYNINJAUIAPI HexEditor :
virtual void selectAll();
virtual void selectNone();
- void setSelectionRange(uint64_t begin, uint64_t end);
virtual void setSelectionOffsets(BNAddressRange range) override;
virtual void updateFonts() override;
@@ -171,6 +170,28 @@ class BINARYNINJAUIAPI HexEditor :
void deleteBack();
void deleteForward();
+ void extendSelectionToStartOfBinary();
+ void extendSelectionToEndOfBinary();
+ void extendSelectionToStartOfSection();
+ void extendSelectionToEndOfSection();
+ void extendSelectionToStartOfSegment();
+ void extendSelectionToEndOfSegment();
+ void extendSelectionToStartOfDataVariable();
+ void extendSelectionToEndOfDataVariable();
+ void extendSelectionByBytes();
+ void extendSelectionToAddress();
+ void setSelectionSizeTo();
+ void saveSelectionTo();
+
+ bool canExtendSelectionToStartOfSection();
+ bool canExtendSelectionToEndOfSection();
+ bool canExtendSelectionToStartOfSegment();
+ bool canExtendSelectionToEndOfSegment();
+ bool canExtendSelectionToStartOfDataVariable();
+ bool canExtendSelectionToEndOfDataVariable();
+
+ void setSelectionOffsetsInternal(BNAddressRange range, bool navigateToStart = true);
+
BinaryViewRef m_data;
ViewFrame* m_view;
diff --git a/ui/linearview.h b/ui/linearview.h
index 8223c515..ce2e8fa4 100644
--- a/ui/linearview.h
+++ b/ui/linearview.h
@@ -253,6 +253,7 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub
bool navigateToGotoLabel(uint64_t label);
bool navigateToMatchingBrace();
bool navigateToExternalLink(uint64_t linkSourceAddr);
+ void setSelectionOffsetsInternal(BNAddressRange range, bool navigateToStart = true);
void viewData();
void scrollLines(int count);
@@ -518,6 +519,26 @@ protected:
void splitToNewTabAndNavigateFromCursorPosition();
void splitToNewWindowAndNavigateFromCursorPosition();
void splitToNewPaneAndNavigateFromCursorPosition();
+
+ void extendSelectionToStartOfBinary();
+ void extendSelectionToEndOfBinary();
+ void extendSelectionToStartOfSection();
+ void extendSelectionToEndOfSection();
+ void extendSelectionToStartOfSegment();
+ void extendSelectionToEndOfSegment();
+ void extendSelectionToStartOfDataVariable();
+ void extendSelectionToEndOfDataVariable();
+ void extendSelectionByBytes();
+ void extendSelectionToAddress();
+ void setSelectionSizeTo();
+ void saveSelectionTo();
+
+ bool canExtendSelectionToStartOfSection();
+ bool canExtendSelectionToEndOfSection();
+ bool canExtendSelectionToStartOfSegment();
+ bool canExtendSelectionToEndOfSegment();
+ bool canExtendSelectionToStartOfDataVariable();
+ bool canExtendSelectionToEndOfDataVariable();
};
/*!