summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-03-16 16:14:16 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2020-03-19 13:17:18 +0900
commite8ea9741ec8db10089c8fa3fd3cc74c7009af258 (patch)
treea4fee80383fd5a7bdf08a0654aabefa2b68a7af6
parent879e7aee6cf15708c11a9ee163b2586695e36370 (diff)
trigger feedback event
-rw-r--r--src/lib/elementary/efl_ui_mi_controller.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/lib/elementary/efl_ui_mi_controller.c b/src/lib/elementary/efl_ui_mi_controller.c
index fd0e53f263..690babeee1 100644
--- a/src/lib/elementary/efl_ui_mi_controller.c
+++ b/src/lib/elementary/efl_ui_mi_controller.c
@@ -59,7 +59,10 @@ _efl_ui_mi_controller_trigger(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, const char
59 pd->cur_state_idx = i; 59 pd->cur_state_idx = i;
60 efl_ui_mi_state_sector_get(state, &_start, &_end); 60 efl_ui_mi_state_sector_get(state, &_start, &_end);
61 if (_start) 61 if (_start)
62 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end); 62 {
63 efl_event_callback_call(state, EFL_UI_MI_STATE_EVENT_TRIGGER, NULL);
64 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end);
65 }
63 else 66 else
64 ERR("No start point"); 67 ERR("No start point");
65 68
@@ -87,7 +90,10 @@ _efl_ui_mi_controller_trigger_next(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, Eina_
87 efl_ui_mi_state_sector_get(cur_state, &_start, &_end); 90 efl_ui_mi_state_sector_get(cur_state, &_start, &_end);
88 91
89 if (_start) 92 if (_start)
90 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end); 93 {
94 efl_event_callback_call(cur_state, EFL_UI_MI_STATE_EVENT_TRIGGER, NULL);
95 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end);
96 }
91 else 97 else
92 ERR("No start point"); 98 ERR("No start point");
93 99
@@ -184,22 +190,26 @@ _efl_ui_mi_controller_efl_file_load(Eo *obj, Efl_Ui_Mi_Controller_Data *pd)
184 if (sector_list) 190 if (sector_list)
185 { 191 {
186 Eina_List *l; 192 Eina_List *l;
187 Efl_Gfx_Frame_Sector_Data *sector; 193 Efl_Gfx_Frame_Sector_Data *sector;
188 194 Eo *state = NULL;
189 const char *start_sector = NULL, *end_sector = NULL; 195 const char *start_sector = NULL, *end_sector = NULL;
196
190 EINA_LIST_FOREACH(sector_list, l, sector) 197 EINA_LIST_FOREACH(sector_list, l, sector)
191 { 198 {
192 start_sector = end_sector; 199 start_sector = end_sector;
193 end_sector = sector->name; 200 end_sector = sector->name;
194 if (start_sector && end_sector) 201 if (start_sector && end_sector)
195 { 202 {
196 Eo* state = efl_add(EFL_UI_MI_STATE_CLASS, obj); 203 state = efl_add(EFL_UI_MI_STATE_CLASS, obj);
197 //efl_ui_mi_state_controller_set(state, controller);
198 efl_key_data_set(state, "controller", obj); 204 efl_key_data_set(state, "controller", obj);
199 efl_ui_mi_state_sector_set(state, start_sector, end_sector); 205 efl_ui_mi_state_sector_set(state, start_sector, end_sector);
200 efl_ui_mi_controller_state_add(obj, state); 206 efl_ui_mi_controller_state_add(obj, state);
201 } 207 }
202 } 208 }
209 state = efl_add(EFL_UI_MI_STATE_CLASS, obj);
210 efl_key_data_set(state, "controller", obj);
211 efl_ui_mi_state_sector_set(state, "*", NULL);
212 efl_ui_mi_controller_state_add(obj, state);
203 213
204 EINA_LIST_FOREACH(sector_list, l, sector) 214 EINA_LIST_FOREACH(sector_list, l, sector)
205 { 215 {
@@ -233,6 +243,17 @@ _size_hint_event_cb(void *data, const Efl_Event *event)
233 _sizing_eval(event->object, data); 243 _sizing_eval(event->object, data);
234} 244}
235 245
246static void
247_animation_playback_progress_changed_cb(void *data, const Efl_Event *event)
248{
249 Eo* obj = data;
250 Efl_Ui_Mi_Controller_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
251 if (!pd) return NULL;
252
253 Efl_Ui_Mi_State *cur_state = eina_array_data_get (pd->states, pd->cur_state_idx);
254 efl_event_callback_call(cur_state, EFL_UI_MI_STATE_EVENT_FEEDBACK, (double*)event->info);
255}
256
236EOLIAN static void 257EOLIAN static void
237_efl_ui_mi_controller_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_Controller_Data *pd) 258_efl_ui_mi_controller_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_Controller_Data *pd)
238{ 259{
@@ -242,6 +263,7 @@ _efl_ui_mi_controller_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_Controller_D
242 pd->anim = efl_add(EFL_UI_VG_ANIMATION_CLASS, obj); 263 pd->anim = efl_add(EFL_UI_VG_ANIMATION_CLASS, obj);
243 elm_widget_resize_object_set(obj, pd->anim); 264 elm_widget_resize_object_set(obj, pd->anim);
244 265
266 efl_event_callback_add(pd->anim, EFL_PLAYER_EVENT_PLAYBACK_PROGRESS_CHANGED, _animation_playback_progress_changed_cb, obj);
245 efl_key_data_set(obj, "anim", pd->anim); 267 efl_key_data_set(obj, "anim", pd->anim);
246 268
247 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_hint_event_cb, pd); 269 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_hint_event_cb, pd);