ObjectFactory.cs 3.3 KB

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