Add unique_ptr<TaskRunner>

This commit is contained in:
ArthurSonzogni
2025-07-02 20:17:51 +02:00
parent 1b479ee12d
commit 4ac28b5675
4 changed files with 23 additions and 6 deletions

View File

@@ -26,6 +26,10 @@ struct Event;
using Component = std::shared_ptr<ComponentBase>;
class ScreenInteractivePrivate;
namespace task {
class TaskRunner;
}
/// @brief ScreenInteractive is a `Screen` that can handle events, run a main
/// loop, and manage components.
///
@@ -40,6 +44,9 @@ class ScreenInteractive : public Screen {
static ScreenInteractive FitComponent();
static ScreenInteractive TerminalOutput();
// Destructor.
~ScreenInteractive();
// Options. Must be called before Loop().
void TrackMouse(bool enable = true);
@@ -156,6 +163,8 @@ class ScreenInteractive : public Screen {
std::unique_ptr<Selection> selection_;
std::function<void()> selection_on_change_;
std::unique_ptr<task::TaskRunner> task_runner_;
friend class Loop;
public: