diff options
| author | Jon Palmisciano <jp@jonpalmisc.com> | 2022-05-17 10:00:44 -0400 |
|---|---|---|
| committer | Jon Palmisciano <jp@jonpalmisc.com> | 2022-05-17 10:24:20 -0400 |
| commit | 20612a39c6e96159ca375b8f1cfd06b38c85126b (patch) | |
| tree | e6c46738297030ec7f51dc921f27949850bba327 /ui/addressindicator.h | |
| parent | 5737aa32811c3015164819a275ef492a4e4bd66c (diff) | |
Refactor, add `AddressIndicator` APIs; default-initialize members
- Back format enums with `char` type
Diffstat (limited to 'ui/addressindicator.h')
| -rw-r--r-- | ui/addressindicator.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/addressindicator.h b/ui/addressindicator.h index 4d7d8cf1..76d3eefa 100644 --- a/ui/addressindicator.h +++ b/ui/addressindicator.h @@ -6,7 +6,7 @@ #include "uicontext.h" //! Format for displaying offsets. -enum class OffsetFormat +enum class OffsetFormat : char { VirtualAddress, FileStart, @@ -16,7 +16,7 @@ enum class OffsetFormat }; //! Format for displaying an address range. -enum class RangeFormat +enum class RangeFormat : char { StartOnly, EndOnly, @@ -38,7 +38,8 @@ class BINARYNINJAUIAPI AddressIndicator : public MenuHelper uint64_t m_begin, m_end; BinaryViewRef m_view; - DisplayOptions m_options; + DisplayOptions m_options{}; + const DisplayOptions m_defaultOptions{}; //! Format an offset as a string. //! @@ -51,7 +52,10 @@ class BINARYNINJAUIAPI AddressIndicator : public MenuHelper QString formatRange(uint64_t start, uint64_t end, RangeFormat, OffsetFormat) const; //! Create a QAction to copy a formatted offset/range. - void addActionForFormat(QMenu*, RangeFormat, OffsetFormat, QString help = ""); + void addCopyAction(QMenu*, RangeFormat, OffsetFormat, QString help = ""); + + //! Create a QAction to set the display format. + void addDisplayAction(QMenu*, RangeFormat, OffsetFormat, QString help = ""); //! Refresh the text displayed in the status bar. void updateDisplay(); |
