diff options
Diffstat (limited to 'src/zenutil/consoletui.cpp')
| -rw-r--r-- | src/zenutil/consoletui.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/zenutil/consoletui.cpp b/src/zenutil/consoletui.cpp index 4410d463d..124132aed 100644 --- a/src/zenutil/consoletui.cpp +++ b/src/zenutil/consoletui.cpp @@ -480,4 +480,69 @@ TuiPollQuit() #endif } +void +TuiSetScrollRegion(uint32_t Top, uint32_t Bottom) +{ + printf("\033[%u;%ur", Top, Bottom); +} + +void +TuiResetScrollRegion() +{ + printf("\033[r"); +} + +void +TuiMoveCursor(uint32_t Row, uint32_t Col) +{ + printf("\033[%u;%uH", Row, Col); +} + +void +TuiSaveCursor() +{ + printf( + "\033" + "7"); +} + +void +TuiRestoreCursor() +{ + printf( + "\033" + "8"); +} + +void +TuiEraseLine() +{ + printf("\033[2K"); +} + +void +TuiWrite(std::string_view Text) +{ + fwrite(Text.data(), 1, Text.size(), stdout); +} + +void +TuiFlush() +{ + fflush(stdout); +} + +void +TuiShowCursor(bool Show) +{ + if (Show) + { + printf("\033[?25h"); + } + else + { + printf("\033[?25l"); + } +} + } // namespace zen |