From 62fbb6b6a97eed463b394c355766e2284d77d328 Mon Sep 17 00:00:00 2001 From: TimonPost Date: Fri, 22 Jun 2018 21:04:30 +0200 Subject: [PATCH] added unix cursor hide show, fixed windows and added alternate screen functionality. Also refactored and cleaned up code.: --- .idea/workspace.xml | 814 +++++++++--------- .../bin.rs | 5 +- .../color/mod.rs | 14 +- .../cursor/mod.rs | 16 +- .../terminal/alternate_screen.rs | 20 +- .../terminal/raw_mode.rs | 13 +- .../terminal/terminal.rs | 28 +- src/cursor/ansi_cursor.rs | 59 +- src/cursor/cursor.rs | 96 ++- src/cursor/mod.rs | 23 +- src/cursor/winapi_cursor.rs | 44 +- src/kernel/windows_kernel/ansi_support.rs | 25 +- src/kernel/windows_kernel/cursor.rs | 2 +- src/kernel/windows_kernel/kernel.rs | 51 +- src/lib.rs | 1 + src/manager/ansi_manager.rs | 34 +- src/manager/manager.rs | 46 +- src/manager/mod.rs | 16 +- src/manager/win_manager.rs | 56 +- src/shared/functions.rs | 7 +- src/shared/raw.rs | 32 +- src/shared/screen.rs | 74 +- src/state/command_manager.rs | 12 +- src/state/commands/mod.rs | 14 +- src/state/commands/shared_commands.rs | 33 +- src/state/commands/unix_command.rs | 8 +- src/state/commands/win_commands.rs | 79 +- src/state/context.rs | 48 +- src/state/state_manager.rs | 6 +- src/style/color/color.rs | 6 +- src/style/styles/objectstyle.rs | 8 +- src/style/styles/styledobject.rs | 29 +- src/terminal/ansi_terminal.rs | 45 +- src/terminal/mod.rs | 11 +- src/terminal/terminal.rs | 33 +- src/terminal/winapi_terminal.rs | 49 +- 36 files changed, 1014 insertions(+), 843 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4be070b..34650e9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,22 +3,39 @@ + + + + + + + + + + + + + + + + - + + @@ -31,20 +48,20 @@ - - + + - - + + - - + + - - + + @@ -52,87 +69,79 @@ - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + - - + + - - + + + + + + + + + + + + + + + @@ -148,36 +157,36 @@ - self. - output - std - stdout - 'terminal - &Terminal - &self.term - HANDLE - command - End - termina - screen - colored_terminal - ObjectStyle - changed_states - state - context - Context TerminalColor conte terminal_cursor term ScreenManager color - terminal cursor( IStateCommand execute - get_to_alternate_screen_command functions + set + cursor_vis + write + ToAlternateScreenBufferCommand + new + terminal + ICommand + Write + StyledObject + get_to_alternate_screen_command + &context + cursor + context + data + Mutex + WriteConsoleOutputW + CONSOLE_CURSOR_INFO + use + Borrow + fmt crossterm_cursor @@ -186,11 +195,13 @@ &Context Terminal context + context.clone() D:\Windows\GIT\crossterm\src D:\Windows\GIT\crossterm $PROJECT_DIR$/src + C:\Users\Timon\Documents\Programming\rust\crossterm\src @@ -204,52 +215,52 @@ @@ -263,10 +274,10 @@ - @@ -289,6 +300,7 @@ + @@ -307,6 +319,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -386,9 +419,8 @@