summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-04 13:44:29 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-11-04 13:46:49 +0100
commit56d541fbdb1cdc980dcdee644be24d52255af3fb (patch)
treeda93117cc36114f929348c206bdc03bfbb5f4c31
parentdc5ffbb8660db8f93ebf698802a56b31daeaf8b9 (diff)
efl_canvas_animation: improve generally
Summary: to be taken over by doccop Depends on D10559 Reviewers: Jaehyun_Cho, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10560
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation.eo65
1 files changed, 45 insertions, 20 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo
index a64047820f..987220bf4d 100644
--- a/src/lib/evas/canvas/efl_canvas_animation.eo
+++ b/src/lib/evas/canvas/efl_canvas_animation.eo
@@ -2,75 +2,100 @@ import efl_canvas_animation_types;
2 2
3class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable 3class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable
4{ 4{
5 [[Efl animation class]] 5 [[Base class to be used by classes implementing specific canvas animations.
6
7 A canvas animation modifies the properties of a @Efl.Canvas.Object like
8 @Efl.Gfx.Entity.position, @Efl.Gfx.Entity.scale or @Efl.Gfx.Mapping.rotate, for example.
9 The value of the changed properties moves smoothly as the provided progress value
10 evolves from $[0] to $[1].
11
12 For example implementations see @Efl.Canvas.Animation_Translate or @Efl.Canvas.Animation_Scale.
13 ]]
6 c_prefix: efl_animation; 14 c_prefix: efl_animation;
7 methods { 15 methods {
8 @property final_state_keep { 16 @property final_state_keep {
9 [[Keep final state property]] 17 [[If $true the last mapping state the animation applies will be kept.
18 Otherwise all the @Efl.Gfx.Mapping properties will be reset when the animation ends.]]
10 set { 19 set {
11 } 20 }
12 get { 21 get {
13 } 22 }
14 values { 23 values {
15 keep: bool; [[$true to keep final state, $false otherwise.]] 24 keep: bool; [[$true to keep the final state.]]
16 } 25 }
17 } 26 }
18 @property duration { 27 @property duration {
19 [[Duration property]] 28 [[The duration of a single animation "run".
29 The @Efl.Playable.length implementation will return this duration adjusted by @.repeat_mode and
30 @.repeat_count.
31 ]]
20 set { 32 set {
21 } 33 }
22 get { 34 get {
23 } 35 }
24 values { 36 values {
25 sec: double; [[Duration value.]] 37 sec: double; [[Duration in seconds.]]
26 } 38 }
27 } 39 }
28 @property repeat_mode { 40 @property repeat_mode {
29 [[Repeat mode property]] 41 [[What to do when the animation finishes.
42 ]]
30 set { 43 set {
31 } 44 }
32 get { 45 get {
33 } 46 }
34 values { 47 values {
35 mode: Efl.Canvas.Animation_Repeat_Mode; [[Repeat mode.]] 48 mode: Efl.Canvas.Animation_Repeat_Mode(Efl.Canvas.Animation_Repeat_Mode.restart); [[Repeat mode.]]
36 } 49 }
37 } 50 }
38 @property repeat_count { 51 @property repeat_count {
39 [[Repeat count property]] 52 [[How many times to repeat an animation once it finishes.
40 set { 53 $[0] means that the animation only plays once (it is not repeated) and is the default value.
41 } 54 $[-1] means that the animation is repeated forever.
42 get { 55 ]]
43 }
44 values { 56 values {
45 count: int; [[Repeat count. -1 repeats animation infinitely.]] 57 count: int(0); [[Repeat count.]]
46 } 58 }
47 } 59 }
48 @property start_delay { 60 @property start_delay {
49 [[Start delay property]] 61 [[The time that passes since the animation is started and the first real change to the object is applied.
62 ]]
50 set { 63 set {
51 } 64 }
52 get { 65 get {
53 } 66 }
54 values { 67 values {
55 sec: double; [[Delay time, in seconds, from when the animation starts until the animation is animated.]] 68 sec: double; [[Delay time in seconds.]]
56 } 69 }
57 } 70 }
58 @property interpolator { 71 @property interpolator {
59 [[Interpolator property]] 72 [[Optional mapping function.
73
74 Animations are based on a timer that moves linearly from 0 to 1. This $interpolator
75 method is applied before the timer is passed to the animation, to achieve effects
76 like acceleration or deceleration, for example.
77 ]]
60 set { 78 set {
61 } 79 }
62 get { 80 get {
63 } 81 }
64 values { 82 values {
65 interpolator: Efl.Interpolator; [[Interpolator which indicates interpolation function.]] 83 interpolator: Efl.Interpolator; [[Mapping function. By default it is $NULL (linear mapping).]]
66 } 84 }
67 } 85 }
68 animation_apply { 86 animation_apply {
87 [[Overwrite this method to implement your own animation subclasses.
88
89 This is used for example by @Efl.Canvas.Animation_Translate or @Efl.Canvas.Animation_Scale.
90
91 Subclasses should call their parent's @.animation_apply to get the adjusted $progress value
92 and then perform the animation by modifying the $target's properties.
93 ]]
69 params { 94 params {
70 @in progress: double; 95 @in progress: double; [[Animation progress from $[0] to $[1].]]
71 @in target: Efl.Canvas.Object; 96 @in target: Efl.Canvas.Object; [[Object to animate.]]
72 } 97 }
73 return: double; [[Final applied progress.]] 98 return: double; [[Final applied progress, after possible adjustments. See @.interpolator.]]
74 } 99 }
75 } 100 }
76 implements { 101 implements {