Hello, Cedric Bail On Aug 24, 2013 8:27 PM, "Bluezery" <[email protected]> wrote: > Are there any performance issue to adding signals?
We have no benchmark for anything above Evas. So all comment on this subject are assumption. > odd/even already seems to has performance/memory consumption issue. > Adding more group name or alias into theme can increase memory when edje is > loaded even though that group is not used. > Eventhough performance issue is not signicant by emitting signals, it > decrease performance somewhat anyway. There is a lot of difference from 1.7 to 1.8 regarding edje signal handling. We now reuse signal automat across all object of the same group. This means that already matched signal will always take the fast path and not use memory. It will be my assumption until someone come with an elementary benchmark and I can improve performance in that case. > Below features can be implemented on the theme itself actually and > application can emit signals on realized callback. Application have to do > more things but this has no performance/memory issues. > And those are implemented already and will be submitted to Tizen 3.0 In general application developers should never deal with any complexity that the toolkit could handle for them. If the toolkit make life easier for 10 application ,that's time they can spend on making better application or be lazy and have a party instead. Cedric > Brs, > Kim. > > ================================================================================= > barbieri pushed a commit to branch master. > > commit b40a6eb85bf44acf8757507bf02e4110ca22e2a0 > Author: Gustavo Sverzut Barbieri <barbieri@...> > Date: Thu Aug 22 17:00:26 2013 -0300 > > genlist: implement list position signals. > > Genlist will now emit the following signals to item view related to > their position in the whole list: > - elm,state,list,first: first item of the whole list > - elm,state,list,last: last item of the whole list > - elm,state,list,middle: any item that is not first or last. > - elm,state,list,single: when the item is the only element of > list. > And the following related to a group (considering its given 'parent'): > - elm,state,group,first: first item of the group > - elm,state,group,last: last item of the group > - elm,state,group,middle: any item that is not first or last. > - elm,state,group,single: when the item is the only element of > group. > > Unlike odd/even the signals have an extra namespace "list" or "group" > to avoid conflicts with applications that may have declared these > signals themselves for other purposes. > > With this patch one can implement easily something like this: > > > https://developer.apple.com/library/ios/documentation/userexperience/conceptual/tableview_iphone/Art/tv_grouped_style.jpg > --- > src/lib/elm_genlist.c | 75 > +++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 73 insertions(+), 2 deletions(-) > > diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c > index d76a1c6..904b502 100644 > --- a/src/lib/elm_genlist.c > +++ b/src/lib/elm_genlist.c > @@ -792,11 +792,13 @@ _item_tree_effect_finish(Elm_Genlist_Smart_Data *sd) > static void > _elm_genlist_item_position_state_update(Elm_Gen_Item *it) > { > + unsigned idx = it->item->order_num_in; > + > ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); > > if (!it->item->nostacking) > { > - if ((it->item->order_num_in & 0x1) ^ it->item->stacking_even) > + if ((idx & 0x1) ^ it->item->stacking_even) > { > if (it->deco_all_view) > evas_object_stack_below(it->deco_all_view, sd->stack[0]); > else evas_object_stack_below(VIEW(it), sd->stack[0]); > @@ -808,7 +810,7 @@ _elm_genlist_item_position_state_update(Elm_Gen_Item > *it) > } > } > > - if (it->item->order_num_in & 0x1) > + if (idx & 0x1) > { > edje_object_signal_emit(VIEW(it), "elm,state,odd", "elm"); > if (it->deco_all_view) > @@ -820,6 +822,62 @@ _elm_genlist_item_position_state_update(Elm_Gen_Item > *it) > if (it->deco_all_view) > edje_object_signal_emit(it->deco_all_view, "elm,state,even", > "elm"); > } > + > + if (sd->item_count == 1) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,list,single", "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,list,single", "elm"); > + } > + else if (idx == 0) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,list,first", "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,list,first", "elm"); > + } > + else if (idx == sd->item_count - 1) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,list,last", "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,list,last", "elm"); > + } > + else if (idx > 0) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,list,middle", "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,list,middle", "elm"); > + } > + > + if (it->parent) > + { > + unsigned first_idx = it->parent->item->order_num_in + 1; > + unsigned count = eina_list_count(it->parent->item->items); > + > + if (count == 1) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,group,single", > "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,group,single", "elm"); > + } > + else if (idx == first_idx) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,group,first", > "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,group,first", "elm"); > + } > + else if (it == > eina_list_data_get(eina_list_last(it->parent->item->items))) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,group,last", > "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,group,last", "elm"); > + } > + else if (idx > first_idx) > + { > + edje_object_signal_emit(VIEW(it), "elm,state,group,middle", > "elm"); > + if (it->deco_all_view) > + edje_object_signal_emit(it->deco_all_view, > "elm,state,group,middle", "elm"); > + } > + } > } > > static void > @@ -828,6 +886,19 @@ _item_order_update(const Eina_Inlist *l, > { > Elm_Gen_Item *it, *it2; > > + /* > + * always update position state of previous item, it may have been > + * marked as "single" if it was the only element at the time, or > + * "middle", "first" or "last" in the case of insert into different > + * positions. > + */ > + if ((l->prev) && (start > 0)) > + { > + it = ELM_GEN_ITEM_FROM_INLIST(l->prev); > + it->item->order_num_in = start - 1; > + _elm_genlist_item_position_state_update(it); > + } > + > for (it = ELM_GEN_ITEM_FROM_INLIST(l); l; l = l->next, > it = ELM_GEN_ITEM_FROM_INLIST(l)) > { > > -- > > > > > -- > BRs, > Kim. > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
