#pragma once #include #include #include #include #include #include enum ImCmdTextType { ImCmdTextType_Regular, ImCmdTextType_Highlight, ImCmdTextType_COUNT, }; namespace ImCmd { struct Command { const char* Name; std::function InitialCallback; std::function SubsequentCallback; std::function TerminatingCallback; }; // Command management void AddCommand(Command command); void RemoveCommand(const char* name); // Styling void SetStyleFont(ImCmdTextType type, ImFont* font); void SetStyleColor(ImCmdTextType type, ImU32 color); void ClearStyleColor(ImCmdTextType type); //< Clear the style color for the given type, defaulting to ImGuiCol_Text // Command palette widget void SetNextCommandPaletteSearch(const char* text); void SetNextCommandPaletteSearchBoxFocused(); void ShowCommandPalette(const char* name); bool IsAnyItemSelected(); void RemoveCache(const char* name); void RemoveAllCaches(); // Command palette widget in a window helper void SetNextWindowAffixedTop(ImGuiCond cond = 0); void ShowCommandPaletteWindow(const char* name, bool* p_open); // Command responses, only call these in command callbacks (except TerminatingCallback) void Prompt(std::vector options); } // namespace ImCmd