FontFaceBitmap.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // FontFaceBitmap.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Gui
  18. {
  19. /// <summary>
  20. /// Bitmap font face description.
  21. /// </summary>
  22. public unsafe partial class FontFaceBitmap : FontFace
  23. {
  24. unsafe partial void OnFontFaceBitmapCreated ();
  25. [Preserve]
  26. public FontFaceBitmap (IntPtr handle) : base (handle)
  27. {
  28. OnFontFaceBitmapCreated ();
  29. }
  30. [Preserve]
  31. protected FontFaceBitmap (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnFontFaceBitmapCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern IntPtr FontFaceBitmap_FontFaceBitmap (IntPtr font);
  37. [Preserve]
  38. public FontFaceBitmap (Font font) : base (UrhoObjectFlag.Empty)
  39. {
  40. Runtime.Validate (typeof(FontFaceBitmap));
  41. handle = FontFaceBitmap_FontFaceBitmap ((object)font == null ? IntPtr.Zero : font.Handle);
  42. Runtime.RegisterObject (this);
  43. OnFontFaceBitmapCreated ();
  44. }
  45. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  46. internal static extern bool FontFaceBitmap_Load (IntPtr handle, byte* fontData, uint fontDataSize, float pointSize);
  47. /// <summary>
  48. /// Load font face.
  49. /// </summary>
  50. public override bool Load (byte* fontData, uint fontDataSize, float pointSize)
  51. {
  52. Runtime.ValidateRefCounted (this);
  53. return FontFaceBitmap_Load (handle, fontData, fontDataSize, pointSize);
  54. }
  55. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  56. internal static extern bool FontFaceBitmap_Load0 (IntPtr handle, IntPtr fontFace, bool usedGlyphs);
  57. /// <summary>
  58. /// Load from existed font face, pack used glyphs into smallest texture size and smallest number of texture.
  59. /// </summary>
  60. public bool Load (FontFace fontFace, bool usedGlyphs)
  61. {
  62. Runtime.ValidateRefCounted (this);
  63. return FontFaceBitmap_Load0 (handle, (object)fontFace == null ? IntPtr.Zero : fontFace.Handle, usedGlyphs);
  64. }
  65. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  66. internal static extern bool FontFaceBitmap_Save_File (IntPtr handle, IntPtr dest, int pointSize, string indentation);
  67. /// <summary>
  68. /// Save as a new bitmap font type in XML format. Return true if successful.
  69. /// </summary>
  70. public bool Save (File dest, int pointSize, string indentation = "\t")
  71. {
  72. Runtime.ValidateRefCounted (this);
  73. return FontFaceBitmap_Save_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, pointSize, indentation);
  74. }
  75. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  76. internal static extern bool FontFaceBitmap_Save_MemoryBuffer (IntPtr handle, IntPtr dest, int pointSize, string indentation);
  77. /// <summary>
  78. /// Save as a new bitmap font type in XML format. Return true if successful.
  79. /// </summary>
  80. public bool Save (MemoryBuffer dest, int pointSize, string indentation = "\t")
  81. {
  82. Runtime.ValidateRefCounted (this);
  83. return FontFaceBitmap_Save_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, pointSize, indentation);
  84. }
  85. }
  86. }