2017-09-13 17:33:45 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Debugger/RegisterColumn.h"
|
2017-09-13 17:33:45 +00:00
|
|
|
|
|
|
|
class QTableWidget;
|
|
|
|
class QCloseEvent;
|
2019-07-06 08:50:11 +00:00
|
|
|
class QShowEvent;
|
2017-09-13 17:33:45 +00:00
|
|
|
|
|
|
|
class RegisterWidget : public QDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit RegisterWidget(QWidget* parent = nullptr);
|
|
|
|
~RegisterWidget();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void RequestTableUpdate();
|
2019-10-06 08:20:52 +00:00
|
|
|
void RequestViewInCode(u32 addr);
|
|
|
|
void RequestViewInMemory(u32 addr);
|
2017-11-19 17:50:38 +00:00
|
|
|
void RequestMemoryBreakpoint(u32 addr);
|
2021-02-17 17:02:23 +00:00
|
|
|
void RequestWatch(QString name, u32 addr);
|
2017-09-13 17:33:45 +00:00
|
|
|
void UpdateTable();
|
|
|
|
void UpdateValue(QTableWidgetItem* item);
|
|
|
|
void UpdateValueType(QTableWidgetItem* item);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent*) override;
|
2019-07-06 08:50:11 +00:00
|
|
|
void showEvent(QShowEvent* event) override;
|
2017-09-13 17:33:45 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void CreateWidgets();
|
|
|
|
void ConnectWidgets();
|
|
|
|
void PopulateTable();
|
|
|
|
|
|
|
|
void ShowContextMenu();
|
|
|
|
void OnItemChanged(QTableWidgetItem* item);
|
|
|
|
|
|
|
|
void AddRegister(int row, int column, RegisterType type, std::string register_name,
|
2018-01-13 07:21:32 +00:00
|
|
|
std::function<u64()> get_reg, std::function<void(u64)> set_reg);
|
2017-09-13 17:33:45 +00:00
|
|
|
|
2019-07-06 08:50:11 +00:00
|
|
|
void Update();
|
|
|
|
|
2017-09-13 17:33:45 +00:00
|
|
|
QTableWidget* m_table;
|
|
|
|
bool m_updating = false;
|
|
|
|
};
|