dolphin/Source/Core/DolphinQt/Debugger/WatchWidget.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
1.9 KiB
C
Raw Permalink Normal View History

2017-09-27 06:53:05 +00:00
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2017-09-27 06:53:05 +00:00
#pragma once
#include <QDockWidget>
#include "Common/CommonTypes.h"
class QAction;
class QCloseEvent;
class QShowEvent;
2017-09-27 06:53:05 +00:00
class QTableWidget;
class QTableWidgetItem;
class QToolBar;
namespace Core
{
class CPUThreadGuard;
class System;
2024-08-18 13:08:44 +00:00
} // namespace Core
2017-09-27 06:53:05 +00:00
class WatchWidget : public QDockWidget
{
Q_OBJECT
public:
explicit WatchWidget(QWidget* parent = nullptr);
~WatchWidget();
void AddWatch(QString name, u32 addr);
signals:
void RequestMemoryBreakpoint(u32 addr);
void ShowMemory(u32 addr);
2017-09-27 06:53:05 +00:00
protected:
void closeEvent(QCloseEvent*) override;
void showEvent(QShowEvent* event) override;
2017-09-27 06:53:05 +00:00
private:
void CreateWidgets();
void ConnectWidgets();
void OnDelete();
void OnClear();
void OnNewWatch();
2017-09-27 06:53:05 +00:00
void OnLoad();
void OnSave();
void UpdateButtonsEnabled();
2017-09-27 06:53:05 +00:00
void Update();
void SetEmptyRow(int row);
2017-09-27 06:53:05 +00:00
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);
2017-09-27 06:53:05 +00:00
void AddWatchBreakpoint(int row);
void ShowInMemory(int row);
2018-04-11 21:43:47 +00:00
void UpdateIcons();
void LockSelectedWatches();
void UnlockSelectedWatches();
2018-04-11 21:43:47 +00:00
Core::System& m_system;
QAction* m_new;
QAction* m_delete;
QAction* m_clear;
2017-09-27 06:53:05 +00:00
QAction* m_load;
QAction* m_save;
QToolBar* m_toolbar;
QTableWidget* m_table;
bool m_updating = false;
2019-06-28 21:04:23 +00:00
static constexpr int NUM_COLUMNS = 7;
2022-12-23 02:50:16 +00:00
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;
2017-09-27 06:53:05 +00:00
};