1/*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013-2015, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef REGISTERS_VIEW_H
7#define REGISTERS_VIEW_H
8
9#include <GroupView.h>
10
11#include "table/Table.h"
12#include "Team.h"
13
14
15class Architecture;
16class BMenu;
17
18
19class RegistersView : public BGroupView, private TableListener {
20public:
21								RegistersView(Architecture* architecture);
22								~RegistersView();
23
24	static	RegistersView*		Create(Architecture* architecture);
25									// throws
26
27	virtual	void				MessageReceived(BMessage* message);
28
29			void				SetCpuState(CpuState* cpuState);
30
31			void				LoadSettings(const BMessage& settings);
32			status_t			SaveSettings(BMessage& settings);
33
34private:
35			class RegisterValueColumn;
36			class RegisterTableModel;
37
38private:
39	// TableListener
40	virtual	void				TableRowInvoked(Table* table, int32 rowIndex);
41
42	virtual	void				TableCellMouseDown(Table* table, int32 rowIndex,
43									int32 columnIndex, BPoint screenWhere,
44									uint32 buttons);
45
46			void				_Init();
47			status_t			_AddFormatItem(BMenu* menu, int32 format);
48
49private:
50			Architecture*		fArchitecture;
51			CpuState*			fCpuState;
52			Table*				fRegisterTable;
53			RegisterTableModel*	fRegisterTableModel;
54};
55
56
57#endif	// REGISTERS_VIEW_H
58