The source code moved from the SPIN with license changed to Flora 1.1
[apps/native/home/homescreen-efl.git] / inc / livebox / livebox_animator.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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
7  *
8  * http://floralicense.org/license/
9  *
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.
15  */
16
17 #ifndef LIVEBOX_ANIMATOR_H_
18 #define LIVEBOX_ANIMATOR_H_
19
20 struct _Anim_Data;
21
22 typedef void (*Anim_Grid_End)(struct _Anim_Data **ad);
23
24 typedef struct _Anim_Data {
25         double anim_time;
26         Evas_Object *obj;
27         Ecore_Pos_Map map;
28         double map_var_1;
29         double map_var_2;
30         Eina_Rectangle *geometry_start;
31         Eina_Rectangle *geometry_end;
32         Anim_Grid_End on_end;
33         Ecore_Animator *animator;
34         bool anim_is_running;
35 } Anim_Data_t;
36
37 /**
38  * @brief Delete an animator
39  * @param ad Animator to delete
40  */
41 extern void livebox_animator_del_grid(Anim_Data_t **ad);
42
43 /**
44  * @brief creates a grid animator and starts it
45  * @details Animator will be performed on grid item. It works by packing
46  * an item to grid's virtual resolution.
47  * Notice that the animated item has to be packed to a grid before the
48  * animation starts
49  * @param obj object to animate
50  * @param anim_time animation time
51  * @param map animator mapping method
52  * @param map_var_1 value used by map
53  * @param map_var_2 value used by map
54  * @param geometry_start animator start position
55  * @param geometry_end animator end position
56  * @param on_end callback called on end of animation
57  * @param ad_out created animator object
58  */
59 extern void livebox_animator_play_grid_pack_set(Evas_Object *obj,
60                 float anim_time,
61                 Ecore_Pos_Map map, float map_var_1, float map_var_2,
62                 Eina_Rectangle *geometry_start, Eina_Rectangle *geometry_end,
63                 Anim_Grid_End on_end,
64                 Anim_Data_t **ad_out);
65
66 /**
67  * @brief creates a geometry animator and starts it
68  * @details object position and size will be animated
69  * @param obj object ot animate
70  * @param anim_time animation time
71  * @param map animator mapping method
72  * @param map_var_1 value used by map
73  * @param map_var_2 value used by map
74  * @param geometry_start animator start position
75  * @param geometry_end animator end position
76  * @param on_end callback called on end of animation
77  * @param ad_out created animator object
78  */
79 extern void livebox_animator_play_geometry_set(Evas_Object *obj,
80                 float anim_time,
81                 Ecore_Pos_Map map, float map_var_1, float map_var_2,
82                 Eina_Rectangle *geometry_start, Eina_Rectangle *geometry_end,
83                 Anim_Grid_End on_end,
84                 Anim_Data_t **ad_out);
85
86 #endif /* LIVEBOX_ANIMATOR_H_ */