[gegl] ops: port many more ops to macro based property meta data



commit e965f6b9aa96e0b5434b359dbc0e928699a0137e
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 20 21:20:53 2014 +0200

    ops: port many more ops to macro based property meta data

 operations/common/brightness-contrast.c |   24 +++----
 operations/common/checkerboard.c        |   84 ++++++++++------------
 operations/common/cubism.c              |   30 ++++-----
 operations/common/fractal-explorer.c    |  110 +++++++++++++----------------
 operations/common/gaussian-blur.c       |   35 +++++-----
 operations/common/grid.c                |   84 ++++++++++------------
 operations/common/introspect.c          |    4 +-
 operations/common/layer.c               |   51 ++++++--------
 operations/common/lens-distortion.c     |   59 +++++++---------
 operations/common/levels.c              |   35 +++++----
 operations/common/linear-gradient.c     |   50 +++++--------
 operations/common/load.c                |    5 +-
 operations/common/magick-load.c         |    6 +-
 operations/common/mantiuk06.c           |   25 +++----
 operations/common/map-absolute.c        |    4 +-
 operations/common/map-relative.c        |   16 ++---
 operations/common/matting-global.c      |    6 +-
 operations/common/mblur.c               |    7 +-
 operations/common/mirrors.c             |  118 ++++++++++++++-----------------
 operations/common/mono-mixer.c          |   24 +++----
 operations/common/panorama-projection.c |   86 ++++++++++-------------
 21 files changed, 381 insertions(+), 482 deletions(-)
---
diff --git a/operations/common/brightness-contrast.c b/operations/common/brightness-contrast.c
index ebaeb14..836606f 100644
--- a/operations/common/brightness-contrast.c
+++ b/operations/common/brightness-contrast.c
@@ -24,21 +24,19 @@
 /*  Here in the top of the file the properties of the operation is declared,
  *  this causes the declaration of a structure for containing the data.
  *
- *  The first member of each gegl_property_ macro becomes a struct member
+ *  The first member of each property_ macro becomes a struct member
  *  in the GeglProperties struct used when processing.
  */
 
-gegl_property_double (contrast, _("Contrast"), 
-   "description", _("Magnitude of contrast scaling >1.0 brighten < 1.0 darken"),
-   "default", 1.0, "min", -5.0, "max", 5.0,
-   "ui-min", 0.0, "ui-max", 2.0, "ui-gamma", 1.0,
-   NULL)
+property_double (contrast, _("Contrast"),  1.0)
+   description  (_("Magnitude of contrast scaling >1.0 brighten < 1.0 darken"))
+   value_range  (-5.0, 5.0)
+   ui_range     (0.0, 2.0)
 
-gegl_property_double (brightness, _("Brightness"), 
-   "description", _("Amount to increase brightness"),
-   "default", 0.0, "min", -3.0, "max", 3.0,
-   "ui-min", -1.0, "ui-max", 1.0, "ui-gamma", 1.0,
-   NULL)
+property_double (brightness, _("Brightness"), 0.0)
+   description  (_("Amount to increase brightness"))
+   value_range  (-3.0, 3.0)
+   ui_range     (-1.0, 1.0)
 
 #else
 
@@ -84,7 +82,7 @@ process (GeglOperation       *op,
          const GeglRectangle *roi,
          gint                 level)
 {
-  /* Retrieve a pointer to GeglChantO structure which contains all the
+  /* Retrieve a pointer to GeglProperties structure which contains all the
    * chanted properties
    */
   GeglProperties *o = GEGL_PROPERTIES (op);
@@ -156,4 +154,4 @@ gegl_op_class_init (GeglOpClass *klass)
       NULL);
 }
 
-#endif /* closing #ifdef GEGL_CHANT_PROPERTIES ... else ... */
+#endif /* closing #ifdef GEGL_PROPERTIES ... else ... */
diff --git a/operations/common/checkerboard.c b/operations/common/checkerboard.c
index 01d3766..5afb548 100644
--- a/operations/common/checkerboard.c
+++ b/operations/common/checkerboard.c
@@ -22,52 +22,44 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (x, _("Width"),
-    "description", _("Horizontal width of cells pixels"),
-    "default",  16,
-    "min",       1,
-    "ui-min",    1, "ui-max", 256, "ui-gamma", 1.5,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (y, _("Height"),
-    "description", _("Vertical width of cells pixels"),
-    "default", 16, "min", 1,
-    "ui-min",  1,  "ui-max", 256, "ui-gamma", 1.5,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_int (x_offset, _("Offset X"),
-    "description", _("Horizontal offset (from origin) for start of grid"),
-    "ui-min", -10, "ui-max", 10,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (y_offset, _("Offset Y"),
-    "description", _("Vertical offset (from origin) for start of grid"),
-    "ui-min", -10, "ui-max",  10,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_color (color1, _("Color"),
-    "description", _("One of the cell colors (defaults to 'black')"),
-    "default", "black",
-    "role",    "color-primary",
-    NULL)
-
-gegl_property_color (color2, _("Color"),
-    "description", _("One of the cell colors (defaults to 'white')"),
-    "default", "white",
-    "role",    "color-secondary",
-    NULL)
-
-gegl_property_format (format, _("Babl Format"),
-    "description", _("The babl format of the output"),
-    NULL)
+property_int (x, _("Width"), 16)
+    description (_("Horizontal width of cells pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 256)
+    ui_gamma    (1.5)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_int (y, _("Height"), 16)
+    description (_("Vertical width of cells pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 256)
+    ui_gamma    (1.5)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_int (x_offset, _("Offset X"), 0.0)
+    description (_("Horizontal offset (from origin) for start of grid"))
+    ui_range (-10, 10)
+    ui_meta("unit", "pixel-coordinate")
+    ui_meta ("axis", "x")
+
+property_int (y_offset, _("Offset Y"), 0)
+    description (_("Vertical offset (from origin) for start of grid"))
+    ui_range    (-10, 10)
+    ui_meta     ("unit", "pixel-coordinate")
+    ui_meta     ("axis", "y")
+
+property_color  (color1, _("Color"), "black")
+    description (_("One of the cell colors (defaults to 'black')"))
+    ui_meta     ("role", "color-primary")
+
+property_color  (color2, _("Color"), "white")
+    description (_("One of the cell colors (defaults to 'white')"))
+    ui_meta     ("role", "color-secondary")
+
+property_format (format, _("Babl Format"), NULL)
+    description ( _("The babl format of the output"))
 
 #else
 
diff --git a/operations/common/cubism.c b/operations/common/cubism.c
index 6a16841..109d669 100644
--- a/operations/common/cubism.c
+++ b/operations/common/cubism.c
@@ -27,23 +27,19 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (tile_size, _("Tile size"),
-    "default", 10.0, "min", 0.0, "max", 256.0,
-    "description", _("Average diameter of each tile (in pixels)"),
-    "unit", "pixel-distance",
-    NULL)
-
-gegl_property_double (tile_saturation, _("Tile saturation"),
-    "default", 2.5, "min", 0.0, "max", 10.0,
-    _("Expand tiles by this amount"),
-    NULL)
-
-gegl_property_color (bg_color, _("Background Color"),
-    "description", _("The tiles' background color"),
-    "default", "rgba(0.0, 0.0, 0.0, 0.0)",
-    NULL)
-
-gegl_property_seed (seed, _("Random seed"), rand, NULL)
+property_double (tile_size, _("Tile size"), 10.0)
+    description (_("Average diameter of each tile (in pixels)"))
+    value_range (0.0, 256.0)
+    ui_meta     ("unit", "pixel-distance")
+
+property_double (tile_saturation, _("Tile saturation"), 2.5)
+    description (_("Expand tiles by this amount"))
+    value_range (0.0, 10.0)
+
+property_color  (bg_color, _("Background Color"), "rgba(0.0, 0.0, 0.0, 0.0)")
+    description (("The tiles' background color"))
+
+property_seed (seed, _("Random seed"), rand)
 
 #else
 
diff --git a/operations/common/fractal-explorer.c b/operations/common/fractal-explorer.c
index bda6548..a2f551b 100644
--- a/operations/common/fractal-explorer.c
+++ b/operations/common/fractal-explorer.c
@@ -39,48 +39,44 @@ enum_start (gegl_fractal_explorer_type)
   enum_value (GEGL_FRACTAL_EXPLORER_TYPE_SIERPINSKI, "Sierpinski")
 enum_end (GeglFractalExplorerType)
 
-gegl_property_enum (fractaltype, _("Fractal type"),
+property_enum (fractaltype, _("Fractal type"),
     GeglFractalExplorerType, gegl_fractal_explorer_type,
-    "description", _("Type of a fractal"),
-    "default", GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT,
-    NULL)
-gegl_property_int (iter, _("Iterations"),
-    "description", _("Iterations"),
-    "default", 50, "min", 1, "max", 1000,
-    NULL)
-gegl_property_double (zoom, _("Zoom"),
-    "description", _("Zoom in the fractal space"),
-    "default", 300.0 , "min"   , 0.0000001, "max"     , 10000000.0,
-    "ui-min",  0.0001, "ui-max", 10000.0  , "ui-gamma", 1.5,
-   NULL)
-gegl_property_double (shiftx, _("Shift X"),
-    "description", _("X shift in the fractal space"),
-    "ui-min", -1000.0, "ui-max",  1000.0, "ui-gamma", 1.5,
-    NULL)
-gegl_property_double (shifty, _("Shift Y"),
-    "description", _("Y shift in the fractal space"),
-    "ui-min", -1000.0, "ui-max",  1000.0, "ui-gamma", 1.5,
-    NULL)
-gegl_property_double (cx, _("CX"),
-    "description", _("CX (No effect in Mandelbrot and Sierpinski)"),
-    "default", -0.75, "min", -2.5, "max", 2.5,
-    NULL)
-gegl_property_double (cy, _("CY"),
-    "description", _("CY (No effect in Mandelbrot and Sierpinski)"),
-    "default", 0.2, "min", -2.5, "max", 2.5,
-    NULL)
-gegl_property_double (redstretch, _("Red stretch"),
-    "description", _("Red stretching factor"), 
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    NULL)
-gegl_property_double (greenstretch, _("Green stretch"),
-    "description", _("Green stretching factor"),
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    NULL)
-gegl_property_double (bluestretch, _("Blue stretch"),
-    "description", _("Green stretching factor"), 
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    NULL)
+    GEGL_FRACTAL_EXPLORER_TYPE_MANDELBROT)
+    description (_("Type of a fractal"))
+
+property_int (iter, _("Iterations"), 50)
+    value_range (1, 1000)
+
+property_double (zoom, _("Zoom"), 300.0)
+    description (_("Zoom in the fractal space"))
+    value_range (0.0000001, 10000000.0)
+    ui_range    (0.0000001, 10000.0)
+    ui_gamma    (1.5)
+
+property_double (shiftx, _("Shift X"), 0.0)
+    description (_("X shift in the fractal space"))
+    ui_range    (-1000.0, 1000.0)
+
+property_double (shifty, _("Shift Y"), 0.0)
+    description (_("Y shift in the fractal space"))
+    ui_range    (-1000.0, 1000.0)
+
+property_double (cx, _("CX"), -0.75)
+    description (_("CX (No effect in Mandelbrot and Sierpinski)"))
+    value_range (-2.5, 2.5)
+
+property_double (cy, _("CY"), -0.2)
+    description (_("CY (No effect in Mandelbrot and Sierpinski)"))
+    value_range (-2.5, 2.5)
+
+property_double (redstretch, _("Red stretching factor"), 1.0)
+    value_range (0.0, 1.0)
+
+property_double (greenstretch, _("Green stretching factor"), 1.0)
+    value_range (0.0, 1.0)
+
+property_double (bluestretch, _("Blue stretching factor"), 1.0)
+    value_range (0.0, 1.0)
 
 enum_start (gegl_fractal_explorer_mode)
   enum_value (GEGL_FRACTAL_EXPLORER_MODE_SIN , "Sine")
@@ -88,34 +84,26 @@ enum_start (gegl_fractal_explorer_mode)
   enum_value (GEGL_FRACTAL_EXPLORER_MODE_NONE, "None")
 enum_end (GeglFractalExplorerMode)
 
-gegl_property_enum (redmode, _("Red mode"),
+property_enum (redmode, _("Red application mode"),
     GeglFractalExplorerMode, gegl_fractal_explorer_mode,
-    "description",   _("Red application mode"),
-    "default", GEGL_FRACTAL_EXPLORER_MODE_COS,
-    NULL)
+    GEGL_FRACTAL_EXPLORER_MODE_COS)
 
-gegl_property_enum (greenmode, _("Green mode"),
+property_enum (greenmode, _("Green application mode"),
     GeglFractalExplorerMode, gegl_fractal_explorer_mode,
-    "default", GEGL_FRACTAL_EXPLORER_MODE_COS,
-    "description",   _("Green application mode"), 
-    NULL)
+    GEGL_FRACTAL_EXPLORER_MODE_COS)
 
-gegl_property_enum (bluemode, _("Blue mode"),
+property_enum (bluemode, _("Blue application mode"),
     GeglFractalExplorerMode, gegl_fractal_explorer_mode,
-    "description", _("Blue application mode"),
-    "default", GEGL_FRACTAL_EXPLORER_MODE_SIN,
-    NULL)
+    GEGL_FRACTAL_EXPLORER_MODE_SIN)
 
-gegl_property_boolean (redinvert  , _("Red inversion")  , NULL)
-gegl_property_boolean (greeninvert, _("Green inversion"), NULL)
-gegl_property_boolean (blueinvert , _("Blue inversion") , NULL)
+property_boolean (redinvert  , _("Red inversion")  , FALSE)
+property_boolean (greeninvert, _("Green inversion"), FALSE)
+property_boolean (blueinvert , _("Blue inversion") , FALSE)
 
-gegl_property_int (ncolors, _("Colors"),
-    "description", _("Number of colors"),
-    "default", 256, "min", 2, "max", MAXNCOLORS,
-    NULL)
+property_int    (ncolors, _("Number of colors"), 256)
+    value_range (2, MAXNCOLORS)
 
-gegl_property_boolean (useloglog, _("Loglog smoothing"), NULL)
+property_boolean (useloglog, _("Loglog smoothing"), FALSE)
 
 #else
 
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index 65e1476..4aab31e 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -33,27 +33,26 @@ enum_start (gegl_gaussian_blur_filter)
   enum_value (GEGL_GAUSSIAN_BLUR_FILTER_IIR,  "IIR")
 enum_end (GeglGaussianBlurFilter)
 
-gegl_property_double (std_dev_x, _("Size X"),
-    "description", _("Standard deviation for the horizontal axis (multiply by ~2 to get radius)"),
-    "default", 1.5, "min", 0.0, "max", 1500.0,
-    "ui-min", 0.0, "ui-max", 100.0, "ui-gamma", 3.0,
-    "axis", "x",
-    "unit", "pixel-coordinate",
-    NULL)
-
-gegl_property_double (std_dev_y, _("Size Y"),
-    "description", _("Standard deviation for the horizontal axis (multiply by ~2 to get radius)"),
-    "default", 1.5, "min", 0.0, "max", 1500.0,
-    "ui-min", 0.0, "ui-max", 100.0, "ui-gamma", 3.0,
-    "axis", "y",
-    "unit", "pixel-coordinate",
-    NULL)
-
-gegl_property_enum  (filter, _("Filter"),
+property_double (std_dev_x, _("Size X"), 1.5)
+    description (_("Standard deviation for the horizontal axis"))
+    value_range (0.0, 1500.0)
+    ui_range    (0.0, 100.0)
+    ui_gamma    (3.0)
+    ui_meta     ("axis", "x")
+    ui_meta     ("unit", "pixel-coordinate")
+
+property_double (std_dev_y, _("Size Y"), 1.5)
+    description (_("Standard deviation for the vertical axis"))
+    value_range (0.0, 1500.0)
+    ui_range    (0.0, 100.0)
+    ui_gamma    (3.0)
+    ui_meta     ("axis", "y")
+    ui_meta     ("unit", "pixel-coordinate")
+
+property_enum  (filter, _("Filter"),
     GeglGaussianBlurFilter, gegl_gaussian_blur_filter,
-    "default", GEGL_GAUSSIAN_BLUR_FILTER_AUTO,
-    "description", _("Optional parameter to override the automatic selection of blur filter"),
-    NULL)
+    GEGL_GAUSSIAN_BLUR_FILTER_AUTO)
+    description (_("Optional parameter to override the automatic selection of blur filter"))
 
 #else
 
diff --git a/operations/common/grid.c b/operations/common/grid.c
index ac168d1..a8afaf6 100644
--- a/operations/common/grid.c
+++ b/operations/common/grid.c
@@ -21,59 +21,49 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (x, _("Width"),
-    "description", _("Horizontal width of cells pixels"),
-    "default", 32, "min", 1, "max", G_MAXINT,
-    "ui-min", 1, "ui-max", 128,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (y, _("Height"),
-    "description", _("Vertical width of cells pixels"),
-    "default", 32, "min", 1, "max", G_MAXINT,
-    "ui-min", 1, "ui-max", 128,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_int (x_offset, _("Offset X"),
-    "description", _("Horizontal offset (from origin) for start of grid"),
-    "default", 0,
-    "ui-min", -64, "ui-max", 64,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (y_offset, _("Offset Y"),
-    "description", _("Vertical offset (from origin) for start of grid"),
-    "default", 0,
-    "ui-min", -64, "ui-max", 64,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_int (line_width, _("Line width"),
-    "description", _("Width of grid lines in pixels"),
-    "default", 4, "min", 0,
-    "ui-min", 0, "ui-max", 16,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (line_height, _("Line height"),
-    "description", _("Width of grid lines in pixels"),
-    "default", 4, "min", 0,
-    "ui-min", 0, "ui-max", 16,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_color (line_color, _("Color"),
-    "description", _("Color of the grid lines"),
-    "default", "black",
-    "role",    "color-primary",
-    NULL)
+property_int    (x, _("Width"), 32)
+    description (_("Horizontal width of cells pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 128)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_int    (y, _("Height"), 32)
+    description (_("Vertical width of cells pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 128)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_int    (x_offset, _("Offset X"), 0)
+    description (_("Horizontal offset (from origin) for start of grid"))
+    ui_range    (-64, 64)
+    ui_meta     ("unit", "pixel-coordinate")
+    ui_meta     ("axis", "x")
+
+property_int    (y_offset, _("Offset Y"), 0)
+    description (_("Vertical offset (from origin) for start of grid"))
+    ui_range    (-64, 64)
+    ui_meta     ("unit", "pixel-coordinate")
+    ui_meta     ("axis", "y")
+
+property_int    (line_width, _("Line width"), 4)
+    description (_("Width of grid lines in pixels"))
+    value_range (0, G_MAXINT)
+    ui_range    (0, 16)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_int    (line_height, _("Line height"), 4)
+    description (_("Height of grid lines in pixels"))
+    value_range (0, G_MAXINT)
+    ui_range    (0, 16)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_color (line_color, _("Color"), "black")
+    description (_("Color of the grid lines"))
+    ui_meta     ("role",    "color-primary")
 
 #else
 
diff --git a/operations/common/introspect.c b/operations/common/introspect.c
index 8ee2c42..d37ab29 100644
--- a/operations/common/introspect.c
+++ b/operations/common/introspect.c
@@ -23,9 +23,7 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_object(node, _("Node"),
-    "description", _("GeglNode to introspect"),
-    NULL)
+property_object(node, _("Node"), GEGL_TYPE_NODE)
 
 #else
 
diff --git a/operations/common/layer.c b/operations/common/layer.c
index 84a7066..a921cab 100644
--- a/operations/common/layer.c
+++ b/operations/common/layer.c
@@ -27,36 +27,27 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_string(composite_op, _("Operation"),
-    "description", _("Composite operation to use"),
-    "default", "gegl:over",
-    NULL)
-
-gegl_property_double(opacity, _("Opacity"),
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    NULL)
-
-gegl_property_double(x, _("X"),
-    "description", _("Horizontal position in pixels"),
-    "axis", "x",
-    "unit", "pixel-coordinate",
-    NULL)
-
-gegl_property_double(y, _("Y"),
-    "description", _("Vertical position in pixels"),
-    "axis", "y",
-    "unit", "pixel-coordinate",
-    NULL)
-
-gegl_property_double(scale, _("Scale"),
-    "description", _("Scale 1:1 size"),
-    "default", 1.0,
-    NULL)
-
-gegl_property_file_path(src, _("Source"),
-    "description", _("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"),
-    "default", "",
-    NULL)
+property_string(composite_op, _("Operation"), "gegl:over")
+    description (_("Composite operation to use"))
+
+property_double(opacity, _("Opacity"), 1.0)
+    value_range (0.0, 1.0)
+
+property_double(x, _("X"), 0.0)
+    description (_("Horizontal position in pixels"))
+    ui_meta     ("axis", "x")
+    ui_meta     ("unit", "pixel-coordinate")
+
+property_double(y, _("Y"), 0.0)
+    description (_("Vertical position in pixels"))
+    ui_meta     ("axis", "y")
+    ui_meta     ("unit", "pixel-coordinate")
+
+property_double(scale, _("Scale"), 1.0)
+    description (_("Scale 1:1 size"))
+
+property_file_path(src, _("Source"), "")
+    description (_("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"))
 
 #else
 
diff --git a/operations/common/lens-distortion.c b/operations/common/lens-distortion.c
index 8630e5d..74a11fd 100644
--- a/operations/common/lens-distortion.c
+++ b/operations/common/lens-distortion.c
@@ -30,40 +30,31 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (main, _("Main"),
-    "description", _("Amount of second-order distortion"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_double (edge, _("Edge"),
-    "description", _("Amount of fourth-order distortion"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_double (zoom, _("Zoom"),
-    "description", _("Rescale overall image size"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_double (x_shift, _("Shift X"),
-    "description", _("Effect centre offset in X"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_double (y_shift, _("Shift Y"),
-    "description", _("Effect centre offset in Y"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_double (brighten, _("Brighten"),
-    "description", _("Adjust brightness in corners"),
-    "min", -100.0, "max", 100.0,
-    NULL)
-
-gegl_property_color  (background, _("Background"),
-    "description", _("Background color"),
-    "default", "white",
-    NULL)
+property_double (main, _("Main"), 0.0)
+    description (_("Amount of second-order distortion"))
+    value_range (-100.0, 100.0)
+
+property_double (edge, _("Edge"), 0.0)
+    description (_("Amount of fourth-order distortion"))
+    value_range (-100.0, 100.0)
+
+property_double (zoom, _("Zoom"), 0.0)
+    description (_("Rescale overall image size"))
+    value_range (-100, 100.0)
+
+property_double (x_shift, _("Shift X"), 0.0)
+    description (_("Effect centre offset in X"))
+    value_range (-100.0, 100.0)
+
+property_double (y_shift, _("Shift Y"), 0.0)
+    description (_("Effect centre offset in Y"))
+    value_range (-100.0, 100.0)
+
+property_double (brighten, _("Brighten"), 0.0)
+    description (_("Adjust brightness in corners"))
+    value_range (-100.0, 100.0)
+
+property_color  (background, _("Background color"), "white")
 
 #else
 
diff --git a/operations/common/levels.c b/operations/common/levels.c
index 0e5ce22..f66f686 100644
--- a/operations/common/levels.c
+++ b/operations/common/levels.c
@@ -23,22 +23,25 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (in_low, _("Low input"),
-    "description", _("Input luminance level to become lowest output"),
-    "min", -1.0, "max", 4.0, "default", 0.0, "ui-min", 0.0, "ui-max", 1.0,
-    NULL)
-gegl_property_double (in_high, _("High input"),
-    "description", _("Input luminance level to become white"),
-    "min", -1.0, "max", 4.0, "default", 1.0, "ui-min", 0.0, "ui-max", 1.0,
-    NULL)
-gegl_property_double (out_low, _("Low output"),
-    "description", _("Lowest luminance level in output"),
-    "min", -1.0, "max", 4.0, "default", 0.0, "ui-min", 0.0, "ui-max", 1.0,
-    NULL)
-gegl_property_double (out_high, _("High output"),
-    "description", _("Highest luminance level in output"),
-    "min", -1.0, "max", 4.0, "default", 1.0, "ui-min", 0.0, "ui-max", 1.0,
-    NULL)
+property_double (in_low, _("Low input"), 0.0)
+    description ( _("Input luminance level to become lowest output"))
+    value_range (-1.0, 4.0)
+    ui_range    (0.0, 1.0)
+
+property_double (in_high, _("High input"), 1.0)
+    description (_("Input luminance level to become white"))
+    value_range (-1.0, 4.0)
+    ui_range    (0.0, 1.0)
+
+property_double (out_low, _("Low output"), 0.0)
+    description (_("Lowest luminance level in output"))
+    value_range (-1.0, 4.0)
+    ui_range    (0.0, 1.0)
+
+property_double (out_high, _("High output"), 1.0)
+    description (_("Highest luminance level in output"))
+    value_range (-1.0, 4.0)
+    ui_range    (0.0, 1.0)
 
 #else
 
diff --git a/operations/common/linear-gradient.c b/operations/common/linear-gradient.c
index 3987308..4e7ef4e 100644
--- a/operations/common/linear-gradient.c
+++ b/operations/common/linear-gradient.c
@@ -22,39 +22,29 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (start_x, _("X1"),
-    "default", 25.0,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-gegl_property_double (start_y, _("Y1"),
-    "default", 25.0,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_double (end_x, _("X2"),
-    "default", 150.0,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-gegl_property_double (end_y, _("Y2"),
-    "default", 150.0,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_color (start_color, _("Start Color"),
-    "description", _("The color at (x1, y1)"),
-    "default", "black",
-    "role", "color-primary",
-    NULL)
-
-gegl_property_color  (end_color, _("End Color"),
-    "description", _("The color at (x2, y2)"),
-    "default", "white",
-    "role", "color-secondary",
-    NULL)
+property_double (start_x, _("X1"), 25.0)
+    ui_meta("unit", "pixel-coordinate")
+    ui_meta("axis", "x")
+
+property_double (start_y, _("Y1"), 25.0)
+    ui_meta("unit", "pixel-coordinate")
+    ui_meta("axis", "y")
+
+property_double (end_x, _("X2"), 150.0)
+    ui_meta("unit", "pixel-coordinate")
+    ui_meta("axis", "x")
+
+property_double (end_y, _("Y2"), 150.0)
+    ui_meta ("unit", "pixel-coordinate")
+    ui_meta ("axis", "y")
+
+property_color (start_color, _("Start Color"), "black")
+    description (_("The color at (x1, y1)"))
+    ui_meta ("role", "color-primary")
+
+property_color  (end_color, _("End Color"), "white")
+    description (_("The color at (x2, y2)"))
+    ui_meta     ("role", "color-secondary")
 
 #else
 
diff --git a/operations/common/load.c b/operations/common/load.c
index f47a786..830884e 100644
--- a/operations/common/load.c
+++ b/operations/common/load.c
@@ -22,9 +22,8 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_file_path (path, _("File"),
-    "description", _("Path of file to load."),
-    NULL)
+property_file_path (path, _("File"), "")
+    description (_("Path of file to load."))
 
 #else
 
diff --git a/operations/common/magick-load.c b/operations/common/magick-load.c
index 28293fa..3f705bd 100644
--- a/operations/common/magick-load.c
+++ b/operations/common/magick-load.c
@@ -23,10 +23,8 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_file_path (path, _("File"),
-    "description", _("Path of file to load."),
-    "default", "/tmp/gegl-logo.svg",
-    NULL)
+property_file_path (path, _("File"), "/tmp/gegl-logo.svg")
+    description (_("Path of file to load."))
 
 #else
 
diff --git a/operations/common/mantiuk06.c b/operations/common/mantiuk06.c
index b6eab8c..6889782 100644
--- a/operations/common/mantiuk06.c
+++ b/operations/common/mantiuk06.c
@@ -28,20 +28,17 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (contrast, _("Contrast"),
-    "description", _("The amount of contrast compression"),
-    "default", 0.1, "min", 0.0, "max", 1.0, 
-    NULL)
-
-gegl_property_double (saturation, _("Saturation"),
-    "description", _("Global color saturation factor"),
-    "default", 0.8, "min", 0.0, "max", 2.0,
-    NULL)
-
-gegl_property_double (detail, _("Detail"),
-    "description", _("Level of emphasis on image gradient details"),
-    "default", 1.0, "min", 1.0, "max", 99.0,
-    NULL)
+property_double (contrast, _("Contrast"), 0.1)
+    description (_("The amount of contrast compression"))
+    value_range (0.0, 1.0)
+
+property_double (saturation, _("Saturation"), 0.8)
+    description (("Global color saturation factor"))
+    value_range (0.0, 2.0)
+
+property_double (detail, _("Detail"), 1.0)
+    description (_("Level of emphasis on image gradient details"))
+    value_range (1.0, 99.0)
 
 #else
 
diff --git a/operations/common/map-absolute.c b/operations/common/map-absolute.c
index d2db808..7d4ff13 100644
--- a/operations/common/map-absolute.c
+++ b/operations/common/map-absolute.c
@@ -19,9 +19,9 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_enum (sampler_type, _("Resampling method"),
+property_enum (sampler_type, _("Resampling method"),
     GeglSamplerType, gegl_sampler_type,
-    "default", GEGL_SAMPLER_CUBIC, NULL)
+    GEGL_SAMPLER_CUBIC)
 
 #else
 
diff --git a/operations/common/map-relative.c b/operations/common/map-relative.c
index 23db3ae..7d38c53 100644
--- a/operations/common/map-relative.c
+++ b/operations/common/map-relative.c
@@ -20,15 +20,13 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (scaling, _("Scaling"),
-  "description", _("scaling factor of displacement, indicates how large spatial"
-              " displacement a relative mapping value of 1.0 corresponds to."),
-    "min", 0.0, "max", 5000.0, "default", 1.0,
-    NULL)
-gegl_property_enum (sampler_type, _("Resampling method"),
-    GeglSamplerType, gegl_sampler_type,
-    "default", GEGL_SAMPLER_CUBIC,
-    NULL)
+property_double (scaling, _("Scaling"), 1.0)
+  description   (_("scaling factor of displacement, indicates how large spatial"
+              " displacement a relative mapping value of 1.0 corresponds to."))
+  value_range (0.0, 5000.0)
+
+property_enum (sampler_type, _("Resampling method"),
+    GeglSamplerType, gegl_sampler_type, GEGL_SAMPLER_CUBIC)
 
 #else
 
diff --git a/operations/common/matting-global.c b/operations/common/matting-global.c
index e2ae589..9d312d0 100644
--- a/operations/common/matting-global.c
+++ b/operations/common/matting-global.c
@@ -22,9 +22,9 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (iterations, _("Iterations"),
-    "description", _("Number of iterations"), 
-    "default", 10, "ui-max", 200, "min", 1, NULL)
+property_int (iterations, _("Iterations"), 10)
+    value_range (1, 10000)
+    ui_range (1, 200)
 
 #else
 
diff --git a/operations/common/mblur.c b/operations/common/mblur.c
index ac25033..10c7216 100644
--- a/operations/common/mblur.c
+++ b/operations/common/mblur.c
@@ -22,10 +22,9 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (dampness, _("Dampness"),
-    "description", _("The value represents the contribution of the past to the new frame."),
-    "min", 0.0, "max", 1.0, "default", 0.95,
-    NULL)
+property_double (dampness, _("Dampness"), 0.95)
+    description (_("The value represents the contribution of the past to the new frame."))
+    value_range (0.0, 1.0)
 
 #else
 
diff --git a/operations/common/mirrors.c b/operations/common/mirrors.c
index fe14372..46269a3 100644
--- a/operations/common/mirrors.c
+++ b/operations/common/mirrors.c
@@ -27,70 +27,60 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (m_angle, _("Mirror rotation"),
-    "description", _("Rotation applied to the mirrors"),
-    "default", 0.0, "min", 0.0, "max", 180.0,
-    "unit", "degree",
-    NULL)
-
-gegl_property_double (r_angle, _("Result rotation"),
-    "description", _("Rotation applied to the result"),
-    "min", 0.0, "max", 360.0, "default", 0.0,
-    "unit", "degree",
-    NULL)
-
-gegl_property_int    (n_segs, _("Mirrors"),
-    "description", _("Number of mirrors to use"),
-    "default", 6, "min", 2, "max", 24,
-    NULL)
-
-gegl_property_double (c_x, _("Offset X"),
-    "description", _("X offset of the result of mirroring"),
-    "default", 0.5, "min", 0.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (c_y, _("Offset Y"),
-    "description", _("Y offset of the result of mirroring"),
-    "default", 0.5, "min", 0.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (o_x, _("Center X"),
-    "description", _("X axis ratio for the center of mirroring"),
-    "min", -1.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (o_y, _("Center Y"),
-    "description", _("Y axis ratio for the center of mirroring"),
-    "min", -1.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (trim_x, _("Trim X"),
-    "description", _("X axis ratio for trimming mirror expanse"),
-    "min", 0.0, "max", 0.5,
-    NULL)
-
-gegl_property_double (trim_y, _("Trim Y"),
-    "description", _("Y axis ratio for trimming mirror expanse"),
-    "min", 0.0, "max", 0.5,
-    NULL)
-
-gegl_property_double (input_scale, _("Zoom"),
-    "description", _("Scale factor to make rendering size bigger"),
-    "default", 100.0, "min", 0.1, "max", 100.0,
-    NULL)
-
-gegl_property_double (output_scale, _("Expand"),
-    "description", _("Scale factor to make rendering size bigger"),
-    "default", 1.0, "min", 0.0, "max", 100.0,
-    NULL)
-
-gegl_property_boolean (clip, _("Clip result"),
-    "description", _("Clip result to input size"),
-    "default", TRUE, NULL)
-
-gegl_property_boolean (warp, _("Wrap input"),
-    "description", _("Fill full output area"),
-    "default", TRUE, NULL)
+property_double (m_angle, _("Mirror rotation"), 0.0)
+    description (_("Rotation applied to the mirrors"))
+    value_range (0.0, 180.0)
+    ui_meta     ("unit", "degree")
+
+property_double (r_angle, _("Result rotation"), 0.0)
+    description (_("Rotation applied to the result"))
+    value_range (0.0, 360.0)
+    ui_meta     ("unit", "degree")
+
+property_int    (n_segs, _("Mirrors"), 6)
+    description (_("Number of mirrors to use"))
+    value_range (2, 24)
+
+property_double (c_x, _("Offset X"), 0.5)
+    description (_("X offset of the result of mirroring"))
+    value_range (0.0, 1.0)
+    ui_meta     ("unit", "relative-coordinate")
+    ui_meta     ("axis", "x")
+
+property_double (c_y, _("Offset Y"), 0.5)
+    description (_("Y offset of the result of mirroring"))
+    value_range (0.0, 1.0)
+    ui_meta     ("unit", "relative-coordinate")
+    ui_meta     ("axis", "y")
+
+property_double (o_x, _("Center X"), 0.0)
+    description (_("X axis ratio for the center of mirroring"))
+    value_range (-1.0, 1.0)
+
+property_double (o_y, _("Center Y"), 0.0)
+    description (_("Y axis ratio for the center of mirroring"))
+    value_range (-1.0, 1.0)
+
+property_double (trim_x, _("Trim X"), 0.0)
+    description (_("X axis ratio for trimming mirror expanse"))
+    value_range (0.0, 0.5)
+
+property_double (trim_y, _("Trim Y"), 0.0)
+    description (_("Y axis ratio for trimming mirror expanse"))
+    value_range (0.0, 0.5)
+
+property_double (input_scale, _("Zoom"), 100.0)
+    description (_("Scale factor to make rendering size bigger"))
+    value_range (0.1, 100.0)
+
+property_double (output_scale, _("Expand"), 1.0)
+    description (_("Scale factor to make rendering size bigger"))
+    value_range (0.0, 100.0)
+
+property_boolean (clip, _("Clip result to input size"), TRUE)
+
+property_boolean (warp, _("Wrap input"), TRUE)
+    description (_("Fill full output area"))
 
 
 #else
diff --git a/operations/common/mono-mixer.c b/operations/common/mono-mixer.c
index 1a4d6bb..6478a4f 100644
--- a/operations/common/mono-mixer.c
+++ b/operations/common/mono-mixer.c
@@ -23,23 +23,17 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (red, _("Red"),
-    "description", _("Amount of red"),
-    "default", 0.5, "min", -10.0, "max", 10.0,
-    "ui-min", -1.0, "ui-max", 1.0,
-    NULL)
-
-gegl_property_double (green, _("Green"),
-    "description", _("Amount of green"),
-    "default", 0.5, "min", -10.0, "max", 10.0,
-    "ui-min", -1.0, "ui-max", 1.0,
-    NULL)
-
-gegl_property_double (blue, _("Blue"),
-    "description", _("Amount of blue"),
-    "default", 0.5, "min", -10.0, "max", 10.0,
-    "ui-min", -1.0, "ui-max", 1.0,
-    NULL)
+property_double (red, _("Amount of red"), 0.5)
+    value_range (-10.0, 10.0)
+    ui_range    (-1.0, 1.0)
+
+property_double (green, _("Amount of green"), 0.5)
+    value_range (-10.0, 10.0)
+    ui_range    (-1.0, 1.0)
+
+property_double (blue, _("Amount of blue"), 0.5)
+    value_range (-10.0, 10.0)
+    ui_range    (-1.0, 1.0)
 
 #else
 
diff --git a/operations/common/panorama-projection.c b/operations/common/panorama-projection.c
index 9fd6b76..e2c1773 100644
--- a/operations/common/panorama-projection.c
+++ b/operations/common/panorama-projection.c
@@ -20,55 +20,43 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (pan, _("Pan"),
-    "description", _("Horizontal camera panning"),
-    "min",  -180.0, "max", 360.0,
-    "unit", "degree",
-    NULL)
-
-gegl_property_double (tilt, _("Tilt"),
-    "description", _("Vertical angle"),
-    "min", -180.0, "max",  180.0,
-    "unit", "degree",
-    NULL)
-
-gegl_property_double (spin, _("Spin"),
-    "description", _("Spin angle around camera axis"),
-    "min",  -360.0, "max",   360.0,
-    NULL)
-
-gegl_property_double (zoom, _("Zoom"),
-    "description", _("Zoom level"),
-    "default", 100.0, "min", 0.01, "max", 1000.0,
-    NULL)
-
-gegl_property_int (width, _("Width"),
-    "description", _("output/rendering width in pixels, -1 for input width"),
-    "default", -1, "min", -1, "max", 10000,
-    "role", "output-extent",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (height, _("Height"),
-    "description", _("output/rendering height in pixels, -1 for input height"),
-    "default", -1, "min", -1, "max", 10000,
-    "role", "output-extent",
-    "axis", "y",
-    NULL)
-
-gegl_property_boolean (little_planet, _("Little planet"),
-    "description", _("use the pan/tilt location as center for a stereographic/little planet projection."),
-    NULL)
-
-gegl_property_enum (sampler_type, _("Resampling method"),
-    GeglSamplerType, gegl_sampler_type,
-    "description", _("Image resampling method to use"),
-    "default", GEGL_SAMPLER_NEAREST,
-    NULL)
-
-gegl_property_boolean (inverse, _("Inverse"),
-    "description", _("do an inverse projection"),
-    NULL)
+property_double (pan, _("Pan"), 0.0)
+  description   (_("Horizontal camera panning"))
+  value_range   (-360.0, 360.0)
+  ui_meta       ("unit", "degree")
+
+property_double (tilt, _("Tilt"), 0.0)
+  description   (_("Vertical camera panning"))
+  value_range   (-180.0, 180.0)
+  ui_range      (-180.0, 180.0)
+  ui_meta       ("unit", "degree")
+
+property_double (spin, _("Spin"), 0.0)
+  description   (_("Spin angle around camera axis"))
+  value_range   (-360.0, 360.0)
+
+property_double (zoom, _("Zoom"), 100.0)
+  description   (("Zoom level"))
+  value_range   (0.01, 1000.0)
+
+property_int    (width, _("Width"), -1)
+  description   (_("output/rendering width in pixels, -1 for input width"))
+  value_range   (-1, 10000)
+  ui_meta       ("role", "output-extent")
+  ui_meta       ("axis", "x")
+
+property_int    (height, _("Height"), -1)
+  description   (_("output/rendering height in pixels, -1 for input height"))
+  value_range   (-1, 10000)
+  ui_meta       ("role", "output-extent")
+  ui_meta       ("axis", "y")
+
+property_boolean(little_planet, _("Little planet"), FALSE)
+  description   (_("use the pan/tilt location as center for a stereographic/little planet projection."))
+
+property_enum   (sampler_type, _("Resampling method"),
+                  GeglSamplerType, gegl_sampler_type, GEGL_SAMPLER_NEAREST)
+  description   (_("Image resampling method to use"))
 
 #else
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]