IPlatformRenderInterface.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using Avalonia.Media;
  6. namespace Avalonia.Platform
  7. {
  8. /// <summary>
  9. /// Defines the main platform-specific interface for the rendering subsystem.
  10. /// </summary>
  11. public interface IPlatformRenderInterface
  12. {
  13. /// <summary>
  14. /// Creates a formatted text implementation.
  15. /// </summary>
  16. /// <param name="text">The text.</param>
  17. /// <param name="fontFamilyName">The font family.</param>
  18. /// <param name="fontSize">The font size.</param>
  19. /// <param name="fontStyle">The font style.</param>
  20. /// <param name="textAlignment">The text alignment.</param>
  21. /// <param name="fontWeight">The font weight.</param>
  22. /// <param name="wrapping">The text wrapping mode.</param>
  23. /// <returns>An <see cref="IFormattedTextImpl"/>.</returns>
  24. IFormattedTextImpl CreateFormattedText(
  25. string text,
  26. string fontFamilyName,
  27. double fontSize,
  28. FontStyle fontStyle,
  29. TextAlignment textAlignment,
  30. FontWeight fontWeight,
  31. TextWrapping wrapping);
  32. /// <summary>
  33. /// Creates a stream geometry implementation.
  34. /// </summary>
  35. /// <returns>An <see cref="IStreamGeometryImpl"/>.</returns>
  36. IStreamGeometryImpl CreateStreamGeometry();
  37. /// <summary>
  38. /// Creates a renderer.
  39. /// </summary>
  40. /// <param name="surfaces">
  41. /// The list of native platform surfaces that can be used for output.
  42. /// </param>
  43. /// <returns>An <see cref="IRenderTarget"/>.</returns>
  44. IRenderTarget CreateRenderTarget(IEnumerable<object> surfaces);
  45. /// <summary>
  46. /// Creates a render target bitmap implementation.
  47. /// </summary>
  48. /// <param name="width">The width of the bitmap.</param>
  49. /// <param name="height">The height of the bitmap.</param>
  50. /// <returns>An <see cref="IRenderTargetBitmapImpl"/>.</returns>
  51. IRenderTargetBitmapImpl CreateRenderTargetBitmap(int width, int height);
  52. /// <summary>
  53. /// Loads a bitmap implementation from a file..
  54. /// </summary>
  55. /// <param name="fileName">The filename of the bitmap.</param>
  56. /// <returns>An <see cref="IBitmapImpl"/>.</returns>
  57. IBitmapImpl LoadBitmap(string fileName);
  58. /// <summary>
  59. /// Loads a bitmap implementation from a file..
  60. /// </summary>
  61. /// <param name="stream">The stream to read the bitmap from.</param>
  62. /// <returns>An <see cref="IBitmapImpl"/>.</returns>
  63. IBitmapImpl LoadBitmap(Stream stream);
  64. }
  65. }