graphics_breakpoint_observer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 <QDockWidget>
  6. #include "video_core/debug_utils/debug_utils.h"
  7. /**
  8. * Utility class which forwards calls to OnPicaBreakPointHit and OnPicaResume to public slots.
  9. * This is because the Pica breakpoint callbacks are called from a non-GUI thread, while
  10. * the widget usually wants to perform reactions in the GUI thread.
  11. */
  12. class BreakPointObserverDock : public QDockWidget,
  13. protected Pica::DebugContext::BreakPointObserver {
  14. Q_OBJECT
  15. public:
  16. BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context, const QString& title,
  17. QWidget* parent = nullptr);
  18. void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override;
  19. void OnPicaResume() override;
  20. private slots:
  21. virtual void OnBreakPointHit(Pica::DebugContext::Event event, void* data) = 0;
  22. virtual void OnResumed() = 0;
  23. signals:
  24. void Resumed();
  25. void BreakPointHit(Pica::DebugContext::Event event, void* data);
  26. };