2 * Copyright 2011-2015, Rene Gollent, rene@gollent.com. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef INSPECTOR_WINDOW_H
6 #define INSPECTOR_WINDOW_H
11 #include "ExpressionInfo.h"
12 #include "MemoryView.h"
14 #include "TeamMemoryBlock.h"
23 class GuiTeamUiSettings
;
25 class UserInterfaceListener
;
28 class InspectorWindow
: public BWindow
, private Team::Listener
,
29 private TeamMemoryBlock::Listener
, private MemoryView::Listener
,
30 private ExpressionInfo::Listener
{
32 InspectorWindow(::Team
* team
,
33 UserInterfaceListener
* listener
,
35 virtual ~InspectorWindow();
37 static InspectorWindow
* Create(::Team
* team
,
38 UserInterfaceListener
* listener
,
42 virtual void MessageReceived(BMessage
* message
);
43 virtual bool QuitRequested();
46 virtual void ThreadStateChanged(
47 const Team::ThreadEvent
& event
);
49 virtual void MemoryChanged(
50 const Team::MemoryChangedEvent
& event
);
52 // TeamMemoryBlock::Listener
53 virtual void MemoryBlockRetrieved(TeamMemoryBlock
* block
);
54 virtual void MemoryBlockRetrievalFailed(
55 TeamMemoryBlock
* block
, status_t result
);
57 // MemoryView::Listener
58 virtual void TargetAddressChanged(target_addr_t address
);
59 virtual void HexModeChanged(int32 newMode
);
60 virtual void EndianModeChanged(int32 newMode
);
61 virtual void TextModeChanged(int32 newMode
);
63 // ExpressionInfo::Listener
64 virtual void ExpressionEvaluated(ExpressionInfo
* info
,
65 status_t result
, ExpressionResult
* value
);
67 status_t
LoadSettings(
68 const GuiTeamUiSettings
& settings
);
69 status_t
SaveSettings(
75 void _LoadMenuFieldMode(BMenuField
* field
,
77 const BMessage
& settings
);
78 status_t
_SaveMenuFieldMode(BMenuField
* field
,
82 void _SetToAddress(target_addr_t address
);
83 void _SetCurrentBlock(TeamMemoryBlock
* block
);
85 void _SetEditMode(bool enabled
);
87 bool _GetWritableState() const;
89 void _UpdateWritableOptions();
91 void _UpdateWritableIndicator();
92 const char* _GetCurrentWritableIndicator() const;
95 UserInterfaceListener
* fListener
;
96 BTextControl
* fAddressInput
;
98 BMenuField
* fEndianMode
;
99 BMenuField
* fTextMode
;
100 BStringView
* fWritableBlockIndicator
;
101 MemoryView
* fMemoryView
;
102 BButton
* fPreviousBlockButton
;
103 BButton
* fNextBlockButton
;
104 BButton
* fEditBlockButton
;
105 BButton
* fCommitBlockButton
;
106 BButton
* fRevertBlockButton
;
107 TeamMemoryBlock
* fCurrentBlock
;
108 target_addr_t fCurrentAddress
;
110 SourceLanguage
* fLanguage
;
111 ExpressionInfo
* fExpressionInfo
;
115 #endif // INSPECTOR_WINDOW_H