OXYGENHUB
◆ main openmsx / src / imgui / ImGuiReverseBar.hh
1.5 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef IMGUI_REVERSE_BAR_HH
2
#define IMGUI_REVERSE_BAR_HH
3
4
#include "FileListWidget.hh"
5
#include "ImGuiAdjust.hh"
6
#include "ImGuiPart.hh"
7
#include "ImGuiUtils.hh"
8
9
#include "GLUtil.hh"
10
11
#include <string>
12
13
namespace openmsx {
14
15
class ImGuiReverseBar final : public ImGuiPart
16
{
17
public:
18
	explicit ImGuiReverseBar(ImGuiManager& manager);
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
26
public:
27
	bool showReverseBar = true;
28
29
private:
30
	std::string saveStateName;
31
	std::string saveReplayName;
32
	FileListWidget saveStateFileList;
33
	FileListWidget replayFileList;
34
35
	bool saveStateOpen = false;
36
	bool saveReplayOpen = false;
37
38
	ConfirmDialogTclCommand confirmDialog;
39
40
	bool reverseHideTitle = true;
41
	bool reverseFadeOut = true;
42
	bool reverseAllowMove = false;
43
	float reverseAlpha = 1.0f;
44
45
	struct PreviewImage {
46
		std::string name;
47
		gl::Texture texture{gl::Null{}};
48
	} previewImage;
49
50
	AdjustWindowInMainViewPort adjust;
51
52
	static constexpr auto persistentElements = std::tuple{
53
		PersistentElement{"show",      &ImGuiReverseBar::showReverseBar},
54
		PersistentElement{"hideTitle", &ImGuiReverseBar::reverseHideTitle},
55
		PersistentElement{"fadeOut",   &ImGuiReverseBar::reverseFadeOut},
56
		PersistentElement{"allowMove", &ImGuiReverseBar::reverseAllowMove}
57
		// manually handle "adjust"
58
	};
59
};
60
61
} // namespace openmsx
62
63
#endif