summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-01-30 00:47:38 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-01 14:21:27 -0800
commitb4277ce1abfc5df532e651adf8875e7713117fb1 (patch)
treeeb6d494c5127ee439bcb90a050ce2b39cee4c2aa
parentfe04fffaba32f9c4b91628be71c9230ffd4de007 (diff)
naviframe: switch to use animator,tick.
-rw-r--r--src/lib/elc_naviframe.c33
-rw-r--r--src/lib/elm_widget_naviframe.h2
2 files changed, 24 insertions, 11 deletions
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index dd53d8747..9b616e32c 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1419,7 +1419,10 @@ _send_signal(Elm_Naviframe_Item_Data *it, const char *sig)
1419} 1419}
1420 1420
1421static Eina_Bool 1421static Eina_Bool
1422_deferred(void *data) 1422_deferred(void *data,
1423 Eo *o EINA_UNUSED,
1424 const Eo_Event_Description *desc EINA_UNUSED,
1425 void *event_info EINA_UNUSED)
1423{ 1426{
1424 Elm_Naviframe_Data *nfd = data; 1427 Elm_Naviframe_Data *nfd = data;
1425 Elm_Naviframe_Op *nfo; 1428 Elm_Naviframe_Op *nfo;
@@ -1444,8 +1447,9 @@ _deferred(void *data)
1444 free(nfo); 1447 free(nfo);
1445 } 1448 }
1446 1449
1447 nfd->animator = NULL; 1450 eo_do(nfd->obj,
1448 return ECORE_CALLBACK_CANCEL; 1451 eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _deferred, nfd));
1452 return EO_CALLBACK_CONTINUE;
1449} 1453}
1450 1454
1451EOLIAN static void 1455EOLIAN static void
@@ -1462,8 +1466,7 @@ _elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd)
1462 eo_do(EO_OBJ(it), elm_wdg_item_del()); 1466 eo_do(EO_OBJ(it), elm_wdg_item_del());
1463 } 1467 }
1464 1468
1465 //All popping items which are not called yet by animator. 1469 // No need to cleanup animator as it is an event on myself
1466 if (sd->animator) ecore_animator_del(sd->animator);
1467 EINA_LIST_FREE(sd->ops, nfo) 1470 EINA_LIST_FREE(sd->ops, nfo)
1468 free(nfo); 1471 free(nfo);
1469 EINA_LIST_FREE(sd->popping, it) 1472 EINA_LIST_FREE(sd->popping, it)
@@ -1527,6 +1530,16 @@ _elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Ei
1527} 1530}
1528 1531
1529static void 1532static void
1533_schedule_deferred(Elm_Naviframe_Op *nfo, Elm_Naviframe_Data *sd)
1534{
1535 if (!sd->ops)
1536 eo_do(sd->obj,
1537 eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _deferred, sd));
1538
1539 sd->ops = eina_list_append(sd->ops, nfo);
1540}
1541
1542static void
1530_item_push_helper(Elm_Naviframe_Item_Data *item) 1543_item_push_helper(Elm_Naviframe_Item_Data *item)
1531{ 1544{
1532 Elm_Object_Item *eo_top_item; 1545 Elm_Object_Item *eo_top_item;
@@ -1559,8 +1572,7 @@ _item_push_helper(Elm_Naviframe_Item_Data *item)
1559 nfo->related = top_item; 1572 nfo->related = top_item;
1560 nfo->push = EINA_TRUE; 1573 nfo->push = EINA_TRUE;
1561 1574
1562 sd->ops = eina_list_append(sd->ops, nfo); 1575 _schedule_deferred(nfo, sd);
1563 if (!sd->animator) sd->animator = ecore_animator_add(_deferred, sd);
1564 item->pushing = EINA_TRUE; 1576 item->pushing = EINA_TRUE;
1565 } 1577 }
1566 else 1578 else
@@ -1588,9 +1600,10 @@ elm_naviframe_add(Evas_Object *parent)
1588} 1600}
1589 1601
1590EOLIAN static Eo * 1602EOLIAN static Eo *
1591_elm_naviframe_eo_base_constructor(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED) 1603_elm_naviframe_eo_base_constructor(Eo *obj, Elm_Naviframe_Data *sd)
1592{ 1604{
1593 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 1605 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
1606 sd->obj = obj;
1594 eo_do(obj, 1607 eo_do(obj,
1595 evas_obj_type_set(MY_CLASS_NAME_LEGACY), 1608 evas_obj_type_set(MY_CLASS_NAME_LEGACY),
1596 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks), 1609 evas_obj_smart_callbacks_descriptions_set(_smart_callbacks),
@@ -1778,8 +1791,8 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1778 nfo->push = EINA_FALSE; 1791 nfo->push = EINA_FALSE;
1779 1792
1780 sd->popping = eina_list_append(sd->popping, it); 1793 sd->popping = eina_list_append(sd->popping, it);
1781 sd->ops = eina_list_append(sd->ops, nfo); 1794
1782 if (!sd->animator) sd->animator = ecore_animator_add(_deferred, sd); 1795 _schedule_deferred(nfo, sd);
1783 } 1796 }
1784 else 1797 else
1785 eo_do(eo_item, elm_wdg_item_del()); 1798 eo_do(eo_item, elm_wdg_item_del());
diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h
index 0bc526473..249bf0897 100644
--- a/src/lib/elm_widget_naviframe.h
+++ b/src/lib/elm_widget_naviframe.h
@@ -26,11 +26,11 @@
26typedef struct _Elm_Naviframe_Data Elm_Naviframe_Data; 26typedef struct _Elm_Naviframe_Data Elm_Naviframe_Data;
27struct _Elm_Naviframe_Data 27struct _Elm_Naviframe_Data
28{ 28{
29 Evas_Object *obj; /* the object itself */
29 Eina_Inlist *stack; /* top item is the list's LAST item */ 30 Eina_Inlist *stack; /* top item is the list's LAST item */
30 Eina_List *popping; 31 Eina_List *popping;
31 Eina_List *ops; 32 Eina_List *ops;
32 Evas_Object *dummy_edje; 33 Evas_Object *dummy_edje;
33 Ecore_Animator *animator;
34 Evas_Display_Mode dispmode; 34 Evas_Display_Mode dispmode;
35 35
36 Eina_Bool preserve : 1; 36 Eina_Bool preserve : 1;