2012/1/10 Daniel Juyung Seo <[email protected]>: > On Fri, Jan 6, 2012 at 11:34 PM, Gustavo Sverzut Barbieri > <[email protected]> wrote: >> On Fri, Jan 6, 2012 at 6:48 AM, Hyoyoung Chang <[email protected]> wrote: >>> Dear all >>> >>> This patch introduces four new apis about elm_gen{list, grid} item >>> class managements. >>> itc_add function makes a new item_class for the given widget. >>> And itc_del function remove the item_class from the widget. >>> >>> Most of elm_gen{list, grid} users declare itc(item_class) as a global >>> variable. >>> Because itc should be lived at elm_gen{list,grid} item's life cycle. >>> It's inconvenient for users. Even some users pass itc. >>> >>> itc_add makes a new itc. if exact one exists in the given widget, it >>> return the previous made itc. >>> itc_del remove a itc if its reference count reaches at zero. >>> >>> Thanks. >>> >>> >>> EAPI Elm_Genlist_Item_Class * >>> elm_genlist_itc_add(Evas_Object *obj, const char *item_style, >>> Elm_Genlist_Item_Text_Get_Cb text_cb, >>> Elm_Genlist_Item_Content_Get_Cb content_cb, >>> Elm_Genlist_Item_State_Get_Cb state_cb, >>> Elm_Genlist_Item_Del_Cb del_cb); >>> EAPI void >>> elm_genlist_itc_del(Evas_Object *obj, Elm_Genlist_Item_Class *itc); >>> EAPI Elm_Gengrid_Item_Class * >>> elm_gengrid_itc_add(Evas_Object *obj, const char *item_style, >>> Elm_Gengrid_Item_Text_Get_Cb text_cb, >>> Elm_Gengrid_Item_Content_Get_Cb content_cb, >>> Elm_Gengrid_Item_State_Get_Cb state_cb, >>> Elm_Gengrid_Item_Del_Cb del_cb); >>> EAPI void >>> elm_gengrid_itc_del(Evas_Object *obj, Elm_Gengrid_Item_Class *itc); >> >> I dislike it, one can easily do this kind of stuff using item_del_cb(). > >> >> And really, majority of developers should NEVER use this, the global >> static-const is the correct way to go, making sure memory is live, >> unchanged, no mallocs, etc. > > Thanks for your reply. This patch has an assumption that application > can alloc itc memory dynamically. > If itc-dynamic-allocation is not recommended, do you have to use > global variable for itc? > For a huge app that uses many c sources, we can't force them to use > global static :( >
You are making a function to return a pre-made class for others to use? Keep the class static to the function, return a pointer to it. > Daniel Juyung Seo (SeoZ) > >> >> Who may use this is bindings, like Python, JavaScript and that's it. >> They have better ways to manage it. >> >> -- >> Gustavo Sverzut Barbieri >> http://profusion.mobi embedded systems >> -------------------------------------- >> MSN: [email protected] >> Skype: gsbarbieri >> Mobile: +55 (19) 9225-2202 >> >> ------------------------------------------------------------------------------ >> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex >> infrastructure or vast IT resources to deliver seamless, secure access to >> virtual desktops. With this all-in-one solution, easily deploy virtual >> desktops for less than the cost of PCs and save 60% on VDI infrastructure >> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> _______________________________________________ >> enlightenment-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
