2026-03-10 05:37:45 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
2025-09-15 17:21:18 +02:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
#ifndef QT_COMMON_H
|
|
|
|
|
#define QT_COMMON_H
|
|
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
#include <memory>
|
2025-09-15 17:21:18 +02:00
|
|
|
#include <QWindow>
|
2026-05-20 04:49:16 +02:00
|
|
|
|
2025-09-15 17:21:18 +02:00
|
|
|
#include "core/core.h"
|
|
|
|
|
#include "core/file_sys/registered_cache.h"
|
2026-05-20 04:49:16 +02:00
|
|
|
#include "core/frontend/emu_window.h"
|
|
|
|
|
|
|
|
|
|
#include "qt_common/render/emu_thread.h"
|
|
|
|
|
|
|
|
|
|
#include "core/file_sys/vfs/vfs_real.h"
|
2025-09-15 17:21:18 +02:00
|
|
|
|
2026-05-20 04:49:16 +02:00
|
|
|
enum class StartGameType {
|
|
|
|
|
Normal, // Can use custom configuration
|
|
|
|
|
Global, // Only uses global configuration
|
|
|
|
|
};
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
namespace QtCommon {
|
|
|
|
|
|
2026-05-20 04:49:16 +02:00
|
|
|
// TODO: Remove QWidget dependency
|
2026-03-10 06:51:08 +01:00
|
|
|
extern QWidget* rootObject;
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
extern std::unique_ptr<Core::System> system;
|
|
|
|
|
extern std::shared_ptr<FileSys::RealVfsFilesystem> vfs;
|
|
|
|
|
extern std::unique_ptr<FileSys::ManualContentProvider> provider;
|
2026-05-20 04:49:16 +02:00
|
|
|
extern std::unique_ptr<EmuThread> emu_thread;
|
|
|
|
|
|
|
|
|
|
extern const QStringList supported_file_extensions;
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
typedef std::function<bool(std::size_t, std::size_t)> QtProgressCallback;
|
|
|
|
|
|
|
|
|
|
Core::Frontend::WindowSystemType GetWindowSystemType();
|
|
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window);
|
2025-09-15 17:21:18 +02:00
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
void Init(QWidget* root);
|
2025-09-15 17:21:18 +02:00
|
|
|
|
2026-05-20 04:49:16 +02:00
|
|
|
void SetupContentProviders();
|
|
|
|
|
void SetupHID();
|
|
|
|
|
|
2026-03-10 06:51:08 +01:00
|
|
|
const QString tr(const char* str);
|
|
|
|
|
const QString tr(const std::string& str);
|
2025-09-15 17:21:18 +02:00
|
|
|
|
|
|
|
|
std::filesystem::path GetEdenCommand();
|
|
|
|
|
} // namespace QtCommon
|
|
|
|
|
#endif
|