chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.
Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.
The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.
Following REUSE has a few advantages over the current approach:
- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
`.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
files like binary assets / images is always accurate and up to date
To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.
[REUSE]: https://reuse.software
Follow-up to 01cf05bc75b1e47beb08937439f3ed9339e7b254
2022-05-15 00:06:02 +00:00
|
|
|
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-04-08 16:28:54 +00:00
|
|
|
|
2016-12-11 11:53:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-31 16:21:34 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
#include <QDockWidget>
|
|
|
|
#include <QTreeView>
|
2021-04-24 04:50:04 +00:00
|
|
|
|
2018-08-31 16:21:34 +00:00
|
|
|
#include "common/common_types.h"
|
2021-04-24 04:50:04 +00:00
|
|
|
#include "core/hle/kernel/k_auto_object.h"
|
2021-04-24 09:40:31 +00:00
|
|
|
#include "core/hle/kernel/svc_common.h"
|
2016-04-08 16:28:54 +00:00
|
|
|
|
|
|
|
class EmuThread;
|
|
|
|
|
2021-09-03 01:40:55 +00:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
namespace Kernel {
|
2021-04-24 09:40:31 +00:00
|
|
|
class KHandleTable;
|
2021-01-30 06:48:06 +00:00
|
|
|
class KReadableEvent;
|
2020-12-22 06:36:53 +00:00
|
|
|
class KSynchronizationObject;
|
2020-12-31 07:01:08 +00:00
|
|
|
class KThread;
|
2018-01-20 07:48:02 +00:00
|
|
|
} // namespace Kernel
|
2016-04-08 16:28:54 +00:00
|
|
|
|
|
|
|
class WaitTreeThread;
|
|
|
|
|
|
|
|
class WaitTreeItem : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-08-31 16:21:34 +00:00
|
|
|
WaitTreeItem();
|
2018-08-06 17:12:32 +00:00
|
|
|
~WaitTreeItem() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
virtual bool IsExpandable() const;
|
|
|
|
virtual std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const;
|
|
|
|
virtual QString GetText() const = 0;
|
|
|
|
virtual QColor GetColor() const;
|
2018-08-06 17:12:32 +00:00
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
void Expand();
|
|
|
|
WaitTreeItem* Parent() const;
|
|
|
|
const std::vector<std::unique_ptr<WaitTreeItem>>& Children() const;
|
|
|
|
std::size_t Row() const;
|
2021-09-03 01:40:55 +00:00
|
|
|
static std::vector<std::unique_ptr<WaitTreeThread>> MakeThreadItemList(Core::System& system);
|
2016-04-08 16:28:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::size_t row;
|
|
|
|
bool expanded = false;
|
|
|
|
WaitTreeItem* parent = nullptr;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> children;
|
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeText : public WaitTreeItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-12-05 20:59:48 +00:00
|
|
|
explicit WaitTreeText(QString text);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeText() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString text;
|
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeExpandableItem : public WaitTreeItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-08-31 16:21:34 +00:00
|
|
|
WaitTreeExpandableItem();
|
|
|
|
~WaitTreeExpandableItem() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
bool IsExpandable() const override;
|
|
|
|
};
|
|
|
|
|
2018-04-20 20:52:06 +00:00
|
|
|
class WaitTreeMutexInfo : public WaitTreeExpandableItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-06-14 09:44:08 +00:00
|
|
|
explicit WaitTreeMutexInfo(VAddr mutex_address_, const Kernel::KHandleTable& handle_table,
|
2021-09-03 01:40:55 +00:00
|
|
|
Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeMutexInfo() override;
|
|
|
|
|
2018-04-20 20:52:06 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
|
|
|
|
|
|
|
private:
|
2021-04-21 05:18:56 +00:00
|
|
|
VAddr mutex_address{};
|
|
|
|
u32 mutex_value{};
|
|
|
|
Kernel::Handle owner_handle{};
|
|
|
|
Kernel::KThread* owner{};
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2018-04-20 20:52:06 +00:00
|
|
|
};
|
|
|
|
|
2018-05-19 21:52:49 +00:00
|
|
|
class WaitTreeCallstack : public WaitTreeExpandableItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-06-14 09:44:08 +00:00
|
|
|
explicit WaitTreeCallstack(const Kernel::KThread& thread_, Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeCallstack() override;
|
|
|
|
|
2018-05-19 21:52:49 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
|
|
|
|
|
|
|
private:
|
2020-12-31 07:01:08 +00:00
|
|
|
const Kernel::KThread& thread;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2018-05-19 21:52:49 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 14:46:25 +00:00
|
|
|
class WaitTreeSynchronizationObject : public WaitTreeExpandableItem {
|
2016-04-08 16:28:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-06-14 09:44:08 +00:00
|
|
|
explicit WaitTreeSynchronizationObject(const Kernel::KSynchronizationObject& object_,
|
2021-09-03 01:40:55 +00:00
|
|
|
Core::System& system_);
|
2020-02-11 14:46:25 +00:00
|
|
|
~WaitTreeSynchronizationObject() override;
|
2018-08-31 16:21:34 +00:00
|
|
|
|
2020-02-11 14:46:25 +00:00
|
|
|
static std::unique_ptr<WaitTreeSynchronizationObject> make(
|
2021-09-03 01:40:55 +00:00
|
|
|
const Kernel::KSynchronizationObject& object, Core::System& system);
|
2016-04-08 16:28:54 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
|
|
|
|
|
|
|
protected:
|
2020-12-22 06:36:53 +00:00
|
|
|
const Kernel::KSynchronizationObject& object;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeObjectList : public WaitTreeExpandableItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-09-03 01:40:55 +00:00
|
|
|
WaitTreeObjectList(const std::vector<Kernel::KSynchronizationObject*>& list, bool wait_all,
|
|
|
|
Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeObjectList() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
|
|
|
|
|
|
|
private:
|
2020-12-22 06:36:53 +00:00
|
|
|
const std::vector<Kernel::KSynchronizationObject*>& object_list;
|
2016-04-08 16:28:54 +00:00
|
|
|
bool wait_all;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 14:46:25 +00:00
|
|
|
class WaitTreeThread : public WaitTreeSynchronizationObject {
|
2016-04-08 16:28:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-09-03 01:40:55 +00:00
|
|
|
explicit WaitTreeThread(const Kernel::KThread& thread, Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeThread() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
QColor GetColor() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
2020-02-11 14:46:25 +00:00
|
|
|
class WaitTreeEvent : public WaitTreeSynchronizationObject {
|
2016-04-08 16:28:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-06-14 09:44:08 +00:00
|
|
|
explicit WaitTreeEvent(const Kernel::KReadableEvent& object_, Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeEvent() override;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeThreadList : public WaitTreeExpandableItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-09-03 01:40:55 +00:00
|
|
|
explicit WaitTreeThreadList(std::vector<Kernel::KThread*>&& list, Core::System& system_);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeThreadList() override;
|
|
|
|
|
2016-04-08 16:28:54 +00:00
|
|
|
QString GetText() const override;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
|
|
|
|
|
|
|
|
private:
|
2021-04-24 04:50:04 +00:00
|
|
|
std::vector<Kernel::KThread*> thread_list;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeModel : public QAbstractItemModel {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-09-03 01:40:55 +00:00
|
|
|
explicit WaitTreeModel(Core::System& system_, QObject* parent = nullptr);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeModel() override;
|
2016-04-08 16:28:54 +00:00
|
|
|
|
|
|
|
QVariant data(const QModelIndex& index, int role) const override;
|
|
|
|
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
|
|
|
|
QModelIndex parent(const QModelIndex& index) const override;
|
|
|
|
int rowCount(const QModelIndex& parent) const override;
|
|
|
|
int columnCount(const QModelIndex& parent) const override;
|
|
|
|
|
|
|
|
void ClearItems();
|
|
|
|
void InitItems();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<std::unique_ptr<WaitTreeThread>> thread_items;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class WaitTreeWidget : public QDockWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-09-03 01:40:55 +00:00
|
|
|
explicit WaitTreeWidget(Core::System& system_, QWidget* parent = nullptr);
|
2018-08-31 16:21:34 +00:00
|
|
|
~WaitTreeWidget() override;
|
2016-04-08 16:28:54 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void OnDebugModeEntered();
|
|
|
|
void OnDebugModeLeft();
|
|
|
|
|
|
|
|
void OnEmulationStarting(EmuThread* emu_thread);
|
|
|
|
void OnEmulationStopping();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTreeView* view;
|
|
|
|
WaitTreeModel* model;
|
2021-09-03 01:40:55 +00:00
|
|
|
|
|
|
|
Core::System& system;
|
2016-04-08 16:28:54 +00:00
|
|
|
};
|