On Mon, Jul 30, 2012 at 6:02 PM, Enlightenment SVN <[email protected]> wrote: > Log: > elementary: defert Elm_Calendar generation until needed. > > NOTE: The new infra is awesome ! That was a piece of cake once > I understand how it work. I love it !
What is it exactly? smart calculation? Daniel Juyung Seo (SeoZ) > > > Author: cedric > Date: 2012-07-30 02:02:23 -0700 (Mon, 30 Jul 2012) > New Revision: 74562 > Trac: http://trac.enlightenment.org/e/changeset/74562 > > Modified: > trunk/elementary/ChangeLog trunk/elementary/NEWS > trunk/elementary/src/lib/elm_calendar.c > > Modified: trunk/elementary/ChangeLog > =================================================================== > --- trunk/elementary/ChangeLog 2012-07-30 08:25:15 UTC (rev 74561) > +++ trunk/elementary/ChangeLog 2012-07-30 09:02:23 UTC (rev 74562) > @@ -357,3 +357,4 @@ > 2012-07-30 Cedric Bail > > * Allow freeze/thaw on Elm_Layout and reduce number of object update. > + * Defer Elm_Calendar generation until really needed. > > Modified: trunk/elementary/NEWS > =================================================================== > --- trunk/elementary/NEWS 2012-07-30 08:25:15 UTC (rev 74561) > +++ trunk/elementary/NEWS 2012-07-30 09:02:23 UTC (rev 74562) > @@ -32,6 +32,7 @@ > > * Allocate once and reuse Evas_Map. > * Allow freeze/thaw on Elm_Layout and reduce number of object update. > + * Defer Elm_Calendar generation until really needed. > > Removal: > > > Modified: trunk/elementary/src/lib/elm_calendar.c > =================================================================== > --- trunk/elementary/src/lib/elm_calendar.c 2012-07-30 08:25:15 UTC (rev > 74561) > +++ trunk/elementary/src/lib/elm_calendar.c 2012-07-30 09:02:23 UTC (rev > 74562) > @@ -466,17 +466,8 @@ > if (!ELM_WIDGET_CLASS(_elm_calendar_parent_sc)->theme(obj)) > return EINA_FALSE; > > - elm_layout_freeze(obj); > + evas_object_smart_changed(obj); > > - _set_headers(obj); > - _populate(obj); > - > - elm_layout_thaw(obj); > - > - edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj); > - > - elm_layout_sizing_eval(obj); > - > return EINA_TRUE; > } > > @@ -547,7 +538,9 @@ > { > ELM_CALENDAR_DATA_GET(data, sd); > > - if (_update_month(data, sd->spin_speed)) _populate(data); > + if (_update_month(data, sd->spin_speed)) > + evas_object_smart_changed(data); > + > sd->interval = sd->interval / 1.05; > ecore_timer_interval_set(sd->spin, sd->interval); > > @@ -754,6 +747,17 @@ > } > > static void > +_elm_calendar_smart_calculate(Evas_Object *obj) > +{ > + elm_layout_freeze(obj); > + > + _set_headers(obj); > + _populate(obj); > + > + elm_layout_thaw(obj); > +} > + > +static void > _elm_calendar_smart_add(Evas_Object *obj) > { > time_t weekday = 259200; /* Just the first sunday since epoch */ > @@ -815,16 +819,8 @@ > > elm_widget_can_focus_set(obj, EINA_TRUE); > > - elm_layout_freeze(obj); > - > elm_layout_theme_set(obj, "calendar", "base", elm_object_style_get(obj)); > - > - _set_headers(obj); > - _populate(obj); > - > - elm_layout_thaw(obj); > - > - elm_layout_sizing_eval(obj); > + evas_object_smart_changed(obj); > } > > static void > @@ -856,6 +852,7 @@ > { > ELM_WIDGET_CLASS(sc)->base.add = _elm_calendar_smart_add; > ELM_WIDGET_CLASS(sc)->base.del = _elm_calendar_smart_del; > + ELM_WIDGET_CLASS(sc)->base.calculate = _elm_calendar_smart_calculate; > > ELM_WIDGET_CLASS(sc)->theme = _elm_calendar_smart_theme; > ELM_WIDGET_CLASS(sc)->event = _elm_calendar_smart_event; > @@ -898,7 +895,7 @@ > eina_stringshare_replace(&sd->weekdays[i], weekdays[i]); > } > > - _set_headers(obj); > + evas_object_smart_changed(obj); > } > > EAPI const char ** > @@ -949,7 +946,7 @@ > sd->shown_time.tm_year = sd->year_max; > if (sd->shown_time.tm_year < sd->year_min) > sd->shown_time.tm_year = sd->year_min; > - _populate(obj); > + evas_object_smart_changed(obj); > } > > EAPI void > @@ -1003,7 +1000,7 @@ > > _fix_selected_time(sd); > > - _populate(obj); > + evas_object_smart_changed(obj); > } > > EAPI Eina_Bool > @@ -1088,7 +1085,7 @@ > { > ELM_CALENDAR_CHECK(obj); > > - _populate(obj); > + evas_object_smart_changed(obj); > } > > EAPI void > @@ -1102,13 +1099,7 @@ > if (sd->first_week_day != day) > { > sd->first_week_day = day; > - > - elm_layout_freeze(obj); > - > - _set_headers(obj); > - _populate(obj); > - > - elm_layout_thaw(obj); > + evas_object_smart_changed(obj); > } > } > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
