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