1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5 * Moonlight List (moonlight-list@lists.ximian.com)
7 * Copyright 2007 Novell, Inc. (http://www.novell.com)
9 * See the LICENSE file included with the distribution for details.
12 #ifndef __MOON_EASING_H__
13 #define __MOON_EASING_H__
15 #include "dependencyobject.h"
18 /* @CBindingRequisite */
19 typedef double (*EasingFunction
) (double normalizedTime
);
21 /* @Namespace=System.Windows.Media.Animation */
23 class EasingFunctionBase
: public DependencyObject
{
25 /* @GenerateCBinding,GeneratePInvoke */
26 EasingFunctionBase ();
28 /* @PropertyType=EasingMode,DefaultValue=EasingModeOut,GenerateAccessors */
29 const static int EasingModeProperty
;
31 double Ease (double normalizedTime
);
32 virtual double EaseInCore (double normalizedTime
) { return normalizedTime
; }
34 EasingMode
GetEasingMode ();
35 void SetEasingMode (EasingMode easingMode
);
37 /* @GenerateCBinding,GeneratePInvoke */
38 void SetEasingFunction (EasingFunction value
);
41 virtual ~EasingFunctionBase ();
44 EasingFunction easing_function_callback
;
47 /* @Namespace=System.Windows.Media.Animation */
48 class BackEase
: public EasingFunctionBase
51 /* @GenerateCBinding,GeneratePInvoke */
54 /* @PropertyType=double,DefaultValue=1.0,GenerateAccessors */
55 const static int AmplitudeProperty
;
57 /* @GenerateCBinding,GeneratePInvoke */
58 virtual double EaseInCore (double normalizedTime
);
60 double GetAmplitude ();
61 void SetAmplitude (double value
);
67 /* @Namespace=System.Windows.Media.Animation */
68 class BounceEase
: public EasingFunctionBase
71 /* @GenerateCBinding,GeneratePInvoke */
74 /* @PropertyType=gint32,DefaultValue=3,GenerateAccessors */
75 const static int BouncesProperty
;
76 /* @PropertyType=double,DefaultValue=2.0,GenerateAccessors */
77 const static int BouncinessProperty
;
79 /* @GenerateCBinding,GeneratePInvoke */
80 virtual double EaseInCore (double normalizedTime
);
83 void SetBounces (int value
);
85 double GetBounciness ();
86 void SetBounciness (double value
);
89 virtual ~BounceEase();
92 /* @Namespace=System.Windows.Media.Animation */
93 class CircleEase
: public EasingFunctionBase
96 /* @GenerateCBinding,GeneratePInvoke */
99 /* @GenerateCBinding,GeneratePInvoke */
100 virtual double EaseInCore (double normalizedTime
);
103 virtual ~CircleEase ();
106 /* @Namespace=System.Windows.Media.Animation */
107 class CubicEase
: public EasingFunctionBase
110 /* @GenerateCBinding,GeneratePInvoke */
113 /* @GenerateCBinding,GeneratePInvoke */
114 virtual double EaseInCore (double normalizedTime
);
117 virtual ~CubicEase ();
120 /* @Namespace=System.Windows.Media.Animation */
121 class ElasticEase
: public EasingFunctionBase
124 /* @GenerateCBinding,GeneratePInvoke */
127 /* @PropertyType=gint32,DefaultValue=3,GenerateAccessors */
128 const static int OscillationsProperty
;
129 /* @PropertyType=double,DefaultValue=3.0,GenerateAccessors */
130 const static int SpringinessProperty
;
132 /* @GenerateCBinding,GeneratePInvoke */
133 virtual double EaseInCore (double normalizedTime
);
135 int GetOscillations ();
136 void SetOscillations (int value
);
138 double GetSpringiness ();
139 void SetSpringiness (double value
);
142 virtual ~ElasticEase();
145 /* @Namespace=System.Windows.Media.Animation */
146 class ExponentialEase
: public EasingFunctionBase
149 /* @GenerateCBinding,GeneratePInvoke */
152 /* @PropertyType=double,DefaultValue=2.0,GenerateAccessors */
153 const static int ExponentProperty
;
155 /* @GenerateCBinding,GeneratePInvoke */
156 virtual double EaseInCore (double normalizedTime
);
158 double GetExponent ();
159 void SetExponent (double value
);
162 virtual ~ExponentialEase();
165 /* @Namespace=System.Windows.Media.Animation */
166 class PowerEase
: public EasingFunctionBase
169 /* @GenerateCBinding,GeneratePInvoke */
172 /* @PropertyType=double,DefaultValue=2.0,GenerateAccessors */
173 const static int PowerProperty
;
175 /* @GenerateCBinding,GeneratePInvoke */
176 virtual double EaseInCore (double normalizedTime
);
179 void SetPower (double value
);
182 virtual ~PowerEase();
185 /* @Namespace=System.Windows.Media.Animation */
186 class QuadraticEase
: public EasingFunctionBase
189 /* @GenerateCBinding,GeneratePInvoke */
192 /* @GenerateCBinding,GeneratePInvoke */
193 virtual double EaseInCore (double normalizedTime
);
196 virtual ~QuadraticEase ();
199 /* @Namespace=System.Windows.Media.Animation */
200 class QuarticEase
: public EasingFunctionBase
203 /* @GenerateCBinding,GeneratePInvoke */
206 /* @GenerateCBinding,GeneratePInvoke */
207 virtual double EaseInCore (double normalizedTime
);
210 virtual ~QuarticEase ();
213 /* @Namespace=System.Windows.Media.Animation */
214 class QuinticEase
: public EasingFunctionBase
217 /* @GenerateCBinding,GeneratePInvoke */
220 /* @GenerateCBinding,GeneratePInvoke */
221 virtual double EaseInCore (double normalizedTime
);
224 virtual ~QuinticEase ();
227 /* @Namespace=System.Windows.Media.Animation */
228 class SineEase
: public EasingFunctionBase
231 /* @GenerateCBinding,GeneratePInvoke */
234 /* @GenerateCBinding,GeneratePInvoke */
235 virtual double EaseInCore (double normalizedTime
);
238 virtual ~SineEase ();
241 #endif /* __MOON_EASING_H__ */