revert rev. 62944

SVN revision: 62963
This commit is contained in:
Vincent Torri 2011-08-29 19:05:03 +00:00
parent 4d7ca99b4a
commit 93ded6d380
3 changed files with 15 additions and 62 deletions

View File

@ -249,8 +249,6 @@ evas_free(Evas *e)
eina_array_flush(&e->calculate_objects); eina_array_flush(&e->calculate_objects);
eina_array_flush(&e->clip_changes); eina_array_flush(&e->clip_changes);
eina_list_free(e->calc_list);
e->magic = 0; e->magic = 0;
free(e); free(e);
} }

View File

@ -10,8 +10,7 @@ struct _Evas_Object_Smart
void *engine_data; void *engine_data;
void *data; void *data;
Eina_List *callbacks; Eina_List *callbacks;
Eina_Inlist *contained; Eina_Inlist *contained;
Eina_List *calc_node;
Evas_Smart_Cb_Description_Array callbacks_descriptions; Evas_Smart_Cb_Description_Array callbacks_descriptions;
int walking_list; int walking_list;
Eina_Bool deletions_waiting : 1; Eina_Bool deletions_waiting : 1;
@ -549,38 +548,7 @@ evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value)
return; return;
MAGIC_CHECK_END(); MAGIC_CHECK_END();
// XXX: do i need this?
if (obj->delete_me) return;
value = !!value; value = !!value;
if (value)
{
Evas *e = obj->layer->evas;
if (o->need_recalculate)
{
if ((o->calc_node) && (e->calc_list_current != o->calc_node))
e->calc_list = eina_list_demote_list(e->calc_list,
o->calc_node);
else
e->calc_list = eina_list_append(e->calc_list, obj);
}
else
e->calc_list = eina_list_append(e->calc_list, obj);
o->calc_node = eina_list_last(e->calc_list);
}
else
{
Evas *e = obj->layer->evas;
if (o->need_recalculate)
{
if ((o->calc_node) && (e->calc_list_current != o->calc_node))
e->calc_list = eina_list_remove_list(e->calc_list,
o->calc_node);
o->calc_node = NULL;
}
}
if (o->need_recalculate == value) if (o->need_recalculate == value)
return; return;
@ -600,14 +568,11 @@ evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value)
* XXX: on _evas_render_call_smart_calculate() will check for the flag * XXX: on _evas_render_call_smart_calculate() will check for the flag
* XXX: and it will be unset after the first. * XXX: and it will be unset after the first.
*/ */
/*
if (o->need_recalculate) if (o->need_recalculate)
{ {
Evas *e = obj->layer->evas; Evas *e = obj->layer->evas;
eina_array_push(&e->calculate_objects, obj); eina_array_push(&e->calculate_objects, obj);
} }
*/
/* TODO: else, remove from array */ /* TODO: else, remove from array */
} }
@ -673,31 +638,31 @@ evas_call_smarts_calculate(Evas *e)
{ {
Eina_Array *calculate; Eina_Array *calculate;
Evas_Object *obj; Evas_Object *obj;
Eina_List *l; Eina_Array_Iterator it;
unsigned int i;
// printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n");
evas_event_freeze(e); evas_event_freeze(e);
e->in_smart_calc++; e->in_smart_calc++;
calculate = &e->calculate_objects;
EINA_LIST_FOREACH(e->calc_list, l, obj) for (i = 0; i < eina_array_count_get(calculate); ++i)
{ {
Evas_Object_Smart *o = obj->object_data; Evas_Object_Smart *o;
if (obj->delete_me) continue; obj = eina_array_data_get(calculate, i);
e->calc_list_current = l; if (obj->delete_me)
continue;
o = obj->object_data;
if (o->need_recalculate) if (o->need_recalculate)
{ {
o->need_recalculate = 0; o->need_recalculate = 0;
obj->smart.smart->smart_class->calculate(obj); obj->smart.smart->smart_class->calculate(obj);
} }
if (o->calc_node == l) o->calc_node = NULL;
e->calc_list_current = NULL;
} }
EINA_LIST_FREE(e->calc_list, obj) EINA_ARRAY_ITER_NEXT(calculate, i, obj, it)
{ {
obj->recalculate_cycle = 0; obj->recalculate_cycle = 0;
} }
e->calc_list_current = NULL;
e->in_smart_calc--; e->in_smart_calc--;
if (e->in_smart_calc == 0) if (e->in_smart_calc == 0)
{ {
@ -706,7 +671,6 @@ evas_call_smarts_calculate(Evas *e)
} }
evas_event_thaw(e); evas_event_thaw(e);
evas_event_thaw_eval(e); evas_event_thaw_eval(e);
// printf("-CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------^\n");
} }
EAPI void EAPI void
@ -767,19 +731,13 @@ evas_object_smart_cleanup(Evas_Object *obj)
o = (Evas_Object_Smart *)(obj->object_data); o = (Evas_Object_Smart *)(obj->object_data);
if (o->magic == MAGIC_OBJ_SMART) if (o->magic == MAGIC_OBJ_SMART)
{ {
Evas *e = obj->layer->evas;
if ((o->calc_node) && (e->calc_list_current != o->calc_node))
e->calc_list = eina_list_remove_list(e->calc_list,
o->calc_node);
o->calc_node = NULL;
while (o->contained) while (o->contained)
evas_object_smart_member_del((Evas_Object *)o->contained); evas_object_smart_member_del((Evas_Object *)o->contained);
while (o->callbacks) while (o->callbacks)
{ {
Evas_Smart_Callback *cb; Evas_Smart_Callback *cb;
cb = o->callbacks->data; cb = o->callbacks->data;
o->callbacks = eina_list_remove(o->callbacks, cb); o->callbacks = eina_list_remove(o->callbacks, cb);
if (cb->event) eina_stringshare_del(cb->event); if (cb->event) eina_stringshare_del(cb->event);

View File

@ -305,9 +305,6 @@ struct _Evas
Eina_Array calculate_objects; Eina_Array calculate_objects;
Eina_Array clip_changes; Eina_Array clip_changes;
Eina_List *calc_list;
Eina_List *calc_list_current;
Eina_List *post_events; // free me on evas_free Eina_List *post_events; // free me on evas_free
Evas_Callbacks *callbacks; Evas_Callbacks *callbacks;