IOutput.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. namespace Terminal.Gui.Drivers;
  2. /// <summary>
  3. /// The low-level interface drivers implement to provide output capabilities; encapsulates platform-specific
  4. /// output functionality.
  5. /// </summary>
  6. public interface IOutput : IDisposable
  7. {
  8. /// <summary>
  9. /// Gets the current position of the console cursor.
  10. /// </summary>
  11. /// <returns></returns>
  12. Point GetCursorPosition ();
  13. /// <summary>
  14. /// Returns the current size of the console in rows/columns (i.e.
  15. /// of characters not pixels).
  16. /// </summary>
  17. /// <returns></returns>
  18. public Size GetSize ();
  19. /// <summary>
  20. /// Moves the console cursor to the given location.
  21. /// </summary>
  22. /// <param name="col"></param>
  23. /// <param name="row"></param>
  24. void SetCursorPosition (int col, int row);
  25. /// <summary>
  26. /// Updates the console cursor (the blinking underscore) to be hidden,
  27. /// visible etc.
  28. /// </summary>
  29. /// <param name="visibility"></param>
  30. void SetCursorVisibility (CursorVisibility visibility);
  31. /// <summary>
  32. /// Sets the size of the console.
  33. /// </summary>
  34. /// <param name="width"></param>
  35. /// <param name="height"></param>
  36. void SetSize (int width, int height);
  37. /// <summary>
  38. /// Writes the given text directly to the console. Use to send
  39. /// ansi escape codes etc. Regular screen output should use the
  40. /// <see cref="IOutputBuffer"/> overload.
  41. /// </summary>
  42. /// <param name="text"></param>
  43. void Write (ReadOnlySpan<char> text);
  44. /// <summary>
  45. /// Write the contents of the <paramref name="buffer"/> to the console
  46. /// </summary>
  47. /// <param name="buffer"></param>
  48. void Write (IOutputBuffer buffer);
  49. }