forked from enlightenment/efl
protect against a whole bunch of NULLS that the new eo stuff brings out.
SVN revision: 79129
This commit is contained in:
parent
ee63a9e294
commit
0bbec07e69
|
@ -173,6 +173,7 @@ static void
|
||||||
evas_object_event_callback_clear(Evas_Object *eo_obj)
|
evas_object_event_callback_clear(Evas_Object *eo_obj)
|
||||||
{
|
{
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
|
if (!obj) return;
|
||||||
if (!obj->callbacks) return;
|
if (!obj->callbacks) return;
|
||||||
if (!obj->callbacks->deletions_waiting) return;
|
if (!obj->callbacks->deletions_waiting) return;
|
||||||
obj->callbacks->deletions_waiting = 0;
|
obj->callbacks->deletions_waiting = 0;
|
||||||
|
@ -188,6 +189,7 @@ static void
|
||||||
evas_event_callback_clear(Evas *eo_e)
|
evas_event_callback_clear(Evas *eo_e)
|
||||||
{
|
{
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
|
if (!e) return;
|
||||||
if (!e->callbacks) return;
|
if (!e->callbacks) return;
|
||||||
if (!e->callbacks->deletions_waiting) return;
|
if (!e->callbacks->deletions_waiting) return;
|
||||||
e->callbacks->deletions_waiting = 0;
|
e->callbacks->deletions_waiting = 0;
|
||||||
|
@ -205,6 +207,7 @@ evas_object_event_callback_all_del(Evas_Object *eo_obj)
|
||||||
Evas_Func_Node *fn;
|
Evas_Func_Node *fn;
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
|
|
||||||
|
if (!obj) return;
|
||||||
if (!obj->callbacks) return;
|
if (!obj->callbacks) return;
|
||||||
EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
|
EINA_INLIST_FOREACH(obj->callbacks->callbacks, fn)
|
||||||
fn->delete_me = 1;
|
fn->delete_me = 1;
|
||||||
|
@ -215,6 +218,7 @@ evas_object_event_callback_cleanup(Evas_Object *eo_obj)
|
||||||
{
|
{
|
||||||
/* MEM OK */
|
/* MEM OK */
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
|
if (!obj) return;
|
||||||
if (!obj->callbacks) return;
|
if (!obj->callbacks) return;
|
||||||
evas_event_callback_list_post_free(&obj->callbacks->callbacks);
|
evas_event_callback_list_post_free(&obj->callbacks->callbacks);
|
||||||
EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks);
|
EVAS_MEMPOOL_FREE(_mp_cb, obj->callbacks);
|
||||||
|
@ -227,6 +231,7 @@ evas_event_callback_all_del(Evas *eo_e)
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
Evas_Func_Node *fn;
|
Evas_Func_Node *fn;
|
||||||
|
|
||||||
|
if (!e) return;
|
||||||
if (!e->callbacks) return;
|
if (!e->callbacks) return;
|
||||||
EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
|
EINA_INLIST_FOREACH(e->callbacks->callbacks, fn)
|
||||||
fn->delete_me = 1;
|
fn->delete_me = 1;
|
||||||
|
@ -237,6 +242,7 @@ evas_event_callback_cleanup(Evas *eo_e)
|
||||||
{
|
{
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
/* MEM OK */
|
/* MEM OK */
|
||||||
|
if (!e) return;
|
||||||
if (!e->callbacks) return;
|
if (!e->callbacks) return;
|
||||||
evas_event_callback_list_post_free(&e->callbacks->callbacks);
|
evas_event_callback_list_post_free(&e->callbacks->callbacks);
|
||||||
EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
|
EVAS_MEMPOOL_FREE(_mp_cb, e->callbacks);
|
||||||
|
@ -249,6 +255,7 @@ evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
Eina_Inlist **l_mod = NULL, *l;
|
Eina_Inlist **l_mod = NULL, *l;
|
||||||
|
|
||||||
|
if (!e) return;
|
||||||
_evas_walk(e);
|
_evas_walk(e);
|
||||||
if (e->callbacks)
|
if (e->callbacks)
|
||||||
{
|
{
|
||||||
|
@ -285,6 +292,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
|
||||||
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
|
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
|
||||||
Evas_Public_Data *e;
|
Evas_Public_Data *e;
|
||||||
|
|
||||||
|
if (!obj) return;
|
||||||
if ((obj->delete_me) || (!obj->layer)) return;
|
if ((obj->delete_me) || (!obj->layer)) return;
|
||||||
if ((obj->last_event == event_id) &&
|
if ((obj->last_event == event_id) &&
|
||||||
(obj->last_event_type == type)) return;
|
(obj->last_event_type == type)) return;
|
||||||
|
@ -418,6 +426,7 @@ evas_object_event_callback_priority_add(Evas_Object *eo_obj, Evas_Callback_Type
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!obj) return;
|
||||||
if (!func) return;
|
if (!func) return;
|
||||||
|
|
||||||
if (!obj->callbacks)
|
if (!obj->callbacks)
|
||||||
|
@ -453,6 +462,7 @@ evas_object_event_callback_del(Evas_Object *eo_obj, Evas_Callback_Type type, Eva
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
|
|
||||||
|
if (!obj) return NULL;
|
||||||
if (!func) return NULL;
|
if (!func) return NULL;
|
||||||
|
|
||||||
if (!obj->callbacks) return NULL;
|
if (!obj->callbacks) return NULL;
|
||||||
|
@ -485,6 +495,7 @@ evas_object_event_callback_del_full(Evas_Object *eo_obj, Evas_Callback_Type type
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
|
|
||||||
|
if (!obj) return NULL;
|
||||||
if (!func) return NULL;
|
if (!func) return NULL;
|
||||||
|
|
||||||
if (!obj->callbacks) return NULL;
|
if (!obj->callbacks) return NULL;
|
||||||
|
@ -524,6 +535,7 @@ evas_event_callback_priority_add(Evas *eo_e, Evas_Callback_Type type, Evas_Callb
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!e) return;
|
||||||
if (!func) return;
|
if (!func) return;
|
||||||
|
|
||||||
if (!e->callbacks)
|
if (!e->callbacks)
|
||||||
|
@ -558,6 +570,7 @@ evas_event_callback_del(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb func)
|
||||||
return NULL;
|
return NULL;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
|
if (!e) return NULL;
|
||||||
if (!func) return NULL;
|
if (!func) return NULL;
|
||||||
|
|
||||||
if (!e->callbacks) return NULL;
|
if (!e->callbacks) return NULL;
|
||||||
|
@ -590,6 +603,7 @@ evas_event_callback_del_full(Evas *eo_e, Evas_Callback_Type type, Evas_Event_Cb
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
|
|
||||||
|
if (!e) return NULL;
|
||||||
if (!func) return NULL;
|
if (!func) return NULL;
|
||||||
|
|
||||||
if (!e->callbacks) return NULL;
|
if (!e->callbacks) return NULL;
|
||||||
|
@ -621,6 +635,7 @@ evas_post_event_callback_push(Evas *eo_e, Evas_Object_Event_Post_Cb func, const
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
|
if (!e) return;
|
||||||
EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, );
|
EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, );
|
||||||
pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback);
|
pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback);
|
||||||
if (!pc) return;
|
if (!pc) return;
|
||||||
|
@ -643,6 +658,7 @@ evas_post_event_callback_remove(Evas *eo_e, Evas_Object_Event_Post_Cb func)
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
|
if (!e) return;
|
||||||
EINA_LIST_FOREACH(e->post_events, l, pc)
|
EINA_LIST_FOREACH(e->post_events, l, pc)
|
||||||
{
|
{
|
||||||
if (pc->func == func)
|
if (pc->func == func)
|
||||||
|
@ -664,6 +680,7 @@ evas_post_event_callback_remove_full(Evas *eo_e, Evas_Object_Event_Post_Cb func,
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
|
||||||
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
|
||||||
|
if (!e) return;
|
||||||
EINA_LIST_FOREACH(e->post_events, l, pc)
|
EINA_LIST_FOREACH(e->post_events, l, pc)
|
||||||
{
|
{
|
||||||
if ((pc->func == func) && (pc->data == data))
|
if ((pc->func == func) && (pc->data == data))
|
||||||
|
|
|
@ -8,6 +8,8 @@ evas_object_inject(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *
|
||||||
{
|
{
|
||||||
Evas_Layer *lay;
|
Evas_Layer *lay;
|
||||||
|
|
||||||
|
if (!obj) return;
|
||||||
|
if (!e) return;
|
||||||
if (obj->in_layer) return;
|
if (obj->in_layer) return;
|
||||||
lay = evas_layer_find(e, obj->cur.layer);
|
lay = evas_layer_find(e, obj->cur.layer);
|
||||||
if (!lay)
|
if (!lay)
|
||||||
|
|
|
@ -96,10 +96,13 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
||||||
if (obj->prev.map) evas_map_free(obj->prev.map);
|
if (obj->prev.map) evas_map_free(obj->prev.map);
|
||||||
if (obj->cache_map) evas_map_free(obj->cache_map);
|
if (obj->cache_map) evas_map_free(obj->cache_map);
|
||||||
if (obj->map.surface)
|
if (obj->map.surface)
|
||||||
|
{
|
||||||
|
if (obj->layer)
|
||||||
{
|
{
|
||||||
obj->layer->evas->engine.func->image_map_surface_free
|
obj->layer->evas->engine.func->image_map_surface_free
|
||||||
(obj->layer->evas->engine.data.output,
|
(obj->layer->evas->engine.data.output,
|
||||||
obj->map.surface);
|
obj->map.surface);
|
||||||
|
}
|
||||||
obj->map.surface = NULL;
|
obj->map.surface = NULL;
|
||||||
}
|
}
|
||||||
evas_object_grabs_cleanup(eo_obj, obj);
|
evas_object_grabs_cleanup(eo_obj, obj);
|
||||||
|
@ -143,6 +146,7 @@ evas_object_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||||
Evas_Object *eo_obj2;
|
Evas_Object *eo_obj2;
|
||||||
Eina_Bool movch = EINA_FALSE;
|
Eina_Bool movch = EINA_FALSE;
|
||||||
|
|
||||||
|
if (!obj->layer) return;
|
||||||
if (obj->layer->evas->nochange) return;
|
if (obj->layer->evas->nochange) return;
|
||||||
obj->layer->evas->changed = EINA_TRUE;
|
obj->layer->evas->changed = EINA_TRUE;
|
||||||
|
|
||||||
|
@ -320,6 +324,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
|
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
|
if (!obj->layer) return;
|
||||||
|
|
||||||
if (obj->is_smart) goto end;
|
if (obj->is_smart) goto end;
|
||||||
/* FIXME: was_v isn't used... why? */
|
/* FIXME: was_v isn't used... why? */
|
||||||
|
@ -528,17 +533,20 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
if (obj->focused)
|
if (obj->focused)
|
||||||
{
|
{
|
||||||
obj->focused = EINA_FALSE;
|
obj->focused = EINA_FALSE;
|
||||||
|
if (obj->layer)
|
||||||
obj->layer->evas->focused = NULL;
|
obj->layer->evas->focused = NULL;
|
||||||
_evas_object_event_new();
|
_evas_object_event_new();
|
||||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter);
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_OUT, NULL, _evas_event_counter);
|
||||||
|
if (obj->layer)
|
||||||
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
||||||
}
|
}
|
||||||
_evas_object_event_new();
|
_evas_object_event_new();
|
||||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, _evas_event_counter);
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, _evas_event_counter);
|
||||||
|
if (obj->layer)
|
||||||
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
||||||
if (obj->mouse_grabbed > 0)
|
if ((obj->mouse_grabbed > 0) && (obj->layer))
|
||||||
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
||||||
if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
|
if (((obj->mouse_in) || (obj->mouse_grabbed > 0)) && (obj->layer))
|
||||||
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, eo_obj);
|
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, eo_obj);
|
||||||
obj->mouse_grabbed = 0;
|
obj->mouse_grabbed = 0;
|
||||||
obj->mouse_in = 0;
|
obj->mouse_in = 0;
|
||||||
|
@ -559,6 +567,7 @@ _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
if (obj->is_smart) evas_object_smart_del(eo_obj);
|
if (obj->is_smart) evas_object_smart_del(eo_obj);
|
||||||
_evas_object_event_new();
|
_evas_object_event_new();
|
||||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, _evas_event_counter);
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, _evas_event_counter);
|
||||||
|
if (obj->layer)
|
||||||
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
||||||
evas_object_smart_cleanup(eo_obj);
|
evas_object_smart_cleanup(eo_obj);
|
||||||
obj->delete_me = 1;
|
obj->delete_me = 1;
|
||||||
|
@ -713,6 +722,7 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
int nx = 0, ny = 0;
|
int nx = 0, ny = 0;
|
||||||
|
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
|
if (!obj->layer) return;
|
||||||
|
|
||||||
nx = x;
|
nx = x;
|
||||||
ny = y;
|
ny = y;
|
||||||
|
@ -808,6 +818,7 @@ _size_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
Eina_Bool source_invisible = EINA_FALSE;
|
Eina_Bool source_invisible = EINA_FALSE;
|
||||||
|
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
|
if (!obj->layer) return;
|
||||||
if (w < 0) w = 0; if (h < 0) h = 0;
|
if (w < 0) w = 0; if (h < 0) h = 0;
|
||||||
|
|
||||||
if (evas_object_intercept_call_resize(eo_obj, w, h)) return;
|
if (evas_object_intercept_call_resize(eo_obj, w, h)) return;
|
||||||
|
@ -893,7 +904,7 @@ _position_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
Evas_Coord *x = va_arg(*list, Evas_Coord *);
|
Evas_Coord *x = va_arg(*list, Evas_Coord *);
|
||||||
Evas_Coord *y = va_arg(*list, Evas_Coord *);
|
Evas_Coord *y = va_arg(*list, Evas_Coord *);
|
||||||
|
|
||||||
if (obj->delete_me)
|
if ((obj->delete_me) || (!obj->layer))
|
||||||
{
|
{
|
||||||
if (x) *x = 0; if (y) *y = 0;
|
if (x) *x = 0; if (y) *y = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -1402,6 +1413,7 @@ _visible_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
static void
|
static void
|
||||||
_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||||
{
|
{
|
||||||
|
if (!obj->layer) return;
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
if (evas_object_intercept_call_show(eo_obj)) return;
|
if (evas_object_intercept_call_show(eo_obj)) return;
|
||||||
if (obj->is_smart)
|
if (obj->is_smart)
|
||||||
|
@ -1445,6 +1457,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||||
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
||||||
return;
|
return;
|
||||||
MAGIC_CHECK_END();
|
MAGIC_CHECK_END();
|
||||||
|
if (!obj->layer) return;
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
if (evas_object_intercept_call_hide(eo_obj)) return;
|
if (evas_object_intercept_call_hide(eo_obj)) return;
|
||||||
if (obj->is_smart)
|
if (obj->is_smart)
|
||||||
|
@ -1805,7 +1818,7 @@ _evas_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
const Evas_Object_Protected_Data *obj = _pd;
|
const Evas_Object_Protected_Data *obj = _pd;
|
||||||
Evas **evas = va_arg(*list, Evas **);
|
Evas **evas = va_arg(*list, Evas **);
|
||||||
|
|
||||||
if (obj->delete_me)
|
if ((obj->delete_me) || (!obj->layer))
|
||||||
{
|
{
|
||||||
*evas = NULL;
|
*evas = NULL;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue