Cedric, thanks for the revert.
This code is needed until we merge gengrid into genlist :(

Thanks.

Daniel Juyung Seo (SeoZ)

On Mon, Jan 23, 2012 at 10:26 PM, Enlightenment SVN
<no-re...@enlightenment.org> wrote:
> Log:
> elementary: revert r67371.
>
>  NOTE: gengrid and genlist code are still half merged. The specific
>  code for checking widget type is still needed.
>
>
> Author:       cedric
> Date:         2012-01-23 05:26:45 -0800 (Mon, 23 Jan 2012)
> New Revision: 67470
> Trac:         http://trac.enlightenment.org/e/changeset/67470
>
> Modified:
>  trunk/elementary/src/lib/elm_genlist.c
>
> Modified: trunk/elementary/src/lib/elm_genlist.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_genlist.c      2012-01-23 12:35:42 UTC (rev 
> 67469)
> +++ trunk/elementary/src/lib/elm_genlist.c      2012-01-23 13:26:45 UTC (rev 
> 67470)
> @@ -218,6 +218,46 @@
>    {NULL, NULL}
>  };
>
> +/* TEMPORARY */
> +#undef ELM_CHECK_WIDTYPE
> +#define ELM_CHECK_WIDTYPE(obj, widtype) \
> +   if ((!obj) || (!elm_genlist_type_check((obj), __func__))) return
> +#undef ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN
> +#define ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, ...)                \
> +   ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \
> +   ELM_CHECK_WIDTYPE(WIDGET((it)), widtype) __VA_ARGS__;
> +
> +static const char *_gengrid = NULL;
> +static const char *_genlist = NULL;
> +
> +/* THIS FUNCTION IS HACKY AND TEMPORARY!!! */
> +Eina_Bool
> +elm_genlist_type_check(const Evas_Object *obj,
> +                       const char        *func)
> +{
> +   const char *provided, *expected = "(unknown)";
> +   static int abort_on_warn = -1;
> +   provided = elm_widget_type_get(obj);
> +   if (!_genlist) _genlist = eina_stringshare_add("genlist");
> +   if (!_gengrid) _gengrid = eina_stringshare_add("gengrid");
> +   if (EINA_LIKELY(provided == _genlist) || EINA_LIKELY(provided == 
> _gengrid))
> +     return EINA_TRUE;
> +   if ((!provided) || (!provided[0]))
> +     {
> +        provided = evas_object_type_get(obj);
> +        if ((!provided) || (!provided[0]))
> +          provided = "(unknown)";
> +     }
> +   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;
> +        else abort_on_warn = 0;
> +     }
> +   if (abort_on_warn == 1) abort();
> +   return EINA_FALSE;
> +}
> +
>  static Eina_Bool
>  _event_hook(Evas_Object       *obj,
>             Evas_Object       *src __UNUSED__,
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to