summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2020-10-08 04:15:52 -0400
committerGlenn Smith <glenn@vector35.com>2020-10-09 03:28:03 -0400
commit307fe4be9208636e54f90a24f6d0deb56512069d (patch)
treeb45d2ec07809f799c8351fb9038ab50d3710cc2f
parent720777f31913ba8c80f24c3460326764a24976a8 (diff)
Per-character text selection
-rw-r--r--ui/action.h1
-rw-r--r--ui/flowgraphwidget.h8
-rw-r--r--ui/linearview.h5
3 files changed, 14 insertions, 0 deletions
diff --git a/ui/action.h b/ui/action.h
index 3414d8b0..45b09e1e 100644
--- a/ui/action.h
+++ b/ui/action.h
@@ -32,6 +32,7 @@ struct BINARYNINJAUIAPI HighlightTokenState
uint64_t addr;
BinaryNinja::Variable localVar;
size_t tokenIndex;
+ size_t characterIndex;
HighlightTokenState();
};
diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h
index 7a26f5a8..7407e00c 100644
--- a/ui/flowgraphwidget.h
+++ b/ui/flowgraphwidget.h
@@ -60,6 +60,9 @@ class BINARYNINJAUIAPI FlowGraphWidget: public QAbstractScrollArea, public View,
size_t instrIndex;
size_t lineIndexForAddress;
size_t tokenIndex;
+ size_t characterIndex;
+
+ bool operator<(const CursorPosition& other) const;
};
BinaryViewRef m_data;
@@ -246,6 +249,11 @@ public:
void paintMiniGraphAndViewport(QWidget* owner);
bool paintMiniGraph(QWidget* owner, QPainter& p);
+ void paintNode(QPainter& p, FlowGraphNodeRef& node, int minY, int maxY);
+ void paintHighlight(QPainter& p, const std::vector<BinaryNinja::DisassemblyTextLine>& lines,
+ int nodeX, int nodeWidth, int x, int y, size_t line, int tagIndent);
+ void paintEdge(QPainter& p, const FlowGraphNodeRef& node, const BinaryNinja::FlowGraphEdge& edge);
+
void showAddress(uint64_t addr, bool select = false);
void showTopNode();
void showNode(FlowGraphNodeRef node);
diff --git a/ui/linearview.h b/ui/linearview.h
index 413b66e1..c429e31d 100644
--- a/ui/linearview.h
+++ b/ui/linearview.h
@@ -27,6 +27,7 @@ struct BINARYNINJAUIAPI LinearViewCursorPosition
BinaryNinja::Ref<BinaryNinja::LinearViewCursor> cursor;
size_t lineIndex;
size_t tokenIndex;
+ size_t characterIndex;
LinearViewCursorPosition();
LinearViewCursorPosition(const LinearViewCursorPosition& pos);
@@ -151,6 +152,10 @@ class BINARYNINJAUIAPI LinearView: public QAbstractScrollArea, public View, publ
void getHexDumpLineBytes(const BinaryNinja::LinearDisassemblyLine& line, size_t& skippedBytes, size_t& totalBytes,
size_t& totalCols);
+ void paintHexDumpLine(QPainter& p, const LinearViewLine& line, int xoffset, int y, uint32_t addrLen, int tagOffset);
+ void paintAnalysisWarningLine(QPainter& p, const LinearViewLine& line, int xoffset, int y);
+ void paintTokenLine(QPainter& p, const LinearViewLine& line, int xoffset, int y, QRect eventRect, int tagOffset);
+
void setSectionSemantics(const std::string& name, BNSectionSemantics semantics);
bool isLineValidHighlight(const BinaryNinja::LinearDisassemblyLine& line);