Application.Driver.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #nullable enable
  2. namespace Terminal.Gui.App;
  3. public static partial class Application // Driver abstractions
  4. {
  5. internal static bool _forceFakeConsole;
  6. // TODO: Add to IApplication
  7. /// <summary>Gets the <see cref="IConsoleDriver"/> that has been selected. See also <see cref="ForceDriver"/>.</summary>
  8. public static IConsoleDriver? Driver
  9. {
  10. get => ApplicationImpl.Instance.Driver;
  11. internal set => ApplicationImpl.Instance.Driver = value;
  12. }
  13. // TODO: Add to IApplication
  14. // BUGBUG: Force16Colors should be nullable.
  15. /// <summary>
  16. /// Gets or sets whether <see cref="Application.Driver"/> will be forced to output only the 16 colors defined in
  17. /// <see cref="ColorName16"/>. The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output
  18. /// as long as the selected <see cref="IConsoleDriver"/> supports TrueColor.
  19. /// </summary>
  20. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  21. public static bool Force16Colors { get; set; }
  22. // TODO: Add to IApplication
  23. // BUGBUG: ForceDriver should be nullable.
  24. /// <summary>
  25. /// Forces the use of the specified driver (one of "fake", "dotnet", "windows", or "unix"). If not
  26. /// specified, the driver is selected based on the platform.
  27. /// </summary>
  28. /// <remarks>
  29. /// Note, <see cref="Application.Init(IConsoleDriver, string)"/> will override this configuration setting if called
  30. /// with either `driver` or `driverName` specified.
  31. /// </remarks>
  32. [ConfigurationProperty (Scope = typeof (SettingsScope))]
  33. public static string ForceDriver { get; set; } = string.Empty;
  34. // TODO: Add to IApplication
  35. /// <summary>
  36. /// Collection of sixel images to write out to screen when updating.
  37. /// Only add to this collection if you are sure terminal supports sixel format.
  38. /// </summary>
  39. public static List<SixelToRender> Sixel { get; } = new List<SixelToRender> ();
  40. }