libgimpwidgets: add ratio expressions to eevl

Desktop / GNOME / GIMP - Ell [] - 4 October 2017 14:25 EDT

Ratio expressions have the form 'x : y' (the ':' operator has the highest precedence for a binary operator, and is left-associative). Given a reference value 'a', the expression evaluates to 'a * (x / y)'.

Ratio expressions can be controlled by the caller by:

- Enabling or disabling them: They're meant to be used when the eevl servers two paired entries, and can be disabled otherwise.

- Setting the reference value: That's normally the value of the "other" entry of the pair--the one not currently being evaluated.

- Inverting the ratios: Normally, one entry refers to the antecedent term of the ratio, and the other entry refers to the consequent term of the ratio. When evaluating the latter one, the ratio should be inverted.

6caae9c libgimpwidgets: add ratio expressions to eevl
libgimpwidgets/gimpeevl.c | 52 +++++++++++++++++++++++++++++++++++++++--------
libgimpwidgets/gimpeevl.h | 13 +++++++++++-
2 files changed, 55 insertions(+), 10 deletions(-)


  • Share