#pragma once #include #include "modules/base.hpp" namespace modules { struct MenuTreeItem { std::string exec; std::unique_ptr label; }; struct MenuTree { std::vector> items; }; DefineModule(MenuModule, StaticModule) { static constexpr auto TAG_LABEL_TOGGLE = ""; static constexpr auto TAG_MENU = ""; static constexpr auto EVENT_MENU_OPEN = "menu_open-"; static constexpr auto EVENT_MENU_CLOSE = "menu_close"; std::mutex output_mtx; std::mutex cmd_mtx; int current_level = -1; std::vector> levels; std::unique_ptr label_open; std::unique_ptr label_close; public: explicit MenuModule(const std::string& name); std::string get_output(); bool build(Builder *builder, const std::string& tag); bool handle_command(const std::string& cmd); }; }