mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
First version of supporting extraction of the terminal id.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for string
|
||||
#include <thread> // for thread
|
||||
#include <list>
|
||||
|
||||
#include "ftxui/component/animation.hpp" // for TimePoint
|
||||
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
|
||||
@@ -72,6 +73,13 @@ class ScreenInteractive : public Screen {
|
||||
void ForceHandleCtrlC(bool force);
|
||||
void ForceHandleCtrlZ(bool force);
|
||||
|
||||
TerminalID TerminalId() const;
|
||||
|
||||
typedef std::function<void(TerminalID const& terminal_id)> TerminalIDUpdateCallback;
|
||||
|
||||
void OnTerminalIDUpdate(
|
||||
TerminalIDUpdateCallback const& callback);
|
||||
|
||||
// Selection API.
|
||||
std::string GetSelection();
|
||||
void SelectionChange(std::function<void()> callback);
|
||||
@@ -156,6 +164,11 @@ class ScreenInteractive : public Screen {
|
||||
std::unique_ptr<Selection> selection_;
|
||||
std::function<void()> selection_on_change_;
|
||||
|
||||
TerminalID m_terminal_id;
|
||||
|
||||
typedef std::list<TerminalIDUpdateCallback> TerminalIDUpdateCallbackContainer;
|
||||
TerminalIDUpdateCallbackContainer m_terminal_id_update_callbacks;
|
||||
|
||||
friend class Loop;
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user