diff options
Diffstat (limited to 'src/core/frontend')
-rw-r--r-- | src/core/frontend/applets/controller.cpp | 7 | ||||
-rw-r--r-- | src/core/frontend/applets/controller.h | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/error.cpp | 11 | ||||
-rw-r--r-- | src/core/frontend/applets/error.h | 17 | ||||
-rw-r--r-- | src/core/frontend/applets/general_frontend.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/general_frontend.h | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/mii_edit.cpp | 17 | ||||
-rw-r--r-- | src/core/frontend/applets/mii_edit.h | 22 | ||||
-rw-r--r-- | src/core/frontend/applets/profile_select.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/profile_select.h | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/software_keyboard.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/software_keyboard.h | 7 | ||||
-rw-r--r-- | src/core/frontend/applets/web_browser.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/applets/web_browser.h | 5 | ||||
-rw-r--r-- | src/core/frontend/emu_window.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/emu_window.h | 16 | ||||
-rw-r--r-- | src/core/frontend/framebuffer_layout.cpp | 5 | ||||
-rw-r--r-- | src/core/frontend/framebuffer_layout.h | 5 |
18 files changed, 93 insertions, 59 deletions
diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index e1033b634..6c230f619 100644 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp @@ -1,6 +1,5 @@ -// Copyright 2020 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" #include "common/logging/log.h" @@ -66,7 +65,7 @@ void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callb controller->SetNpadStyleIndex(Core::HID::NpadStyleIndex::Handheld); controller->Connect(true); } else { - UNREACHABLE_MSG("Unable to add a new controller based on the given parameters!"); + ASSERT_MSG(false, "Unable to add a new controller based on the given parameters!"); } } diff --git a/src/core/frontend/applets/controller.h b/src/core/frontend/applets/controller.h index 014bc8901..1d2850ad5 100644 --- a/src/core/frontend/applets/controller.h +++ b/src/core/frontend/applets/controller.h @@ -1,6 +1,5 @@ -// Copyright 2020 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/frontend/applets/error.cpp b/src/core/frontend/applets/error.cpp index dceb20ff8..f8b961098 100644 --- a/src/core/frontend/applets/error.cpp +++ b/src/core/frontend/applets/error.cpp @@ -1,6 +1,5 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" #include "core/frontend/applets/error.h" @@ -9,12 +8,12 @@ namespace Core::Frontend { ErrorApplet::~ErrorApplet() = default; -void DefaultErrorApplet::ShowError(ResultCode error, std::function<void()> finished) const { +void DefaultErrorApplet::ShowError(Result error, std::function<void()> finished) const { LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})", error.module.Value(), error.description.Value(), error.raw); } -void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, +void DefaultErrorApplet::ShowErrorWithTimestamp(Result error, std::chrono::seconds time, std::function<void()> finished) const { LOG_CRITICAL( Service_Fatal, @@ -22,7 +21,7 @@ void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::s error.module.Value(), error.description.Value(), error.raw, time.count()); } -void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_text, +void DefaultErrorApplet::ShowCustomErrorText(Result error, std::string main_text, std::string detail_text, std::function<void()> finished) const { LOG_CRITICAL(Service_Fatal, diff --git a/src/core/frontend/applets/error.h b/src/core/frontend/applets/error.h index 699df940d..f378f8805 100644 --- a/src/core/frontend/applets/error.h +++ b/src/core/frontend/applets/error.h @@ -1,6 +1,5 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -15,22 +14,22 @@ class ErrorApplet { public: virtual ~ErrorApplet(); - virtual void ShowError(ResultCode error, std::function<void()> finished) const = 0; + virtual void ShowError(Result error, std::function<void()> finished) const = 0; - virtual void ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, + virtual void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, std::function<void()> finished) const = 0; - virtual void ShowCustomErrorText(ResultCode error, std::string dialog_text, + virtual void ShowCustomErrorText(Result error, std::string dialog_text, std::string fullscreen_text, std::function<void()> finished) const = 0; }; class DefaultErrorApplet final : public ErrorApplet { public: - void ShowError(ResultCode error, std::function<void()> finished) const override; - void ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, + void ShowError(Result error, std::function<void()> finished) const override; + void ShowErrorWithTimestamp(Result error, std::chrono::seconds time, std::function<void()> finished) const override; - void ShowCustomErrorText(ResultCode error, std::string main_text, std::string detail_text, + void ShowCustomErrorText(Result error, std::string main_text, std::string detail_text, std::function<void()> finished) const override; }; diff --git a/src/core/frontend/applets/general_frontend.cpp b/src/core/frontend/applets/general_frontend.cpp index 7483ffb76..29a00fb6f 100644 --- a/src/core/frontend/applets/general_frontend.cpp +++ b/src/core/frontend/applets/general_frontend.cpp @@ -1,6 +1,5 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" #include "core/frontend/applets/general_frontend.h" diff --git a/src/core/frontend/applets/general_frontend.h b/src/core/frontend/applets/general_frontend.h index 1647aa975..cbec8b4ad 100644 --- a/src/core/frontend/applets/general_frontend.h +++ b/src/core/frontend/applets/general_frontend.h @@ -1,6 +1,5 @@ -// Copyright 2019 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/frontend/applets/mii_edit.cpp b/src/core/frontend/applets/mii_edit.cpp new file mode 100644 index 000000000..d37b5368a --- /dev/null +++ b/src/core/frontend/applets/mii_edit.cpp @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/logging/log.h" +#include "core/frontend/applets/mii_edit.h" + +namespace Core::Frontend { + +MiiEditApplet::~MiiEditApplet() = default; + +void DefaultMiiEditApplet::ShowMiiEdit(const std::function<void()>& callback) const { + LOG_WARNING(Service_AM, "(STUBBED) called"); + + callback(); +} + +} // namespace Core::Frontend diff --git a/src/core/frontend/applets/mii_edit.h b/src/core/frontend/applets/mii_edit.h new file mode 100644 index 000000000..58fa2039b --- /dev/null +++ b/src/core/frontend/applets/mii_edit.h @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <functional> + +namespace Core::Frontend { + +class MiiEditApplet { +public: + virtual ~MiiEditApplet(); + + virtual void ShowMiiEdit(const std::function<void()>& callback) const = 0; +}; + +class DefaultMiiEditApplet final : public MiiEditApplet { +public: + void ShowMiiEdit(const std::function<void()>& callback) const override; +}; + +} // namespace Core::Frontend diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp index 4c58c310f..d11fbce0a 100644 --- a/src/core/frontend/applets/profile_select.cpp +++ b/src/core/frontend/applets/profile_select.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/settings.h" #include "core/frontend/applets/profile_select.h" diff --git a/src/core/frontend/applets/profile_select.h b/src/core/frontend/applets/profile_select.h index 3506b9885..8d6ee5279 100644 --- a/src/core/frontend/applets/profile_select.h +++ b/src/core/frontend/applets/profile_select.h @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp index c4863ee73..020c7fa5e 100644 --- a/src/core/frontend/applets/software_keyboard.cpp +++ b/src/core/frontend/applets/software_keyboard.cpp @@ -1,6 +1,5 @@ -// Copyright 2021 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include <thread> diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 490c55cc2..094d1e713 100644 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h @@ -1,6 +1,5 @@ -// Copyright 2021 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -18,6 +17,8 @@ struct KeyboardInitializeParameters { std::u16string sub_text; std::u16string guide_text; std::u16string initial_text; + char16_t left_optional_symbol_key; + char16_t right_optional_symbol_key; u32 max_text_length; u32 min_text_length; s32 initial_cursor_position; diff --git a/src/core/frontend/applets/web_browser.cpp b/src/core/frontend/applets/web_browser.cpp index be4736f47..27c7086be 100644 --- a/src/core/frontend/applets/web_browser.cpp +++ b/src/core/frontend/applets/web_browser.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" #include "core/frontend/applets/web_browser.h" diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h index b6a60c994..1411274f8 100644 --- a/src/core/frontend/applets/web_browser.h +++ b/src/core/frontend/applets/web_browser.h @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 57c6ffc43..1be2dccb0 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -1,6 +1,5 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include <mutex> #include "core/frontend/emu_window.h" diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index e413a520a..ac1906d5e 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -1,6 +1,5 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -42,11 +41,20 @@ public: context.MakeCurrent(); } ~Scoped() { - context.DoneCurrent(); + if (active) { + context.DoneCurrent(); + } + } + + /// In the event that context was destroyed before the Scoped is destroyed, this provides a + /// mechanism to prevent calling a destroyed object's method during the deconstructor + void Cancel() { + active = false; } private: GraphicsContext& context; + bool active{true}; }; /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index 26a5b12aa..90dd68ff1 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #include <cmath> diff --git a/src/core/frontend/framebuffer_layout.h b/src/core/frontend/framebuffer_layout.h index 8e341e4e2..1561d994e 100644 --- a/src/core/frontend/framebuffer_layout.h +++ b/src/core/frontend/framebuffer_layout.h @@ -1,6 +1,5 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once |