diff options
Diffstat (limited to 'src/citra_qt/debugger/graphics_breakpoints.hxx')
| -rw-r--r-- | src/citra_qt/debugger/graphics_breakpoints.hxx | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/citra_qt/debugger/graphics_breakpoints.hxx b/src/citra_qt/debugger/graphics_breakpoints.hxx new file mode 100644 index 000000000..edc41283e --- /dev/null +++ b/src/citra_qt/debugger/graphics_breakpoints.hxx | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | |||
| 9 | #include <QAbstractListModel> | ||
| 10 | #include <QDockWidget> | ||
| 11 | |||
| 12 | #include "video_core/debug_utils/debug_utils.h" | ||
| 13 | |||
| 14 | class QLabel; | ||
| 15 | class QPushButton; | ||
| 16 | class QTreeView; | ||
| 17 | |||
| 18 | class BreakPointModel : public QAbstractListModel { | ||
| 19 | Q_OBJECT | ||
| 20 | |||
| 21 | public: | ||
| 22 | enum { | ||
| 23 | Role_IsEnabled = Qt::UserRole, | ||
| 24 | }; | ||
| 25 | |||
| 26 | BreakPointModel(std::shared_ptr<Pica::DebugContext> context, QObject* parent); | ||
| 27 | |||
| 28 | int columnCount(const QModelIndex& parent = QModelIndex()) const override; | ||
| 29 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
| 30 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; | ||
| 31 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; | ||
| 32 | |||
| 33 | bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); | ||
| 34 | |||
| 35 | public slots: | ||
| 36 | void OnBreakPointHit(Pica::DebugContext::Event event); | ||
| 37 | void OnResumed(); | ||
| 38 | |||
| 39 | private: | ||
| 40 | bool at_breakpoint; | ||
| 41 | Pica::DebugContext::Event active_breakpoint; | ||
| 42 | std::weak_ptr<Pica::DebugContext> context_weak; | ||
| 43 | }; | ||
| 44 | |||
| 45 | class GraphicsBreakPointsWidget : public QDockWidget, Pica::DebugContext::BreakPointObserver { | ||
| 46 | Q_OBJECT | ||
| 47 | |||
| 48 | using Event = Pica::DebugContext::Event; | ||
| 49 | |||
| 50 | public: | ||
| 51 | GraphicsBreakPointsWidget(std::shared_ptr<Pica::DebugContext> debug_context, | ||
| 52 | QWidget* parent = nullptr); | ||
| 53 | |||
| 54 | void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; | ||
| 55 | void OnPicaResume() override; | ||
| 56 | |||
| 57 | public slots: | ||
| 58 | void OnBreakPointHit(Pica::DebugContext::Event event, void* data); | ||
| 59 | void OnResumeRequested(); | ||
| 60 | void OnResumed(); | ||
| 61 | void OnBreakpointSelectionChanged(const QModelIndex&); | ||
| 62 | void OnToggleBreakpointEnabled(); | ||
| 63 | |||
| 64 | signals: | ||
| 65 | void Resumed(); | ||
| 66 | void BreakPointHit(Pica::DebugContext::Event event, void* data); | ||
| 67 | void BreakPointsChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); | ||
| 68 | |||
| 69 | private: | ||
| 70 | void UpdateToggleBreakpointButton(const QModelIndex& index); | ||
| 71 | |||
| 72 | QLabel* status_text; | ||
| 73 | QPushButton* resume_button; | ||
| 74 | QPushButton* toggle_breakpoint_button; | ||
| 75 | |||
| 76 | BreakPointModel* breakpoint_model; | ||
| 77 | QTreeView* breakpoint_list; | ||
| 78 | }; | ||