mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-07-06 13:17:54 -05:00
yuzu qt: Remove global system instances from config, WaitTree, main
This commit is contained in:
@ -18,6 +18,10 @@
|
||||
|
||||
class EmuThread;
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class KHandleTable;
|
||||
class KReadableEvent;
|
||||
@ -42,7 +46,7 @@ public:
|
||||
WaitTreeItem* Parent() const;
|
||||
const std::vector<std::unique_ptr<WaitTreeItem>>& Children() const;
|
||||
std::size_t Row() const;
|
||||
static std::vector<std::unique_ptr<WaitTreeThread>> MakeThreadItemList();
|
||||
static std::vector<std::unique_ptr<WaitTreeThread>> MakeThreadItemList(Core::System& system);
|
||||
|
||||
private:
|
||||
std::size_t row;
|
||||
@ -75,7 +79,8 @@ public:
|
||||
class WaitTreeMutexInfo : public WaitTreeExpandableItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::KHandleTable& handle_table);
|
||||
explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::KHandleTable& handle_table,
|
||||
Core::System& system_);
|
||||
~WaitTreeMutexInfo() override;
|
||||
|
||||
QString GetText() const override;
|
||||
@ -86,12 +91,14 @@ private:
|
||||
u32 mutex_value{};
|
||||
Kernel::Handle owner_handle{};
|
||||
Kernel::KThread* owner{};
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeCallstack : public WaitTreeExpandableItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeCallstack(const Kernel::KThread& thread);
|
||||
explicit WaitTreeCallstack(const Kernel::KThread& thread, Core::System& system_);
|
||||
~WaitTreeCallstack() override;
|
||||
|
||||
QString GetText() const override;
|
||||
@ -99,27 +106,34 @@ public:
|
||||
|
||||
private:
|
||||
const Kernel::KThread& thread;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeSynchronizationObject : public WaitTreeExpandableItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeSynchronizationObject(const Kernel::KSynchronizationObject& object);
|
||||
explicit WaitTreeSynchronizationObject(const Kernel::KSynchronizationObject& object,
|
||||
Core::System& system_);
|
||||
~WaitTreeSynchronizationObject() override;
|
||||
|
||||
static std::unique_ptr<WaitTreeSynchronizationObject> make(
|
||||
const Kernel::KSynchronizationObject& object);
|
||||
const Kernel::KSynchronizationObject& object, Core::System& system);
|
||||
QString GetText() const override;
|
||||
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
||||
|
||||
protected:
|
||||
const Kernel::KSynchronizationObject& object;
|
||||
|
||||
private:
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeObjectList : public WaitTreeExpandableItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
WaitTreeObjectList(const std::vector<Kernel::KSynchronizationObject*>& list, bool wait_all);
|
||||
WaitTreeObjectList(const std::vector<Kernel::KSynchronizationObject*>& list, bool wait_all,
|
||||
Core::System& system_);
|
||||
~WaitTreeObjectList() override;
|
||||
|
||||
QString GetText() const override;
|
||||
@ -128,30 +142,35 @@ public:
|
||||
private:
|
||||
const std::vector<Kernel::KSynchronizationObject*>& object_list;
|
||||
bool wait_all;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeThread : public WaitTreeSynchronizationObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeThread(const Kernel::KThread& thread);
|
||||
explicit WaitTreeThread(const Kernel::KThread& thread, Core::System& system_);
|
||||
~WaitTreeThread() override;
|
||||
|
||||
QString GetText() const override;
|
||||
QColor GetColor() const override;
|
||||
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
||||
|
||||
private:
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeEvent : public WaitTreeSynchronizationObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeEvent(const Kernel::KReadableEvent& object);
|
||||
explicit WaitTreeEvent(const Kernel::KReadableEvent& object, Core::System& system_);
|
||||
~WaitTreeEvent() override;
|
||||
};
|
||||
|
||||
class WaitTreeThreadList : public WaitTreeExpandableItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaitTreeThreadList(std::vector<Kernel::KThread*>&& list);
|
||||
explicit WaitTreeThreadList(std::vector<Kernel::KThread*>&& list, Core::System& system_);
|
||||
~WaitTreeThreadList() override;
|
||||
|
||||
QString GetText() const override;
|
||||
@ -159,13 +178,15 @@ public:
|
||||
|
||||
private:
|
||||
std::vector<Kernel::KThread*> thread_list;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeModel : public QAbstractItemModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WaitTreeModel(QObject* parent = nullptr);
|
||||
explicit WaitTreeModel(Core::System& system_, QObject* parent = nullptr);
|
||||
~WaitTreeModel() override;
|
||||
|
||||
QVariant data(const QModelIndex& index, int role) const override;
|
||||
@ -179,13 +200,15 @@ public:
|
||||
|
||||
private:
|
||||
std::vector<std::unique_ptr<WaitTreeThread>> thread_items;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
class WaitTreeWidget : public QDockWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WaitTreeWidget(QWidget* parent = nullptr);
|
||||
explicit WaitTreeWidget(Core::System& system_, QWidget* parent = nullptr);
|
||||
~WaitTreeWidget() override;
|
||||
|
||||
public slots:
|
||||
@ -198,4 +221,6 @@ public slots:
|
||||
private:
|
||||
QTreeView* view;
|
||||
WaitTreeModel* model;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
Reference in New Issue
Block a user