Skip to content

Commit 01ec263

Browse files
committed
Update variablelist.h for variable placement info
1 parent 5b575ff commit 01ec263

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ui/variablelist.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <clickablelabel.h>
34
#include <QtCore/QSortFilterProxyModel>
45
#include <QtCore/QTimer>
56
#include <QtWidgets/QListView>
@@ -44,14 +45,15 @@ class VariableListItem
4445
BinaryNinja::DataVariable m_dataVar;
4546
BinaryNinja::PossibleValueSet m_pvs;
4647
bool m_hasUidf;
48+
bool m_showPlacementInformation;
4749

4850
public:
4951
//! Create a new VariableListItem of the LocalVariable type.
5052
VariableListItem(
51-
FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name);
53+
FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name, bool showPlacementInformation);
5254

5355
//! Create a new VariableListItem of the DataVariable type.
54-
VariableListItem(FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name);
56+
VariableListItem(FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name, bool showPlacementInformation);
5557

5658
//! Get the type of this list item.
5759
VariableListItemType type() const;
@@ -70,6 +72,7 @@ class VariableListItem
7072

7173
std::vector<BinaryNinja::InstructionTextToken> tokensBeforeName() const;
7274
std::vector<BinaryNinja::InstructionTextToken> tokensAfterName() const;
75+
void displayVariablePlacementInfo(std::vector<BinaryNinja::InstructionTextToken>& tokens) const;
7376

7477
//! Shorthand to get concatenated type, name, and value tokens.
7578
std::vector<BinaryNinja::InstructionTextToken> displayTokens() const;
@@ -111,6 +114,7 @@ class BINARYNINJAUIAPI VariableListModel : public QAbstractListModel
111114

112115
size_t m_prevVariableCount;
113116
uint64_t m_prevSelectionId;
117+
bool m_showPlacementInformation;
114118

115119
public:
116120
VariableListModel(QWidget* parent, ViewFrame* view, BinaryViewRef data);
@@ -127,6 +131,9 @@ class BINARYNINJAUIAPI VariableListModel : public QAbstractListModel
127131
//! Whether or not the function exceeds the set complexity threshold
128132
bool functionExceedsComplexity() const { return m_funcExceedsComplexity; }
129133

134+
//! Get the showPlacementInformation setting
135+
bool showPlacementInformation() const { return m_showPlacementInformation; }
136+
130137
//! Set the focused function and update the content of the list.
131138
void setFunction(FunctionRef func, const BinaryNinja::FunctionViewType& il, const HighlightTokenState& hts);
132139

@@ -180,6 +187,9 @@ class BINARYNINJAUIAPI VariableList : public SidebarWidget, public FilterTarget
180187
FilterEdit* m_filterEdit;
181188
FilteredView* m_filteredList;
182189

190+
ClickableIcon* m_hamburgerButton;
191+
QMenu* m_hamburgerMenu;
192+
183193
ViewFrame* m_view;
184194
BinaryViewRef m_data;
185195

@@ -206,6 +216,7 @@ class BINARYNINJAUIAPI VariableList : public SidebarWidget, public FilterTarget
206216

207217
//! Get the VariableListItem corresponding to the current selection.
208218
VariableListItem* selectedItem() const;
219+
void showHamburgerMenu() const;
209220

210221
//! Show the rename dialog for the selected variable.
211222
void changeSelectedVariableName();

0 commit comments

Comments
 (0)