Hey Tasn, need to check but before there were no limits that the tooltip must be on an elm object. It could be an edje or a single rectangle. All it should use are mouse events.
--Gustavo Sent from my iPhone On 28/08/2011, at 11:13, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > Elm tooltip: Added checks if the object passed is an elm object. > > Author: tasn > Date: 2011-08-28 07:12:38 -0700 (Sun, 28 Aug 2011) > New Revision: 62919 > Trac: http://trac.enlightenment.org/e/changeset/62919 > > Modified: > trunk/elementary/src/lib/elm_widget.c trunk/elementary/src/lib/elm_widget.h > trunk/elementary/src/lib/els_tooltip.c > > Modified: trunk/elementary/src/lib/elm_widget.c > =================================================================== > --- trunk/elementary/src/lib/elm_widget.c 2011-08-28 13:28:12 UTC (rev > 62918) > +++ trunk/elementary/src/lib/elm_widget.c 2011-08-28 14:12:38 UTC (rev > 62919) > @@ -2398,6 +2398,23 @@ > } > > 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) > { > > Modified: trunk/elementary/src/lib/elm_widget.h > =================================================================== > --- trunk/elementary/src/lib/elm_widget.h 2011-08-28 13:28:12 UTC (rev > 62918) > +++ trunk/elementary/src/lib/elm_widget.h 2011-08-28 14:12:38 UTC (rev > 62919) > @@ -400,6 +400,7 @@ > 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); > @@ -671,6 +672,9 @@ > } \ > } 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 > > > Modified: trunk/elementary/src/lib/els_tooltip.c > =================================================================== > --- trunk/elementary/src/lib/els_tooltip.c 2011-08-28 13:28:12 UTC (rev > 62918) > +++ trunk/elementary/src/lib/els_tooltip.c 2011-08-28 14:12:38 UTC (rev > 62919) > @@ -717,6 +717,7 @@ > 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); > @@ -734,6 +735,7 @@ > 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); > @@ -754,6 +756,7 @@ > 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); > > @@ -785,6 +788,7 @@ > 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); > } > > @@ -804,6 +808,7 @@ > 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); > } > @@ -821,6 +826,7 @@ > 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); > @@ -836,6 +842,7 @@ > 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"; > } > @@ -883,6 +890,7 @@ > 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; > } > @@ -899,6 +907,7 @@ > 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; > } > > > ------------------------------------------------------------------------------ > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel