Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
ftxui_app.h
Go to the documentation of this file.
1
22
23#pragma once
24
25#include <cstddef>
26#include <cstdint>
27#include <functional>
28#include <memory>
29#include <string>
30#include <vector>
31
33
34namespace contur {
35
38 {
40 std::uint32_t defaultIntervalMs = 300;
41
43 std::size_t defaultStep = 1;
44
46 std::uint32_t frameIntervalMs = 33;
47
49 std::uint32_t minIntervalMs = 50;
50
52 std::uint32_t maxIntervalMs = 2000;
53
55 std::function<std::vector<std::string>()> logProvider;
56 };
57
61 class FtxuiApp final
62 {
63 public:
67 explicit FtxuiApp(ITuiController &controller, FtxuiAppConfig config = {});
68
70
71 FtxuiApp(const FtxuiApp &) = delete;
72 FtxuiApp &operator=(const FtxuiApp &) = delete;
73
74 FtxuiApp(FtxuiApp &&) noexcept;
75 FtxuiApp &operator=(FtxuiApp &&) noexcept;
76
78 void run();
79
80 private:
81 struct Impl;
82 std::unique_ptr<Impl> impl_;
83 };
84
85} // namespace contur
FtxuiApp & operator=(const FtxuiApp &)=delete
FtxuiApp(const FtxuiApp &)=delete
std::unique_ptr< Impl > impl_
Definition ftxui_app.h:82
FtxuiApp(FtxuiApp &&) noexcept
FtxuiApp(ITuiController &controller, FtxuiAppConfig config={})
Constructs the app bound to an existing controller.
void run()
Starts the interactive event loop. Blocks until the user quits.
TUI controller interface for command/state orchestration.
TUI controller contracts and default controller implementation.
Definition block.h:15
Configuration for FtxuiApp behaviour.
Definition ftxui_app.h:38
std::uint32_t frameIntervalMs
UI frame refresh rate in milliseconds (~30 fps).
Definition ftxui_app.h:46
std::uint32_t minIntervalMs
Minimum autoplay interval (fastest speed).
Definition ftxui_app.h:49
std::function< std::vector< std::string >()> logProvider
Optional callback returning formatted kernel log lines.
Definition ftxui_app.h:55
std::uint32_t maxIntervalMs
Maximum autoplay interval (slowest speed).
Definition ftxui_app.h:52
std::size_t defaultStep
Kernel ticks advanced per autoplay step.
Definition ftxui_app.h:43
std::uint32_t defaultIntervalMs
Autoplay interval used when [Space] is pressed to start play.
Definition ftxui_app.h:40