139 std::vector<std::string> flag_tokens;
141 std::istringstream tokenStream(flags);
142 while (std::getline(tokenStream, token,
'|')) {
143 flag_tokens.push_back(token);
148 static std::map<std::string, ImGuiWindowFlags> flagMap = {
149 {
"None", ImGuiWindowFlags_None},
150 {
"NoTitleBar", ImGuiWindowFlags_NoTitleBar},
151 {
"NoResize", ImGuiWindowFlags_NoResize},
152 {
"NoMove", ImGuiWindowFlags_NoMove},
153 {
"NoScrollbar", ImGuiWindowFlags_NoScrollbar},
154 {
"NoScrollWithMouse", ImGuiWindowFlags_NoScrollWithMouse},
155 {
"NoCollapse", ImGuiWindowFlags_NoCollapse},
156 {
"AlwaysAutoResize", ImGuiWindowFlags_AlwaysAutoResize},
157 {
"NoSavedSettings", ImGuiWindowFlags_NoSavedSettings},
158 {
"NoInputs", ImGuiWindowFlags_NoInputs},
159 {
"MenuBar", ImGuiWindowFlags_MenuBar},
160 {
"HorizontalScrollbar", ImGuiWindowFlags_HorizontalScrollbar},
161 {
"NoFocusOnAppearing", ImGuiWindowFlags_NoFocusOnAppearing},
162 {
"NoBringToFrontOnFocus", ImGuiWindowFlags_NoBringToFrontOnFocus},
163 {
"AlwaysVerticalScrollbar", ImGuiWindowFlags_AlwaysVerticalScrollbar},
164 {
"AlwaysHorizontalScrollbar",
165 ImGuiWindowFlags_AlwaysHorizontalScrollbar},
166 {
"AlwaysUseWindowPadding", ImGuiWindowFlags_AlwaysUseWindowPadding},
167 {
"NoNavInputs", ImGuiWindowFlags_NoNavInputs},
168 {
"NoNavFocus", ImGuiWindowFlags_NoNavFocus},
169 {
"UnsavedDocument", ImGuiWindowFlags_UnsavedDocument},
170 {
"NoNav", ImGuiWindowFlags_NoNav},
171 {
"NoDecoration", ImGuiWindowFlags_NoDecoration},
172 {
"NoInputs", ImGuiWindowFlags_NoInputs},
173 {
"NoFocusOnAppearing", ImGuiWindowFlags_NoFocusOnAppearing},
174 {
"NoBringToFrontOnFocus", ImGuiWindowFlags_NoBringToFrontOnFocus},
175 {
"AlwaysAutoResize", ImGuiWindowFlags_AlwaysAutoResize},
176 {
"NoSavedSettings", ImGuiWindowFlags_NoSavedSettings},
177 {
"NoMouseInputs", ImGuiWindowFlags_NoMouseInputs},
178 {
"NoMouseInputs", ImGuiWindowFlags_NoMouseInputs},
179 {
"NoTitleBar", ImGuiWindowFlags_NoTitleBar},
180 {
"NoResize", ImGuiWindowFlags_NoResize},
181 {
"NoMove", ImGuiWindowFlags_NoMove},
182 {
"NoScrollbar", ImGuiWindowFlags_NoScrollbar},
183 {
"NoScrollWithMouse", ImGuiWindowFlags_NoScrollWithMouse},
184 {
"NoCollapse", ImGuiWindowFlags_NoCollapse},
185 {
"AlwaysVerticalScrollbar", ImGuiWindowFlags_AlwaysVerticalScrollbar},
186 {
"AlwaysHorizontalScrollbar",
187 ImGuiWindowFlags_AlwaysHorizontalScrollbar}};
188 ImGuiWindowFlags windowFlags = ImGuiWindowFlags_None;
189 for (
const auto& flag : flag_tokens) {
190 if (flagMap.find(flag) != flagMap.end()) {
191 windowFlags |= flagMap[flag];
194 attributes.
flags = std::make_unique<ImGuiWindowFlags>(windowFlags);
199 static std::map<std::string, ImGuiTreeNodeFlags> flagMap = {
200 {
"None", ImGuiTreeNodeFlags_None},
201 {
"Selected", ImGuiTreeNodeFlags_Selected},
202 {
"Framed", ImGuiTreeNodeFlags_Framed},
203 {
"AllowItemOverlap", ImGuiTreeNodeFlags_AllowItemOverlap},
204 {
"NoTreePushOnOpen", ImGuiTreeNodeFlags_NoTreePushOnOpen},
205 {
"NoAutoOpenOnLog", ImGuiTreeNodeFlags_NoAutoOpenOnLog},
206 {
"DefaultOpen", ImGuiTreeNodeFlags_DefaultOpen},
207 {
"OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick},
208 {
"OpenOnArrow", ImGuiTreeNodeFlags_OpenOnArrow},
209 {
"Leaf", ImGuiTreeNodeFlags_Leaf},
210 {
"Bullet", ImGuiTreeNodeFlags_Bullet},
211 {
"FramePadding", ImGuiTreeNodeFlags_FramePadding},
212 {
"NavLeftJumpsBackHere", ImGuiTreeNodeFlags_NavLeftJumpsBackHere},
213 {
"CollapsingHeader", ImGuiTreeNodeFlags_CollapsingHeader}};
214 ImGuiTreeNodeFlags treeFlags = ImGuiTreeNodeFlags_None;
215 for (
const auto& flag : flag_tokens) {
216 if (flagMap.find(flag) != flagMap.end()) {
217 treeFlags |= flagMap[flag];
220 attributes.
flags = std::make_unique<ImGuiTreeNodeFlags>(treeFlags);
225 static std::map<std::string, ImGuiTableFlags> flagMap = {
226 {
"None", ImGuiTableFlags_None},
227 {
"Resizable", ImGuiTableFlags_Resizable},
228 {
"Reorderable", ImGuiTableFlags_Reorderable},
229 {
"Hideable", ImGuiTableFlags_Hideable},
230 {
"Sortable", ImGuiTableFlags_Sortable},
231 {
"NoSavedSettings", ImGuiTableFlags_NoSavedSettings},
232 {
"ContextMenuInBody", ImGuiTableFlags_ContextMenuInBody},
233 {
"RowBg", ImGuiTableFlags_RowBg},
234 {
"BordersInnerH", ImGuiTableFlags_BordersInnerH},
235 {
"BordersOuterH", ImGuiTableFlags_BordersOuterH},
236 {
"BordersInnerV", ImGuiTableFlags_BordersInnerV},
237 {
"BordersOuterV", ImGuiTableFlags_BordersOuterV},
238 {
"BordersH", ImGuiTableFlags_BordersH},
239 {
"BordersV", ImGuiTableFlags_BordersV},
240 {
"Borders", ImGuiTableFlags_Borders},
241 {
"NoBordersInBody", ImGuiTableFlags_NoBordersInBody},
242 {
"NoBordersInBodyUntilResize",
243 ImGuiTableFlags_NoBordersInBodyUntilResize},
244 {
"SizingFixedFit", ImGuiTableFlags_SizingFixedFit},
245 {
"SizingFixedSame", ImGuiTableFlags_SizingFixedSame},
246 {
"SizingStretchProp", ImGuiTableFlags_SizingStretchProp},
247 {
"SizingStretchSame", ImGuiTableFlags_SizingStretchSame},
248 {
"NoHostExtendX", ImGuiTableFlags_NoHostExtendX},
249 {
"NoHostExtendY", ImGuiTableFlags_NoHostExtendY},
250 {
"NoKeepColumnsVisible", ImGuiTableFlags_NoKeepColumnsVisible},
251 {
"PreciseWidths", ImGuiTableFlags_PreciseWidths},
252 {
"NoClip", ImGuiTableFlags_NoClip},
253 {
"PadOuterX", ImGuiTableFlags_PadOuterX},
254 {
"NoPadOuterX", ImGuiTableFlags_NoPadOuterX},
255 {
"NoPadInnerX", ImGuiTableFlags_NoPadInnerX},
256 {
"ScrollX", ImGuiTableFlags_ScrollX},
257 {
"ScrollY", ImGuiTableFlags_ScrollY},
258 {
"SortMulti", ImGuiTableFlags_SortMulti},
259 {
"SortTristate", ImGuiTableFlags_SortTristate}};
260 ImGuiTableFlags tableFlags = ImGuiTableFlags_None;
261 for (
const auto& flag : flag_tokens) {
262 if (flagMap.find(flag) != flagMap.end()) {
263 tableFlags |= flagMap[flag];
267 attributes.
flags = std::make_unique<ImGuiTableFlags>(tableFlags);
270 static std::map<std::string, ImGuiTableColumnFlags> flagMap = {
271 {
"None", ImGuiTableColumnFlags_None},
272 {
"DefaultHide", ImGuiTableColumnFlags_DefaultHide},
273 {
"DefaultSort", ImGuiTableColumnFlags_DefaultSort},
274 {
"WidthStretch", ImGuiTableColumnFlags_WidthStretch},
275 {
"WidthFixed", ImGuiTableColumnFlags_WidthFixed},
276 {
"NoResize", ImGuiTableColumnFlags_NoResize},
277 {
"NoReorder", ImGuiTableColumnFlags_NoReorder},
278 {
"NoHide", ImGuiTableColumnFlags_NoHide},
279 {
"NoClip", ImGuiTableColumnFlags_NoClip},
280 {
"NoSort", ImGuiTableColumnFlags_NoSort},
281 {
"NoSortAscending", ImGuiTableColumnFlags_NoSortAscending},
282 {
"NoSortDescending", ImGuiTableColumnFlags_NoSortDescending},
283 {
"NoHeaderWidth", ImGuiTableColumnFlags_NoHeaderWidth},
284 {
"PreferSortAscending", ImGuiTableColumnFlags_PreferSortAscending},
285 {
"PreferSortDescending", ImGuiTableColumnFlags_PreferSortDescending},
286 {
"IndentEnable", ImGuiTableColumnFlags_IndentEnable},
287 {
"IndentDisable", ImGuiTableColumnFlags_IndentDisable},
288 {
"IsEnabled", ImGuiTableColumnFlags_IsEnabled},
289 {
"IsVisible", ImGuiTableColumnFlags_IsVisible},
290 {
"IsSorted", ImGuiTableColumnFlags_IsSorted},
291 {
"IsHovered", ImGuiTableColumnFlags_IsHovered}};
292 ImGuiTableColumnFlags columnFlags = ImGuiTableColumnFlags_None;
293 for (
const auto& flag : flag_tokens) {
294 if (flagMap.find(flag) != flagMap.end()) {
295 columnFlags |= flagMap[flag];
299 attributes.
flags = std::make_unique<ImGuiTableColumnFlags>(columnFlags);