ValueAnimation.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // ValueAnimation.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. /// Value animation class.
  21. /// </summary>
  22. public unsafe partial class ValueAnimation : Resource
  23. {
  24. unsafe partial void OnValueAnimationCreated ();
  25. [Preserve]
  26. public ValueAnimation (IntPtr handle) : base (handle)
  27. {
  28. OnValueAnimationCreated ();
  29. }
  30. [Preserve]
  31. protected ValueAnimation (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnValueAnimationCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int ValueAnimation_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (ValueAnimation_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr ValueAnimation_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (ValueAnimation_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int ValueAnimation_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(ValueAnimation));
  54. return new StringHash (ValueAnimation_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr ValueAnimation_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(ValueAnimation));
  61. return Marshal.PtrToStringAnsi (ValueAnimation_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public ValueAnimation () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr ValueAnimation_ValueAnimation (IntPtr context);
  69. [Preserve]
  70. public ValueAnimation (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(ValueAnimation));
  73. handle = ValueAnimation_ValueAnimation ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnValueAnimationCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void ValueAnimation_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(ValueAnimation));
  85. ValueAnimation_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern bool ValueAnimation_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 ValueAnimation_BeginLoad_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern bool ValueAnimation_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 ValueAnimation_BeginLoad_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool ValueAnimation_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 ValueAnimation_Save_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern bool ValueAnimation_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 ValueAnimation_Save_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool ValueAnimation_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 ValueAnimation_LoadXML (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern bool ValueAnimation_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 ValueAnimation_SaveXML (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void ValueAnimation_SetOwner (IntPtr handle, IntPtr owner);
  149. /// <summary>
  150. /// Set owner.
  151. /// </summary>
  152. private void SetOwner (IntPtr owner)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. ValueAnimation_SetOwner (handle, owner);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void ValueAnimation_SetInterpolationMethod (IntPtr handle, InterpMethod method);
  159. /// <summary>
  160. /// Set interpolation method.
  161. /// </summary>
  162. private void SetInterpolationMethod (InterpMethod method)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. ValueAnimation_SetInterpolationMethod (handle, method);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void ValueAnimation_SetSplineTension (IntPtr handle, float tension);
  169. /// <summary>
  170. /// Set spline tension, should be between 0.0f and 1.0f, but this is not a must.
  171. /// </summary>
  172. private void SetSplineTension (float tension)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. ValueAnimation_SetSplineTension (handle, tension);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void ValueAnimation_SetValueType (IntPtr handle, VariantType valueType);
  179. /// <summary>
  180. /// Set value type.
  181. /// </summary>
  182. private void SetValueType (VariantType valueType)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. ValueAnimation_SetValueType (handle, valueType);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern bool ValueAnimation_SetKeyFrame_0 (IntPtr handle, float time, ref Vector3 value);
  189. /// <summary>
  190. /// Set key frame.
  191. /// </summary>
  192. public bool SetKeyFrame (float time, Vector3 value)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return ValueAnimation_SetKeyFrame_0 (handle, time, ref value);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern bool ValueAnimation_SetKeyFrame_1 (IntPtr handle, float time, ref IntRect value);
  199. /// <summary>
  200. /// Set key frame.
  201. /// </summary>
  202. public bool SetKeyFrame (float time, IntRect value)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return ValueAnimation_SetKeyFrame_1 (handle, time, ref value);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern bool ValueAnimation_SetKeyFrame_2 (IntPtr handle, float time, ref Color value);
  209. /// <summary>
  210. /// Set key frame.
  211. /// </summary>
  212. public bool SetKeyFrame (float time, Color value)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return ValueAnimation_SetKeyFrame_2 (handle, time, ref value);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern bool ValueAnimation_SetKeyFrame_3 (IntPtr handle, float time, ref Vector2 value);
  219. /// <summary>
  220. /// Set key frame.
  221. /// </summary>
  222. public bool SetKeyFrame (float time, Vector2 value)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return ValueAnimation_SetKeyFrame_3 (handle, time, ref value);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern bool ValueAnimation_SetKeyFrame_4 (IntPtr handle, float time, ref Vector4 value);
  229. /// <summary>
  230. /// Set key frame.
  231. /// </summary>
  232. public bool SetKeyFrame (float time, Vector4 value)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return ValueAnimation_SetKeyFrame_4 (handle, time, ref value);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern bool ValueAnimation_SetKeyFrame_5 (IntPtr handle, float time, ref IntVector2 value);
  239. /// <summary>
  240. /// Set key frame.
  241. /// </summary>
  242. public bool SetKeyFrame (float time, IntVector2 value)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. return ValueAnimation_SetKeyFrame_5 (handle, time, ref value);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern bool ValueAnimation_SetKeyFrame_6 (IntPtr handle, float time, ref Quaternion value);
  249. /// <summary>
  250. /// Set key frame.
  251. /// </summary>
  252. public bool SetKeyFrame (float time, Quaternion value)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return ValueAnimation_SetKeyFrame_6 (handle, time, ref value);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern bool ValueAnimation_SetKeyFrame_7 (IntPtr handle, float time, ref Matrix4 value);
  259. /// <summary>
  260. /// Set key frame.
  261. /// </summary>
  262. public bool SetKeyFrame (float time, Matrix4 value)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return ValueAnimation_SetKeyFrame_7 (handle, time, ref value);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern bool ValueAnimation_SetKeyFrame_8 (IntPtr handle, float time, ref Matrix3x4 value);
  269. /// <summary>
  270. /// Set key frame.
  271. /// </summary>
  272. public bool SetKeyFrame (float time, Matrix3x4 value)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return ValueAnimation_SetKeyFrame_8 (handle, time, ref value);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern bool ValueAnimation_SetKeyFrame_9 (IntPtr handle, float time, int value);
  279. /// <summary>
  280. /// Set key frame.
  281. /// </summary>
  282. public bool SetKeyFrame (float time, int value)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. return ValueAnimation_SetKeyFrame_9 (handle, time, value);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern bool ValueAnimation_SetKeyFrame_10 (IntPtr handle, float time, float value);
  289. /// <summary>
  290. /// Set key frame.
  291. /// </summary>
  292. public bool SetKeyFrame (float time, float value)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. return ValueAnimation_SetKeyFrame_10 (handle, time, value);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern bool ValueAnimation_SetKeyFrame_11 (IntPtr handle, float time, string value);
  299. /// <summary>
  300. /// Set key frame.
  301. /// </summary>
  302. public bool SetKeyFrame (float time, string value)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. return ValueAnimation_SetKeyFrame_11 (handle, time, value);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern bool ValueAnimation_SetKeyFrame_12 (IntPtr handle, float time, bool value);
  309. /// <summary>
  310. /// Set key frame.
  311. /// </summary>
  312. public bool SetKeyFrame (float time, bool value)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. return ValueAnimation_SetKeyFrame_12 (handle, time, value);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern bool ValueAnimation_IsValid (IntPtr handle);
  319. /// <summary>
  320. /// Return animation is valid.
  321. /// </summary>
  322. private bool IsValid ()
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. return ValueAnimation_IsValid (handle);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern IntPtr ValueAnimation_GetOwner (IntPtr handle);
  329. /// <summary>
  330. /// Return owner.
  331. /// </summary>
  332. private IntPtr GetOwner ()
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. return ValueAnimation_GetOwner (handle);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern InterpMethod ValueAnimation_GetInterpolationMethod (IntPtr handle);
  339. /// <summary>
  340. /// Return interpolation method.
  341. /// </summary>
  342. private InterpMethod GetInterpolationMethod ()
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. return ValueAnimation_GetInterpolationMethod (handle);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern float ValueAnimation_GetSplineTension (IntPtr handle);
  349. /// <summary>
  350. /// Return spline tension.
  351. /// </summary>
  352. private float GetSplineTension ()
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. return ValueAnimation_GetSplineTension (handle);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern VariantType ValueAnimation_GetValueType (IntPtr handle);
  359. /// <summary>
  360. /// Return value type.
  361. /// </summary>
  362. private VariantType GetValueType ()
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. return ValueAnimation_GetValueType (handle);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern float ValueAnimation_GetBeginTime (IntPtr handle);
  369. /// <summary>
  370. /// Return begin time.
  371. /// </summary>
  372. private float GetBeginTime ()
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. return ValueAnimation_GetBeginTime (handle);
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern float ValueAnimation_GetEndTime (IntPtr handle);
  379. /// <summary>
  380. /// Return end time.
  381. /// </summary>
  382. private float GetEndTime ()
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. return ValueAnimation_GetEndTime (handle);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern Variant ValueAnimation_GetAnimationValue (IntPtr handle, float scaledTime);
  389. /// <summary>
  390. /// Return animation value.
  391. /// </summary>
  392. public Variant GetAnimationValue (float scaledTime)
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. return ValueAnimation_GetAnimationValue (handle, scaledTime);
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern bool ValueAnimation_HasEventFrames (IntPtr handle);
  399. /// <summary>
  400. /// Has event frames.
  401. /// </summary>
  402. public bool HasEventFrames ()
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. return ValueAnimation_HasEventFrames (handle);
  406. }
  407. public override StringHash Type {
  408. get {
  409. return UrhoGetType ();
  410. }
  411. }
  412. public override string TypeName {
  413. get {
  414. return GetTypeName ();
  415. }
  416. }
  417. [Preserve]
  418. public new static StringHash TypeStatic {
  419. get {
  420. return GetTypeStatic ();
  421. }
  422. }
  423. public new static string TypeNameStatic {
  424. get {
  425. return GetTypeNameStatic ();
  426. }
  427. }
  428. /// <summary>
  429. /// Return owner.
  430. /// Or
  431. /// Set owner.
  432. /// </summary>
  433. public IntPtr Owner {
  434. get {
  435. return GetOwner ();
  436. }
  437. set {
  438. SetOwner (value);
  439. }
  440. }
  441. /// <summary>
  442. /// Return interpolation method.
  443. /// Or
  444. /// Set interpolation method.
  445. /// </summary>
  446. public InterpMethod InterpolationMethod {
  447. get {
  448. return GetInterpolationMethod ();
  449. }
  450. set {
  451. SetInterpolationMethod (value);
  452. }
  453. }
  454. /// <summary>
  455. /// Return spline tension.
  456. /// Or
  457. /// Set spline tension, should be between 0.0f and 1.0f, but this is not a must.
  458. /// </summary>
  459. public float SplineTension {
  460. get {
  461. return GetSplineTension ();
  462. }
  463. set {
  464. SetSplineTension (value);
  465. }
  466. }
  467. /// <summary>
  468. /// Return value type.
  469. /// Or
  470. /// Set value type.
  471. /// </summary>
  472. public VariantType ValueType {
  473. get {
  474. return GetValueType ();
  475. }
  476. set {
  477. SetValueType (value);
  478. }
  479. }
  480. /// <summary>
  481. /// Return animation is valid.
  482. /// </summary>
  483. public bool Valid {
  484. get {
  485. return IsValid ();
  486. }
  487. }
  488. /// <summary>
  489. /// Return begin time.
  490. /// </summary>
  491. public float BeginTime {
  492. get {
  493. return GetBeginTime ();
  494. }
  495. }
  496. /// <summary>
  497. /// Return end time.
  498. /// </summary>
  499. public float EndTime {
  500. get {
  501. return GetEndTime ();
  502. }
  503. }
  504. }
  505. }