diff options
| author | Alexander Khosrowshahi <alexk@vector35.com> | 2025-07-08 12:24:45 -0400 |
|---|---|---|
| committer | Alexander Khosrowshahi <alexk@vector35.com> | 2025-07-08 12:24:45 -0400 |
| commit | 01ec263e92c250371d0b4e31a5b5621de3f25f02 (patch) | |
| tree | 79658a45e0c87eda7c7a07fba0e41e8eb2b4722c /ui/variablelist.h | |
| parent | 5b575ff6a87061221e1c17824b2b42af839ccc74 (diff) | |
Update variablelist.h for variable placement info
Diffstat (limited to 'ui/variablelist.h')
| -rw-r--r-- | ui/variablelist.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/variablelist.h b/ui/variablelist.h index 7cad6e2a..374a0fe4 100644 --- a/ui/variablelist.h +++ b/ui/variablelist.h @@ -1,5 +1,6 @@ #pragma once +#include <clickablelabel.h> #include <QtCore/QSortFilterProxyModel> #include <QtCore/QTimer> #include <QtWidgets/QListView> @@ -44,14 +45,15 @@ class VariableListItem BinaryNinja::DataVariable m_dataVar; BinaryNinja::PossibleValueSet m_pvs; bool m_hasUidf; + bool m_showPlacementInformation; public: //! Create a new VariableListItem of the LocalVariable type. VariableListItem( - FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name); + FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name, bool showPlacementInformation); //! Create a new VariableListItem of the DataVariable type. - VariableListItem(FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name); + VariableListItem(FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name, bool showPlacementInformation); //! Get the type of this list item. VariableListItemType type() const; @@ -70,6 +72,7 @@ class VariableListItem std::vector<BinaryNinja::InstructionTextToken> tokensBeforeName() const; std::vector<BinaryNinja::InstructionTextToken> tokensAfterName() const; + void displayVariablePlacementInfo(std::vector<BinaryNinja::InstructionTextToken>& tokens) const; //! Shorthand to get concatenated type, name, and value tokens. std::vector<BinaryNinja::InstructionTextToken> displayTokens() const; @@ -111,6 +114,7 @@ class BINARYNINJAUIAPI VariableListModel : public QAbstractListModel size_t m_prevVariableCount; uint64_t m_prevSelectionId; + bool m_showPlacementInformation; public: VariableListModel(QWidget* parent, ViewFrame* view, BinaryViewRef data); @@ -127,6 +131,9 @@ class BINARYNINJAUIAPI VariableListModel : public QAbstractListModel //! Whether or not the function exceeds the set complexity threshold bool functionExceedsComplexity() const { return m_funcExceedsComplexity; } + //! Get the showPlacementInformation setting + bool showPlacementInformation() const { return m_showPlacementInformation; } + //! Set the focused function and update the content of the list. void setFunction(FunctionRef func, const BinaryNinja::FunctionViewType& il, const HighlightTokenState& hts); @@ -180,6 +187,9 @@ class BINARYNINJAUIAPI VariableList : public SidebarWidget, public FilterTarget FilterEdit* m_filterEdit; FilteredView* m_filteredList; + ClickableIcon* m_hamburgerButton; + QMenu* m_hamburgerMenu; + ViewFrame* m_view; BinaryViewRef m_data; @@ -206,6 +216,7 @@ class BINARYNINJAUIAPI VariableList : public SidebarWidget, public FilterTarget //! Get the VariableListItem corresponding to the current selection. VariableListItem* selectedItem() const; + void showHamburgerMenu() const; //! Show the rename dialog for the selected variable. void changeSelectedVariableName(); |
