Message Dialog library (#767)

* system/MsgDialog: types & basic text display

* system/MsgDialog: User message dialog

* system/MsgDialog: RAII for MsgDialog ui

* system/MsgDialog: Progress bar dialog

* system/MsgDialog: System message texts

* system/MsgDialog: copy all ui state to local memory

handles when game release memory before close
extracted all UI code to it's own file
use single window instead of creating new one every single dialogOpen

* system/MsgDialog: debug logging
This commit is contained in:
Vinicius Rangel 2024-09-08 17:27:50 -03:00 committed by GitHub
parent 035cb3eeaa
commit 446d8c4ff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 716 additions and 153 deletions

35
src/common/fixed_value.h Normal file
View file

@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
/**
* @brief A template class that encapsulates a fixed, compile-time constant value.
*
* @tparam T The type of the value.
* @tparam Value The fixed value of type T.
*
* This class provides a way to encapsulate a value that is constant and known at compile-time.
* The value is stored as a private member and cannot be changed. Any attempt to assign a new
* value to an object of this class will reset it to the fixed value.
*/
template <typename T, T Value>
class FixedValue {
T m_value{Value};
public:
constexpr FixedValue() = default;
constexpr explicit(false) operator T() const {
return m_value;
}
FixedValue& operator=(const T&) {
m_value = Value;
return *this;
}
FixedValue& operator=(T&&) noexcept {
m_value = {Value};
return *this;
}
};