cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=403843500119ae05445907808a049220dfe455f6

commit 403843500119ae05445907808a049220dfe455f6
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Tue Jan 26 14:26:31 2016 -0800

    panel: switch to use per window animator.
    
    Tick provided by to efl.core.animator.
---
 src/lib/elm_panel.c  | 23 +++++++++++++++++++----
 src/lib/elm_panel.eo |  1 +
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c
index 2492eb4..17ed000 100644
--- a/src/lib/elm_panel.c
+++ b/src/lib/elm_panel.c
@@ -1083,8 +1083,12 @@ _elm_panel_evas_object_smart_move(Eo *obj, 
Elm_Panel_Data *sd, Evas_Coord x, Eva
    evas_object_move(sd->hit_rect, x, y);
 }
 
+// FIXME: This is definitively not an animator, but a pre calc function
+// Not sure if I can hook on smart calc or on RENDER_PRE, will be left for 
later
 static Eina_Bool
-_elm_panel_anim_cb(void *data)
+_elm_panel_anim_cb(void *data,
+                   Eo *o EINA_UNUSED, const Eo_Event_Description *desc 
EINA_UNUSED,
+                   void *event_info EINA_UNUSED)
 {
    Evas_Object *obj = data;
    ELM_PANEL_DATA_GET(obj, sd);
@@ -1095,7 +1099,7 @@ _elm_panel_anim_cb(void *data)
    if (sd->hidden) _drawer_close(obj, w, h, EINA_FALSE);
    else _drawer_open(obj, w, h, EINA_FALSE);
 
-   return ECORE_CALLBACK_CANCEL;
+   return EO_CALLBACK_STOP;
 }
 
 EOLIAN static void
@@ -1125,7 +1129,8 @@ _elm_panel_evas_object_smart_resize(Eo *obj, 
Elm_Panel_Data *sd, Evas_Coord w, E
          break;
      }
 
-   ecore_animator_add(_elm_panel_anim_cb, obj);
+   eo_do(obj,
+         eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, 
_elm_panel_anim_cb, obj));
 }
 
 EOLIAN static void
@@ -1181,6 +1186,15 @@ _elm_panel_eo_base_constructor(Eo *obj, Elm_Panel_Data 
*_pd EINA_UNUSED)
 }
 
 EOLIAN static void
+_elm_panel_eo_base_destructor(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
+{
+   eo_do(obj,
+         eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, 
_elm_panel_anim_cb, obj));
+
+   eo_do_super(obj, MY_CLASS, eo_destructor());
+}
+
+EOLIAN static void
 _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
 {
    if (sd->orient == orient) return;
@@ -1379,7 +1393,8 @@ _elm_panel_scrollable_content_size_set(Eo *obj, 
Elm_Panel_Data *sd, double ratio
          break;
      }
 
-   ecore_animator_add(_elm_panel_anim_cb, obj);
+   eo_do(obj,
+         eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, 
_elm_panel_anim_cb, obj));
 }
 
 EOLIAN static Eina_Bool
diff --git a/src/lib/elm_panel.eo b/src/lib/elm_panel.eo
index 667834c..ffaca51 100644
--- a/src/lib/elm_panel.eo
+++ b/src/lib/elm_panel.eo
@@ -67,6 +67,7 @@ class Elm.Panel (Elm.Layout, Elm_Interface_Scrollable,
    implements {
       class.constructor;
       Eo.Base.constructor;
+      Eo.Base.destructor;
       Evas.Object_Smart.add;
       Evas.Object_Smart.member_add;
       Evas.Object_Smart.del;

-- 


Reply via email to