summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_animation_view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/efl_ui_animation_view.c')
-rw-r--r--src/lib/elementary/efl_ui_animation_view.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c
index 6a60e1a..4f3ec3b 100644
--- a/src/lib/elementary/efl_ui_animation_view.c
+++ b/src/lib/elementary/efl_ui_animation_view.c
@@ -42,7 +42,7 @@ static void
42_sizing_eval(void *data) 42_sizing_eval(void *data)
43{ 43{
44 Efl_Ui_Animation_View_Data *pd = data; 44 Efl_Ui_Animation_View_Data *pd = data;
45 if (!pd->file) return; 45 if (!efl_file_loaded_get(pd->obj)) return;
46 46
47 double hw,hh; 47 double hw,hh;
48 efl_gfx_hint_weight_get(pd->obj, &hw, &hh); 48 efl_gfx_hint_weight_get(pd->obj, &hw, &hh);
@@ -208,7 +208,6 @@ _efl_ui_animation_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Animation_View
208EOLIAN static void 208EOLIAN static void
209_efl_ui_animation_view_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Animation_View_Data *pd EINA_UNUSED) 209_efl_ui_animation_view_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
210{ 210{
211 if (pd->file) eina_stringshare_del(pd->file);
212 if (pd->transit) 211 if (pd->transit)
213 { 212 {
214 pd->transit = NULL; //Skip perform transit_del_cb() 213 pd->transit = NULL; //Skip perform transit_del_cb()
@@ -280,26 +279,35 @@ _ready_play(Efl_Ui_Animation_View_Data *pd)
280 return EINA_FALSE; 279 return EINA_FALSE;
281} 280}
282 281
283EOLIAN static Eina_Bool 282EOLIAN static void
284_efl_ui_animation_view_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, const char *file, const char *key) 283_efl_ui_animation_view_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
284{
285 pd->state = EFL_UI_ANIMATION_VIEW_STATE_NOT_READY;
286 pd->frame_cnt = 0;
287 pd->frame_duration = 0;
288 if (pd->transit) elm_transit_del(pd->transit);
289}
290
291EOLIAN static Eina_Error
292_efl_ui_animation_view_efl_file_load(Eo *obj, Efl_Ui_Animation_View_Data *pd)
285{ 293{
286 if (!evas_object_vg_file_set(pd->vg, file, key)) return EINA_FALSE; 294 Eina_Error err;
295 const Eina_File *file;
296 const char *key;
297
298 if (efl_file_loaded_get(obj)) return 0;
299
300 err = efl_file_load(efl_super(obj, MY_CLASS));
301 if (err) return err;
302
303 file = efl_file_mmap_get(obj);
304 key = efl_file_key_get(obj);
305 efl_file_simple_mmap_load(pd->vg, file, key);
287 306
288 if (pd->file) eina_stringshare_del(pd->file);
289 pd->file = eina_stringshare_add(file);
290 pd->progress = 0; 307 pd->progress = 0;
291 308
292 _sizing_eval(pd); 309 _sizing_eval(pd);
293 310
294 if (!pd->file)
295 {
296 pd->state = EFL_UI_ANIMATION_VIEW_STATE_NOT_READY;
297 pd->frame_cnt = 0;
298 pd->frame_duration = 0;
299 if (pd->transit) elm_transit_del(pd->transit);
300 return EINA_FALSE;
301 }
302
303 if (!_ready_play(pd)) return EINA_TRUE; 311 if (!_ready_play(pd)) return EINA_TRUE;
304 312
305 if (pd->auto_play) 313 if (pd->auto_play)
@@ -391,7 +399,7 @@ _efl_ui_animation_view_auto_play_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation
391} 399}
392 400
393EOLIAN static Eina_Bool 401EOLIAN static Eina_Bool
394_efl_ui_animation_view_play(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd) 402_efl_ui_animation_view_play(Eo *obj, Efl_Ui_Animation_View_Data *pd)
395{ 403{
396 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAY) return EINA_FALSE; 404 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAY) return EINA_FALSE;
397 405
@@ -401,7 +409,7 @@ _efl_ui_animation_view_play(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
401 pd->play_back = EINA_FALSE; 409 pd->play_back = EINA_FALSE;
402 pd->auto_play_pause = EINA_FALSE; 410 pd->auto_play_pause = EINA_FALSE;
403 411
404 if (!pd->file) return EINA_FALSE; 412 if (!efl_file_loaded_get(obj)) return EINA_FALSE;
405 if (!pd->transit && !_ready_play(pd)) return EINA_FALSE; 413 if (!pd->transit && !_ready_play(pd)) return EINA_FALSE;
406 414
407 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOP) 415 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOP)
@@ -471,7 +479,7 @@ _efl_ui_animation_view_resume(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *p
471} 479}
472 480
473EOLIAN static Eina_Bool 481EOLIAN static Eina_Bool
474_efl_ui_animation_view_play_back(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd) 482_efl_ui_animation_view_play_back(Eo *obj, Efl_Ui_Animation_View_Data *pd)
475{ 483{
476 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAY_BACK) return EINA_FALSE; 484 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAY_BACK) return EINA_FALSE;
477 485
@@ -481,7 +489,7 @@ _efl_ui_animation_view_play_back(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data
481 pd->play_back = EINA_TRUE; 489 pd->play_back = EINA_TRUE;
482 pd->auto_play_pause = EINA_FALSE; 490 pd->auto_play_pause = EINA_FALSE;
483 491
484 if (!pd->file) return EINA_FALSE; 492 if (!efl_file_loaded_get(obj)) return EINA_FALSE;
485 if (!pd->transit && !_ready_play(pd)) return EINA_FALSE; 493 if (!pd->transit && !_ready_play(pd)) return EINA_FALSE;
486 494
487 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOP) 495 if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOP)
@@ -662,7 +670,7 @@ elm_animation_view_add(Evas_Object *parent)
662EAPI Eina_Bool 670EAPI Eina_Bool
663elm_animation_view_file_set(Elm_Animation_View *obj, const char *file, const char *key) 671elm_animation_view_file_set(Elm_Animation_View *obj, const char *file, const char *key)
664{ 672{
665 return efl_file_set(obj, file, key); 673 return efl_file_simple_load(obj, file, key);
666} 674}
667 675
668EAPI Elm_Animation_View_State 676EAPI Elm_Animation_View_State