eo: remove EFL_EVENT_SPECIAL_SKIP.
EFL_EVENT_SPECIAL_SKIP has been defined to 1 for a long time and there wasn't a way to disable it at all. There is no reason to not use it at all, so here we go. This was default, now it is without useless code. Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D7743
This commit is contained in:
parent
4a25abccd6
commit
27b06dd4ad
|
@ -13,8 +13,6 @@
|
||||||
#include "eo_private.h"
|
#include "eo_private.h"
|
||||||
#include "eina_promise_private.h"
|
#include "eina_promise_private.h"
|
||||||
|
|
||||||
#define EFL_EVENT_SPECIAL_SKIP 1
|
|
||||||
|
|
||||||
EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_ADD =
|
EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_ADD =
|
||||||
EFL_EVENT_DESCRIPTION_HOT("callback,add");
|
EFL_EVENT_DESCRIPTION_HOT("callback,add");
|
||||||
|
|
||||||
|
@ -58,12 +56,10 @@ struct _Efl_Object_Data
|
||||||
unsigned int callbacks_count;
|
unsigned int callbacks_count;
|
||||||
|
|
||||||
unsigned short event_freeze_count;
|
unsigned short event_freeze_count;
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
unsigned short event_cb_efl_event_callback_add_count;
|
unsigned short event_cb_efl_event_callback_add_count;
|
||||||
unsigned short event_cb_efl_event_callback_del_count;
|
unsigned short event_cb_efl_event_callback_del_count;
|
||||||
unsigned short event_cb_efl_event_del_count;
|
unsigned short event_cb_efl_event_del_count;
|
||||||
unsigned short event_cb_efl_event_noref_count;
|
unsigned short event_cb_efl_event_noref_count;
|
||||||
#endif
|
|
||||||
Eina_Bool callback_stopped : 1;
|
Eina_Bool callback_stopped : 1;
|
||||||
Eina_Bool need_cleaning : 1;
|
Eina_Bool need_cleaning : 1;
|
||||||
Eina_Bool allow_parent_unref : 1; // Allows unref to zero even with a parent
|
Eina_Bool allow_parent_unref : 1; // Allows unref to zero even with a parent
|
||||||
|
@ -1158,8 +1154,6 @@ _efl_pending_future_new(void)
|
||||||
sizeof(Efl_Future_Pending));
|
sizeof(Efl_Future_Pending));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
|
|
||||||
#define CB_COUNT_INC(cnt) do { if ((cnt) != 0xffff) (cnt)++; } while(0)
|
#define CB_COUNT_INC(cnt) do { if ((cnt) != 0xffff) (cnt)++; } while(0)
|
||||||
#define CB_COUNT_DEC(cnt) do { if ((cnt) != 0xffff) (cnt)--; } while(0)
|
#define CB_COUNT_DEC(cnt) do { if ((cnt) != 0xffff) (cnt)--; } while(0)
|
||||||
|
|
||||||
|
@ -1190,14 +1184,12 @@ _special_event_count_dec(Efl_Object_Data *pd, const Efl_Callback_Array_Item *it)
|
||||||
else if (it->desc == EFL_EVENT_NOREF)
|
else if (it->desc == EFL_EVENT_NOREF)
|
||||||
CB_COUNT_DEC(pd->event_cb_efl_event_noref_count);
|
CB_COUNT_DEC(pd->event_cb_efl_event_noref_count);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Actually remove, doesn't care about walking list, or delete_me */
|
/* Actually remove, doesn't care about walking list, or delete_me */
|
||||||
static void
|
static void
|
||||||
_eo_callback_remove(Efl_Object_Data *pd, Eo_Callback_Description **cb)
|
_eo_callback_remove(Efl_Object_Data *pd, Eo_Callback_Description **cb)
|
||||||
{
|
{
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
const Efl_Callback_Array_Item *it;
|
const Efl_Callback_Array_Item *it;
|
||||||
|
|
||||||
if ((*cb)->func_array)
|
if ((*cb)->func_array)
|
||||||
|
@ -1206,7 +1198,6 @@ _eo_callback_remove(Efl_Object_Data *pd, Eo_Callback_Description **cb)
|
||||||
_special_event_count_dec(pd, it);
|
_special_event_count_dec(pd, it);
|
||||||
}
|
}
|
||||||
else _special_event_count_dec(pd, &((*cb)->items.item));
|
else _special_event_count_dec(pd, &((*cb)->items.item));
|
||||||
#endif
|
|
||||||
|
|
||||||
_eo_callback_free(*cb);
|
_eo_callback_free(*cb);
|
||||||
|
|
||||||
|
@ -1237,12 +1228,10 @@ _eo_callback_remove_all(Efl_Object_Data *pd)
|
||||||
pd->callbacks = NULL;
|
pd->callbacks = NULL;
|
||||||
pd->callbacks_count = 0;
|
pd->callbacks_count = 0;
|
||||||
pd->has_destroyed_event_cb = EINA_FALSE;
|
pd->has_destroyed_event_cb = EINA_FALSE;
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
pd->event_cb_efl_event_callback_add_count = 0;
|
pd->event_cb_efl_event_callback_add_count = 0;
|
||||||
pd->event_cb_efl_event_callback_del_count = 0;
|
pd->event_cb_efl_event_callback_del_count = 0;
|
||||||
pd->event_cb_efl_event_del_count = 0;
|
pd->event_cb_efl_event_del_count = 0;
|
||||||
pd->event_cb_efl_event_noref_count = 0;
|
pd->event_cb_efl_event_noref_count = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1392,9 +1381,7 @@ _efl_object_event_callback_priority_add(Eo *obj, Efl_Object_Data *pd,
|
||||||
if (cb->generation) pd->need_cleaning = EINA_TRUE;
|
if (cb->generation) pd->need_cleaning = EINA_TRUE;
|
||||||
|
|
||||||
_eo_callbacks_sorted_insert(pd, cb);
|
_eo_callbacks_sorted_insert(pd, cb);
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
_special_event_count_inc(pd, &(cb->items.item));
|
_special_event_count_inc(pd, &(cb->items.item));
|
||||||
#endif
|
|
||||||
if (EINA_UNLIKELY(desc == EFL_EVENT_DESTRUCT))
|
if (EINA_UNLIKELY(desc == EFL_EVENT_DESTRUCT))
|
||||||
pd->has_destroyed_event_cb = EINA_TRUE;
|
pd->has_destroyed_event_cb = EINA_TRUE;
|
||||||
|
|
||||||
|
@ -1500,10 +1487,8 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd,
|
||||||
if (!!cb->generation) pd->need_cleaning = EINA_TRUE;
|
if (!!cb->generation) pd->need_cleaning = EINA_TRUE;
|
||||||
|
|
||||||
_eo_callbacks_sorted_insert(pd, cb);
|
_eo_callbacks_sorted_insert(pd, cb);
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
for (it = cb->items.item_array; it->func; it++)
|
for (it = cb->items.item_array; it->func; it++)
|
||||||
_special_event_count_inc(pd, it);
|
_special_event_count_inc(pd, it);
|
||||||
#else
|
|
||||||
if (!pd->has_destroyed_event_cb)
|
if (!pd->has_destroyed_event_cb)
|
||||||
{
|
{
|
||||||
for (it = cb->items.item_array; it->func; it++)
|
for (it = cb->items.item_array; it->func; it++)
|
||||||
|
@ -1513,7 +1498,6 @@ _efl_object_event_callback_array_priority_add(Eo *obj, Efl_Object_Data *pd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
for (it = cb->items.item_array; it->func; it++) num++;
|
for (it = cb->items.item_array; it->func; it++) num++;
|
||||||
|
@ -1620,7 +1604,6 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pd->callbacks_count == 0) return EINA_FALSE;
|
if (pd->callbacks_count == 0) return EINA_FALSE;
|
||||||
#ifdef EFL_EVENT_SPECIAL_SKIP
|
|
||||||
else if ((desc == EFL_EVENT_CALLBACK_ADD) &&
|
else if ((desc == EFL_EVENT_CALLBACK_ADD) &&
|
||||||
(pd->event_cb_efl_event_callback_add_count == 0)) return EINA_FALSE;
|
(pd->event_cb_efl_event_callback_add_count == 0)) return EINA_FALSE;
|
||||||
else if ((desc == EFL_EVENT_CALLBACK_DEL) &&
|
else if ((desc == EFL_EVENT_CALLBACK_DEL) &&
|
||||||
|
@ -1629,7 +1612,6 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
|
||||||
(pd->event_cb_efl_event_del_count == 0)) return EINA_FALSE;
|
(pd->event_cb_efl_event_del_count == 0)) return EINA_FALSE;
|
||||||
else if ((desc == EFL_EVENT_NOREF) &&
|
else if ((desc == EFL_EVENT_NOREF) &&
|
||||||
(pd->event_cb_efl_event_noref_count == 0)) return EINA_FALSE;
|
(pd->event_cb_efl_event_noref_count == 0)) return EINA_FALSE;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (pd->event_frame)
|
if (pd->event_frame)
|
||||||
frame.generation = ((Efl_Event_Callback_Frame*)pd->event_frame)->generation + 1;
|
frame.generation = ((Efl_Event_Callback_Frame*)pd->event_frame)->generation + 1;
|
||||||
|
|
Loading…
Reference in New Issue