aboutsummaryrefslogtreecommitdiff
path: root/tui.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2023-09-15 02:24:05 +0100
committerdam <dam@gudinoff>2023-09-15 02:24:05 +0100
commitee1a68abb41ec7d0f76b458b5340d08a3f881a2b (patch)
tree4308ed1e8bb3c47ad9246145d00341d0d220563e /tui.jai
parent7469ce1ab6c761e81334b918a34972fedba0923e (diff)
downloadtask-time-tracker-ee1a68abb41ec7d0f76b458b5340d08a3f881a2b.tar.zst
task-time-tracker-ee1a68abb41ec7d0f76b458b5340d08a3f881a2b.zip
Added QueryWindowSizeInChars to tui.jai.
Diffstat (limited to 'tui.jai')
-rw-r--r--tui.jai24
1 files changed, 20 insertions, 4 deletions
diff --git a/tui.jai b/tui.jai
index a0eb025..3c868ee 100644
--- a/tui.jai
+++ b/tui.jai
@@ -12,6 +12,16 @@ Drawings :: struct {
TeeB :: "\x76";
TeeT :: "\x77";
LineV :: "\x78";
+
+ Blank :: "\x5F";
+ Diamond :: "\x60";
+ Checkerboard :: "\x61";
+ PlusMinus :: "\x67";
+ LessThanOrEqual :: "\x79";
+ GreaterThanOrEqual :: "\x7A";
+ Pi :: "\x7B";
+ NotEqual :: "\x7C";
+ CenteredDot :: "\x7E";
}
Commands :: struct {
@@ -21,6 +31,11 @@ Commands :: struct {
EnterDrawingMode :: "\e(0";
EnterNormalMode :: "\e(B";
ClearScreen :: "\e[2J";
+ ClearLine :: "\e[2K";
+
+ RefreshWindow :: "\e[7t"; // TODO Not yet tested.
+
+ SetUTF8 :: "\e%G"; // TODO TEST ME PLEASE
// Cursor Visibility
ShowCursor :: "\e[?25h";
@@ -44,21 +59,22 @@ Commands :: struct {
CursorNormalMode :: "\e[?1l";
// Query State
- QueryCursorPos :: "\e[6n"; // Emits the cursor position as: ESC [ <r> ; <c> R Where <r> = row and <c> = column.
+ QueryCursorPosition :: "\e[6n"; // Emits the cursor position as: "ESC [ <r> ; <c> R" Where <r> = row and <c> = column.
QueryDeviceAttributes :: "\e[0c";
+ QueryWindowSizeInChars :: "\e[18t"; // Emits the window size as: "ESC [ 8 <r> ; <c> t" Where <r> = row and <c> = column.
+
}
start :: () {
- write_string(Commands.EnterAlternateBuffer);
+ write_strings(Commands.EnterAlternateBuffer, Commands.SetUTF8, Commands.HideCursor);
}
stop :: () {
- write_string(Commands.EnterMainBuffer);
+ write_strings(Commands.EnterMainBuffer, Commands.ShowCursor);
}
draw_box :: (x: int, y: int, width: int, height: int, to_standard_error := false) {
- write_string(Commands.HideCursor);
write_strings(
// Commands.EnterNormalMode,
Commands.EnterDrawingMode,