4#ifndef FTXUI_COMPONENT_APP_HPP
5#define FTXUI_COMPONENT_APP_HPP
35class FTXUI_EXPORT(COMPONENT) App :
public Screen {
42 static App FixedSize(
int dimx,
int dimy);
52 static App FullscreenPrimaryScreen();
56 static App FullscreenAlternateScreen();
70 App& operator=(App&&) noexcept;
71 App(const App&) = delete;
72 App& operator=(const App&) = delete;
81 void TrackMouse(
bool enable = true);
91 void HandlePipedInput(
bool enable = true);
119 void ForceHandleCtrlC(
bool force = true);
123 void ForceHandleCtrlZ(
bool force = true);
129 void Post(
Task task);
133 void PostEvent(Event event);
137 static
void PostEventOrExecute(
Closure closure);
141 void RequestAnimationFrame();
151 std::
string GetSelection();
154 void SelectionChange(std::function<
void()> callback);
159 const std::
string& TerminalName() const;
162 int TerminalVersion() const;
165 const std::
string& TerminalEmulatorName() const;
168 const std::
string& TerminalEmulatorVersion() const;
171 const std::vector<
int>& TerminalCapabilities() const;
174 std::vector<std::
string> TerminalCapabilityNames() const;
186 void RunOnce(const
Component& component);
187 void RunOnceBlocking(
Component component);
190 bool HandleSelection(
bool handled, Event event);
192 std::
string ResetCursorPosition();
194 void RequestCursorPosition(
bool force = false);
196 void TerminalSend(std::string_view);
197 void TerminalFlush();
199 void InstallPipedInputHandling();
200 void InstallTerminalInfo();
202 void Signal(
int signal);
204 size_t FetchTerminalEvents();
206 void PostAnimationTask();
209 explicit App(std::unique_ptr<Internal> internal,
int dimx,
int dimy);
211 std::unique_ptr<Internal> internal_;
218 static void Signal(App& s,
int signal) { s.Signal(signal); }
The FTXUI ftxui:: namespace.
std::unique_ptr< CapturedMouseInterface > CapturedMouse
std::variant< Event, Closure, AnimationTask > Task
std::function< void()> Closure
std::shared_ptr< ComponentBase > Component