ObjectFactory.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // ObjectFactory.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
  18. {
  19. /// <summary>
  20. /// Base class for object factories.
  21. /// </summary>
  22. public unsafe partial class ObjectFactory : RefCounted
  23. {
  24. public ObjectFactory (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected ObjectFactory (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern IntPtr ObjectFactory_CreateObject (IntPtr handle);
  32. /// <summary>
  33. /// Create an object. Implemented in templated subclasses.
  34. /// </summary>
  35. public UrhoObject CreateObject ()
  36. {
  37. Runtime.ValidateRefCounted (this);
  38. return Runtime.LookupRefCounted<UrhoObject> (ObjectFactory_CreateObject (handle));
  39. }
  40. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  41. internal static extern IntPtr ObjectFactory_GetContext (IntPtr handle);
  42. /// <summary>
  43. /// Return execution context.
  44. /// </summary>
  45. private Context GetContext ()
  46. {
  47. return Runtime.LookupRefCounted<Context> (ObjectFactory_GetContext (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern TypeInfo* ObjectFactory_GetTypeInfo (IntPtr handle);
  51. /// <summary>
  52. /// Return type info of objects created by this factory.
  53. /// </summary>
  54. private TypeInfo* GetTypeInfo ()
  55. {
  56. Runtime.ValidateRefCounted (this);
  57. return ObjectFactory_GetTypeInfo (handle);
  58. }
  59. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  60. internal static extern int ObjectFactory_GetType (IntPtr handle);
  61. /// <summary>
  62. /// Return type hash of objects created by this factory.
  63. /// </summary>
  64. private StringHash UrhoGetType ()
  65. {
  66. Runtime.ValidateRefCounted (this);
  67. return new StringHash (ObjectFactory_GetType (handle));
  68. }
  69. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  70. internal static extern IntPtr ObjectFactory_GetTypeName (IntPtr handle);
  71. /// <summary>
  72. /// Return type name of objects created by this factory.
  73. /// </summary>
  74. private string GetTypeName ()
  75. {
  76. Runtime.ValidateRefCounted (this);
  77. return Marshal.PtrToStringAnsi (ObjectFactory_GetTypeName (handle));
  78. }
  79. /// <summary>
  80. /// Return execution context.
  81. /// </summary>
  82. public Context Context {
  83. get {
  84. return GetContext ();
  85. }
  86. }
  87. /// <summary>
  88. /// Return type info of objects created by this factory.
  89. /// </summary>
  90. public TypeInfo* TypeInfo {
  91. get {
  92. return GetTypeInfo ();
  93. }
  94. }
  95. /// <summary>
  96. /// Return type hash of objects created by this factory.
  97. /// </summary>
  98. public StringHash Type {
  99. get {
  100. return UrhoGetType ();
  101. }
  102. }
  103. /// <summary>
  104. /// Return type name of objects created by this factory.
  105. /// </summary>
  106. public string TypeName {
  107. get {
  108. return GetTypeName ();
  109. }
  110. }
  111. }
  112. }