screen_interactive.hpp
atomic
ftxui/component/receiver.hpp
functional
memory
string
thread
variant
ftxui/component/animation.hpp
ftxui/component/captured_mouse.hpp
ftxui/component/event.hpp
ftxui/component/task.hpp
ftxui/dom/selection.hpp
ftxui/screen/screen.hpp
src/ftxui/component/button.cpp
src/ftxui/component/component.cpp
src/ftxui/component/hoverable.cpp
src/ftxui/component/input.cpp
src/ftxui/component/loop.cpp
src/ftxui/component/menu.cpp
src/ftxui/component/radiobox.cpp
src/ftxui/component/screen_interactive.cpp
src/ftxui/component/slider.cpp
src/ftxui/component/window.cpp
ftxui/component/animation.hpp
ftxui/component/captured_mouse.hpp
ftxui/component/event.hpp
ftxui/component/mouse.hpp
ftxui/component/receiver.hpp
include/ftxui/component/screen_interactive.hpp
ftxui/component/task.hpp
ftxui/dom/selection.hpp
ftxui/screen/box.hpp
ftxui/screen/color.hpp
ftxui/screen/image.hpp
ftxui/screen/pixel.hpp
ftxui/screen/screen.hpp
ftxui/screen/terminal.hpp
ftxui/util/autoreset.hpp
algorithm
atomic
chrono
condition_variable
cstdint
functional
memory
mutex
queue
sstream
string
thread
utility
variant
vector
include/ftxui/component/screen_interactive.hpp
src/ftxui/component/button.cpp
src/ftxui/component/component.cpp
src/ftxui/component/hoverable.cpp
src/ftxui/component/input.cpp
src/ftxui/component/loop.cpp
src/ftxui/component/menu.cpp
src/ftxui/component/radiobox.cpp
src/ftxui/component/screen_interactive.cpp
src/ftxui/component/slider.cpp
src/ftxui/component/window.cpp
ftxui::ScreenInteractive
ftxui::ScreenInteractive::SelectionData
ftxui::ScreenInteractive::Private
ftxui

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #ifndefFTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP
    #defineFTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP

    #include<atomic>//foratomic
    #include<ftxui/component/receiver.hpp>//forReceiver,Sender
    #include<functional>//forfunction
    #include<memory>//forshared_ptr
    #include<string>//forstring
    #include<thread>//forthread
    #include<variant>//forvariant

    #include"ftxui/component/animation.hpp"//forTimePoint
    #include"ftxui/component/captured_mouse.hpp"//forCapturedMouse
    #include"ftxui/component/event.hpp"//forEvent
    #include"ftxui/component/task.hpp"//forTask,Closure
    #include"ftxui/dom/selection.hpp"//forSelectionOption
    #include"ftxui/screen/screen.hpp"//forScreen

    namespaceftxui{
    classComponentBase;
    classLoop;
    structEvent;

    usingComponent=std::shared_ptr<ComponentBase>;
    classScreenInteractivePrivate;

    classScreenInteractive:publicScreen{
    public:
    //Constructors:
    staticScreenInteractiveFixedSize(intdimx,intdimy);
    staticScreenInteractiveFullscreen();
    staticScreenInteractiveFullscreenPrimaryScreen();
    staticScreenInteractiveFullscreenAlternateScreen();
    staticScreenInteractiveFitComponent();
    staticScreenInteractiveTerminalOutput();

    //Options.MustbecalledbeforeLoop().
    voidTrackMouse(boolenable=true);

    //Returnthecurrentlyactivescreen,nullptrifnone.
    staticScreenInteractive*Active();

    //Start/Stopthemainloop.
    voidLoop(Component);
    voidExit();
    ClosureExitLoopClosure();

    //Posttaskstobeexecutedbytheloop.
    voidPost(Tasktask);
    voidPostEvent(Eventevent);
    voidRequestAnimationFrame();

    CapturedMouseCaptureMouse();

    //Decorateafunction.Theoutputtedonewillexecutesimilarlytothe
    //inputtedone,butwiththecurrentlyactivescreenterminalhooks
    //temporarilyuninstalled.
    ClosureWithRestoredIO(Closure);

    //FTXUIimplementshandlersforCtrl-CandCtrl-Z.Bydefault,thesehandlers
    //areexecuted,evenifthecomponentcatchestheevent.Thisavoidusers
    //handlingeveryeventtobetrappedintheapplication.However,insome
    //cases,theapplicationmaywanttohandletheseeventsitself.Inthis
    //case,theapplicationcanforceFTXUItonothandletheseeventsbycalling
    //thefollowingfunctionswithforce=true.
    voidForceHandleCtrlC(boolforce);
    voidForceHandleCtrlZ(boolforce);

    //SelectionAPI.
    std::stringGetSelection();
    voidSelectionChange(std::function<void()>callback);

    private:
    voidExitNow();

    voidInstall();
    voidUninstall();

    voidPreMain();
    voidPostMain();

    boolHasQuitted();
    voidRunOnce(Componentcomponent);
    voidRunOnceBlocking(Componentcomponent);

    voidHandleTask(Componentcomponent,Task&task);
    boolHandleSelection(boolhandled,Eventevent);
    voidRefreshSelection();
    voidDraw(Componentcomponent);
    voidResetCursorPosition();

    voidSignal(intsignal);

    ScreenInteractive*suspended_screen_=nullptr;
    enumclassDimension{
    FitComponent,
    Fixed,
    Fullscreen,
    TerminalOutput,
    };
    Dimensiondimension_=Dimension::Fixed;
    booluse_alternative_screen_=false;
    ScreenInteractive(intdimx,
    intdimy,
    Dimensiondimension,
    booluse_alternative_screen);

    booltrack_mouse_=true;

    Sender<Task>task_sender_;
    Receiver<Task>task_receiver_;

    std::stringset_cursor_position;
    std::stringreset_cursor_position;

    std::atomic<bool>quit_{false};
    std::threadevent_listener_;
    std::threadanimation_listener_;
    boolanimation_requested_=false;
    animation::TimePointprevious_animation_time_;

    intcursor_x_=1;
    intcursor_y_=1;

    boolmouse_captured=false;
    boolprevious_frame_resized_=false;

    boolframe_valid_=false;

    boolforce_handle_ctrl_c_=true;
    boolforce_handle_ctrl_z_=true;

    //Thestyleofthecursortorestoreonexit.
    intcursor_reset_shape_=1;

    //SelectionAPI:
    CapturedMouseselection_pending_;
    structSelectionData{
    intstart_x=-1;
    intstart_y=-1;
    intend_x=-2;
    intend_y=-2;
    boolempty=true;
    booloperator==(constSelectionData&other)const;
    booloperator!=(constSelectionData&other)const;
    };
    SelectionDataselection_data_;
    SelectionDataselection_data_previous_;
    std::unique_ptr<Selection>selection_;
    std::function<void()>selection_on_change_;

    friendclassLoop;

    public:
    classPrivate{
    public:
    staticvoidSignal(ScreenInteractive&s,intsignal){s.Signal(signal);}
    };
    friendPrivate;
    };

    }//namespaceftxui

    #endif/*endofincludeguard:FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP*/