public FormRenderer(IConsoleDriver consoleDriver, bool cursorVisible = true) { _consoleDriver = consoleDriver; _cursorVisible = cursorVisible; _offscreenBuffer = new OffscreenBuffer(_consoleDriver); }
static ConsoleDriver() { // Put the actual new statements into separate methods to avoid initalizing // three classes when only one is needed. if (!IsConsole) { driver = CreateNullConsoleDriver(); } else if (Environment.IsRunningOnWindows) { driver = CreateWindowsConsoleDriver(); } else { string term = Environment.GetEnvironmentVariable("TERM"); // Perhaps we should let the Terminfo driver return a // success/failure flag based on the terminal properties if (term == "dumb") { is_console = false; driver = CreateNullConsoleDriver(); } else { driver = CreateTermInfoDriver(term); } } }
public static TPage StartWith <TPage>(IConsoleDriver driver) where TPage : Page, new() { return(new TPage { Driver = driver }); }
public void Flush(IConsoleDriver consoleDriver) { var idx = 0; for (var row = 0; row < Height; row++) { var span = 1; var spanning = false; var spanCol = 0; for (var col = 0; col < Width; col++) { var next = col < Width - 1 ? _buffer[idx + 1] : null; var cc = _buffer[idx]; if (spanning || _dirtyMap[idx] != DirtyStatus.Clean) { if (cc.Equals(next)) { span++; spanning = true; } else { consoleDriver.WriteCharactersAt(spanCol, row, span, cc.Character, cc.Attributes); span = 1; spanning = false; spanCol = col + 1; } } else { spanCol++; } _dirtyMap[idx] = DirtyStatus.Clean; idx++; } } if (Cursor.ActionPending == VirtualConsoleCursorAction.Show) { consoleDriver.SetCursorVisibility(isVisible: true); Cursor.VisibilityChanged(isVisible: true); } if (Cursor.MovementPending) { consoleDriver.SetCursorAt(Cursor.Position.Left, Cursor.Position.Top); Cursor.MovementPending = false; } else if (Cursor.ActionPending == VirtualConsoleCursorAction.Hide) { consoleDriver.SetCursorVisibility(isVisible: false); Cursor.VisibilityChanged(isVisible: false); } IsDirty = false; }
public RenderScope(OffscreenBuffer offscreenBuffer, IConsoleDriver consoleDriver, int cursorBottom, int writtenLineCount) { _offscreenBuffer = offscreenBuffer; _consoleDriver = consoleDriver; _cursorBottom = cursorBottom; _writtenLineCount = writtenLineCount; _offscreenBuffer.ClearBuffer(); }
public PageTests() { capture = Substitute.For <ICaptureOutput>(); driver = Substitute.For <IConsoleDriver>(); driver .Output .Returns(capture); driver .Keyboard .Returns(Substitute.For <IKeyboardSimulator>()); }
public static IConsoleDriver SetDriver ( [NotNull] IConsoleDriver driver ) { Code.NotNull(driver, "driver"); IConsoleDriver previousDriver = _driver; _driver = driver; return(previousDriver); }
static ConsoleDriver() { if (!IsConsole) { driver = new NullConsoleDriver(); } else if (Environment.IsRunningOnWindows) { driver = new WindowsConsoleDriver(); } else { driver = new TermInfoDriver(Environment.GetEnvironmentVariable("TERM")); } }
public static void Initialize(bool alreadyActive) { if (PlatformHelper.Is(Platform.MacOS) || PlatformHelper.Is(Platform.Linux)) { Driver = new LinuxConsoleDriver(); } else if (PlatformHelper.Is(Platform.Windows)) { Driver = new WindowsConsoleDriver(); } else { throw new PlatformNotSupportedException("Was unable to determine console driver for platform " + PlatformHelper.Current); } Driver.Initialize(alreadyActive); }
static ConsoleDriver () { // Put the actual new statements into separate methods to avoid initalizing // three classes when only one is needed. if (!IsConsole) { driver = CreateNullConsoleDriver (); } else if (Environment.IsRunningOnWindows) { driver = CreateWindowsConsoleDriver (); } else { string term = Environment.GetEnvironmentVariable ("TERM"); // Perhaps we should let the Terminfo driver return a // success/failure flag based on the terminal properties if (term == "dumb"){ is_console = false; driver = CreateNullConsoleDriver (); } else driver = CreateTermInfoDriver (term); } }
public static void Initialize(bool alreadyActive) { switch (Utility.CurrentOs) { case Platform.MacOS: case Platform.Linux: { Driver = new LinuxConsoleDriver(); break; } case Platform.Windows: { Driver = new WindowsConsoleDriver(); break; } } Driver.Initialize(alreadyActive); }
public EventPumper(IConsoleDriver console) => _console = console;
public ScreenBuffer(IConsoleDriver consoleDriver) { _consoleDriver = consoleDriver; }
ITvision2Options ITvision2Options.UseConsoleDriver(IConsoleDriver driverToUse) { ConsoleDriver = driverToUse; return(this); }
public WindowResizedHook(IConsoleDriver driver) { _driver = driver; }
public OffscreenBuffer(IConsoleDriver consoleDriver) { _consoleDriver = consoleDriver; _cursorBottom = _consoleDriver.CursorTop; }
public static TPage StartWith <TPage>(this IConsoleDriver driver) where TPage : Page, new() { return(Page.StartWith <TPage>(driver)); }
public static IConsoleDriver Sleep(this IConsoleDriver driver, int milliseconds) { Thread.Sleep(milliseconds); return(driver); }
public ViewportFactory(IConsoleDriver console) { _console = console; }
public FormRenderer(IConsoleDriver consoleDriver) { _offscreenBuffer = new OffscreenBuffer(consoleDriver); }