Commit 37afd470 authored by Ell's avatar Ell

operations: sprinkle some GUM over a bunch of ops

GUM is a small language for controlling some UI attributes of operation
properties dynamically, based on context.  It is currently used by GIMP,
as of commit bb2417c29943e68baecd87f6c8c7808ebc3d091e.  See the comment
at the top of app/widget/gimppropgui-eval.c, in the GIMP tree, for a
description of the language.

This commit adds ui_meta keys containing GUM expression for a bunch of
ops, to make their UI more context aware.  The list of ops is not
necessarily exhaustive -- there may be more ops that can be GUMified.

Note that the new ui_meta keys augment, rather than replace, the existing
static attributes of properties (in particular, their label and
description), so that they still retain a meaningful value for users that
don't support GUM.
parent bfff776b
......@@ -37,26 +37,72 @@ property_enum (color_model, _("Color model"),
property_double (cpn_1_frequency, _("Component 1 frequency"), 1)
value_range (0, 20)
ui_meta ("sensitive", "! cpn-1-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Red frequency"))
ui_meta ("hsl-label", _("Hue frequency"))
property_double (cpn_2_frequency, _("Component 2 frequency"), 1)
value_range (0, 20)
ui_meta ("sensitive", "! cpn-2-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Green frequency"))
ui_meta ("hsl-label", _("Saturation frequency"))
property_double (cpn_3_frequency, _("Component 3 frequency"), 1)
value_range (0, 20)
ui_meta ("sensitive", "! cpn-3-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Blue frequency"))
ui_meta ("hsl-label", _("Lightness frequency"))
property_double (cpn_1_phaseshift, _("Component 1 phase shift"), 0)
value_range (0, 360)
ui_meta ("unit", "degree")
ui_meta ("sensitive", "! cpn-1-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Red phase shift"))
ui_meta ("hsl-label", _("Hue phase shift"))
property_double (cpn_2_phaseshift, _("Component 2 phase shift"), 0)
value_range (0, 360)
ui_meta ("unit", "degree")
ui_meta ("sensitive", "! cpn-2-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Green phase shift"))
ui_meta ("hsl-label", _("Saturation phase shift"))
property_double (cpn_3_phaseshift, _("Component 3 phase shift"), 0)
value_range (0, 360)
ui_meta ("unit", "degree")
ui_meta ("sensitive", "! cpn-3-keep")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Blue phase shift"))
ui_meta ("hsl-label", _("Lightness phase shift"))
property_boolean (cpn_1_keep, _("Keep component 1"), FALSE)
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Keep red component"))
ui_meta ("hsl-label", _("Keep hue component"))
property_boolean (cpn_2_keep, _("Keep component 2"), FALSE)
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Keep green component"))
ui_meta ("hsl-label", _("Keep saturation component"))
property_boolean (cpn_3_keep, _("Keep component 3"), FALSE)
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {hsl} : hsl-label]")
ui_meta ("rgb-label", _("Keep blue component"))
ui_meta ("hsl-label", _("Keep lightness component"))
#else
......
......@@ -50,9 +50,11 @@ property_double (e5, _("(5,5)"), 0.0)
property_double (divisor, _("Divisor"), 1.0)
ui_range (-1000.0, 1000.0)
ui_meta ("sensitive", "! normalize")
property_double (offset, _("Offset"), 0.0)
value_range (-1.0, 1.0)
ui_meta ("sensitive", "! normalize")
property_boolean (red, _("Red channel"), TRUE)
property_boolean (green, _("Green channel"), TRUE)
......
......@@ -73,10 +73,14 @@ property_double (shifty, _("Shift Y"), 0.0)
property_double (cx, _("CX"), -0.75)
description (_("CX (No effect in Mandelbrot and Sierpinski)"))
value_range (-2.5, 2.5)
ui_meta ("visible", "! fractaltype {mandelbrot, sierpinski}")
ui_meta ("description", "''")
property_double (cy, _("CY"), -0.2)
description (_("CY (No effect in Mandelbrot and Sierpinski)"))
value_range (-2.5, 2.5)
ui_meta ("visible", "$cx.visible")
ui_meta ("description", "''")
property_double (redstretch, _("Red stretching factor"), 1.0)
value_range (0.0, 1.0)
......
......@@ -50,10 +50,12 @@ property_double (Y2, _("Y2"), 1.0)
property_double (JX, _("JX"), 0.5)
description (_("Julia seed X value, position"))
value_range (-50.0, 50.0)
ui_meta ("visible", "fractal {julia}")
property_double (JY, _("JY"), 0.5)
description (_("Julia seed Y value, position"))
value_range (-50.0, 50.0)
ui_meta ("visible", "$JX.visible")
property_int (depth, _("Depth"), 3)
value_range (1, 65536)
......
......@@ -64,18 +64,36 @@ property_double (twist, _("Black and green angle"), 75.0)
value_range (-180.0, 180.0)
ui_meta ("unit", "degree")
description (_("angle offset for patterns"))
ui_meta ("label", "[color-model {white-on-black,"
" black-on-white} : bw-label,"
" color-model {rgb} : rgb-label,"
" color-model {cmyk} : cmyk-label]")
ui_meta ("bw-label", _("Angle"))
ui_meta ("rgb-label", _("Green angle"))
ui_meta ("cmyk-label", _("Black angle"))
property_double (twist2, _("Red and cyan angle"), 15.0)
value_range (-180.0, 180.0)
ui_meta ("unit", "degree")
ui_meta ("visible", "color-model {rgb, cmyk}")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {cmyk} : cmyk-label]")
ui_meta ("rgb-label", _("Red angle"))
ui_meta ("cmyk-label", _("Cyan angle"))
property_double (twist3, _("Blue and magenta angle"), 45.0)
value_range (-180.0, 180.0)
ui_meta ("unit", "degree")
ui_meta ("visible", "color-model {rgb, cmyk}")
ui_meta ("label", "[color-model {rgb} : rgb-label,"
" color-model {cmyk} : cmyk-label]")
ui_meta ("rgb-label", _("Blue angle"))
ui_meta ("cmyk-label", _("Magenta angle"))
property_double (twist4, _("Yellow angle"), 0.0)
value_range (-180.0, 180.0)
ui_meta ("unit", "degree")
ui_meta ("visible", "color-model {cmyk}")
#else
......
......@@ -53,15 +53,18 @@ property_int (pole_x, _("X"), 0)
value_range (0, G_MAXINT)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "x")
ui_meta ("sensitive", "$middle.sensitive & ! middle")
property_int (pole_y, _("Y"), 0)
description (_("Origin point for the polar coordinates"))
value_range (0, G_MAXINT)
ui_meta ("unit", "pixel-coordinate")
ui_meta ("axis", "y")
ui_meta ("sensitive", "$pole-x.sensitive")
property_boolean (middle, _("Choose middle"), TRUE)
description(_("Let origin point to be the middle one"))
description (_("Let origin point to be the middle one"))
ui_meta ("sensitive", "polar")
#else
......
......@@ -29,6 +29,7 @@ property_double (low_limit, _("Low limit"), 0.0)
value_range (-G_MAXDOUBLE, 0.0)
ui_range (-2.0, 0.0)
description (_("Pixels values lower than this limit will be set to it"))
ui_meta ("sensitive", "clip-low")
property_boolean (clip_high, _("Clip high pixel values"), TRUE)
description (_("Clip high pixel values"))
......@@ -37,6 +38,7 @@ property_double (high_limit, _("High limit"), 1.0)
value_range (1.0, G_MAXDOUBLE)
ui_range (1.0, 3.0)
description (_("Pixels values higher than this limit will be set to it"))
ui_meta ("sensitive", "clip-high")
#else
......
......@@ -77,6 +77,7 @@ property_enum (background_type, _("Background type"),
property_color (bg_color, _("Background color"), "rgba(0.0, 0.0, 0.0, 1.0)")
description (("The tiles' background color"))
ui_meta ("role", "color-primary")
ui_meta ("visible", "background-type {color}")
property_seed (seed, _("Random seed"), rand)
......
......@@ -55,6 +55,8 @@ property_double (rate, _("Propagating rate"), 1.0)
property_color (color, _("Color"), "blue")
description (_("Color to use for the \"Only color\" and \"Color to peaks\" modes"))
ui_meta ("role", "color-primary")
ui_meta ("visible", "mode {color_peak, color}")
ui_meta ("description", "''")
property_boolean (top, _("To top"), TRUE)
description (_("Propagate to top"))
......@@ -73,6 +75,7 @@ property_boolean (value, _("Propagating value channel"), TRUE)
property_boolean (alpha, _("Propagating alpha channel"), TRUE)
description (_("Propagating alpha channel"))
ui_meta ("sensitive", "! mode {color_peak}")
#else
......
......@@ -55,6 +55,7 @@ property_double (base, _("Base"), 2.0)
value_range (1.0, G_MAXDOUBLE)
ui_range (1.0, 20.0)
ui_gamma (2.0)
ui_meta ("visible", "type {logarithmic}")
property_double (balance, _("Balance"), 0.0)
description (_("Area balance between the two colors"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment