SDEngine
Game Engine
Loading...
Searching...
No Matches
LayoutManager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <string>
5#include <vector>
6
7#include "SD/export.hpp"
8
9namespace sd {
10
11struct ApplicationRuntime;
12
15public:
16 enum class Preset {
17 DEFAULT,
18 MINIMAL
19 };
20
22 ~LayoutManager() = default;
23
25 void init();
26
28 void apply_preset(Preset preset, ApplicationRuntime runtime);
29
31 void apply_pending_layout(ApplicationRuntime runtime);
32
34 void save_layout(const std::string& name);
35
37 bool load_layout(const std::string& name, ApplicationRuntime runtime);
38
40 void delete_layout(const std::string& name, ApplicationRuntime runtime);
41
43 std::vector<std::string> get_user_layout_names() const;
44
46 bool has_layout(const std::string& name) const;
47
49 const std::string& get_current_layout() const { return m_current_layout; }
50
51private:
52 void ensure_layouts_directory_exists();
53 std::string get_layout_path(const std::string& name) const;
54 void save_current_layout_name();
55 void refresh_layout_list();
56
57 std::map<std::string, std::string> m_user_layouts;
58 std::string m_current_layout = "Default";
59 std::string m_pending_layout;
60 bool m_is_initialized = false;
61 bool m_has_applied_initial_layout = false;
62};
63
64} // namespace sd
Manages window layouts using ImGui DockBuilder for presets and INI for user layouts.
Definition LayoutManager.hpp:14
std::map< std::string, std::string > m_user_layouts
Definition LayoutManager.hpp:57
~LayoutManager()=default
Preset
Definition LayoutManager.hpp:16
std::string m_pending_layout
Definition LayoutManager.hpp:59
const std::string & get_current_layout() const
Get the currently active layout/preset name.
Definition LayoutManager.hpp:49
Definition Application.hpp:28
Definition ApplicationRuntime.hpp:12
constexpr T g_type_max
Definition types.hpp:21