From 9427e27e24a7135880ee2881c3c44988e174b41a Mon Sep 17 00:00:00 2001 From: Zephyron Date: Tue, 31 Dec 2024 16:19:25 +1000 Subject: chore: update project branding to citron --- src/yuzu/qt_common.cpp | 60 -------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/yuzu/qt_common.cpp (limited to 'src/yuzu/qt_common.cpp') diff --git a/src/yuzu/qt_common.cpp b/src/yuzu/qt_common.cpp deleted file mode 100644 index 413402165..000000000 --- a/src/yuzu/qt_common.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-FileCopyrightText: 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include -#include "common/logging/log.h" -#include "core/frontend/emu_window.h" -#include "yuzu/qt_common.h" - -#if !defined(WIN32) && !defined(__APPLE__) -#include -#elif defined(__APPLE__) -#include -#endif - -namespace QtCommon { -Core::Frontend::WindowSystemType GetWindowSystemType() { - // Determine WSI type based on Qt platform. - QString platform_name = QGuiApplication::platformName(); - if (platform_name == QStringLiteral("windows")) - return Core::Frontend::WindowSystemType::Windows; - else if (platform_name == QStringLiteral("xcb")) - return Core::Frontend::WindowSystemType::X11; - else if (platform_name == QStringLiteral("wayland")) - return Core::Frontend::WindowSystemType::Wayland; - else if (platform_name == QStringLiteral("wayland-egl")) - return Core::Frontend::WindowSystemType::Wayland; - else if (platform_name == QStringLiteral("cocoa")) - return Core::Frontend::WindowSystemType::Cocoa; - else if (platform_name == QStringLiteral("android")) - return Core::Frontend::WindowSystemType::Android; - - LOG_CRITICAL(Frontend, "Unknown Qt platform {}!", platform_name.toStdString()); - return Core::Frontend::WindowSystemType::Windows; -} // namespace Core::Frontend::WindowSystemType - -Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window) { - Core::Frontend::EmuWindow::WindowSystemInfo wsi; - wsi.type = GetWindowSystemType(); - -#if defined(WIN32) - // Our Win32 Qt external doesn't have the private API. - wsi.render_surface = reinterpret_cast(window->winId()); -#elif defined(__APPLE__) - wsi.render_surface = reinterpret_cast(objc_msgSend)( - reinterpret_cast(window->winId()), sel_registerName("layer")); -#else - QPlatformNativeInterface* pni = QGuiApplication::platformNativeInterface(); - wsi.display_connection = pni->nativeResourceForWindow("display", window); - if (wsi.type == Core::Frontend::WindowSystemType::Wayland) - wsi.render_surface = window ? pni->nativeResourceForWindow("surface", window) : nullptr; - else - wsi.render_surface = window ? reinterpret_cast(window->winId()) : nullptr; -#endif - wsi.render_surface_scale = window ? static_cast(window->devicePixelRatio()) : 1.0f; - - return wsi; -} -} // namespace QtCommon -- cgit v1.2.3