-
-
Notifications
You must be signed in to change notification settings - Fork 336
/
VariablesView.h
115 lines (90 loc) · 2.93 KB
/
VariablesView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2012-2014, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef VARIABLES_VIEW_H
#define VARIABLES_VIEW_H
#include <GroupView.h>
#include "table/TreeTable.h"
class ActionMenuItem;
class CpuState;
class SettingsMenu;
class StackFrame;
class Thread;
class Type;
class TypeComponentPath;
class ValueNode;
class ValueNodeContainer;
class Variable;
class VariablesViewState;
class VariablesViewStateHistory;
class VariablesView : public BGroupView, private TreeTableListener {
public:
class Listener;
public:
VariablesView(Listener* listener);
~VariablesView();
static VariablesView* Create(Listener* listener);
// throws
void SetStackFrame(Thread* thread,
StackFrame* stackFrame);
virtual void MessageReceived(BMessage* message);
virtual void DetachedFromWindow();
void LoadSettings(const BMessage& settings);
status_t SaveSettings(BMessage& settings);
void SetStackFrameClearPending();
private:
// TreeTableListener
virtual void TreeTableNodeExpandedChanged(TreeTable* table,
const TreeTablePath& path, bool expanded);
virtual void TreeTableCellMouseDown(TreeTable* table,
const TreeTablePath& path,
int32 columnIndex, BPoint screenWhere,
uint32 buttons);
private:
class ContainerListener;
class ModelNode;
class VariableValueColumn;
class VariableTableModel;
class ContextMenu;
class TableCellContextMenuTracker;
typedef BObjectList<ActionMenuItem> ContextActionList;
private:
void _Init();
void _RequestNodeValue(ModelNode* node);
status_t _GetContextActionsForNode(ModelNode* node,
ContextActionList* actions);
status_t _AddContextAction(const char* action,
uint32 what, ContextActionList* actions,
BMessage*& _message);
void _FinishContextMenu(bool force);
void _SaveViewState() const;
void _RestoreViewState();
status_t _AddViewStateDescendentNodeInfos(
VariablesViewState* viewState, void* parent,
TreeTablePath& path) const;
status_t _ApplyViewStateDescendentNodeInfos(
VariablesViewState* viewState, void* parent,
TreeTablePath& path);
void _CopyVariableValueToClipboard();
private:
Thread* fThread;
StackFrame* fStackFrame;
TreeTable* fVariableTable;
VariableTableModel* fVariableTableModel;
ContainerListener* fContainerListener;
VariablesViewState* fPreviousViewState;
VariablesViewStateHistory* fViewStateHistory;
TableCellContextMenuTracker* fTableCellContextMenuTracker;
bool fFrameClearPending;
Listener* fListener;
};
class VariablesView::Listener {
public:
virtual ~Listener();
virtual void ValueNodeValueRequested(CpuState* cpuState,
ValueNodeContainer* container,
ValueNode* valueNode) = 0;
};
#endif // VARIABLES_VIEW_H