elm: more ELM_FREE_FUNC cleanups.

This commit is contained in:
Daniel Juyung Seo 2013-05-24 00:58:38 +09:00
parent 07911ab648
commit ef8701a173
9 changed files with 63 additions and 193 deletions

View File

@ -360,11 +360,7 @@ _transition_layout_animation_stop(Elm_Box_Transition *layout_data)
{
layout_data->animation_ended = EINA_TRUE;
if (layout_data->animator)
{
ecore_animator_del(layout_data->animator);
layout_data->animator = NULL;
}
ELM_FREE_FUNC(layout_data->animator, ecore_animator_del);
if (layout_data->transition_end_cb)
layout_data->transition_end_cb(layout_data->transition_end_data);
@ -791,11 +787,7 @@ elm_box_transition_free(void *data)
(box_data->box, SIG_CHILD_ADDED, _transition_layout_child_added);
evas_object_smart_callback_del
(box_data->box, SIG_CHILD_REMOVED, _transition_layout_child_removed);
if (box_data->animator)
{
ecore_animator_del(box_data->animator);
box_data->animator = NULL;
}
ELM_FREE_FUNC(box_data->animator, ecore_animator_del);
free(data);
}

View File

@ -2879,12 +2879,7 @@ _anim_st_free(Item_Container_Drag_Info *st)
{ /* Stops and free mem of ongoing animation */
if (st)
{
if (st->ea)
{
ecore_animator_del(st->ea);
st->ea = NULL;
}
ELM_FREE_FUNC(st->ea, ecore_animator_del);
Anim_Icon *sti;
EINA_LIST_FREE(st->icons, sti)

View File

@ -1552,11 +1552,7 @@ _down_cb(void *data,
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (sd->animator)
{
ecore_animator_del(sd->animator);
sd->animator = NULL;
}
ELM_FREE_FUNC(sd->animator, ecore_animator_del);
sd->down = EINA_TRUE;
sd->started = EINA_FALSE;
evas_object_geometry_get(data, &x, &y, &w, &h);

View File

@ -1240,9 +1240,8 @@ _item_place(Elm_Gen_Item *it,
}
else if (item->item_reorder_move_animator)
{
ecore_animator_del
(item->item_reorder_move_animator);
item->item_reorder_move_animator = NULL;
ELM_FREE_FUNC(item->item_reorder_move_animator,
ecore_animator_del);
item->moving = EINA_FALSE;
}
}

View File

@ -3066,8 +3066,7 @@ _item_del(Elm_Gen_Item *it)
if (sd->tree_effect_animator)
{
_item_tree_effect_finish(sd);
ecore_animator_del(sd->tree_effect_animator);
sd->tree_effect_animator = NULL;
ELM_FREE_FUNC(sd->tree_effect_animator, ecore_animator_del);
}
sd->expanded_item = NULL;
sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
@ -4966,22 +4965,10 @@ static void
_clear(Elm_Genlist_Smart_Data *sd)
{
sd->anchor_item = NULL;
if (sd->queue_idle_enterer)
{
ecore_idle_enterer_del(sd->queue_idle_enterer);
sd->queue_idle_enterer = NULL;
}
if (sd->must_recalc_idler)
{
ecore_idler_del(sd->must_recalc_idler);
sd->must_recalc_idler = NULL;
}
if (sd->queue) sd->queue = eina_list_free(sd->queue);
if (sd->reorder_move_animator)
{
ecore_animator_del(sd->reorder_move_animator);
sd->reorder_move_animator = NULL;
}
ELM_FREE_FUNC(sd->queue_idle_enterer, ecore_idle_enterer_del);
ELM_FREE_FUNC(sd->must_recalc_idler, ecore_idler_del);
ELM_FREE_FUNC(sd->queue, eina_list_free);
ELM_FREE_FUNC(sd->reorder_move_animator, ecore_animator_del);
sd->show_item = NULL;
sd->reorder_old_pan_y = 0;
}
@ -7004,11 +6991,7 @@ _decorate_mode_set(Eo *obj, void *_pd, va_list *valist)
if (sd->decorate_all_mode == decorated) return;
sd->decorate_all_mode = decorated;
if (sd->tree_effect_animator)
{
ecore_animator_del(sd->tree_effect_animator);
sd->tree_effect_animator = NULL;
}
ELM_FREE_FUNC(sd->tree_effect_animator, ecore_animator_del);
sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
list = elm_genlist_realized_items_get(obj);

View File

@ -1298,8 +1298,7 @@ _elm_scroll_momentum_end(Elm_Scrollable_Smart_Interface_Data *sid)
eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&px, &py));
_elm_scroll_wanted_coordinates_update(sid, px, py);
ecore_animator_del(sid->down.momentum_animator);
sid->down.momentum_animator = NULL;
ELM_FREE_FUNC(sid->down.momentum_animator, ecore_animator_del);
sid->down.bounce_x_hold = EINA_FALSE;
sid->down.bounce_y_hold = EINA_FALSE;
sid->down.ax = 0;
@ -1438,15 +1437,13 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
if (sid->down.now) return; // down bounce while still held down
if (sid->down.onhold_animator)
{
ecore_animator_del(sid->down.onhold_animator);
sid->down.onhold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.hold_animator)
{
ecore_animator_del(sid->down.hold_animator);
sid->down.hold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -1468,11 +1465,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
{
if (sid->bouncemex)
{
if (sid->scrollto.x.animator)
{
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
sid->down.bounce_x_animator =
ecore_animator_add(_elm_scroll_bounce_x_animator, sid->obj);
sid->down.anim_start2 = ecore_loop_time_get();
@ -1492,11 +1485,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
{
if (sid->bouncemey)
{
if (sid->scrollto.y.animator)
{
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
sid->down.bounce_y_animator =
ecore_animator_add(_elm_scroll_bounce_y_animator, sid->obj);
sid->down.anim_start3 = ecore_loop_time_get();
@ -1755,44 +1744,32 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
{
_elm_scroll_anim_stop(sid);
}
if (sid->scrollto.x.animator)
{
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
}
if (sid->scrollto.y.animator)
{
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
if (sid->down.bounce_x_animator)
{
ecore_animator_del(sid->down.bounce_x_animator);
sid->down.bounce_x_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_x_animator, ecore_animator_del);
sid->bouncemex = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.bounce_y_animator)
{
ecore_animator_del(sid->down.bounce_y_animator);
sid->down.bounce_y_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_y_animator, ecore_animator_del);
sid->bouncemey = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.hold_animator)
{
ecore_animator_del(sid->down.hold_animator);
sid->down.hold_animator = NULL;
ELM_FREE_FUNC(sid->down.hold_animator, ecore_animator_del);
_elm_scroll_drag_stop(sid);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.momentum_animator)
{
ecore_animator_del(sid->down.momentum_animator);
sid->down.momentum_animator = NULL;
ELM_FREE_FUNC(sid->down.momentum_animator, ecore_animator_del);
sid->down.bounce_x_hold = EINA_FALSE;
sid->down.bounce_y_hold = EINA_FALSE;
sid->down.ax = 0;
@ -1939,28 +1916,18 @@ _elm_scroll_wheel_event_cb(void *data,
{
_elm_scroll_anim_stop(sid);
}
if (sid->scrollto.x.animator)
{
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
}
if (sid->scrollto.y.animator)
{
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
if (sid->down.bounce_x_animator)
{
ecore_animator_del(sid->down.bounce_x_animator);
sid->down.bounce_x_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_x_animator, ecore_animator_del);
sid->bouncemex = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.bounce_y_animator)
{
ecore_animator_del(sid->down.bounce_y_animator);
sid->down.bounce_y_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_y_animator, ecore_animator_del);
sid->bouncemey = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
@ -2285,8 +2252,7 @@ _elm_scroll_scroll_to_y(Elm_Scrollable_Smart_Interface_Data *sid,
}
if (sid->down.bounce_y_animator)
{
ecore_animator_del(sid->down.bounce_y_animator);
sid->down.bounce_y_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_y_animator, ecore_animator_del);
_elm_scroll_momentum_end(sid);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
@ -2330,8 +2296,7 @@ _elm_scroll_scroll_to_x(Elm_Scrollable_Smart_Interface_Data *sid,
}
if (sid->down.bounce_x_animator)
{
ecore_animator_del(sid->down.bounce_x_animator);
sid->down.bounce_x_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_x_animator, ecore_animator_del);
_elm_scroll_momentum_end(sid);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
@ -2372,8 +2337,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
{
if (sid->down.onhold_animator)
{
ecore_animator_del(sid->down.onhold_animator);
sid->down.onhold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -2572,8 +2536,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
}
if (sid->down.hold_animator)
{
ecore_animator_del(sid->down.hold_animator);
sid->down.hold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -2640,44 +2603,32 @@ _elm_scroll_mouse_down_event_cb(void *data,
sid->down.hold = EINA_TRUE;
_elm_scroll_anim_stop(sid);
}
if (sid->scrollto.x.animator)
{
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
}
if (sid->scrollto.y.animator)
{
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
if (sid->down.bounce_x_animator)
{
ecore_animator_del(sid->down.bounce_x_animator);
sid->down.bounce_x_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_x_animator, ecore_animator_del);
sid->bouncemex = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.bounce_y_animator)
{
ecore_animator_del(sid->down.bounce_y_animator);
sid->down.bounce_y_animator = NULL;
ELM_FREE_FUNC(sid->down.bounce_y_animator, ecore_animator_del);
sid->bouncemey = EINA_FALSE;
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.hold_animator)
{
ecore_animator_del(sid->down.hold_animator);
sid->down.hold_animator = NULL;
ELM_FREE_FUNC(sid->down.hold_animator, ecore_animator_del);
_elm_scroll_drag_stop(sid);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
if (sid->down.momentum_animator)
{
ecore_animator_del(sid->down.momentum_animator);
sid->down.momentum_animator = NULL;
ELM_FREE_FUNC(sid->down.momentum_animator, ecore_animator_del);
sid->down.bounce_x_hold = EINA_FALSE;
sid->down.bounce_y_hold = EINA_FALSE;
sid->down.ax = 0;
@ -3058,8 +3009,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
!(sid->block & ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL))
{
Evas_Coord px;
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, NULL));
sid->down.sx = px;
sid->down.x = sid->down.history[0].x;
@ -3069,8 +3019,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
!(sid->block & ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL))
{
Evas_Coord py;
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
eo_do(sid->pan_obj, elm_obj_pan_pos_get(NULL, &py));
sid->down.sy = py;
sid->down.y = sid->down.history[0].y;
@ -3349,8 +3298,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
{
if (sid->down.onhold_animator)
{
ecore_animator_del(sid->down.onhold_animator);
sid->down.onhold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -3976,8 +3924,7 @@ _elm_scroll_momentum_animator_disabled_set(Eo *obj EINA_UNUSED, void *_pd EINA_U
{
if (sid->down.momentum_animator)
{
ecore_animator_del(sid->down.momentum_animator);
sid->down.momentum_animator = NULL;
ELM_FREE_FUNC(sid->down.momentum_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -4001,17 +3948,8 @@ _elm_scroll_bounce_animator_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list
sid->bounce_animator_disabled = disabled;
if (sid->bounce_animator_disabled)
{
if (sid->scrollto.x.animator)
{
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
}
if (sid->scrollto.y.animator)
{
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
}
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
}
}
@ -4185,8 +4123,7 @@ _elm_scroll_freeze_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
if (sid->down.onhold_animator)
{
ecore_animator_del(sid->down.onhold_animator);
sid->down.onhold_animator = NULL;
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
@ -4519,18 +4456,13 @@ _elm_scroll_interface_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
eo_do(obj, elm_scrollable_interface_content_set(NULL));
if (!sid->extern_pan) evas_object_del(sid->pan_obj);
if (sid->down.hold_animator)
ecore_animator_del(sid->down.hold_animator);
if (sid->down.onhold_animator)
ecore_animator_del(sid->down.onhold_animator);
if (sid->down.momentum_animator)
ecore_animator_del(sid->down.momentum_animator);
if (sid->down.bounce_x_animator)
ecore_animator_del(sid->down.bounce_x_animator);
if (sid->down.bounce_y_animator)
ecore_animator_del(sid->down.bounce_y_animator);
if (sid->scrollto.x.animator) ecore_animator_del(sid->scrollto.x.animator);
if (sid->scrollto.y.animator) ecore_animator_del(sid->scrollto.y.animator);
ELM_FREE_FUNC(sid->down.hold_animator, ecore_animator_del);
ELM_FREE_FUNC(sid->down.onhold_animator, ecore_animator_del);
ELM_FREE_FUNC(sid->down.momentum_animator, ecore_animator_del);
ELM_FREE_FUNC(sid->down.bounce_x_animator, ecore_animator_del);
ELM_FREE_FUNC(sid->down.bounce_y_animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.x.animator, ecore_animator_del);
ELM_FREE_FUNC(sid->scrollto.y.animator, ecore_animator_del);
}
static void

View File

@ -258,8 +258,7 @@ _transit_del(Elm_Transit *transit)
transit->deleted = EINA_TRUE;
if (transit->animator)
ecore_animator_del(transit->animator);
ELM_FREE_FUNC(transit->animator, ecore_animator_del);
//remove effects
while (transit->effect_list)
@ -717,8 +716,7 @@ elm_transit_go(Elm_Transit *transit)
Eina_List *elist;
Evas_Object *obj;
if (transit->animator)
ecore_animator_del(transit->animator);
ELM_FREE_FUNC(transit->animator, ecore_animator_del);
EINA_LIST_FOREACH(transit->objs, elist, obj)
_transit_obj_data_update(transit, obj);

View File

@ -254,8 +254,7 @@ _view_smart_del(Evas_Object *obj)
sd = evas_object_smart_data_get(obj);
if (sd->mouse.pan_anim)
ecore_animator_del(sd->mouse.pan_anim);
ELM_FREE_FUNC(sd->mouse.pan_anim, ecore_animator_del);
_ewk_view_parent_sc.sc.del(obj);
}
@ -303,8 +302,7 @@ _view_smart_mouse_up(Ewk_View_Smart_Data *esd,
if (sd->mouse.pan_anim)
{
ecore_animator_del(sd->mouse.pan_anim);
sd->mouse.pan_anim = NULL;
ELM_FREE_FUNC(sd->mouse.pan_anim, ecore_animator_del);
if (sd->mouse.longpress_timer)
_ewk_view_parent_sc.mouse_down(esd, &sd->mouse.event);
@ -2379,11 +2377,7 @@ _region_show(Eo *obj, void *_pd, va_list *list)
zh = fh / zoom;
rx = (x * fw) / zw;
ry = (y * fh) / zh;
if (sd->bring_in.animator)
{
ecore_animator_del(sd->bring_in.animator);
sd->bring_in.animator = NULL;
}
ELM_FREE_FUNC(sd->bring_in.animator, ecore_animator_del);
ewk_frame_scroll_set(frame, rx, ry);
#else
(void)obj;
@ -2436,8 +2430,7 @@ _region_bring_in(Eo *obj, void *_pd, va_list *list)
sd->bring_in.start.y = sy;
sd->bring_in.end.x = rx;
sd->bring_in.end.y = ry;
if (sd->bring_in.animator)
ecore_animator_del(sd->bring_in.animator);
ELM_FREE_FUNC(sd->bring_in.animator, ecore_animator_del);
sd->bring_in.animator = ecore_animator_timeline_add(
_elm_config->bring_in_scroll_friction, _bring_in_anim_cb, obj);
#else

View File

@ -33,11 +33,7 @@ _elm_ews_wm_border_del(void *data)
if (_ews_border_mover_obj == deco)
{
if (_ews_border_mover)
{
ecore_animator_del(_ews_border_mover);
_ews_border_mover = NULL;
}
ELM_FREE_FUNC(_ews_border_mover, ecore_animator_del);
_ews_border_mover_obj = NULL;
}
}
@ -280,14 +276,13 @@ _elm_ews_border_sig_move_start(void *data, Evas_Object *o __UNUSED__, const char
Evas_Object *bs_o = ecore_evas_ews_backing_store_get(ee);
int x, y, ox, oy;
if (_ews_border_mover) ecore_animator_del(_ews_border_mover);
ELM_FREE_FUNC(_ews_border_mover, ecore_animator_del);
evas_pointer_output_xy_get(evas_object_evas_get(bs_o), &x, &y);
evas_object_geometry_get(bs_o, &ox, &oy, NULL, NULL);
_ews_border_mover_off.x = x - ox;
_ews_border_mover_off.y = y - oy;
_ews_border_mover_obj = bs_o;
if (_ews_border_mover) ecore_animator_del(_ews_border_mover);
_ews_border_mover = ecore_animator_add(_elm_ews_border_mover, ee);
}
@ -295,8 +290,7 @@ static void
_elm_ews_border_sig_move_stop(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *sig __UNUSED__, const char *source __UNUSED__)
{
if (!_ews_border_mover) return;
ecore_animator_del(_ews_border_mover);
_ews_border_mover = NULL;
ELM_FREE_FUNC(_ews_border_mover, ecore_animator_del);
_ews_border_mover_obj = NULL;
}
@ -529,23 +523,11 @@ _elm_ews_wm_shutdown(void)
{
Ecore_Event_Handler *eh;
if (_ews_border_mover)
{
ecore_animator_del(_ews_border_mover);
_ews_border_mover = NULL;
}
ELM_FREE_FUNC(_ews_border_mover, ecore_animator_del);
_ews_border_mover_obj = NULL;
EINA_LIST_FREE(_ews_ev_handlers, eh) ecore_event_handler_del(eh);
if (_ews_borders)
{
eina_hash_free(_ews_borders);
_ews_borders = NULL;
}
if (_ews_borders_geo)
{
eina_hash_free(_ews_borders_geo);
_ews_borders_geo = NULL;
}
ELM_FREE_FUNC(_ews_borders, eina_hash_free);
ELM_FREE_FUNC(_ews_borders_geo, ecore_animator_del);
_ews_bg = NULL;
}