From 876c829512301e3f20161f05d7c193540e6d1710 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sat, 28 Sep 2024 17:39:03 -0500 Subject: Working through file picker. --- src/imgui_context.hpp | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) (limited to 'src/imgui_context.hpp') diff --git a/src/imgui_context.hpp b/src/imgui_context.hpp index 413bd0b..fa04fb2 100644 --- a/src/imgui_context.hpp +++ b/src/imgui_context.hpp @@ -16,6 +16,8 @@ class ImguiContext { const ImGuiIO& getIO() const; + ImGuiIO& getIO(); + void setIOFlag(ImGuiConfigFlags_ flag) const; bool processEvent(SDL_Event& event) const; void startFrame() const; @@ -74,29 +76,58 @@ class ConditionalRaii { } \ }; -STRUCT_FUNCTOR_ARGS(ImguiBeginMenuBar, Imgui::BeginMenuBar) -STRUCT_FUNCTOR(ImguiEndMenuBar, Imgui::EndMenuBar) +STRUCT_FUNCTOR_ARGS(ImBeginMenuBar, Imgui::BeginMenuBar) +STRUCT_FUNCTOR(ImEndMenuBar, Imgui::EndMenuBar) -using ImguiMenuBar = ConditionalRaii; +using ImMenuBar = ConditionalRaii; -STRUCT_FUNCTOR_ARGS(ImguiBeginMenu, Imgui::BeginMenu) -STRUCT_FUNCTOR(ImguiEndMenu, Imgui::EndMenu) +STRUCT_FUNCTOR_ARGS(ImBeginMenu, Imgui::BeginMenu) +STRUCT_FUNCTOR(ImEndMenu, Imgui::EndMenu) -using ImguiMenu = ConditionalRaii; +using ImMenu = ConditionalRaii; -STRUCT_FUNCTOR_ARGS(ImguiBeginPopupModal, Imgui::BeginPopupModal) +STRUCT_FUNCTOR_ARGS(ImBeginPopupModal, Imgui::BeginPopupModal) // N.B. EndPopup is needed for BeginPopupModal -STRUCT_FUNCTOR(ImguiEndPopupModal, Imgui::EndPopup) +STRUCT_FUNCTOR(ImEndPopupModal, Imgui::EndPopup) + +using ImPopupModal = ConditionalRaii; + +STRUCT_FUNCTOR_ARGS(ImBeginTable, Imgui::BeginTable) +STRUCT_FUNCTOR(ImEndTable, Imgui::EndTable) -using ImguiPopupModal = ConditionalRaii; +using ImTable = ConditionalRaii; -// STRUCT_FUNCTOR_ARGS(Imgui +// STRUCT_FUNCTOR_ARGS(Im #undef Imgui #undef STRUCT_FUNCTOR #undef STRUCT_FUNCTOR_ARGS +constexpr auto ImBegin = ImGui::Begin; +constexpr auto ImEnd = ImGui::End; + +inline void ImSameLine(float xOffset = 0.0, float spacing = 0.0) +{ + ImGui::SameLine(xOffset, spacing); +} + +#define ImText ImGui::Text + +inline bool ImButton(const char* label, const ImVec2& size = ImVec2(0, 0)) +{ + return ImGui::Button(label, size); +} + +constexpr auto ImGetTime = ImGui::GetTime; +inline void ImNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f) +{ + ImGui::TableNextRow(row_flags, min_row_height); +} +constexpr auto ImNextColumn = ImGui::TableNextColumn; + +#define ImSelectable ImGui::Selectable + } // namespace bookmouse #endif -- cgit v1.2.3