ITextRenderer.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #nullable enable
  2. namespace Terminal.Gui.Text;
  3. /// <summary>
  4. /// Interface for rendering formatted text to the console.
  5. /// </summary>
  6. public interface ITextRenderer
  7. {
  8. /// <summary>
  9. /// Draws the formatted text to the console driver.
  10. /// </summary>
  11. /// <param name="formattedText">The formatted text to draw.</param>
  12. /// <param name="screen">The screen bounds for drawing.</param>
  13. /// <param name="normalColor">The color for normal text.</param>
  14. /// <param name="hotColor">The color for HotKey text.</param>
  15. /// <param name="fillRemaining">Whether to fill remaining area with spaces.</param>
  16. /// <param name="maximum">The maximum container bounds.</param>
  17. /// <param name="driver">The console driver to use for drawing.</param>
  18. void Draw(
  19. FormattedText formattedText,
  20. Rectangle screen,
  21. Attribute normalColor,
  22. Attribute hotColor,
  23. bool fillRemaining = false,
  24. Rectangle maximum = default,
  25. IConsoleDriver? driver = null);
  26. /// <summary>
  27. /// Gets the region that would be drawn by the formatted text.
  28. /// </summary>
  29. /// <param name="formattedText">The formatted text.</param>
  30. /// <param name="screen">The screen bounds.</param>
  31. /// <param name="maximum">The maximum container bounds.</param>
  32. /// <returns>A region representing the areas that would be drawn.</returns>
  33. Region GetDrawRegion(
  34. FormattedText formattedText,
  35. Rectangle screen,
  36. Rectangle maximum = default);
  37. }