2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 %define Animation_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
19 %typemap(csimports) NameSpace::ClassName %{
21 using System.Runtime.InteropServices;
26 %define Animation_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
27 %typemap(cscode) NameSpace::ClassName %{
29 public static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get();
30 public static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get();
31 public static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get();
32 public static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get();
33 public static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get();
34 public static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get();
35 public static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get();
36 public static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get();
37 public static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get();
38 public static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get();
39 public static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get();
40 public static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get();
41 public static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get();
42 public static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get();
43 public static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get();
44 public static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get();
45 public static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get();
46 public static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get();
47 public static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get();
48 public static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get();
49 public static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get();
50 public static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get();
51 public static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get();
52 public static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get();
53 public static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get();
54 public static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get();
55 public static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get();
56 public static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get();
57 public static readonly int COLOR = NDalicPINVOKE.Actor_Property_COLOR_get();
58 public static readonly int COLOR_RED = NDalicPINVOKE.Actor_Property_COLOR_RED_get();
59 public static readonly int COLOR_GREEN = NDalicPINVOKE.Actor_Property_COLOR_GREEN_get();
60 public static readonly int COLOR_BLUE = NDalicPINVOKE.Actor_Property_COLOR_BLUE_get();
61 public static readonly int COLOR_ALPHA = NDalicPINVOKE.Actor_Property_COLOR_ALPHA_get();
62 public static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get();
63 public static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get();
64 public static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get();
65 public static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get();
66 public static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get();
67 public static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get();
68 public static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get();
69 public static readonly int COLOR_MODE = NDalicPINVOKE.Actor_Property_COLOR_MODE_get();
70 public static readonly int POSITION_INHERITANCE = NDalicPINVOKE.Actor_Property_POSITION_INHERITANCE_get();
71 public static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get();
72 public static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get();
73 public static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get();
74 public static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get();
75 public static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get();
76 public static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get();
77 public static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get();
78 public static readonly int PADDING = NDalicPINVOKE.Actor_Property_PADDING_get();
79 public static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get();
80 public static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get();
81 public static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get();
82 public static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get();
83 public static readonly int BATCH_PARENT = NDalicPINVOKE.Actor_Property_BATCH_PARENT_get();
87 * @brief Event arguments that passed via Finished signal
90 public class FinishedEventArgs : EventArgs
92 private Animation _animation;
95 * @brief Animation - is the Animation which has finished with the animation.
98 public Animation Animation
111 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
112 private delegate void FinishedEventCallbackDelegate(IntPtr Animation);
113 private DaliEventHandler<object,FinishedEventArgs> _animationFinishedEventHandler;
114 private FinishedEventCallbackDelegate _animationFinishedEventCallbackDelegate;
117 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
118 * (in the type of FinishedEventHandler - DaliEventHandler<object,FinishedEventArgs>) provided by the user.
119 * Finished signal is emitted when an Animation's animations have finished.
121 public event DaliEventHandler<object,FinishedEventArgs> Finished
127 // Restricted to only one listener
128 if (_animationFinishedEventHandler == null)
130 _animationFinishedEventHandler += value;
132 _animationFinishedEventCallbackDelegate = new FinishedEventCallbackDelegate(OnFinished);
133 this.FinishedSignal().Connect(_animationFinishedEventCallbackDelegate);
142 if (_animationFinishedEventHandler != null)
144 this.FinishedSignal().Disconnect(_animationFinishedEventCallbackDelegate);
147 _animationFinishedEventHandler -= value;
152 // Callback for Animation FinishedSignal
153 private void OnFinished(IntPtr data)
155 FinishedEventArgs e = new FinishedEventArgs();
157 // Populate all members of "e" (FinishedEventArgs) with real data
158 e.Animation = Animation.GetAnimationFromPtr(data);
160 if (_animationFinishedEventHandler != null)
162 //here we send all data to user event handlers
163 _animationFinishedEventHandler(this, e);
168 public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
169 ClassName ret = new ClassName(cPtr, false);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public float Duration
183 float ret = GetDuration();
188 public AlphaFunction DefaultAlphaFunction
192 SetDefaultAlphaFunction(value);
196 AlphaFunction ret = GetDefaultAlphaFunction();
201 public Animation.State Status
205 Animation.State ret = GetState();
210 public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue)
212 dynamic var = (object)(propertyIndex);
213 dynamic obj = (object)(relativeValue);
214 AnimateBy(new Property(target, var), new Property.Value(obj));
217 public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha)
219 dynamic var = (object)(propertyIndex);
220 dynamic obj = (object)(relativeValue);
221 AnimateBy(new Property(target, var), new Property.Value(obj), alpha);
224 public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, TimePeriod period)
226 dynamic var = (object)(propertyIndex);
227 dynamic obj = (object)(relativeValue);
228 AnimateBy(new Property(target, var), new Property.Value(obj), period);
231 public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha, TimePeriod period)
233 dynamic var = (object)(propertyIndex);
234 dynamic obj = (object)(relativeValue);
235 AnimateBy(new Property(target, var), new Property.Value(obj), alpha, period);
238 public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue)
240 dynamic var = (object)(propertyIndex);
241 dynamic obj = (object)(destinationValue);
242 AnimateTo(new Property(target, var), new Property.Value(obj));
245 public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha)
247 dynamic var = (object)(propertyIndex);
248 dynamic obj = (object)(destinationValue);
249 AnimateTo(new Property(target, var), new Property.Value(obj), alpha);
252 public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, TimePeriod period)
254 dynamic var = (object)(propertyIndex);
255 dynamic obj = (object)(destinationValue);
256 AnimateTo(new Property(target, var), new Property.Value(obj), period);
259 public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha, TimePeriod period)
261 dynamic var = (object)(propertyIndex);
262 dynamic obj = (object)(destinationValue);
263 AnimateTo(new Property(target, var), new Property.Value(obj), alpha, period);
266 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames)
268 dynamic var = (object)(propertyIndex);
269 AnimateBetween(new Property(target, var), keyFrames);
272 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, Animation.Interpolation interpolation)
274 dynamic var = (object)(propertyIndex);
275 AnimateBetween(new Property(target, var), keyFrames, interpolation);
278 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha)
280 dynamic var = (object)(propertyIndex);
281 AnimateBetween(new Property(target, var), keyFrames, alpha);
284 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
286 dynamic var = (object)(propertyIndex);
287 AnimateBetween(new Property(target, var), keyFrames, alpha, interpolation);
290 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period)
292 dynamic var = (object)(propertyIndex);
293 AnimateBetween(new Property(target, var), keyFrames, period);
296 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
298 dynamic var = (object)(propertyIndex);
299 AnimateBetween(new Property(target, var), keyFrames, period, interpolation);
302 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
304 dynamic var = (object)(propertyIndex);
305 AnimateBetween(new Property(target, var), keyFrames, alpha, period);
308 public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
310 dynamic var = (object)(propertyIndex);
311 AnimateBetween(new Property(target, var), keyFrames, alpha, period, interpolation);
319 %define DALI_animation_EVENTHANDLER_PARAM( NameSpace, ClassName)
320 Animation_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
321 Animation_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
326 DALI_animation_EVENTHANDLER_PARAM( Dali, Animation);