diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2018-01-15 17:56:31 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2018-01-15 21:18:48 +0900 |
commit | 26738a3a25507d21c5b5709a868d674546eaeb2c (patch) | |
tree | f1d99188d6d79e0ee1a89566fc7276087d04f71f | |
parent | b04aeb41e74a6979bfe66ef859e4d9144b3468b1 (diff) | |
download | efl-26738a3a25507d21c5b5709a868d674546eaeb2c.tar.gz |
eo: Warn on calls to NULL objectdevs/jpeg/no_null_calls
This makes eo print a WRN message in case a function is called on NULL.
efl_del is an exception to this rule (implemented in a hackish way, I
admit).
A few (most likely not all) of said warnings have been resolved.
-rw-r--r-- | src/lib/ecore_input_evas/ecore_input_evas.c | 28 | ||||
-rw-r--r-- | src/lib/edje/edje_smart.c | 16 | ||||
-rw-r--r-- | src/lib/edje/edje_util.c | 6 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_button.c | 1 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_check.c | 1 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_focus_manager_calc.c | 15 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_focus_manager_sub.c | 9 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_focus_util.c | 2 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_layout.c | 45 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar.c | 1 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_radio.c | 6 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_widget.c | 12 | ||||
-rw-r--r-- | src/lib/elementary/elm_interface_scrollable.c | 3 | ||||
-rw-r--r-- | src/lib/elementary/elm_widget.h | 7 | ||||
-rw-r--r-- | src/lib/elementary/els_cursor.c | 2 | ||||
-rw-r--r-- | src/lib/eo/eo.c | 16 |
16 files changed, 120 insertions, 50 deletions
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c index 7866bd5d9a..bd2f0d1868 100644 --- a/src/lib/ecore_input_evas/ecore_input_evas.c +++ b/src/lib/ecore_input_evas/ecore_input_evas.c @@ -417,12 +417,12 @@ static Eina_Bool _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press) { Ecore_Input_Window *lookup; + Eo *seat; lookup = _ecore_event_window_match(e->event_window); if (!lookup) return ECORE_CALLBACK_PASS_ON; - ecore_event_evas_seat_modifier_lock_update(lookup->evas, - e->modifiers, - efl_input_device_seat_get(e->dev)); + seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL; + ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat); if (press == ECORE_DOWN) { if (!lookup->direct || @@ -531,9 +531,8 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr if (e->multi.device == 0) { - ecore_event_evas_seat_modifier_lock_update(lookup->evas, - e->modifiers, - efl_input_device_seat_get(e->dev)); + Eo *seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL; + ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat); if (press == ECORE_DOWN) { if (!lookup->direct || @@ -612,10 +611,9 @@ ecore_event_evas_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void * if (!lookup) return ECORE_CALLBACK_PASS_ON; if (e->multi.device == 0) { + Eo *seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL; _ecore_event_evas_push_mouse_move(e); - ecore_event_evas_seat_modifier_lock_update(lookup->evas, - e->modifiers, - efl_input_device_seat_get(e->dev)); + ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat); if (!lookup->direct || !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_MOVE, e)) { @@ -671,12 +669,13 @@ static Eina_Bool _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io) { Ecore_Input_Window *lookup; + Eo *seat; lookup = _ecore_event_window_match(e->event_window); if (!lookup) return ECORE_CALLBACK_PASS_ON; - ecore_event_evas_seat_modifier_lock_update(lookup->evas, - e->modifiers, - efl_input_device_seat_get(e->dev)); + seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL; + ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat); + switch (io) { case ECORE_IN: @@ -718,12 +717,13 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void { Ecore_Event_Mouse_Wheel *e; Ecore_Input_Window *lookup; + Eo *seat; e = event; lookup = _ecore_event_window_match(e->event_window); if (!lookup) return ECORE_CALLBACK_PASS_ON; - ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, - efl_input_device_seat_get(e->dev)); + seat = e->dev ? efl_input_device_seat_get(e->dev) : NULL; + ecore_event_evas_seat_modifier_lock_update(lookup->evas, e->modifiers, seat); if (!lookup->direct || !lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e)) { diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index ae038fb10e..6b4ed89256 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -182,13 +182,21 @@ _efl_canvas_layout_efl_gfx_position_set(Eo *obj, Edje *ed, Eina_Position2D pos) ep = ed->table_parts[i]; if ((ep->type == EDJE_RP_TYPE_TEXT) && (ep->typedata.text)) { - evas_object_move(ep->object, - ed->x + ep->x + ep->typedata.text->offset.x, - ed->y + ep->y + ep->typedata.text->offset.y); + if (ep->object) + evas_object_move(ep->object, + ed->x + ep->x + ep->typedata.text->offset.x, + ed->y + ep->y + ep->typedata.text->offset.y); + else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE) + WRN("No object for part '%s' in group '%s'", + ep->part ? ep->part->name : "<invalid>", ed->group); } else { - evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y); + if (ep->object) + evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y); + else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE) + WRN("No object for part '%s' in group '%s'", + ep->part ? ep->part->name : "<invalid>", ed->group); if ((ep->type == EDJE_RP_TYPE_SWALLOW) && (ep->typedata.swallow)) { diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index b5638ecfc1..cfbccd6c26 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -3297,7 +3297,11 @@ _efl_canvas_layout_efl_part_part(Eo *obj, Edje *ed, const char *part) if ((!ed) || (!part)) return NULL; rp = _edje_real_part_recursive_get(&ed, part); - if (!rp) return NULL; + if (EINA_UNLIKELY(!rp)) + { + WRN("No such part '%s' in group '%s'.", part, ed->group); + return NULL; + } if (rp->part->type == EDJE_PART_TYPE_BOX) return _edje_box_internal_proxy_get(obj, ed, rp); diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 34dbd02ca7..8cdfa7d161 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -109,6 +109,7 @@ _icon_signal_emit(Evas_Object *obj) { char buf[64]; + if (!elm_widget_resize_object_get(obj)) return; snprintf(buf, sizeof(buf), "elm,state,icon,%s", elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c index f4917b32e4..2bb3e07a4c 100644 --- a/src/lib/elementary/efl_ui_check.c +++ b/src/lib/elementary/efl_ui_check.c @@ -93,6 +93,7 @@ _icon_signal_emit(Evas_Object *obj) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); char buf[64]; + if (!elm_widget_resize_object_get(obj)) return; snprintf(buf, sizeof(buf), "elm,state,icon,%s", elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c b/src/lib/elementary/efl_ui_focus_manager_calc.c index c8641b5338..2e1b10a1d3 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.c +++ b/src/lib/elementary/efl_ui_focus_manager_calc.c @@ -81,6 +81,8 @@ typedef struct { static void _manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) { + Eo *manager; + EINA_SAFETY_ON_NULL_RETURN(pd->root); if (!efl_isa(pd->root->focusable, EFL_UI_WIN_CLASS)) @@ -89,7 +91,12 @@ _manager_in_chain_set(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd) //so we dont run infinitly this does not fix it, but at least we only have a error EINA_SAFETY_ON_TRUE_RETURN(efl_ui_focus_user_focus_manager_get(pd->root->focusable) == obj); - efl_ui_focus_manager_focus_set(efl_ui_focus_user_focus_manager_get(pd->root->focusable), pd->root->focusable); + manager = efl_ui_focus_user_focus_manager_get(pd->root->focusable); + if (manager) + efl_ui_focus_manager_focus_set(manager, pd->root->focusable); + else + DBG("No focus manager for focusable %s@%p", + efl_class_name_get(pd->root->focusable), pd->root->focusable); } static Efl_Ui_Focus_Direction @@ -1569,8 +1576,10 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U if (node_type == NODE_TYPE_NORMAL) { //populate the new change - efl_ui_focus_object_focus_set(last_focusable, EINA_FALSE); - efl_ui_focus_object_focus_set(new_focusable, EINA_TRUE); + if (last_focusable) + efl_ui_focus_object_focus_set(last_focusable, EINA_FALSE); + if (new_focusable) + efl_ui_focus_object_focus_set(new_focusable, EINA_TRUE); efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED, last_focusable); } diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c index 5404eb05ee..4e1ce22052 100644 --- a/src/lib/elementary/efl_ui_focus_manager_sub.c +++ b/src/lib/elementary/efl_ui_focus_manager_sub.c @@ -137,10 +137,10 @@ _logical_manager_change(void *data EINA_UNUSED, const Efl_Event *ev) Eina_List *n; Efl_Ui_Focus_User *b; Efl_Ui_Focus_Manager *manager; - manager = efl_ui_focus_user_focus_manager_get(ev->object); if (!ev->info) return; + manager = efl_ui_focus_user_focus_manager_get(ev->object); EINA_LIST_FOREACH(pd->current_border, n, b) { if (b == ev->object) continue; @@ -156,13 +156,12 @@ _flush_manager(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd) Efl_Ui_Focus_User *b; Eina_List *n; - logical = efl_ui_focus_user_focus_parent_get(obj); manager = efl_ui_focus_user_focus_manager_get(obj); //unregister from the old - efl_event_callback_array_del(pd->manager, parent_manager(), obj); - efl_event_callback_array_add(manager, parent_manager(), obj); + if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj); + if (manager) efl_event_callback_array_add(manager, parent_manager(), obj); EINA_LIST_FOREACH(pd->current_border , n, b) { @@ -203,7 +202,7 @@ _efl_ui_focus_manager_sub_efl_object_destructor(Eo *obj, Efl_Ui_Focus_Manager_Su { _border_unregister(obj, pd); - efl_event_callback_array_del(pd->manager, parent_manager(), obj); + if (pd->manager) efl_event_callback_array_del(pd->manager, parent_manager(), obj); efl_destructor(efl_super(obj, MY_CLASS)); } diff --git a/src/lib/elementary/efl_ui_focus_util.c b/src/lib/elementary/efl_ui_focus_util.c index 76ec9280e5..aa0fbbdb42 100644 --- a/src/lib/elementary/efl_ui_focus_util.c +++ b/src/lib/elementary/efl_ui_focus_util.c @@ -25,7 +25,7 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus top = elm_widget_top_get(user); o = efl_key_data_get(top, "__delayed_focus_set"); - efl_event_callback_del(o, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed, o); + if (o) efl_event_callback_del(o, EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed, o); efl_key_data_set(top, "__delayed_focus_set", NULL); if (!m) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 60c6500828..cc636716d1 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -165,8 +165,12 @@ _icon_signal_emit(Efl_Ui_Layout_Data *sd, { char buf[1024]; const char *type; + Eo *edje; int i; + edje = elm_widget_resize_object_get(sd->obj); + if (!edje) return; + //FIXME: Don't limit to the icon and end here. // send signals for all contents after elm 2.0 if (sub_d->type != SWALLOW) return; @@ -184,11 +188,10 @@ _icon_signal_emit(Efl_Ui_Layout_Data *sd, snprintf(buf, sizeof(buf), "elm,state,%s,%s", type, visible ? "visible" : "hidden"); - ELM_WIDGET_DATA_GET_OR_RETURN(sd->obj, wd); - edje_object_signal_emit(wd->resize_obj, buf, "elm"); + edje_object_signal_emit(edje, buf, "elm"); /* themes might need immediate action here */ - edje_object_message_signal_process(wd->resize_obj); + edje_object_message_signal_process(edje); } static inline void @@ -640,17 +643,14 @@ _efl_ui_layout_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd) Efl_Ui_Layout_Sub_Connect *sc; Edje_Signal_Data *esd; Evas_Object *child; - Eina_List *l; + Eina_List *l, *ll; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); elm_layout_freeze(obj); - EINA_LIST_FREE(sd->subs, sub_d) - { - eina_stringshare_del(sub_d->part); - free(sub_d); - } + EINA_LIST_FOREACH_SAFE(sd->subs, l, ll, sub_d) + efl_ui_widget_sub_object_del(obj, sub_d->obj); EINA_LIST_FREE(sd->parts_cursors, pc) _part_cursor_free(pc); @@ -943,6 +943,13 @@ elm_layout_content_get(const Evas_Object *obj, const char *swallow) else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE)) return NULL; + if (!efl_layout_group_part_exist_get(obj, swallow)) + { + DBG("No such part '%s' in group '%s'", + swallow, elm_widget_theme_element_get(obj)); + return NULL; + } + return efl_content_get(efl_part(obj, swallow)); } @@ -951,6 +958,7 @@ _efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part) { const Eina_List *l; Efl_Ui_Layout_Sub_Object_Data *sub_d; + Eo *handle; EINA_LIST_FOREACH(sd->subs, l, sub_d) { @@ -962,7 +970,8 @@ _efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part) } ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - return efl_content_get(efl_part(wd->resize_obj, part)); + handle = efl_part(wd->resize_obj, part); + return handle ? efl_content_get(handle) : NULL; } EAPI Evas_Object * @@ -2430,17 +2439,18 @@ elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, con EOLIAN static Eo * _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part) { - Efl_Canvas_Layout_Part_Type type; + Efl_Canvas_Layout_Part_Type type = EFL_CANVAS_LAYOUT_PART_TYPE_NONE; EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL); // Check part type without using edje_object_part_object_get(), as this // can cause recalc, which has side effects... and could be slow. - type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); if (eina_streq(part, "background")) { + if (efl_layout_group_part_exist_get(wd->resize_obj, part)) + type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW) { if (type < EFL_CANVAS_LAYOUT_PART_TYPE_LAST && @@ -2459,6 +2469,10 @@ _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, else if (eina_streq(part, "shadow")) return efl_part(efl_super(obj, MY_CLASS), part); + if (!efl_layout_group_part_exist_get(wd->resize_obj, part)) + goto no_part; + + type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); if (type >= EFL_CANVAS_LAYOUT_PART_TYPE_LAST) { ERR("Invalid type found for part '%s' in group '%s'", part, elm_widget_theme_element_get(obj)); @@ -2476,11 +2490,14 @@ _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, case EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW: return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, part); case EFL_CANVAS_LAYOUT_PART_TYPE_NONE: - WRN("No such part '%s' in group '%s'", part, elm_widget_theme_element_get(obj)); - return NULL; + goto no_part; default: return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS, obj, part); } + +no_part: + WRN("No such part '%s' in group '%s'", part, elm_widget_theme_element_get(obj)); + return NULL; } static const char * diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 6c41b669e0..4bd7e87afc 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -172,6 +172,7 @@ _icon_signal_emit(Evas_Object *obj) { char buf[64]; + if (!elm_widget_resize_object_get(obj)) return; snprintf(buf, sizeof(buf), "elm,state,icon,%s", elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); diff --git a/src/lib/elementary/efl_ui_radio.c b/src/lib/elementary/efl_ui_radio.c index 51d406c0b9..1486cf8b31 100644 --- a/src/lib/elementary/efl_ui_radio.c +++ b/src/lib/elementary/efl_ui_radio.c @@ -137,14 +137,16 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) static void _icon_signal_emit(Evas_Object *obj) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); char buf[64]; + Eo *edje; + edje = elm_widget_resize_object_get(obj); + if (!edje) return; snprintf(buf, sizeof(buf), "elm,state,icon,%s", elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); elm_layout_signal_emit(obj, buf, "elm"); - edje_object_message_signal_process(wd->resize_obj); + edje_object_message_signal_process(edje); } EOLIAN static Efl_Ui_Theme_Apply diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 4767f9a32f..7d9a18108f 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -311,7 +311,7 @@ _focus_manager_eval(Eo *obj, Elm_Widget_Smart_Data *pd) { new = parent; } - else + else if (parent) { new = efl_ui_focus_user_focus_manager_get(parent); provider = parent; @@ -2439,10 +2439,14 @@ _efl_ui_widget_disabled_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool disabl } EOLIAN static Eina_Bool -_efl_ui_widget_disabled_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) +_efl_ui_widget_disabled_get(Eo *obj, Elm_Widget_Smart_Data *sd) { + Eo *parent; + if (sd->disabled) return EINA_TRUE; - return elm_widget_disabled_get(elm_widget_parent_get(obj)); + if ((parent = elm_widget_parent_get(obj)) != NULL) + return elm_widget_disabled_get(parent); + return EINA_FALSE; } EOLIAN static void @@ -5480,7 +5484,7 @@ _efl_ui_widget_efl_object_provider_find(const Eo *obj, Elm_Widget_Smart_Data *pd if (pd->provider_lookup) return NULL; pd->provider_lookup = EINA_TRUE; - lookup = efl_provider_find(pd->parent_obj, klass); + if (pd->parent_obj) lookup = efl_provider_find(pd->parent_obj, klass); if (!lookup) lookup = efl_provider_find(efl_super(obj, MY_CLASS), klass); pd->provider_lookup = EINA_FALSE; diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index 1d654632a2..8bba0e1d4c 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -82,7 +82,8 @@ _round(double value, int pos) static void _elm_pan_update(Elm_Pan_Smart_Data *psd) { - evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py); + if (psd->content) + evas_object_move(psd->content, psd->x - psd->px, psd->y - psd->py); } EOLIAN static void diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index a25cf236ac..4bdff24148 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -830,6 +830,13 @@ EAPI extern Eina_Bool _elm_legacy_add; #define elm_legacy_add(k, p, ...) ({ _elm_legacy_add = 1; \ efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); }) +static inline Eo * +elm_widget_resize_object_get(const Eo *obj) +{ + Elm_Widget_Smart_Data *wd = efl_data_scope_safe_get(obj, EFL_UI_WIDGET_CLASS); + return wd ? wd->resize_obj : NULL; +} + static inline Eina_Bool elm_widget_is_legacy(const Eo *obj) { diff --git a/src/lib/elementary/els_cursor.c b/src/lib/elementary/els_cursor.c index 8d15df1762..fbcde054bf 100644 --- a/src/lib/elementary/els_cursor.c +++ b/src/lib/elementary/els_cursor.c @@ -212,6 +212,8 @@ _elm_cursor_set_hot_spots(Elm_Cursor *cur) Evas_Coord cx, cy, cw, ch, x, y, w, h; int prev_hot_x, prev_hot_y; + if (!cur->visible) return; + prev_hot_x = cur->hot_x; prev_hot_y = cur->hot_y; diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 50df250acf..45e4cee0f4 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -40,6 +40,8 @@ EAPI Eina_Lock _efl_class_creation_lock; EAPI unsigned int _efl_object_init_generation = 1; int _eo_log_dom = -1; Eina_Thread _efl_object_main_thread; +static unsigned int efl_del_api_generation = 0; +static Efl_Object_Op _efl_del_api_op_id = 0; typedef enum _Eo_Ref_Op { EO_REF_OP_NONE, @@ -101,6 +103,8 @@ static inline void *_efl_data_xref_internal(const char *file, int line, _Eo_Obje static inline void _efl_data_xunref_internal(_Eo_Object *obj, void *data, const _Eo_Object *ref_obj); static void _vtable_init(Eo_Vtable *vtable, size_t size); +static inline Efl_Object_Op _efl_object_api_op_id_get_internal(const void *api_func); + /* Start of Dich */ @@ -450,7 +454,7 @@ _efl_object_call_resolve(Eo *eo_id, const char *func_name, Efl_Object_Op_Call_Da Eina_Bool is_override = EINA_FALSE; Eina_Bool super = EINA_TRUE; - if (EINA_UNLIKELY(!eo_id)) return EINA_FALSE; + if (EINA_UNLIKELY(!eo_id)) goto on_null; call->eo_id = eo_id; @@ -668,6 +672,16 @@ obj_super: err_klass: _EO_POINTER_ERR(eo_id, "in %s:%d: func '%s': obj_id=%p is an invalid ref.", file, line, func_name, eo_id); return EINA_FALSE; + +on_null: + if (EINA_UNLIKELY(efl_del_api_generation != _efl_object_init_generation)) + { + _efl_del_api_op_id = _efl_object_api_op_id_get_internal(EFL_FUNC_COMMON_OP_FUNC(efl_del)); + efl_del_api_generation = _efl_object_init_generation; + } + if (cache->op != _efl_del_api_op_id) + WRN("NULL passed to function %s().", func_name); + return EINA_FALSE; } EAPI void |