}
EAPI Eina_Bool
+elm_widget_is_check(const Evas_Object *obj)
+{
+ static int abort_on_warn = -1;
+ if (elm_widget_is(obj))
+ return EINA_TRUE;
+
+ ERR("Passing Object: %p.", obj);
+ if (abort_on_warn == -1)
+ {
+ if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1;
+ else abort_on_warn = 0;
+ }
+ if (abort_on_warn == 1) abort();
+ return EINA_FALSE;
+}
+
+EAPI Eina_Bool
elm_widget_type_check(const Evas_Object *obj,
const char *type)
{
EAPI Eina_Bool elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI void elm_widget_type_register(const char **ptr);
EAPI void elm_widget_type_unregister(const char **ptr);
+EAPI Eina_Bool elm_widget_is_check(const Evas_Object *obj);
EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type);
EAPI Eina_List *elm_widget_stringlist_get(const char *str);
EAPI void elm_widget_stringlist_free(Eina_List *list);
} \
} while (0)
+#define ELM_CHECK_WID_IS(obj) \
+ if (!elm_widget_is_check(obj)) return
+
#define ELM_CHECK_WIDTYPE(obj, widtype) \
if (!elm_widget_type_check((obj), (widtype))) return
EAPI void
elm_object_tooltip_show(Evas_Object *obj)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
tt->visible_lock = EINA_TRUE;
_elm_tooltip_show(tt);
EAPI void
elm_object_tooltip_hide(Evas_Object *obj)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
tt->visible_lock = EINA_FALSE;
_elm_tooltip_hide_anim_start(tt);
EAPI void
elm_object_tooltip_text_set(Evas_Object *obj, const char *text)
{
+ ELM_CHECK_WID_IS(obj);
EINA_SAFETY_ON_NULL_RETURN(obj);
EINA_SAFETY_ON_NULL_RETURN(text);
EAPI void
elm_object_tooltip_content_cb_set(Evas_Object *obj, Elm_Tooltip_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
{
+ ELM_CHECK_WID_IS(obj);
elm_object_sub_tooltip_content_cb_set(obj, obj, func, data, del_cb);
}
EAPI void
elm_object_tooltip_unset(Evas_Object *obj)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
_elm_tooltip_unset(tt);
}
EAPI void
elm_object_tooltip_style_set(Evas_Object *obj, const char *style)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
if (!eina_stringshare_replace(&tt->style, style)) return;
elm_tooltip_theme(tt);
EAPI const char *
elm_object_tooltip_style_get(const Evas_Object *obj)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj, NULL);
return tt->style ? tt->style : "default";
}
EAPI Eina_Bool
elm_tooltip_size_restrict_disable(Evas_Object *obj, Eina_Bool disable)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj, EINA_FALSE);
return tt->free_size = disable;
}
EAPI Eina_Bool
elm_tooltip_size_restrict_disabled_get(const Evas_Object *obj)
{
+ ELM_CHECK_WID_IS(obj);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj, EINA_FALSE);
return tt->free_size;
}