mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-30 23:33:17 +00:00
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:
parent
035cb3eeaa
commit
446d8c4ff1
9 changed files with 716 additions and 153 deletions
35
src/common/fixed_value.h
Normal file
35
src/common/fixed_value.h
Normal 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;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue