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();
69 App& operator=(App&&) noexcept;
70 App(const App&) = delete;
71 App& operator=(const App&) = delete;
81 void TrackMouse(
bool enable = true);
92 void HandlePipedInput(
bool enable = true);
121 void ForceHandleCtrlC(
bool force = true);
125 void ForceHandleCtrlZ(
bool force = true);
131 void Post(
Task task);
135 void PostEvent(Event event);
139 static
void PostEventOrExecute(
Closure closure);
143 void RequestAnimationFrame();
154 std::
string GetSelection();
157 void SelectionChange(std::function<
void()> callback);
162 const std::
string& TerminalName() const;
165 int TerminalVersion() const;
168 const std::
string& TerminalEmulatorName() const;
171 const std::
string& TerminalEmulatorVersion() const;
174 const std::vector<
int>& TerminalCapabilities() const;
177 std::vector<std::
string> TerminalCapabilityNames() const;
189 void RunOnce(const
Component& component);
190 void RunOnceBlocking(
Component component);
193 bool HandleSelection(
bool handled, Event event);
195 std::
string ResetCursorPosition();
197 void RequestCursorPosition(
bool force = false);
199 void TerminalSend(std::string_view);
200 void TerminalFlush();
202 void InstallPipedInputHandling();
203 void InstallTerminalInfo();
205 void Signal(
int signal);
207 size_t FetchTerminalEvents();
209 void PostAnimationTask();
212 explicit App(std::unique_ptr<Internal> internal,
int dimx,
int dimy);
214 std::unique_ptr<Internal> internal_;
221 static void Signal(App& s,
int signal) { s.Signal(signal); }
std::unique_ptr< CapturedMouseInterface > CapturedMouse
std::variant< Event, Closure, AnimationTask > Task
std::function< void()> Closure
std::shared_ptr< ComponentBase > Component