I love this commit! This will be so helpful to application programmers. Thanks stu!
Daniel Juyung Seo (SeoZ) On Mon, Sep 12, 2011 at 11:06 AM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > make ELM_CHECK_WIDTYPE & co macros useful. would you believe this macro came > from my first ever code patch :D > > > Author: discomfitor > Date: 2011-09-11 19:06:27 -0700 (Sun, 11 Sep 2011) > New Revision: 63334 > Trac: http://trac.enlightenment.org/e/changeset/63334 > > Modified: > trunk/elementary/src/lib/elm_transit.c trunk/elementary/src/lib/elm_widget.c > trunk/elementary/src/lib/elm_widget.h > > Modified: trunk/elementary/src/lib/elm_transit.c > =================================================================== > --- trunk/elementary/src/lib/elm_transit.c 2011-09-12 02:05:30 UTC (rev > 63333) > +++ trunk/elementary/src/lib/elm_transit.c 2011-09-12 02:06:27 UTC (rev > 63334) > @@ -2212,7 +2212,7 @@ > > EINA_LIST_FOREACH(transit->objs, elist, obj) > { > - if (elm_widget_type_check(obj, type)) > + if (elm_widget_type_check(obj, type, __func__)) > elm_icon_file_set(obj, > eina_list_nth(image_animation->images, count), > NULL); > } > > Modified: trunk/elementary/src/lib/elm_widget.c > =================================================================== > --- trunk/elementary/src/lib/elm_widget.c 2011-09-12 02:05:30 UTC (rev > 63333) > +++ trunk/elementary/src/lib/elm_widget.c 2011-09-12 02:06:27 UTC (rev > 63334) > @@ -2447,7 +2447,8 @@ > > EAPI Eina_Bool > elm_widget_type_check(const Evas_Object *obj, > - const char *type) > + const char *type, > + const char *func) > { > const char *provided, *expected = "(unknown)"; > static int abort_on_warn = -1; > @@ -2460,7 +2461,7 @@ > if ((!provided) || (!provided[0])) > provided = "(unknown)"; > } > - ERR("Passing Object: %p, of type: '%s' when expecting type: '%s'", obj, > provided, expected); > + ERR("Passing Object: %p in function: %s, of type: '%s' when expecting > type: '%s'", obj, func, provided, expected); > if (abort_on_warn == -1) > { > if (getenv("ELM_ERROR_ABORT")) abort_on_warn = 1; > > Modified: trunk/elementary/src/lib/elm_widget.h > =================================================================== > --- trunk/elementary/src/lib/elm_widget.h 2011-09-12 02:05:30 UTC (rev > 63333) > +++ trunk/elementary/src/lib/elm_widget.h 2011-09-12 02:06:27 UTC (rev > 63334) > @@ -401,7 +401,7 @@ > 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_Bool elm_widget_type_check(const Evas_Object *obj, const > char *type, const char *func); > EAPI Eina_List *elm_widget_stringlist_get(const char *str); > EAPI void elm_widget_stringlist_free(Eina_List *list); > EAPI void elm_widget_focus_hide_handle(Evas_Object *obj); > @@ -676,7 +676,7 @@ > if (!elm_widget_is_check(obj)) return > > #define ELM_CHECK_WIDTYPE(obj, widtype) \ > - if (!elm_widget_type_check((obj), (widtype))) return > + if (!elm_widget_type_check((obj), (widtype), __func__)) return > > #define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, ...) \ > ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ > @@ -684,7 +684,7 @@ > > #define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_GOTO(it, label) \ > ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \ > - if (!elm_widget_type_check((it->base.widget), (widtype))) goto label; > + if (!elm_widget_type_check((it->base.widget), (widtype), __func__)) goto > label; > > #define ELM_WIDGET_STANDARD_SETUP(wdat, wdtype, par, evas, ob, ret) \ > do { \ > > > ------------------------------------------------------------------------------ > Doing More with Less: The Next Generation Virtual Desktop > What are the key obstacles that have prevented many mid-market businesses > from deploying virtual desktops? How do next-generation virtual desktops > provide companies an easier-to-deploy, easier-to-manage and more affordable > virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/ > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ Using storage to extend the benefits of virtualization and iSCSI Virtualization increases hardware utilization and delivers a new level of agility. Learn what those decisions are and how to modernize your storage and backup environments for virtualization. http://www.accelacomm.com/jaw/sfnl/114/51434361/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel