Application.Driver.cs 1.9 KB

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