-
-
Notifications
You must be signed in to change notification settings - Fork 335
/
InspectorWindow.h
103 lines (83 loc) · 2.74 KB
/
InspectorWindow.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
/*
* Copyright 2011-2015, Rene Gollent, rene@gollent.com. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef INSPECTOR_WINDOW_H
#define INSPECTOR_WINDOW_H
#include <Window.h>
#include "ExpressionInfo.h"
#include "MemoryView.h"
#include "Team.h"
#include "TeamMemoryBlock.h"
#include "Types.h"
class BButton;
class BMenuField;
class BMessenger;
class BStringView;
class BTextControl;
class GuiTeamUiSettings;
class SourceLanguage;
class UserInterfaceListener;
class InspectorWindow : public BWindow, private Team::Listener,
private TeamMemoryBlock::Listener, private MemoryView::Listener,
private ExpressionInfo::Listener {
public:
InspectorWindow(::Team* team,
UserInterfaceListener* listener,
BHandler* target);
virtual ~InspectorWindow();
static InspectorWindow* Create(::Team* team,
UserInterfaceListener* listener,
BHandler* target);
// throws
virtual void MessageReceived(BMessage* message);
virtual bool QuitRequested();
// Team::Listener
virtual void ThreadStateChanged(
const Team::ThreadEvent& event);
// TeamMemoryBlock::Listener
virtual void MemoryBlockRetrieved(TeamMemoryBlock* block);
virtual void MemoryBlockRetrievalFailed(
TeamMemoryBlock* block, status_t result);
// MemoryView::Listener
virtual void TargetAddressChanged(target_addr_t address);
virtual void HexModeChanged(int32 newMode);
virtual void EndianModeChanged(int32 newMode);
virtual void TextModeChanged(int32 newMode);
// ExpressionInfo::Listener
virtual void ExpressionEvaluated(ExpressionInfo* info,
status_t result, ExpressionResult* value);
status_t LoadSettings(
const GuiTeamUiSettings& settings);
status_t SaveSettings(
BMessage& settings);
private:
void _Init();
void _LoadMenuFieldMode(BMenuField* field,
const char* name,
const BMessage& settings);
status_t _SaveMenuFieldMode(BMenuField* field,
const char* name,
BMessage& settings);
void _SetToAddress(target_addr_t address);
void _SetCurrentBlock(TeamMemoryBlock* block);
void _UpdateWritableIndicator();
const char* _GetCurrentWritableIndicator() const;
private:
UserInterfaceListener* fListener;
BTextControl* fAddressInput;
BMenuField* fHexMode;
BMenuField* fEndianMode;
BMenuField* fTextMode;
BStringView* fWritableBlockIndicator;
MemoryView* fMemoryView;
BButton* fPreviousBlockButton;
BButton* fNextBlockButton;
TeamMemoryBlock* fCurrentBlock;
target_addr_t fCurrentAddress;
::Team* fTeam;
SourceLanguage* fLanguage;
ExpressionInfo* fExpressionInfo;
BHandler* fTarget;
};
#endif // INSPECTOR_WINDOW_H