#ifndef FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP #define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP #include #include #include #include #include #include #include "ftxui/component/event.hpp" #include "ftxui/screen/screen.hpp" namespace ftxui { class Component; class ScreenInteractive : public Screen { public: static ScreenInteractive FixedSize(int dimx, int dimy); static ScreenInteractive Fullscreen(); static ScreenInteractive FitComponent(); static ScreenInteractive TerminalOutput(); ~ScreenInteractive(); void Loop(Component*); std::function ExitLoopClosure(); void PostEvent(Event event); private: void Draw(Component* component); void EventLoop(Component* component); enum class Dimension { FitComponent, Fixed, Fullscreen, TerminalOutput, }; Dimension dimension_ = Dimension::Fixed; ScreenInteractive(int dimx, int dimy, Dimension dimension); std::condition_variable events_queue_cv; std::mutex events_queue_mutex; std::queue events_queue; std::atomic quit_ = false; }; } // namespace ftxui #endif /* end of include guard: FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP */