-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
MemoryViewWidget.h
72 lines (57 loc) · 1.35 KB
/
MemoryViewWidget.h
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
// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QTableWidget>
#include "Common/CommonTypes.h"
namespace AddressSpace
{
enum class Type;
}
class MemoryViewWidget : public QTableWidget
{
Q_OBJECT
public:
enum class Type
{
U8,
U16,
U32,
ASCII,
Float32
};
enum class BPType
{
ReadWrite,
ReadOnly,
WriteOnly
};
explicit MemoryViewWidget(QWidget* parent = nullptr);
void Update();
void ToggleBreakpoint();
void ToggleRowBreakpoint(bool row);
void SetAddressSpace(AddressSpace::Type address_space);
AddressSpace::Type GetAddressSpace() const;
void SetType(Type type);
void SetBPType(BPType type);
void SetAddress(u32 address);
void SetBPLoggingEnabled(bool enabled);
u32 GetContextAddress() const;
void resizeEvent(QResizeEvent*) override;
void keyPressEvent(QKeyEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* event) override;
signals:
void BreakpointsChanged();
void ShowCode(u32 address);
private:
void OnContextMenu();
void OnCopyAddress();
void OnCopyHex();
AddressSpace::Type m_address_space{};
Type m_type = Type::U8;
BPType m_bp_type = BPType::ReadWrite;
bool m_do_log = true;
u32 m_context_address;
u32 m_address = 0;
};