openMSX
ImGuiReverseBar.hh
Go to the documentation of this file.
1#ifndef IMGUI_REVERSE_BAR_HH
2#define IMGUI_REVERSE_BAR_HH
3
4#include "ImGuiAdjust.hh"
5#include "ImGuiPart.hh"
6
7#include "GLUtil.hh"
8#include "TclObject.hh"
9
10#include <string>
11#include <filesystem>
12
13namespace openmsx {
14
15class ImGuiReverseBar final : public ImGuiPart
16{
17public:
19
20 [[nodiscard]] zstring_view iniName() const override { return "reverse bar"; }
21 void save(ImGuiTextBuffer& buf) override;
22 void loadLine(std::string_view name, zstring_view value) override;
23 void showMenu(MSXMotherBoard* motherBoard) override;
24 void paint(MSXMotherBoard* motherBoard) override;
25
26public:
27 bool showReverseBar = true;
28
29private:
30 std::string saveStateName;
31 std::string saveReplayName;
32 struct Info {
33 struct Entry {
34 Entry(std::string f, std::string d, std::time_t t) // workaround, needed for clang, not gcc or msvc
35 : fullName(std::move(f)), displayName(std::move(d)), ftime(t) {} // fixed in clang-16
36 std::string fullName;
37 std::string displayName;
38 std::time_t ftime;
39 };
40 std::vector<Entry> entries;
41 bool entriesChanged = false;
42 bool submenuOpen = false;
43 };
44 Info saveStateInfo;
45 Info replayInfo;
46
47 bool saveStateOpen = false;
48 bool saveReplayOpen = false;
49
50 TclObject confirmCmd;
51 std::string confirmText;
52
53 bool reverseHideTitle = true;
54 bool reverseFadeOut = true;
55 bool reverseAllowMove = false;
56 float reverseAlpha = 1.0f;
57
58 struct PreviewImage {
59 std::string name;
60 gl::Texture texture{gl::Null{}};
61 } previewImage;
62
63 AdjustWindowInMainViewPort adjust;
64
65 static constexpr auto persistentElements = std::tuple{
67 PersistentElement{"hideTitle", &ImGuiReverseBar::reverseHideTitle},
68 PersistentElement{"fadeOut", &ImGuiReverseBar::reverseFadeOut},
69 PersistentElement{"allowMove", &ImGuiReverseBar::reverseAllowMove}
70 // manually handle "adjust"
71 };
72};
73
74} // namespace openmsx
75
76#endif
TclObject t
Most basic/generic texture: only contains a texture ID.
Definition GLUtil.hh:40
ImGuiPart(ImGuiManager &manager_)
Definition ImGuiPart.hh:12
void loadLine(std::string_view name, zstring_view value) override
void save(ImGuiTextBuffer &buf) override
void paint(MSXMotherBoard *motherBoard) override
zstring_view iniName() const override
void showMenu(MSXMotherBoard *motherBoard) override
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11
PersistentElement(zstring_view, T C::*) -> PersistentElement< C, T >
STL namespace.
Entry(std::string f, std::string d, std::time_t t)