Classes | |
| struct | HexEditorHighlightState |
| struct | CellAlignedText |
| A piece of text together with the character cell it starts at. More... | |
| class | FontParameters |
| class | RenderContext |
Enumerations | |
| enum | HexEditorHighlightMode { NoHighlight , ColumnHighlight , ByteValueHighlight } |
| enum | HexEditorColorMode { NoColorization , AsciiColorization , ModificationColorization } |
| enum | HexEditorHighlightContrast { NormalContrastHighlight , MediumContrastHighlight , HighContrastHighlight } |
| struct HexEditorHighlightState |
Public Member Functions | |
| void | restoreSettings () |
| void | saveSettings () |
Public Attributes | |
| HexEditorHighlightMode | mode |
| HexEditorColorMode | color |
| HexEditorHighlightContrast | contrast |
| void HexEditorHighlightState::restoreSettings | ( | ) |
| void HexEditorHighlightState::saveSettings | ( | ) |
| HexEditorHighlightMode HexEditorHighlightState::mode |
| HexEditorColorMode HexEditorHighlightState::color |
| HexEditorHighlightContrast HexEditorHighlightState::contrast |
| struct CellAlignedText |
| class FontParameters |
Public Member Functions | |
| FontParameters (QWidget *parent, float fontScale=1.0f) | |
| void | update () |
| const QFont & | getFont () const |
| QFont & | getFont () |
| const QFont & | getEmojiFont () const |
| QFont & | getEmojiFont () |
| void | setFont (const QFont &font) |
| void | setEmojiFont (const QFont &emojiFont) |
| int | getBaseline () const |
| int | getWidth () const |
| int | getHeight () const |
| int | getOffset () const |
| FontParameters::FontParameters | ( | QWidget * | parent, |
| float | fontScale = 1.0f ) |
| void FontParameters::update | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
| void FontParameters::setFont | ( | const QFont & | font | ) |
| void FontParameters::setEmojiFont | ( | const QFont & | emojiFont | ) |
|
inline |
|
inline |
|
inline |
|
inline |
| class RenderContext |
Public Member Functions | |
| RenderContext (QWidget *parent, float fontScale=1.0f) | |
| void | update () |
| FontParameters & | getFontParamters () |
| const FontParameters & | getFontParameters () const |
| int | getFontWidth () const |
| int | getFontHeight () const |
| void | init (QPainter &p) |
| QColor | getColorForHexDumpByte (const HexEditorHighlightState &state, BNModificationStatus modification, uint8_t byte) |
| QColor | getHighlightColor (BNHighlightColor color) |
| HighlightTokenState | getTokenForDisassemblyLinePosition (int64_t col, const std::vector< BinaryNinja::InstructionTextToken > &tokens) |
| HighlightTokenState | getTokenForDisassemblyTokenIndex (size_t tokenIndex, const std::vector< BinaryNinja::InstructionTextToken > &tokens) |
| HighlightTokenState | getHighlightTokenForTextToken (const BinaryNinja::InstructionTextToken &token) |
| void | drawText (QPainter &p, int x, int y, QColor color, const QString &text) const |
| void | drawCellAlignedText (QPainter &p, int x, int y, QColor color, const std::string &text) const |
| Draws text positioned on the character cell grid, so that wide code points occupy the cells their token width accounted for. | |
| void | drawUnderlinedText (QPainter &p, int x, int y, QColor color, const QString &text) |
| void | drawSeparatorLine (QPainter &p, QColor top, QColor bottom, QColor line, const QRect &rect) |
| void | drawInstructionHighlight (QPainter &p, const QRect &rect, bool focused=true) |
| void | drawLinearDisassemblyLineBackground (QPainter &p, BNLinearDisassemblyLineType type, const QRect &rect, const QRect &dirtyRect, int gutterWidth) |
| int | drawDisassemblyLine (QPainter &p, int left, int top, const std::vector< BinaryNinja::InstructionTextToken > &tokens, HighlightTokenState &highlight, bool highlightOnly=false, bool renderCollapseIndicator=false) const |
| void | drawHexEditorLine (QPainter &p, int left, int top, const HexEditorHighlightState &highlight, BinaryViewRef view, uint64_t lineStartAddr, size_t cols, size_t firstCol, size_t count, bool cursorVisible, bool cursorAscii, size_t cursorPos, bool byteCursor) |
| QFont | getFont () const |
| QFont | getEmojiFont () const |
| void | setFont (const QFont &font) |
Static Public Member Functions | |
| static std::vector< CellAlignedText > | layOutTextInCells (const std::string &text) |
| Splits text into the pieces needed to draw it on the character cell grid. | |
| RenderContext::RenderContext | ( | QWidget * | parent, |
| float | fontScale = 1.0f ) |
| void RenderContext::update | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
| void RenderContext::init | ( | QPainter & | p | ) |
| QColor RenderContext::getColorForHexDumpByte | ( | const HexEditorHighlightState & | state, |
| BNModificationStatus | modification, | ||
| uint8_t | byte ) |
| QColor RenderContext::getHighlightColor | ( | BNHighlightColor | color | ) |
| HighlightTokenState RenderContext::getTokenForDisassemblyLinePosition | ( | int64_t | col, |
| const std::vector< BinaryNinja::InstructionTextToken > & | tokens ) |
| HighlightTokenState RenderContext::getTokenForDisassemblyTokenIndex | ( | size_t | tokenIndex, |
| const std::vector< BinaryNinja::InstructionTextToken > & | tokens ) |
| HighlightTokenState RenderContext::getHighlightTokenForTextToken | ( | const BinaryNinja::InstructionTextToken & | token | ) |
| void RenderContext::drawText | ( | QPainter & | p, |
| int | x, | ||
| int | y, | ||
| QColor | color, | ||
| const QString & | text ) const |
| void RenderContext::drawCellAlignedText | ( | QPainter & | p, |
| int | x, | ||
| int | y, | ||
| QColor | color, | ||
| const std::string & | text ) const |
Draws text positioned on the character cell grid, so that wide code points occupy the cells their token width accounted for.
ASCII text is drawn in a single call as a fast path.
| void RenderContext::drawUnderlinedText | ( | QPainter & | p, |
| int | x, | ||
| int | y, | ||
| QColor | color, | ||
| const QString & | text ) |
| void RenderContext::drawSeparatorLine | ( | QPainter & | p, |
| QColor | top, | ||
| QColor | bottom, | ||
| QColor | line, | ||
| const QRect & | rect ) |
| void RenderContext::drawInstructionHighlight | ( | QPainter & | p, |
| const QRect & | rect, | ||
| bool | focused = true ) |
| void RenderContext::drawLinearDisassemblyLineBackground | ( | QPainter & | p, |
| BNLinearDisassemblyLineType | type, | ||
| const QRect & | rect, | ||
| const QRect & | dirtyRect, | ||
| int | gutterWidth ) |
| int RenderContext::drawDisassemblyLine | ( | QPainter & | p, |
| int | left, | ||
| int | top, | ||
| const std::vector< BinaryNinja::InstructionTextToken > & | tokens, | ||
| HighlightTokenState & | highlight, | ||
| bool | highlightOnly = false, | ||
| bool | renderCollapseIndicator = false ) const |
| void RenderContext::drawHexEditorLine | ( | QPainter & | p, |
| int | left, | ||
| int | top, | ||
| const HexEditorHighlightState & | highlight, | ||
| BinaryViewRef | view, | ||
| uint64_t | lineStartAddr, | ||
| size_t | cols, | ||
| size_t | firstCol, | ||
| size_t | count, | ||
| bool | cursorVisible, | ||
| bool | cursorAscii, | ||
| size_t | cursorPos, | ||
| bool | byteCursor ) |
|
inline |
|
inline |
| void RenderContext::setFont | ( | const QFont & | font | ) |
|
static |
Splits text into the pieces needed to draw it on the character cell grid.
Text is broken at grapheme cluster boundaries, since a cluster is what the user sees as a single character and what the width accounting measured; a cluster can span many code points, as combining marks, emoji modifiers, and ZWJ sequences all join into one. Runs of plain ASCII are kept together so the font can still shape and apply ligatures across them.
The returned cell offsets always total the string's width as reported by BinaryNinja::Unicode::GetDisplayWidth, so drawing stays aligned with the layout that width produced.
| text | Text to lay out |
| enum HexEditorColorMode |