2017-10-16 21:45 GMT+09:00 Gustavo Sverzut Barbieri <barbi...@gmail.com>:
> > +function Efl.Ui.Format_Func_Cb { > > + [[Function pointer for format function hook]] > > + params { > > + @in str: ptr(Eina.Strbuf); > > + @in value: Eina.Value; > > I'd use const(generic_value), there is no need to use `Eina.Value` > since it's a "native" eolian type... and you don't want to modify it, > then saying "const" would make it clear. > I think it's called "any_value" now :) Although I still see "generic_value" in some places. @q66 care to explain why we have both of those? Another comment: this needs doc. What is $str and why is it an @in value, etc... (I know, but it's far from obvious here) > +interface Efl.Ui.Format > > +{ > > + [[interface class for format_func]] > > + methods { > > + @property func_cb @protected { > > not so good name, particularly for a "Format" interface, just > replicate the name and let eolian de-duplicate the format: > > Efl.Ui.Format.format_func or format_cb... should generate: > efl_ui_format_func_set/get. > > also, I don't see why is this "ui" only, it's good to go into a > broader namespace (if we do have, not sure). > > > > > + @property unit @protected { > > + [[Control the format string for a given units label > > + > > + If $NULL is passed on $format, it will make $obj's units > > + area to be hidden completely. If not, it'll set the <b>format > > + string</b> for the units label's text. The units label is > > + provided a floating point value, so the units text is up > display > > + at most one floating point value. Note that the units label > is > > + optional. Use a format string such as "%1.2f meters" for > example. > > + > > + Note: The default format string is an integer percentage, > > + as in $"%.0f %%". > > + ]] > > also dislike the name "unit", since it's "format" -- in the general > term and gets a value... I'd not limit it to "units", meaning that's > only to format units of a value. You may use it to format some date, > etc. > > my suggestion is to change it to "format_template" or > "format_string"... and pass that to format_cb/func as above, so you > could change the template string and get it passed to the format > template: > > format_func(result_strbuf, format_template, value) > Agree with all the above comments. -- Jean-Philippe André ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel