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
15 enum class Preset {
16 DEFAULT,
17 MINIMAL
18 };
19
21 ~LayoutManager() = default;
22
24 void init();
25
27 void apply_preset(Preset preset, ApplicationRuntime runtime);
28
30 void apply_pending_layout(ApplicationRuntime runtime);
31
33 void save_layout(const std::string& name);
34
36 bool load_layout(const std::string& name, ApplicationRuntime runtime);
37
39 void delete_layout(const std::string& name, ApplicationRuntime runtime);
40
42 std::vector<std::string> get_user_layout_names() const;
43
45 bool has_layout(const std::string& name) const;
46
48 const std::string& get_current_layout() const { return m_current_layout; }
49
50
51 void ensure_layouts_directory_exists();
52 std::string get_layout_path(const std::string& name) const;
53 void save_current_layout_name();
54 void refresh_layout_list();
55
56 std::map<std::string, std::string> m_user_layouts;
57 std::string m_current_layout = "Default";
58 std::string m_pending_layout;
59 bool m_is_initialized = false;
60 bool m_has_applied_initial_layout = false;
61};
62
63} // namespace sd
Definition Application.hpp:22
Definition ApplicationRuntime.hpp:12
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:56
~LayoutManager()=default
Preset
Definition LayoutManager.hpp:15
std::string m_pending_layout
Definition LayoutManager.hpp:58
const std::string & get_current_layout() const
Get the currently active layout/preset name.
Definition LayoutManager.hpp:48
consteval U64 type_id_of()
Definition type_id.hpp:6