1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 /// A set of key frames for a property that can be animated using Dali Animation.
32 /// This allows the generation of key frame objects from individual Property::Values.
34 public class KeyFrames : BaseHandle
36 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
38 internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn)
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
43 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj)
45 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
50 DisposeQueue.Instance.Add(this);
53 public override void Dispose()
55 if (!Stage.IsInstalled())
57 DisposeQueue.Instance.Add(this);
63 if (swigCPtr.Handle != global::System.IntPtr.Zero)
68 NDalicPINVOKE.delete_KeyFrames(swigCPtr);
70 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
72 global::System.GC.SuppressFinalize(this);
82 /// <param name="progress">A progress value between 0.0 and 1.0</param>
83 /// <param name="value">A value</param>
84 public void Add(float progress, object value)
87 Add(progress, new PropertyValue(obj));
93 /// <param name="progress">A progress value between 0.0 and 1.0</param>
94 /// <param name="value">A value</param>
95 /// <param name="alpha">The alpha function used to blend to the next keyframe</param>
96 public void Add(float progress, object value, AlphaFunction alpha)
99 Add(progress, new PropertyValue(obj), alpha);
103 /// Creates an initialized KeyFrames handle.
105 public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true)
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 /// Downcasts a handle to KeyFrames handle.
112 /// If handle points to a KeyFrames object, the downcast produces valid handle.
113 /// If not, the returned handle is left uninitialized.
115 /// <param name="handle">Handle to an object</param>
116 /// <returns>Handle to a KeyFrames object or an uninitialized handle</returns>
117 public static KeyFrames DownCast(BaseHandle handle)
119 KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_DownCast(BaseHandle.getCPtr(handle)), true);
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 internal KeyFrames(KeyFrames handle) : this(NDalicPINVOKE.new_KeyFrames__SWIG_1(KeyFrames.getCPtr(handle)), true)
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 internal KeyFrames Assign(KeyFrames rhs)
131 KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_Assign(swigCPtr, KeyFrames.getCPtr(rhs)), false);
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 /// Gets the type of the key frame.
139 /// <returns>The key frame property type</returns>
140 public PropertyType GetType()
142 PropertyType ret = (PropertyType)NDalicPINVOKE.KeyFrames_GetType(swigCPtr);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 /// Adds a key frame.
150 /// <param name="progress">A progress value between 0.0 and 1.0</param>
151 /// <param name="value">A value</param>
152 public void Add(float progress, PropertyValue value)
154 NDalicPINVOKE.KeyFrames_Add__SWIG_0(swigCPtr, progress, PropertyValue.getCPtr(value));
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 /// Adds a key frame.
161 /// <param name="progress">A progress value between 0.0 and 1.0</param>
162 /// <param name="value">A value</param>
163 /// <param name="alpha">The alpha function used to blend to the next keyframe</param>
164 public void Add(float progress, PropertyValue value, AlphaFunction alpha)
166 NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();