From: Fredrik Alstromer [EMAIL PROTECTED] > As requested, I'm moving this discussion to the mailing list... > for the history, see the bugzilla entry 76616.
I don't have anything to say about how this should work, but I'd like to make some suggestions about the approach to development. Mostly it should be possible to do this in a modular way -- evaluating expressions doesn't really have anything to do with the details of size entries. So I suggest your effort should go into writing a function that looks like gchar *gimp_math_expr_parse (info, expression) where "info" is a structure containing any information you need to do the parsing (resolution, image dimensions, whatever), and "expression" is the string entered by the user. The code could go into new .c/.h files either in libgimpwidgets or perhaps libgimpmath. That way, the size entry code can simply call the function to evaluate the string before using it. It would perhaps be possible to set up the infrastructure for this in the trunk development branch, that is, to create the files and have the size entry code call the evaluation function, but with the function initially just returning "expression" unchanged. If it were done this way, it would be possible for you to work without worrying much about changes in the size entry code -- which, as Sven has pointed out, needs improvement in several respects. Please don't take the details here too seriously. The function name and form were written on the fly, without any serious thought. The only real point is that the code should be factored. (And if I'm saying things that you had already planned to do, I apologize, but it didn't come through clearly.) -- Bill
_______________________________________________ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer