blob: 95ec2cc564faddf72e42c4b93bdee2635479be1d (
plain)
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
|
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QDockWidget>
#include "Common/CommonTypes.h"
class QAction;
class QCloseEvent;
class QShowEvent;
class QTableWidget;
class QTableWidgetItem;
class QToolBar;
namespace Core
{
class CPUThreadGuard;
class System;
} // namespace Core
class WatchWidget : public QDockWidget
{
Q_OBJECT
public:
explicit WatchWidget(QWidget* parent = nullptr);
~WatchWidget() override;
void AddWatch(const QString& name, u32 addr);
signals:
void RequestMemoryBreakpoint(u32 addr);
void ShowMemory(u32 addr);
protected:
void closeEvent(QCloseEvent*) override;
void showEvent(QShowEvent* event) override;
private:
void CreateWidgets();
void ConnectWidgets();
void OnDelete();
void OnClear();
void OnNewWatch();
void OnLoad();
void OnSave();
void UpdateButtonsEnabled();
void Update();
void SetEmptyRow(int row);
void ShowContextMenu();
void OnItemChanged(QTableWidgetItem* item);
void LockWatchAddress(const Core::CPUThreadGuard& guard, u32 address);
void DeleteSelectedWatches();
void DeleteWatch(const Core::CPUThreadGuard& guard, int row);
void DeleteWatchAndUpdate(int row);
void AddWatchBreakpoint(int row);
void ShowInMemory(int row);
void UpdateIcons();
void LockSelectedWatches();
void UnlockSelectedWatches();
Core::System& m_system;
QAction* m_new;
QAction* m_delete;
QAction* m_clear;
QAction* m_load;
QAction* m_save;
QToolBar* m_toolbar;
QTableWidget* m_table;
bool m_updating = false;
static constexpr int NUM_COLUMNS = 7;
static constexpr int COLUMN_INDEX_LABEL = 0;
static constexpr int COLUMN_INDEX_ADDRESS = 1;
static constexpr int COLUMN_INDEX_HEX = 2;
static constexpr int COLUMN_INDEX_DECIMAL = 3;
static constexpr int COLUMN_INDEX_STRING = 4;
static constexpr int COLUMN_INDEX_FLOAT = 5;
static constexpr int COLUMN_INDEX_LOCK = 6;
};
|