On Fri, 6 Jan 2012 12:34:43 -0200 Gustavo Sverzut Barbieri
<barbi...@profusion.mobi> said:

finally i'm getting around to this thread...

one thing i don't like is passing in all the funcs as params. we did this with
smart class. we abandoned it.

BUt we should have a elm_genlist_itc_new() (and free()).

why? 1. refcounting, 2. handling initializing the struct all to null/0 AND
setting a version. (yes we can do it with static/const structs and app sets
version so we know struct size base don version num... BUT that doesn't solve
the core problem here)...

and the CORE problem is... dlclose(). your object has been deleted. done - u
dlclose the module it came from.. CRASH. the struct for item class just was
ripped out of memory. almost everything else allows the module to remove
callbacks and anything that may be called... EXCEPT for this. here the class
must stay around in memory - the module can fill func ptr's with NULL to make
it save (and make it do nothing) but the class struct must live. i'll send my
feedback to hyoyoung's mail. :)

> On Fri, Jan 6, 2012 at 6:48 AM, Hyoyoung Chang <hyoyo...@gmail.com> 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.
> 
> 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: barbi...@gmail.com
> 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
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
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