summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-01-26 14:26:31 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-02-01 14:21:27 -0800
commitdfabca1fea2d55f503c1f4b5a3b366b2c916491d (patch)
treed673181b1001af4fe3f43220ad66966d5415cf18
parent1387a7c7f2fc18fffe5f65159abe15cd5865bc96 (diff)
downloadelementary-dfabca1fea2d55f503c1f4b5a3b366b2c916491d.tar.gz
panel: switch to use per window animator.
-rw-r--r--src/lib/elm_panel.c23
-rw-r--r--src/lib/elm_panel.eo1
2 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c
index 2492eb4bc..7b3693723 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(evas_object_evas_get(obj),
+ eo_event_callback_add(EVAS_CANVAS_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(evas_object_evas_get(obj),
+ eo_event_callback_del(EVAS_CANVAS_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(evas_object_evas_get(obj),
+ eo_event_callback_add(EVAS_CANVAS_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 667834c7a..ffaca5158 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;