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)
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
1083 evas_object_move(sd->hit_rect, x, y); 1083 evas_object_move(sd->hit_rect, x, y);
1084} 1084}
1085 1085
1086// FIXME: This is definitively not an animator, but a pre calc function
1087// Not sure if I can hook on smart calc or on RENDER_PRE, will be left for later
1086static Eina_Bool 1088static Eina_Bool
1087_elm_panel_anim_cb(void *data) 1089_elm_panel_anim_cb(void *data,
1090 Eo *o EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
1091 void *event_info EINA_UNUSED)
1088{ 1092{
1089 Evas_Object *obj = data; 1093 Evas_Object *obj = data;
1090 ELM_PANEL_DATA_GET(obj, sd); 1094 ELM_PANEL_DATA_GET(obj, sd);
@@ -1095,7 +1099,7 @@ _elm_panel_anim_cb(void *data)
1095 if (sd->hidden) _drawer_close(obj, w, h, EINA_FALSE); 1099 if (sd->hidden) _drawer_close(obj, w, h, EINA_FALSE);
1096 else _drawer_open(obj, w, h, EINA_FALSE); 1100 else _drawer_open(obj, w, h, EINA_FALSE);
1097 1101
1098 return ECORE_CALLBACK_CANCEL; 1102 return EO_CALLBACK_STOP;
1099} 1103}
1100 1104
1101EOLIAN static void 1105EOLIAN static void
@@ -1125,7 +1129,8 @@ _elm_panel_evas_object_smart_resize(Eo *obj, Elm_Panel_Data *sd, Evas_Coord w, E
1125 break; 1129 break;
1126 } 1130 }
1127 1131
1128 ecore_animator_add(_elm_panel_anim_cb, obj); 1132 eo_do(evas_object_evas_get(obj),
1133 eo_event_callback_add(EVAS_CANVAS_EVENT_ANIMATOR_TICK, _elm_panel_anim_cb, obj));
1129} 1134}
1130 1135
1131EOLIAN static void 1136EOLIAN static void
@@ -1181,6 +1186,15 @@ _elm_panel_eo_base_constructor(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
1181} 1186}
1182 1187
1183EOLIAN static void 1188EOLIAN static void
1189_elm_panel_eo_base_destructor(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED)
1190{
1191 eo_do(evas_object_evas_get(obj),
1192 eo_event_callback_del(EVAS_CANVAS_EVENT_ANIMATOR_TICK, _elm_panel_anim_cb, obj));
1193
1194 eo_do_super(obj, MY_CLASS, eo_destructor());
1195}
1196
1197EOLIAN static void
1184_elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient) 1198_elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
1185{ 1199{
1186 if (sd->orient == orient) return; 1200 if (sd->orient == orient) return;
@@ -1379,7 +1393,8 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
1379 break; 1393 break;
1380 } 1394 }
1381 1395
1382 ecore_animator_add(_elm_panel_anim_cb, obj); 1396 eo_do(evas_object_evas_get(obj),
1397 eo_event_callback_add(EVAS_CANVAS_EVENT_ANIMATOR_TICK, _elm_panel_anim_cb, obj));
1383} 1398}
1384 1399
1385EOLIAN static Eina_Bool 1400EOLIAN 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,
67 implements { 67 implements {
68 class.constructor; 68 class.constructor;
69 Eo.Base.constructor; 69 Eo.Base.constructor;
70 Eo.Base.destructor;
70 Evas.Object_Smart.add; 71 Evas.Object_Smart.add;
71 Evas.Object_Smart.member_add; 72 Evas.Object_Smart.member_add;
72 Evas.Object_Smart.del; 73 Evas.Object_Smart.del;