graphics_breakpoints_p.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <QAbstractListModel>
  7. #include "video_core/debug_utils/debug_utils.h"
  8. class BreakPointModel : public QAbstractListModel {
  9. Q_OBJECT
  10. public:
  11. enum {
  12. Role_IsEnabled = Qt::UserRole,
  13. };
  14. BreakPointModel(std::shared_ptr<Pica::DebugContext> context, QObject* parent);
  15. int columnCount(const QModelIndex& parent = QModelIndex()) const override;
  16. int rowCount(const QModelIndex& parent = QModelIndex()) const override;
  17. QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
  18. QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
  19. bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
  20. public slots:
  21. void OnBreakPointHit(Pica::DebugContext::Event event);
  22. void OnResumed();
  23. private:
  24. std::weak_ptr<Pica::DebugContext> context_weak;
  25. bool at_breakpoint;
  26. Pica::DebugContext::Event active_breakpoint;
  27. };