summaryrefslogtreecommitdiff
path: root/src/imgui_context.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imgui_context.hpp')
-rw-r--r--src/imgui_context.hpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/imgui_context.hpp b/src/imgui_context.hpp
index c6059d6..413bd0b 100644
--- a/src/imgui_context.hpp
+++ b/src/imgui_context.hpp
@@ -54,6 +54,8 @@ class ConditionalRaii {
bool m_expr;
};
+#define Imgui ImGui
+
#define STRUCT_FUNCTOR(FUNCTOR_NAME, FUNCTOR_FUNCTION) \
struct FUNCTOR_NAME { \
auto operator()() -> decltype(FUNCTOR_FUNCTION()) \
@@ -72,17 +74,25 @@ class ConditionalRaii {
} \
};
-STRUCT_FUNCTOR_ARGS(ImGuiBeginMenuBar, ImGui::BeginMenuBar)
-STRUCT_FUNCTOR(ImGuiEndMenuBar, ImGui::EndMenuBar)
+STRUCT_FUNCTOR_ARGS(ImguiBeginMenuBar, Imgui::BeginMenuBar)
+STRUCT_FUNCTOR(ImguiEndMenuBar, Imgui::EndMenuBar)
+
+using ImguiMenuBar = ConditionalRaii<ImguiBeginMenuBar, ImguiEndMenuBar>;
+
+STRUCT_FUNCTOR_ARGS(ImguiBeginMenu, Imgui::BeginMenu)
+STRUCT_FUNCTOR(ImguiEndMenu, Imgui::EndMenu)
+
+using ImguiMenu = ConditionalRaii<ImguiBeginMenu, ImguiEndMenu>;
-using ImguiMenuBar = ConditionalRaii<ImGuiBeginMenuBar, ImGuiEndMenuBar>;
+STRUCT_FUNCTOR_ARGS(ImguiBeginPopupModal, Imgui::BeginPopupModal)
+// N.B. EndPopup is needed for BeginPopupModal
+STRUCT_FUNCTOR(ImguiEndPopupModal, Imgui::EndPopup)
-STRUCT_FUNCTOR_ARGS(ImGuiBeginMenu, ImGui::BeginMenu)
-STRUCT_FUNCTOR(ImGuiEndMenu, ImGui::EndMenu)
+using ImguiPopupModal = ConditionalRaii<ImguiBeginPopupModal, ImguiEndPopupModal>;
-using ImguiMenu = ConditionalRaii<ImGuiBeginMenu, ImGuiEndMenu>;
+// STRUCT_FUNCTOR_ARGS(Imgui
-// STRUCT_FUNCTOR_ARGS(ImGui
+#undef Imgui
#undef STRUCT_FUNCTOR
#undef STRUCT_FUNCTOR_ARGS