[gegl] operations: sprinkle some GUM over a bunch of ops
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations: sprinkle some GUM over a bunch of ops
- Date: Sat, 13 May 2017 21:13:49 +0000 (UTC)
commit 37afd47046008241ae432c3401b9ad4b507d887a
Author: Ell <ell_se yahoo com>
Date: Sat May 13 17:03:48 2017 -0400
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.
operations/common/alien-map.c | 46 ++++++++++++++++++++++++++++++++
operations/common/convolution-matrix.c | 2 +
operations/common/fractal-explorer.c | 4 +++
operations/common/fractal-trace.c | 2 +
operations/common/newsprint.c | 18 ++++++++++++
operations/common/polar-coordinates.c | 5 +++-
operations/common/rgb-clip.c | 2 +
operations/common/tile-paper.c | 1 +
operations/common/value-propagate.c | 3 ++
operations/workshop/spiral.c | 1 +
10 files changed, 83 insertions(+), 1 deletions(-)
---
diff --git a/operations/common/alien-map.c b/operations/common/alien-map.c
index ebe76dd..2aa0a60 100644
--- a/operations/common/alien-map.c
+++ b/operations/common/alien-map.c
@@ -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
diff --git a/operations/common/convolution-matrix.c b/operations/common/convolution-matrix.c
index 7af8922..c3a33e9 100644
--- a/operations/common/convolution-matrix.c
+++ b/operations/common/convolution-matrix.c
@@ -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)
diff --git a/operations/common/fractal-explorer.c b/operations/common/fractal-explorer.c
index e2495b7..012cb2e 100644
--- a/operations/common/fractal-explorer.c
+++ b/operations/common/fractal-explorer.c
@@ -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)
diff --git a/operations/common/fractal-trace.c b/operations/common/fractal-trace.c
index c785cc5..e9e407b 100644
--- a/operations/common/fractal-trace.c
+++ b/operations/common/fractal-trace.c
@@ -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)
diff --git a/operations/common/newsprint.c b/operations/common/newsprint.c
index 8da0e20..13fd15c 100644
--- a/operations/common/newsprint.c
+++ b/operations/common/newsprint.c
@@ -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
diff --git a/operations/common/polar-coordinates.c b/operations/common/polar-coordinates.c
index eb96c37..2be4fca 100644
--- a/operations/common/polar-coordinates.c
+++ b/operations/common/polar-coordinates.c
@@ -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
diff --git a/operations/common/rgb-clip.c b/operations/common/rgb-clip.c
index 65af346..6f03723 100644
--- a/operations/common/rgb-clip.c
+++ b/operations/common/rgb-clip.c
@@ -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
diff --git a/operations/common/tile-paper.c b/operations/common/tile-paper.c
index 3b98e8b..1eec5dc 100644
--- a/operations/common/tile-paper.c
+++ b/operations/common/tile-paper.c
@@ -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)
diff --git a/operations/common/value-propagate.c b/operations/common/value-propagate.c
index 82d8cd1..5c50210 100644
--- a/operations/common/value-propagate.c
+++ b/operations/common/value-propagate.c
@@ -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
diff --git a/operations/workshop/spiral.c b/operations/workshop/spiral.c
index f8f17eb..b031220 100644
--- a/operations/workshop/spiral.c
+++ b/operations/workshop/spiral.c
@@ -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"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]