8
8
9
9
#include " AWidget.hpp"
10
10
11
- namespace usa {
12
-
13
11
namespace Engine {
14
12
15
13
/* *
16
14
* @class UiWindow
17
- *
15
+ *
18
16
* @brief Window base class
19
- *
17
+ *
20
18
*/
21
19
class UiWindow
22
20
{
@@ -33,115 +31,115 @@ namespace Engine {
33
31
public:
34
32
/* *
35
33
* @brief Construct a new Ui Window object
36
- *
34
+ *
37
35
*/
38
36
UiWindow () = default ;
39
37
40
38
/* *
41
39
* @brief Construct a new Ui Window object
42
- *
40
+ *
43
41
* @param name The name of the window, the name may be rendered
44
42
* @param flags The flags parameters of the window
45
43
*/
46
44
UiWindow (const std::string_view &name, ImGuiWindowFlags flags = 0 ) : m_window_flags(flags), m_name(name) {}
47
45
48
46
/* *
49
47
* @brief Destroy the Ui Window object
50
- *
48
+ *
51
49
*/
52
50
virtual ~UiWindow () = default ;
53
51
54
52
/* *
55
53
* @brief Open the window
56
- *
54
+ *
57
55
*/
58
56
auto open () -> void { m_isOpen = true ; }
59
57
60
58
/* *
61
59
* @brief Close the window
62
- *
60
+ *
63
61
*/
64
62
auto close () -> void { m_isOpen = false ; }
65
63
66
64
/* *
67
65
* @brief Render the window and everything it contains
68
- *
66
+ *
69
67
*/
70
68
virtual auto render () -> void;
71
69
72
70
/* *
73
71
* @brief Set the Window Flags
74
- *
72
+ *
75
73
* @param flags The value of the flags, different value will trigger different options
76
74
*/
77
75
auto setWindowFlags (ImGuiWindowFlags flags) noexcept -> void { m_window_flags = flags; }
78
76
79
77
/* *
80
78
* @brief Set the position of the object
81
- *
79
+ *
82
80
* @param pos The new postion of the object
83
81
*/
84
82
auto setPosition (const ImVec2 &pos) noexcept -> void { m_position = pos; }
85
83
86
84
/* *
87
85
* @brief Set the size of the object
88
- *
86
+ *
89
87
* @param size The new size of the object
90
88
*/
91
89
auto setSize (const ImVec2 &size) noexcept -> void { m_size = size; }
92
90
93
91
/* *
94
92
* @brief Set the name of the object
95
- *
93
+ *
96
94
* @param name The new name of the object
97
95
*/
98
96
auto setName (const std::string_view &name) noexcept -> void { m_name = name; }
99
97
100
98
/* *
101
99
* @brief Get the Flags object
102
- *
103
- * @return ImGuiWindowFlags&
100
+ *
101
+ * @return ImGuiWindowFlags&
104
102
*/
105
103
auto getFlags () -> ImGuiWindowFlags &{ return m_window_flags; }
106
104
107
105
/* *
108
106
* @brief Get the position of the object
109
- *
110
- * @return const ImVec2&
107
+ *
108
+ * @return const ImVec2&
111
109
*/
112
110
auto getPosition () -> const ImVec2 & { return m_position; }
113
111
/* *
114
112
* @brief Get the size of the object
115
- *
116
- * @return const ImVec2&
113
+ *
114
+ * @return const ImVec2&
117
115
*/
118
116
auto getSize () -> const ImVec2 & { return m_size; }
119
117
/* *
120
118
* @brief Get the name of the object
121
- *
122
- * @return const std::string_view&
119
+ *
120
+ * @return const std::string_view&
123
121
*/
124
122
auto getName () -> const std::string_view & { return m_name; }
125
123
126
124
/* *
127
125
* @brief Add a new widget to the window
128
- *
129
- * @param widget The new widget to add
126
+ *
127
+ * @param widget The new widget to add
130
128
*/
131
129
auto addWidget (std::shared_ptr<AWidget> widget) -> void { m_WidgetList.emplace_back (widget); }
132
-
130
+
133
131
/* *
134
132
* @brief Delete a widget stored in the window
135
- *
133
+ *
136
134
* @param name The name of the widget to delete
137
135
* @return true Return true if a widget was delete
138
136
* @return false Return false if no widget was found
139
137
*/
140
138
auto deleteWidget (const std::string_view &name) -> bool;
141
-
139
+
142
140
/* *
143
141
* @brief Get the Widget object
144
- *
142
+ *
145
143
* @param name The name of the widget to get
146
144
* @return std::shared_ptr<AWidget> Return a widget smart pointer if found
147
145
* @return nullptr Return nullptr if the widget was not found
@@ -150,29 +148,27 @@ namespace Engine {
150
148
151
149
/* *
152
150
* @brief Add a new sub Window in the current window
153
- *
154
- * @param win The new window to add
151
+ *
152
+ * @param win The new window to add
155
153
*/
156
154
auto addWindow (std::shared_ptr<UiWindow> win) -> void { m_WindowList.emplace_back (win); }
157
-
155
+
158
156
/* *
159
157
* @brief Delete a sub-window stored in the window
160
- *
158
+ *
161
159
* @param name the name of the sub-window to delete
162
160
* @return true return true if a window was deleted
163
161
* @return false return false otherwise
164
162
*/
165
163
auto deleteWindow (const std::string_view &name) -> bool;
166
-
164
+
167
165
/* *
168
166
* @brief Get the Window object
169
- *
167
+ *
170
168
* @param name The name of the window object to get
171
169
* @return std::shared_ptr<UiWindow> return a UiWindow smart pointer
172
170
* @return nullptr return nullptr otherwise
173
171
*/
174
172
auto getWindow (const std::string_view &name) -> std::shared_ptr<UiWindow>;
175
173
};
176
174
}
177
-
178
- }
0 commit comments