ObjectAnimation.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // ObjectAnimation.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. /// Object animation class, an object animation include one or more attribute animations and theirs wrap mode and speed for an Animatable object.
  21. /// </summary>
  22. public unsafe partial class ObjectAnimation : Resource
  23. {
  24. public ObjectAnimation (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected ObjectAnimation (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern int ObjectAnimation_GetType (IntPtr handle);
  32. private StringHash UrhoGetType ()
  33. {
  34. Runtime.ValidateRefCounted (this);
  35. return new StringHash (ObjectAnimation_GetType (handle));
  36. }
  37. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  38. internal static extern IntPtr ObjectAnimation_GetTypeName (IntPtr handle);
  39. private string GetTypeName ()
  40. {
  41. Runtime.ValidateRefCounted (this);
  42. return Marshal.PtrToStringAnsi (ObjectAnimation_GetTypeName (handle));
  43. }
  44. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  45. internal static extern int ObjectAnimation_GetTypeStatic ();
  46. private static StringHash GetTypeStatic ()
  47. {
  48. Runtime.Validate (typeof(ObjectAnimation));
  49. return new StringHash (ObjectAnimation_GetTypeStatic ());
  50. }
  51. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  52. internal static extern IntPtr ObjectAnimation_GetTypeNameStatic ();
  53. private static string GetTypeNameStatic ()
  54. {
  55. Runtime.Validate (typeof(ObjectAnimation));
  56. return Marshal.PtrToStringAnsi (ObjectAnimation_GetTypeNameStatic ());
  57. }
  58. public ObjectAnimation () : this (Application.CurrentContext)
  59. {
  60. }
  61. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  62. internal static extern IntPtr ObjectAnimation_ObjectAnimation (IntPtr context);
  63. public ObjectAnimation (Context context) : base (UrhoObjectFlag.Empty)
  64. {
  65. Runtime.Validate (typeof(ObjectAnimation));
  66. handle = ObjectAnimation_ObjectAnimation ((object)context == null ? IntPtr.Zero : context.Handle);
  67. Runtime.RegisterObject (this);
  68. }
  69. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  70. internal static extern void ObjectAnimation_RegisterObject (IntPtr context);
  71. /// <summary>
  72. /// Register object factory.
  73. /// </summary>
  74. public static void RegisterObject (Context context)
  75. {
  76. Runtime.Validate (typeof(ObjectAnimation));
  77. ObjectAnimation_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  78. }
  79. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  80. internal static extern bool ObjectAnimation_BeginLoad_File (IntPtr handle, IntPtr source);
  81. /// <summary>
  82. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  83. /// </summary>
  84. public override bool BeginLoad (File source)
  85. {
  86. Runtime.ValidateRefCounted (this);
  87. return ObjectAnimation_BeginLoad_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  88. }
  89. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  90. internal static extern bool ObjectAnimation_BeginLoad_MemoryBuffer (IntPtr handle, IntPtr source);
  91. /// <summary>
  92. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  93. /// </summary>
  94. public override bool BeginLoad (MemoryBuffer source)
  95. {
  96. Runtime.ValidateRefCounted (this);
  97. return ObjectAnimation_BeginLoad_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  98. }
  99. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  100. internal static extern bool ObjectAnimation_Save_File (IntPtr handle, IntPtr dest);
  101. /// <summary>
  102. /// Save resource. Return true if successful.
  103. /// </summary>
  104. public override bool Save (File dest)
  105. {
  106. Runtime.ValidateRefCounted (this);
  107. return ObjectAnimation_Save_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  108. }
  109. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  110. internal static extern bool ObjectAnimation_Save_MemoryBuffer (IntPtr handle, IntPtr dest);
  111. /// <summary>
  112. /// Save resource. Return true if successful.
  113. /// </summary>
  114. public override bool Save (MemoryBuffer dest)
  115. {
  116. Runtime.ValidateRefCounted (this);
  117. return ObjectAnimation_Save_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  118. }
  119. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  120. internal static extern bool ObjectAnimation_LoadXML (IntPtr handle, ref Urho.Resources.XmlElement source);
  121. /// <summary>
  122. /// Load from XML data. Return true if successful.
  123. /// </summary>
  124. public bool LoadXml (Urho.Resources.XmlElement source)
  125. {
  126. Runtime.ValidateRefCounted (this);
  127. return ObjectAnimation_LoadXML (handle, ref source);
  128. }
  129. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  130. internal static extern bool ObjectAnimation_SaveXML (IntPtr handle, ref Urho.Resources.XmlElement dest);
  131. /// <summary>
  132. /// Save as XML data. Return true if successful.
  133. /// </summary>
  134. public bool SaveXml (Urho.Resources.XmlElement dest)
  135. {
  136. Runtime.ValidateRefCounted (this);
  137. return ObjectAnimation_SaveXML (handle, ref dest);
  138. }
  139. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  140. internal static extern void ObjectAnimation_AddAttributeAnimation (IntPtr handle, string name, IntPtr attributeAnimation, WrapMode wrapMode, float speed);
  141. /// <summary>
  142. /// Add attribute animation, attribute name can in following format: "attribute" or "#0/#1/attribute" or ""#0/#1/
  143. /// #1/attribute.
  144. /// </summary>
  145. public void AddAttributeAnimation (string name, ValueAnimation attributeAnimation, WrapMode wrapMode, float speed)
  146. {
  147. Runtime.ValidateRefCounted (this);
  148. ObjectAnimation_AddAttributeAnimation (handle, name, (object)attributeAnimation == null ? IntPtr.Zero : attributeAnimation.Handle, wrapMode, speed);
  149. }
  150. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  151. internal static extern void ObjectAnimation_RemoveAttributeAnimation (IntPtr handle, string name);
  152. /// <summary>
  153. /// Remove attribute animation, attribute name can in following format: "attribute" or "#0/#1/attribute" or ""#0/#1/
  154. /// #1/attribute.
  155. /// </summary>
  156. public void RemoveAttributeAnimation (string name)
  157. {
  158. Runtime.ValidateRefCounted (this);
  159. ObjectAnimation_RemoveAttributeAnimation (handle, name);
  160. }
  161. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  162. internal static extern void ObjectAnimation_RemoveAttributeAnimation0 (IntPtr handle, IntPtr attributeAnimation);
  163. /// <summary>
  164. /// Remove attribute animation.
  165. /// </summary>
  166. public void RemoveAttributeAnimation (ValueAnimation attributeAnimation)
  167. {
  168. Runtime.ValidateRefCounted (this);
  169. ObjectAnimation_RemoveAttributeAnimation0 (handle, (object)attributeAnimation == null ? IntPtr.Zero : attributeAnimation.Handle);
  170. }
  171. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  172. internal static extern IntPtr ObjectAnimation_GetAttributeAnimation (IntPtr handle, string name);
  173. /// <summary>
  174. /// Return attribute animation by name.
  175. /// </summary>
  176. public ValueAnimation GetAttributeAnimation (string name)
  177. {
  178. Runtime.ValidateRefCounted (this);
  179. return Runtime.LookupObject<ValueAnimation> (ObjectAnimation_GetAttributeAnimation (handle, name));
  180. }
  181. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  182. internal static extern WrapMode ObjectAnimation_GetAttributeAnimationWrapMode (IntPtr handle, string name);
  183. /// <summary>
  184. /// Return attribute animation wrap mode by name.
  185. /// </summary>
  186. public WrapMode GetAttributeAnimationWrapMode (string name)
  187. {
  188. Runtime.ValidateRefCounted (this);
  189. return ObjectAnimation_GetAttributeAnimationWrapMode (handle, name);
  190. }
  191. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  192. internal static extern float ObjectAnimation_GetAttributeAnimationSpeed (IntPtr handle, string name);
  193. /// <summary>
  194. /// Return attribute animation speed by name.
  195. /// </summary>
  196. public float GetAttributeAnimationSpeed (string name)
  197. {
  198. Runtime.ValidateRefCounted (this);
  199. return ObjectAnimation_GetAttributeAnimationSpeed (handle, name);
  200. }
  201. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  202. internal static extern IntPtr ObjectAnimation_GetAttributeAnimationInfo (IntPtr handle, string name);
  203. /// <summary>
  204. /// Return attribute animation info by name.
  205. /// </summary>
  206. public ValueAnimationInfo GetAttributeAnimationInfo (string name)
  207. {
  208. Runtime.ValidateRefCounted (this);
  209. return Runtime.LookupRefCounted<ValueAnimationInfo> (ObjectAnimation_GetAttributeAnimationInfo (handle, name));
  210. }
  211. public override StringHash Type {
  212. get {
  213. return UrhoGetType ();
  214. }
  215. }
  216. public override string TypeName {
  217. get {
  218. return GetTypeName ();
  219. }
  220. }
  221. public new static StringHash TypeStatic {
  222. get {
  223. return GetTypeStatic ();
  224. }
  225. }
  226. public new static string TypeNameStatic {
  227. get {
  228. return GetTypeNameStatic ();
  229. }
  230. }
  231. }
  232. }