ObjectAnimation.cs 9.7 KB

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