openMSX
ImGuiCpp.hh
Go to the documentation of this file.
1#ifndef IMGUI_CPP_HH
2#define IMGUI_CPP_HH
3
4#include "narrow.hh"
5#include "xrange.hh"
6
7#include <imgui.h>
8
9#include <concepts>
10
11// C++ wrapper around the Dear ImGui C-API
12//
13// Several Dear ImGui functions always need to be called in pairs. Some examples:
14// * ImGui::Begin() always needs to be paired with ImGui::End().
15// * Similar for ImGui::TreeNodeEx() and ImGui::TreePop().
16//
17// These wrapper ensure that you cannot do a wrong pairing.
18//
19// In case of the former 'End()' must always be called (whether 'Begin()'
20// returned 'true' or 'false'). But for the latter 'TreePop()' may only be
21// called when 'TreeNodeEx()' returned 'true'. This difference only exists for
22// historic reason (and thus for backwards compatibility). The Dear ImGui
23// documentation states that in some future version this difference will likely
24// be removed. These wrappers already hide this difference today.
25//
26// Example usage:
27// * This uses the original Dear ImGui C-API:
28// if (ImGui::Begin("my-window")) {
29// ImGui::BeginDisabled(b);
30// if (ImGui::TreeNodeEx("bla", flag)) {
31// ... more stuff
32// ImGui::TreePop();
33// }
34// if (ImGui::TreeNodeEx("foobar")) {
35// ... more stuff
36// ImGui::TreePop();
37// }
38// ImGui::EndDisabled();
39// }
40// ImGui::End();
41//
42// * This is the exact same example, but with our C++ wrapper functions:
43// im::Window("my-window", [&]{
44// im::Disabled(b, [&]{
45// im::TreeNode("bla", flag, [&]{
46// ... more stuff
47// });
48// im::TreeNode("foobar", [&]{
49// ... more stuff
50// });
51// });
52// });
53//
54// This wrapper is inspired by ideas from:
55// https://github.com/ocornut/imgui/issues/2096
56// https://github.com/ocornut/imgui/pull/2197
57// https://github.com/mnesarco/imgui_sugar
58// https://github.com/kfsone/imguiwrap
59
60namespace im {
61
62// im::Window(): wrapper around ImGui::Begin() / ImGui::End()
63inline void Window(const char* name, bool* p_open, ImGuiWindowFlags flags, std::invocable<> auto next)
64{
65 if (ImGui::Begin(name, p_open, flags)) {
66 next();
67 }
68 ImGui::End();
69}
70inline void Window(const char* name, bool* p_open, std::invocable<> auto next)
71{
72 Window(name, p_open, 0, next);
73}
74inline void Window(const char* name, std::invocable<> auto next)
75{
76 Window(name, nullptr, 0, next);
77}
78
80 bool open = false; // [level] true <=> window is open
81 bool do_raise = false; // [edge] set to true when you want to raise this window
82 // gets automatically reset when done
83 void raise() { do_raise = open = true; }
84};
85inline void Window(const char* name, WindowStatus& status, ImGuiWindowFlags flags, std::invocable<> auto next)
86{
87 if (ImGui::Begin(name, &status.open, flags)) {
88 if (status.do_raise) {
89 status.do_raise = false;
90 if (!ImGui::IsWindowAppearing()) { // otherwise crash, viewport not yet initialized???
91 // depending on the backend (e.g. Wayland) this could be nullptr
92 if (auto* swf = ImGui::GetPlatformIO().Platform_SetWindowFocus) {
93 swf(ImGui::GetWindowViewport());
94 }
95 // When window is inside the main viewport, this function is
96 // needed to raise focus even if Platform_SetWindowFocus exists
97 ImGui::SetWindowFocus();
98 }
99 }
100 next();
101 }
102 ImGui::End();
103}
104inline void Window(const char* name, WindowStatus& status, std::invocable<> auto next)
105{
106 Window(name, status, 0, next);
107}
108
109// im::Child(): wrapper around ImGui::BeginChild() / ImGui::EndChild()
110inline void Child(const char* str_id, const ImVec2& size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags, std::invocable<> auto next)
111{
112 if (ImGui::BeginChild(str_id, size, child_flags, window_flags)) {
113 next();
114 }
115 ImGui::EndChild();
116}
117inline void Child(const char* str_id, const ImVec2& size, ImGuiChildFlags child_flags, std::invocable<> auto next)
118{
119 Child(str_id, size, child_flags, 0, next);
120}
121inline void Child(const char* str_id, const ImVec2& size, std::invocable<> auto next)
122{
123 Child(str_id, size, 0, 0, next);
124}
125inline void Child(const char* str_id, std::invocable<> auto next)
126{
127 Child(str_id, {}, 0, 0, next);
128}
129
130// im::Font(): wrapper around ImGui::PushFont() / ImGui::PopFont()
131inline void Font(ImFont* font, std::invocable<> auto next)
132{
133 ImGui::PushFont(font);
134 next();
135 ImGui::PopFont();
136}
137// Same functionality as im::Font(), but different usage (sometimes one sometimes the other is easier).
139 explicit ScopedFont(ImFont* font) { ImGui::PushFont(font); }
140 ~ScopedFont() { ImGui::PopFont(); }
141
142 ScopedFont(const ScopedFont&) = delete;
144 ScopedFont& operator=(const ScopedFont&) = delete;
146};
147
148// im::StyleColor(): wrapper around ImGui::PushStyleColor() / ImGui::PopStyleColor()
149// Add more overloads when needed
150/*inline void StyleColor(ImGuiCol idx, ImVec4 col, std::invocable<> auto next)
151{
152 ImGui::PushStyleColor(idx, col);
153 next();
154 ImGui::PopStyleColor(1);
155}*/
156/*inline void StyleColor(bool active, ImGuiCol idx, ImVec4 col, std::invocable<> auto next)
157{
158 if (active) ImGui::PushStyleColor(idx, col);
159 next();
160 if (active) ImGui::PopStyleColor(1);
161}*/
162inline void StyleColor(ImGuiCol idx1, ImVec4 col1,
163 ImGuiCol idx2, ImVec4 col2,
164 std::invocable<> auto next)
165{
166 ImGui::PushStyleColor(idx1, col1);
167 ImGui::PushStyleColor(idx2, col2);
168 next();
169 ImGui::PopStyleColor(2);
170}
171inline void StyleColor(ImGuiCol idx1, ImVec4 col1,
172 ImGuiCol idx2, ImVec4 col2,
173 ImGuiCol idx3, ImVec4 col3,
174 std::invocable<> auto next)
175{
176 ImGui::PushStyleColor(idx1, col1);
177 ImGui::PushStyleColor(idx2, col2);
178 ImGui::PushStyleColor(idx3, col3);
179 next();
180 ImGui::PopStyleColor(3);
181}
182inline void StyleColor(ImGuiCol idx1, ImVec4 col1,
183 ImGuiCol idx2, ImVec4 col2,
184 ImGuiCol idx3, ImVec4 col3,
185 ImGuiCol idx4, ImVec4 col4,
186 std::invocable<> auto next)
187{
188 ImGui::PushStyleColor(idx1, col1);
189 ImGui::PushStyleColor(idx2, col2);
190 ImGui::PushStyleColor(idx3, col3);
191 ImGui::PushStyleColor(idx4, col4);
192 next();
193 ImGui::PopStyleColor(4);
194}
195inline void StyleColor(ImGuiCol idx, ImU32 col, std::invocable<> auto next)
196{
197 ImGui::PushStyleColor(idx, ImGui::ColorConvertU32ToFloat4(col));
198 next();
199 ImGui::PopStyleColor(1);
200}
201inline void StyleColor(bool active, ImGuiCol idx, ImU32 col, std::invocable<> auto next)
202{
203 if (active) ImGui::PushStyleColor(idx, ImGui::ColorConvertU32ToFloat4(col));
204 next();
205 if (active) ImGui::PopStyleColor(1);
206}
207
208// im::StyleVar(): wrapper around ImGui::PushStyleVar() / ImGui::PopStyleVar()
209// Add more overloads when needed
210inline void StyleVar(ImGuiStyleVar idx, float val, std::invocable<> auto next)
211{
212 ImGui::PushStyleVar(idx, val);
213 next();
214 ImGui::PopStyleVar(1);
215}
216inline void StyleVar(ImGuiStyleVar idx, const ImVec2& val, std::invocable<> auto next)
217{
218 ImGui::PushStyleVar(idx, val);
219 next();
220 ImGui::PopStyleVar(1);
221}
222
223// im::ItemWidth(): wrapper around ImGui::PushItemWidth() / ImGui::PopItemWidth()
224inline void ItemWidth(float item_width, std::invocable<> auto next)
225{
226 ImGui::PushItemWidth(item_width);
227 next();
228 ImGui::PopItemWidth();
229}
230
231// im::TextWrapPos(): wrapper around ImGui::PushTextWrapPos() / ImGui::PopTextWrapPos()
232inline void TextWrapPos(float wrap_local_pos_x, std::invocable<> auto next)
233{
234 ImGui::PushTextWrapPos(wrap_local_pos_x);
235 next();
236 ImGui::PopTextWrapPos();
237}
238inline void TextWrapPos(std::invocable<> auto next)
239{
240 TextWrapPos(0.0f, next);
241}
242
243// im::Indent(): wrapper around ImGui::Indent() / ImGui::Unindent()
244inline void Indent(float indent_w, std::invocable<> auto next)
245{
246 ImGui::Indent(indent_w);
247 next();
248 ImGui::Unindent(indent_w);
249}
250inline void Indent(std::invocable<> auto next)
251{
252 Indent(0.0f, next);
253}
254
255// im::Group(): wrapper around ImGui::BeginGroup() / ImGui::EndGroup()
256inline void Group(std::invocable<> auto next)
257{
258 ImGui::BeginGroup();
259 next();
260 ImGui::EndGroup();
261}
262
263// im::ID(): wrapper around ImGui::PushID() / ImGui::PopID()
264inline void ID(const char* str_id, std::invocable<> auto next)
265{
266 ImGui::PushID(str_id);
267 next();
268 ImGui::PopID();
269}
270inline void ID(const char* str_id_begin, const char* str_id_end, std::invocable<> auto next)
271{
272 ImGui::PushID(str_id_begin, str_id_end);
273 next();
274 ImGui::PopID();
275}
276inline void ID(const void* ptr_id, std::invocable<> auto next)
277{
278 ImGui::PushID(ptr_id);
279 next();
280 ImGui::PopID();
281}
282inline void ID(int int_id, std::invocable<> auto next)
283{
284 ImGui::PushID(int_id);
285 next();
286 ImGui::PopID();
287}
288inline void ID(const std::string& str, std::invocable<> auto next)
289{
290 auto begin = str.data();
291 auto end = begin + str.size();
292 ID(begin, end, next);
293}
294inline void ID(std::string_view str, std::invocable<> auto next)
295{
296 auto begin = str.data();
297 auto end = begin + str.size();
298 ID(begin, end, next);
299}
300
301inline void ID_for_range(int count, std::invocable<int> auto next)
302{
303 for (auto i : xrange(count)) {
304 ID(i, [&]{ next(i); });
305 }
306}
307inline void ID_for_range(size_t count, std::invocable<int> auto next)
308{
309 ID_for_range(narrow<int>(count), next);
310}
311
312// im::Combo(): wrapper around ImGui::BeginCombo() / ImGui::EndCombo()
313inline void Combo(const char* label, const char* preview_value, ImGuiComboFlags flags, std::invocable<> auto next)
314{
315 if (ImGui::BeginCombo(label, preview_value, flags)) {
316 next();
317 ImGui::EndCombo();
318 }
319}
320inline void Combo(const char* label, const char* preview_value, std::invocable<> auto next)
321{
322 Combo(label, preview_value, 0, next);
323}
324
325// im::TreeNode(): wrapper around ImGui::TreeNodeEx() / ImGui::TreePop()
326inline bool TreeNode(const char* label, ImGuiTreeNodeFlags flags, std::invocable<> auto next)
327{
328 bool open = ImGui::TreeNodeEx(label, flags);
329 if (open) {
330 next();
331 ImGui::TreePop();
332 }
333 return open;
334}
335inline bool TreeNode(const char* label, std::invocable<> auto next)
336{
337 return TreeNode(label, 0, next);
338}
339inline void TreeNode(const char* label, bool* p_open, std::invocable<> auto next)
340{
341 assert(p_open);
342 ImGui::SetNextItemOpen(*p_open);
343 int flags = 0;
344 *p_open = ImGui::TreeNodeEx(label, flags);
345 if (*p_open) {
346 next();
347 ImGui::TreePop();
348 }
349}
350
351// im::ListBox(): wrapper around ImGui::BeginListBox() / ImGui::EndListBox()
352inline void ListBox(const char* label, const ImVec2& size, std::invocable<> auto next)
353{
354 if (ImGui::BeginListBox(label, size)) {
355 next();
356 ImGui::EndListBox();
357 }
358}
359inline void ListBox(const char* label, std::invocable<> auto next)
360{
361 ListBox(label, {}, next);
362}
363
364// im::MainMenuBar(): wrapper around ImGui::BeginMenuBar() / ImGui::EndMenuBar()
365inline void MenuBar(std::invocable<> auto next)
366{
367 if (ImGui::BeginMenuBar()) {
368 next();
369 ImGui::EndMenuBar();
370 }
371}
372
373// im::MainMenuBar(): wrapper around ImGui::BeginMainMenuBar() / ImGui::EndMainMenuBar()
374inline void MainMenuBar(std::invocable<> auto next)
375{
376 if (ImGui::BeginMainMenuBar()) {
377 next();
378 ImGui::EndMainMenuBar();
379 }
380}
381
382// im::Menu(): wrapper around ImGui::BeginMenu() / ImGui::EndMenu()
383inline bool Menu(const char* label, bool enabled, std::invocable<> auto next)
384{
385 bool open = ImGui::BeginMenu(label, enabled);
386 if (open) {
387 next();
388 ImGui::EndMenu();
389 }
390 return open;
391}
392inline bool Menu(const char* label, std::invocable<> auto next)
393{
394 return Menu(label, true, next);
395}
396
397// im::Tooltip(): wrapper around ImGui::BeginTooltip() / ImGui::EndTooltip()
398inline void Tooltip(std::invocable<> auto next)
399{
400 if (ImGui::BeginTooltip()) {
401 next();
402 ImGui::EndTooltip();
403 }
404}
405// im::Tooltip(): wrapper around ImGui::BeginItemTooltip() / ImGui::EndTooltip()
406inline void ItemTooltip(std::invocable<> auto next)
407{
408 if (ImGui::BeginItemTooltip()) {
409 next();
410 ImGui::EndTooltip();
411 }
412}
413
414// im::Popup(): wrapper around ImGui::BeginPopup() / ImGui::EndPopup()
415inline void Popup(const char* str_id, ImGuiWindowFlags flags, std::invocable<> auto next)
416{
417 if (ImGui::BeginPopup(str_id, flags)) {
418 next();
419 ImGui::EndPopup();
420 }
421}
422inline void Popup(const char* str_id, std::invocable<> auto next)
423{
424 Popup(str_id, 0, next);
425}
426
427// im::PopupModal(): wrapper around ImGui::BeginPopupModal() / ImGui::EndPopup()
428inline void PopupModal(const char* name, bool* p_open, ImGuiWindowFlags flags, std::invocable<> auto next)
429{
430 if (ImGui::BeginPopupModal(name, p_open, flags)) {
431 next();
432 ImGui::EndPopup();
433 }
434}
435inline void PopupModal(const char* name, bool* p_open, std::invocable<> auto next)
436{
437 PopupModal(name, p_open, 0, next);
438}
439inline void PopupModal(const char* name, std::invocable<> auto next)
440{
441 PopupModal(name, nullptr, 0, next);
442}
443
444// im::PopupContextItem(): wrapper around ImGui::BeginPopupContextItem() / ImGui::EndPopup()
445inline void PopupContextItem(const char* str_id, ImGuiPopupFlags popup_flags, std::invocable<> auto next)
446{
447 if (ImGui::BeginPopupContextItem(str_id, popup_flags)) {
448 next();
449 ImGui::EndPopup();
450 }
451}
452inline void PopupContextItem(const char* str_id, std::invocable<> auto next)
453{
454 PopupContextItem(str_id, ImGuiPopupFlags_MouseButtonRight, next);
455}
456inline void PopupContextItem(std::invocable<> auto next)
457{
458 PopupContextItem(nullptr, ImGuiPopupFlags_MouseButtonRight, next);
459}
460
461// im::PopupContextWindow(): wrapper around ImGui::BeginPopupContextWindow() / ImGui::EndPopup()
462inline void PopupContextWindow(const char* str_id, ImGuiPopupFlags popup_flags, std::invocable<> auto next)
463{
464 if (ImGui::BeginPopupContextWindow(str_id, popup_flags)) {
465 next();
466 ImGui::EndPopup();
467 }
468}
469inline void PopupContextWindow(const char* str_id, std::invocable<> auto next)
470{
471 PopupContextWindow(str_id, 1, next);
472}
473inline void PopupContextWindow(std::invocable<> auto next)
474{
475 PopupContextWindow(nullptr, 1, next);
476}
477
478// im::Table(): wrapper around ImGui::BeginTable() / ImGui::EndTable()
479inline void Table(const char* str_id, int column, ImGuiTableFlags flags, const ImVec2& outer_size, float inner_width, std::invocable<> auto next)
480{
481 if (ImGui::BeginTable(str_id, column, flags, outer_size, inner_width)) {
482 next();
483 ImGui::EndTable();
484 }
485}
486inline void Table(const char* str_id, int column, ImGuiTableFlags flags, const ImVec2& outer_size, std::invocable<> auto next)
487{
488 Table(str_id, column, flags, outer_size, 0.0f, next);
489}
490inline void Table(const char* str_id, int column, ImGuiTableFlags flags, std::invocable<> auto next)
491{
492 Table(str_id, column, flags, {}, 0.0f, next);
493}
494inline void Table(const char* str_id, int column, std::invocable<> auto next)
495{
496 Table(str_id, column, 0, {}, 0.0f, next);
497}
498
499// im::TabBar(): wrapper around ImGui::BeginTabBar() / ImGui::EndTabBar()
500inline void TabBar(const char* str_id, ImGuiTabBarFlags flags, std::invocable<> auto next)
501{
502 if (ImGui::BeginTabBar(str_id, flags)) {
503 next();
504 ImGui::EndTabBar();
505 }
506}
507inline void TabBar(const char* str_id, std::invocable<> auto next)
508{
509 TabBar(str_id, 0, next);
510}
511
512// im::TabItem(): wrapper around ImGui::BeginTabItem() / ImGui::EndTabItem()
513inline void TabItem(const char* label, bool* p_open, ImGuiTabItemFlags flags, std::invocable<> auto next)
514{
515 if (ImGui::BeginTabItem(label, p_open, flags)) {
516 next();
517 ImGui::EndTabItem();
518 }
519}
520inline void TabItem(const char* label, bool* p_open, std::invocable<> auto next)
521{
522 TabItem(label, p_open, 0, next);
523}
524inline void TabItem(const char* label, std::invocable<> auto next)
525{
526 TabItem(label, nullptr, 0, next);
527}
528
529// im::Disabled(): wrapper around ImGui::BeginDisabled() / ImGui::EndDisabled()
530inline void Disabled(bool b, std::invocable<> auto next)
531{
532 ImGui::BeginDisabled(b);
533 next();
534 ImGui::EndDisabled();
535}
536
537// im::DisabledIndent(): combination of Disabled() and Indent()
538inline void DisabledIndent(bool b, std::invocable<> auto next)
539{
540 ImGui::BeginDisabled(b);
541 ImGui::Indent(); // TODO for now not configurable
542 next();
543 ImGui::Unindent();
544 ImGui::EndDisabled();
545}
546
547// im::VisuallyDisabled(): similar to Disabled(), but only visually disable, still allow to interact normally
548inline void VisuallyDisabled(bool b, std::invocable<> auto next)
549{
550 if (b) {
551 const auto& style = ImGui::GetStyle();
552 ImGui::PushStyleVar(ImGuiStyleVar_Alpha, style.Alpha * style.DisabledAlpha);
553 }
554 next();
555 if (b) {
556 ImGui::PopStyleVar(1);
557 }
558}
559
560// im::ListClipper: wrapper around ImGuiListClipper
561// hides the typical nested loop
562inline void ListClipper(size_t count, int forceIndex, float lineHeight, std::invocable<int> auto next)
563{
564 ImGuiListClipper clipper; // only draw the actually visible lines
565 clipper.Begin(narrow<int>(count), lineHeight);
566 if (forceIndex > 0) clipper.IncludeItemByIndex(narrow<int>(forceIndex));
567 while (clipper.Step()) {
568 for (int i : xrange(clipper.DisplayStart, clipper.DisplayEnd)) {
569 next(i);
570 }
571 }
572}
573inline void ListClipper(size_t count, int forceIndex, std::invocable<int> auto next)
574{
575 ListClipper(count, forceIndex, -1.0f, next);
576}
577inline void ListClipper(size_t count, std::invocable<int> auto next)
578{
579 ListClipper(count, -1, next);
580}
581
582// im::ListClipperID: combination of im::ListClipper() and im::ID()
583inline void ListClipperID(size_t count, std::invocable<int> auto next)
584{
585 ImGuiListClipper clipper; // only draw the actually visible lines
586 clipper.Begin(narrow<int>(count));
587 while (clipper.Step()) {
588 for (int i : xrange(clipper.DisplayStart, clipper.DisplayEnd)) {
589 ImGui::PushID(i);
590 next(i);
591 ImGui::PopID();
592 }
593 }
594}
595
596} // namespace im
597
598#endif
Definition ImGuiCpp.hh:60
void DisabledIndent(bool b, std::invocable<> auto next)
Definition ImGuiCpp.hh:538
void Table(const char *str_id, int column, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, std::invocable<> auto next)
Definition ImGuiCpp.hh:479
void MainMenuBar(std::invocable<> auto next)
Definition ImGuiCpp.hh:374
void MenuBar(std::invocable<> auto next)
Definition ImGuiCpp.hh:365
void Window(const char *name, bool *p_open, ImGuiWindowFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:63
void VisuallyDisabled(bool b, std::invocable<> auto next)
Definition ImGuiCpp.hh:548
void ID(const char *str_id, std::invocable<> auto next)
Definition ImGuiCpp.hh:264
void PopupContextItem(const char *str_id, ImGuiPopupFlags popup_flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:445
void StyleVar(ImGuiStyleVar idx, float val, std::invocable<> auto next)
Definition ImGuiCpp.hh:210
void TabBar(const char *str_id, ImGuiTabBarFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:500
void PopupContextWindow(const char *str_id, ImGuiPopupFlags popup_flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:462
bool TreeNode(const char *label, ImGuiTreeNodeFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:326
void Combo(const char *label, const char *preview_value, ImGuiComboFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:313
void ItemWidth(float item_width, std::invocable<> auto next)
Definition ImGuiCpp.hh:224
void ListBox(const char *label, const ImVec2 &size, std::invocable<> auto next)
Definition ImGuiCpp.hh:352
void Child(const char *str_id, const ImVec2 &size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:110
void PopupModal(const char *name, bool *p_open, ImGuiWindowFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:428
void TextWrapPos(float wrap_local_pos_x, std::invocable<> auto next)
Definition ImGuiCpp.hh:232
bool Menu(const char *label, bool enabled, std::invocable<> auto next)
Definition ImGuiCpp.hh:383
void StyleColor(ImGuiCol idx1, ImVec4 col1, ImGuiCol idx2, ImVec4 col2, std::invocable<> auto next)
Definition ImGuiCpp.hh:162
void Disabled(bool b, std::invocable<> auto next)
Definition ImGuiCpp.hh:530
void Group(std::invocable<> auto next)
Definition ImGuiCpp.hh:256
void Font(ImFont *font, std::invocable<> auto next)
Definition ImGuiCpp.hh:131
void TabItem(const char *label, bool *p_open, ImGuiTabItemFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:513
void Tooltip(std::invocable<> auto next)
Definition ImGuiCpp.hh:398
void Indent(float indent_w, std::invocable<> auto next)
Definition ImGuiCpp.hh:244
void ListClipper(size_t count, int forceIndex, float lineHeight, std::invocable< int > auto next)
Definition ImGuiCpp.hh:562
void ListClipperID(size_t count, std::invocable< int > auto next)
Definition ImGuiCpp.hh:583
void Popup(const char *str_id, ImGuiWindowFlags flags, std::invocable<> auto next)
Definition ImGuiCpp.hh:415
void ItemTooltip(std::invocable<> auto next)
Definition ImGuiCpp.hh:406
void ID_for_range(int count, std::invocable< int > auto next)
Definition ImGuiCpp.hh:301
ScopedFont(ImFont *font)
Definition ImGuiCpp.hh:139
ScopedFont(const ScopedFont &)=delete
ScopedFont(ScopedFont &&)=delete
ScopedFont & operator=(ScopedFont &&)=delete
ScopedFont & operator=(const ScopedFont &)=delete
constexpr auto xrange(T e)
Definition xrange.hh:132
constexpr auto begin(const zstring_view &x)
constexpr auto end(const zstring_view &x)