[gegl] ops: migrate more ops to macro based api



commit e0485095ed2548b280eebe5f2d3744327dde3f14
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 20 19:08:59 2014 +0200

    ops: migrate more ops to macro based api

 operations/common/noise-simplex.c     |   30 +++++++------
 operations/common/noise-slur.c        |   12 ++---
 operations/common/noise-spread.c      |   28 ++++++-------
 operations/common/oilify.c            |   35 +++++++---------
 operations/common/opacity.c           |    8 ++--
 operations/common/open-buffer.c       |    5 +-
 operations/common/over.c              |   19 ++++----
 operations/common/photocopy.c         |   20 ++++-----
 operations/common/pixelize.c          |   62 ++++++++++++---------------
 operations/common/plasma.c            |   75 +++++++++++++++-----------------
 operations/common/polar-coordinates.c |   71 +++++++++++++-----------------
 operations/common/posterize.c         |    9 ++--
 operations/common/radial-gradient.c   |   44 ++++++++++----------
 operations/common/raw-load.c          |    6 +--
 operations/common/rectangle.c         |   54 ++++++++++-------------
 operations/common/red-eye-removal.c   |    7 +--
 16 files changed, 222 insertions(+), 263 deletions(-)
---
diff --git a/operations/common/noise-simplex.c b/operations/common/noise-simplex.c
index 3d64d69..7e8fb68 100644
--- a/operations/common/noise-simplex.c
+++ b/operations/common/noise-simplex.c
@@ -26,21 +26,25 @@
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_double  (scale, _("Scale"), 0, 20.0, 1.0,
-                    _("The scale of the noise function"))
-gegl_chant_int     (iterations, _("Iterations"), 1, 20, 1,
-                    _("The number of noise octaves."))
-gegl_chant_seed    (seed, rand, _("Random seed"),
-                    _("The random seed for the noise function"))
+property_double (scale, _("Scale"), 1.0)
+    description (_("The scale of the noise function"))
+    value_range (0.0, 20.0)
+
+property_int    (iterations, _("Iterations"), 1)
+    description (_("The number of noise octaves."))
+    value_range (1, 20)
+
+property_seed   (seed, _("Random seed"), rand)
+    description (_("The random seed for the noise function"))
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_RENDER
-#define GEGL_CHANT_C_FILE       "noise-simplex.c"
+#define GEGL_OP_POINT_RENDER
+#define GEGL_OP_C_FILE       "noise-simplex.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 #include <gegl-buffer-cl-iterator.h>
 #include <gegl-debug.h>
 #include <math.h>
@@ -164,7 +168,7 @@ cl_process (GeglOperation       *operation,
             cl_mem               out_tex,
             const GeglRectangle *roi)
 {
-  GeglChantO   *o          = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties   *o      = GEGL_PROPERTIES (operation);
   const size_t  gbl_size[] = {roi->width, roi->height};
   size_t        work_group_size;
   cl_uint       cl_iterations   = o->iterations;
@@ -223,7 +227,7 @@ c_process (GeglOperation       *operation,
            const GeglRectangle *roi,
            gint                 level)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
   Context     context;
   gfloat     *pixel;
   gint        s, t;
@@ -302,7 +306,7 @@ process (GeglOperation       *operation,
 }
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass       *operation_class;
   GeglOperationSourceClass *source_class;
diff --git a/operations/common/noise-slur.c b/operations/common/noise-slur.c
index 3b84e4f..053a7e2 100644
--- a/operations/common/noise-slur.c
+++ b/operations/common/noise-slur.c
@@ -31,15 +31,13 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (pct_random, _("Randomization (%)"),
-    "default", 50.0, "min", 0.0, "max", 100.0,
-    NULL)
+property_double (pct_random, _("Randomization (%)"), 50.0)
+    value_range (0.0, 100.0)
 
-gegl_property_int (repeat, _("Repeat"),
-    "default", 1, "min", 1, "max", 100,
-    NULL)
+property_int    (repeat, _("Repeat"), 1)
+    value_range (1, 100)
 
-gegl_property_seed (seed, _("Random seed"), rand, NULL)
+property_seed (seed, _("Random seed"), rand)
 
 #else
 
diff --git a/operations/common/noise-spread.c b/operations/common/noise-spread.c
index 517dcd5..7060760 100644
--- a/operations/common/noise-spread.c
+++ b/operations/common/noise-spread.c
@@ -26,21 +26,19 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (amount_x, _("Horizontal"),
-    "description", _("Horizontal spread amount"),
-    "default", 5, "min", 0, "max", 256,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (amount_y, _("Vertical"),
-    "description", _("Vertical spread amount"),
-    "default", 5, "min", 0, "max", 256,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_seed (seed, _("Random seed"), rand, NULL)
+property_int    (amount_x, _("Horizontal"), 5)
+    description (_("Horizontal spread amount"))
+    value_range (0, 512)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_int    (amount_y, _("Vertical"), 5)
+    description (_("Vertical spread amount"))
+    value_range (0, 512)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_seed (seed, _("Random seed"), rand)
 
 #else
 
diff --git a/operations/common/oilify.c b/operations/common/oilify.c
index 29b4f0a..5f28f34 100644
--- a/operations/common/oilify.c
+++ b/operations/common/oilify.c
@@ -24,25 +24,20 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (mask_radius, _("Mask Radius"),
-    "description", _("Radius of circle around pixel"),
-    "default", 4, "min", 1, "max", 25,
-    "unit", "pixel-distance",
-    NULL)
-
-gegl_property_int (exponent, _("Exponent"),
-    "default", 8, "min", 1, "max", 20,
-    NULL)
-
-gegl_property_int (intensities, _("Number of intensities"),
-    "description", _("Histogram size"),
-    "default", 128, "min", 8, "max", 256,
-    NULL)
-
-gegl_property_boolean (use_inten, _("Intensity Mode"),
-    "description", _("Use pixel luminance values"),
-    "default", TRUE,
-    NULL)
+property_int    (mask_radius, _("Mask Radius"), 4)
+    description (_("Radius of circle around pixel"))
+    value_range (1, 25)
+    ui_meta     ("unit", "pixel-distance")
+
+property_int    (exponent, _("Exponent"), 8)
+    value_range (1, 20)
+
+property_int (intensities, _("Number of intensities"), 128)
+    description(_("Histogram size"))
+    value_range (8, 256)
+
+property_boolean (use_inten, _("Intensity Mode"), TRUE)
+    description(_("Use pixel luminance values"))
 
 #else
 
@@ -479,7 +474,7 @@ gegl_op_class_init (GeglOpClass *klass)
   gegl_operation_class_set_keys (operation_class,
                                  "categories" , "artistic",
                                  "name"       , "gegl:oilify",
-                                 "description", _("Emulate an oil painting"),
+                                 "description",_("Emulate an oil painting"),
                                  NULL);
 }
 #endif
diff --git a/operations/common/opacity.c b/operations/common/opacity.c
index 9d94beb..1c5aa59 100644
--- a/operations/common/opacity.c
+++ b/operations/common/opacity.c
@@ -22,10 +22,10 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (value, _("Opacity"),
-    "description", _("Global opacity value that is always used on top of the optional auxiliary input 
buffer."),
-    "default", 1.0, "min", -10.0, "max", 10.0,
-    "ui-min", 0.0, "ui-max", 1.0, NULL)
+property_double (value, _("Opacity"), 1.0)
+    description (_("Global opacity value that is always used on top of the optional auxiliary input 
buffer."))
+    value_range (-10.0, 10.0)
+    ui_range    (0.0, 1.0)
 
 #else
 
diff --git a/operations/common/open-buffer.c b/operations/common/open-buffer.c
index af250fd..e852908 100644
--- a/operations/common/open-buffer.c
+++ b/operations/common/open-buffer.c
@@ -22,9 +22,8 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_string(path, _("File"),
-    "description", _("a GeglBuffer on disk to open"),
-    NULL)
+property_string (path, _("File"), "")
+    description (_("a GeglBuffer on disk to open"))
 
 #else
 
diff --git a/operations/common/over.c b/operations/common/over.c
index e63e31a..c26ef5a 100644
--- a/operations/common/over.c
+++ b/operations/common/over.c
@@ -20,22 +20,21 @@
 #include <glib/gi18n-lib.h>
 
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_boolean (srgb, _("sRGB"),
-                    FALSE,
-                    _("Use sRGB gamma instead of linear"))
+property_boolean (srgb, _("sRGB"), FALSE)
+    description (_("Use sRGB gamma instead of linear"))
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_COMPOSER
-#define GEGL_CHANT_C_FILE        "over.c"
+#define GEGL_OP_POINT_COMPOSER
+#define GEGL_OP_C_FILE        "over.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 static void prepare (GeglOperation *operation)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
 
   const Babl *format;
 
@@ -125,7 +124,7 @@ static gboolean operation_process (GeglOperation        *operation,
 {
   GeglOperationClass  *operation_class;
   gpointer input, aux;
-  operation_class = GEGL_OPERATION_CLASS (gegl_chant_parent_class);
+  operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
 
   /* get the raw values this does not increase the reference count */
   input = gegl_operation_context_get_object (context, "input");
@@ -164,7 +163,7 @@ static gboolean operation_process (GeglOperation        *operation,
 }
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass              *operation_class;
   GeglOperationPointComposerClass *point_composer_class;
diff --git a/operations/common/photocopy.c b/operations/common/photocopy.c
index e80aa94..1d43199 100644
--- a/operations/common/photocopy.c
+++ b/operations/common/photocopy.c
@@ -22,21 +22,17 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (mask_radius, _("Mask Radius"),
-    "default", 10.0, "min", 0.0, "max", 50.0,
-    NULL)
+property_double (mask_radius, _("Mask Radius"), 10.0)
+    value_range (0.0, 50.0)
 
-gegl_property_double (sharpness, _("Sharpness"),
-    "default", 0.5, "min", 0.0, "max", 1.0,
-    NULL)
+property_double (sharpness, _("Sharpness"), 0.5)
+    value_range (0.0, 1.0)
 
-gegl_property_double (black, _("Percent Black"),
-    "default", 0.2, "min", 0.0, "max", 1.0,
-    NULL)
+property_double (black, _("Percent Black"), 0.2)
+    value_range (0.0, 1.0)
 
-gegl_property_double (white, _("Percent White"),
-    "default", 0.2, "min", 0.0, "max", 1.0,
-    NULL)
+property_double (white, _("Percent White"), 0.2)
+    value_range (0.0, 1.0)
 
 #else
 
diff --git a/operations/common/pixelize.c b/operations/common/pixelize.c
index 098dabf..510833a 100644
--- a/operations/common/pixelize.c
+++ b/operations/common/pixelize.c
@@ -29,45 +29,39 @@ enum_start (gegl_pixelize_norm)
   enum_value (GEGL_PIXELIZE_NORM_INFINITY,  "Square")
 enum_end (GeglPixelizeNorm)
 
-gegl_property_enum (norm, _("Shape"),
-    GeglPixelizeNorm, gegl_pixelize_norm,
-    "description", _("The shape of pixels"),
-    "default", GEGL_PIXELIZE_NORM_INFINITY,
-    NULL)
-
-gegl_property_int (size_x, _("Block width"),
-    "description", _("Width of blocks in pixels"),
-    "min", 1, "default", 16,
-    "ui-min", 1, "ui-max", 2048, "ui-gamma", 1.5,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (size_y, _("Block height"),
-    "description", _("Width of blocks in pixels"),
-    "min", 1, "default", 16,
-    "ui-min", 1, "ui-max", 2048, "ui-gamma", 1.5,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_double (ratio_x, _("X size ratio"),
-    "description", _("Horizontal size ratio of a pixel inside each block"),
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    "axis", "x",
-    NULL)
-
-gegl_property_double (ratio_y, _("Y size ratio"),
-    "description", _("Vertical size ratio of a pixel inside each block"),
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    "axis", "y",
-    NULL)
-
-gegl_property_color  (background, _("Background color"),
-    "description", _("Color used to fill the background"),
-    "default", "white",
-    "role", "color-secondary",
-    NULL)
+property_enum   (norm, _("Shape"),
+    GeglPixelizeNorm, gegl_pixelize_norm, GEGL_PIXELIZE_NORM_INFINITY)
+    description (_("The shape of pixels"))
+
+property_int    (size_x, _("Block width"), 16)
+    description (_("Width of blocks in pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 2048)
+    ui_gamma    (1.5)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_int    (size_y, _("Block height"), 16)
+    description (_("Height of blocks in pixels"))
+    value_range (1, G_MAXINT)
+    ui_range    (1, 2048)
+    ui_gamma    (1.5)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_double (ratio_x, _("X size ratio"), 1.0)
+    description (_("Horizontal size ratio of a pixel inside each block"))
+    value_range (0.0, 1.0)
+    ui_meta     ("axis", "x")
+
+property_double (ratio_y, _("Y size ratio"), 1.0)
+    description (_("Vertical size ratio of a pixel inside each block"))
+    value_range (0.0, 1.0)
+    ui_meta     ("axis", "y")
+
+property_color  (background, _("Background color"), "white")
+    description (_("Color used to fill the background"))
+    ui_meta     ("role", "color-secondary")
 
 #else
 
diff --git a/operations/common/plasma.c b/operations/common/plasma.c
index 16ab89d..43b2ce8 100644
--- a/operations/common/plasma.c
+++ b/operations/common/plasma.c
@@ -33,46 +33,41 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (turbulence, _("Turbulence"),
-    "description", _("High values give more variation in details"),
-    "default", 1.0, "min", 0.0, "max", 7.0,
-    NULL)
-
-gegl_property_int (x, _("X"),
-    "description", _("X start of the generated buffer"),
-    "ui-min", -4096, "ui-max",  4096,
-    "unit",  "pixel-coordinate",
-    "axis",  "x",
-    "role",  "output-extent",
-    NULL)
-
-gegl_property_int (y, _("Y"),
-    "description", _("Y start of the generated buffer"),
-    "ui-min", -4096, "ui-max",  4096,
-    "unit",  "pixel-coordinate",
-    "axis",  "y",
-    "role",  "output-extent",
-    NULL)
-
-gegl_property_int (width, _("Width"),
-    "description", _("Width of the generated buffer"),
-    "default", 1024, "min", 0,
-    "ui-min",  0, "ui-max",  4096,
-    "unit",  "pixel-distance",
-    "axis",  "x",
-    "role",  "output-extent",
-    NULL)
-
-gegl_property_int (height, _("Height"),
-    "description", _("Height of the generated buffer"),
-    "default", 768, "min",       0,
-    "ui-min",    0, "ui-max", 4096,
-    "unit",  "pixel-distance",
-    "axis",  "y",
-    "role",  "output-extent",
-    NULL)
-
-gegl_property_seed (seed, _("Random seed"), rand, NULL)
+property_double (turbulence, _("Turbulence"), 1.0)
+    description (_("High values give more variation in details"))
+    value_range (0.0, 7.0)
+
+property_int   (x, _("X"), 0)
+    description(_("X start of the generated buffer"))
+    ui_range   (-4096, 4096)
+    ui_meta    ("unit", "pixel-coordinate")
+    ui_meta    ("axis", "x")
+    ui_meta    ("role", "output-extent")
+
+property_int   (y, _("Y"), 0)
+    description(_("Y start of the generated buffer"))
+    ui_range   (-4096, 4096)
+    ui_meta    ("unit", "pixel-coordinate")
+    ui_meta    ("axis", "y")
+    ui_meta    ("role", "output-extent")
+
+property_int    (width, _("Width"), 1024)
+    description (_("Width of the generated buffer"))
+    value_range (0, G_MAXINT)
+    ui_range    (0, 4096)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+    ui_meta     ("role", "output-extent")
+
+property_int (height, _("Height"), 768)
+    description(_("Height of the generated buffer"))
+    value_range (0, G_MAXINT)
+    ui_range    (0, 4096)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+    ui_meta     ("role", "output-extent")
+
+property_seed (seed, _("Random seed"), rand)
 
 #else
 
diff --git a/operations/common/polar-coordinates.c b/operations/common/polar-coordinates.c
index a53fc52..263dbca 100644
--- a/operations/common/polar-coordinates.c
+++ b/operations/common/polar-coordinates.c
@@ -31,46 +31,37 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (depth, _("Circle depth in percent"),
-    "min", 0.0, "max", 100.0, "default", 100.0,
-    NULL)
-
-gegl_property_double  (angle, _("Offset angle"),
-    "min", 0.0, "max", 359.9, 
-    NULL)
-
-gegl_property_boolean (bw, _("Map backwards"),
-    "description", _("Start from the right instead of the left"),
-    NULL)
-
-gegl_property_boolean (top, _("Map from top"),
-  "description", _("Put the top row in the middle and the bottom row on the outside"),
-  "default", TRUE,
-  NULL)
-
-gegl_property_boolean (polar, _("To polar"),
-    "description", _("Map the image to a circle"),
-    "default", TRUE,
-    NULL)
-
-gegl_property_int (pole_x, _("X"),
-    "description", _("Origin point for the polar coordinates"),
-    "min", 0, "max", G_MAXINT,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-
-gegl_property_int (pole_y, _("Y"),
-    "description", _("Origin point for the polar coordinates"),
-    "min", 0, "max", G_MAXINT,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_boolean (middle, _("Choose middle"),
-    "description", _("Let origin point to be the middle one"),
-    "default", TRUE,
-    NULL)
+property_double (depth, _("Circle depth in percent"), 100.0)
+  value_range (0.0, 100.0)
+  ui_meta     ("unit", "percent")
+
+property_double (angle, _("Offset angle"), 0.0)
+  value_range   (0.0, 360.0)
+  ui_meta       ("unit", "degree")
+
+property_boolean (bw, _("Map backwards"), FALSE)
+  description    (_("Start from the right instead of the left"))
+
+property_boolean (top, _("Map from top"), TRUE)
+  description    (_("Put the top row in the middle and the bottom row on the outside"))
+
+property_boolean (polar, _("To polar"), TRUE)
+  description    (_("Map the image to a circle"))
+
+property_int  (pole_x, _("X"), 0)
+  description (_("Origin point for the polar coordinates"))
+  value_range (0, G_MAXINT)
+  ui_meta     ("unit", "pixel-coordinate")
+  ui_meta     ("axis", "x")
+
+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")
+
+property_boolean (middle, _("Choose middle"), TRUE)
+  description(_("Let origin point to be the middle one"))
 
 #else
 
diff --git a/operations/common/posterize.c b/operations/common/posterize.c
index 2b285ef..0ffc33c 100644
--- a/operations/common/posterize.c
+++ b/operations/common/posterize.c
@@ -21,11 +21,10 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_int (levels, _("Levels"),
-    "description", _("number of levels per component"),
-    "default", 8, "min",    1,  "max",      64,
-    "ui-min",  1, "ui-max", 64, "ui-gamma", 2.0,
-    NULL)
+property_int  (levels, _("Levels"), 8)
+  description (_("number of levels per component"))
+  value_range (1, 64)
+  ui_gamma    (2.0)
 
 #else
 
diff --git a/operations/common/radial-gradient.c b/operations/common/radial-gradient.c
index 278db94..1a805c3 100644
--- a/operations/common/radial-gradient.c
+++ b/operations/common/radial-gradient.c
@@ -20,23 +20,23 @@
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_double (start_x,      _("X1"), G_MININT, G_MAXINT, 25.0, "")
-gegl_chant_double (start_y,      _("Y1"), G_MININT, G_MAXINT, 25.0, "")
-gegl_chant_double (end_x,        _("X2"), G_MININT, G_MAXINT, 50.0, "")
-gegl_chant_double (end_y,        _("Y2"), G_MININT, G_MAXINT, 50.0, "")
-gegl_chant_color  (start_color,  _("Start Color"), "black",
-                                 _("The color at (x1, y1)"))
-gegl_chant_color  (end_color,    _("End Color"), "white",
-                                 _("The color at (x2, y2)"))
+property_double (start_x, _("X1"), 25.0)
+property_double (start_y, _("Y1"), 25.0)
+property_double (end_x,   _("X2"), 50.0)
+property_double (end_y,   _("Y2"), 50.0)
+property_color  (start_color, _("Start Color"), "black")
+    description (_("The color at (x1, y1)"))
+property_color  (end_color, _("End Color"), "white")
+    description (_("The color at (x2, y2)"))
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_RENDER
-#define GEGL_CHANT_C_FILE "radial-gradient.c"
+#define GEGL_OP_POINT_RENDER
+#define GEGL_OP_C_FILE "radial-gradient.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 #include <math.h>
 
@@ -68,11 +68,11 @@ process (GeglOperation       *operation,
          const GeglRectangle *roi,
          gint                 level)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
-  gfloat     *out_pixel = out_buf;
-  gfloat      color1[4];
-  gfloat      color2[4];
-  gfloat      length = dist (o->start_x, o->start_y, o->end_x, o->end_y);
+  GeglProperties *o         = GEGL_PROPERTIES (operation);
+  gfloat         *out_pixel = out_buf;
+  gfloat         color1[4];
+  gfloat         color2[4];
+  gfloat         length = dist (o->start_x, o->start_y, o->end_x, o->end_y);
 
   gegl_color_get_pixel (o->start_color, babl_format ("R'G'B'A float"), color1);
   gegl_color_get_pixel (o->end_color, babl_format ("R'G'B'A float"), color2);
@@ -107,18 +107,18 @@ process (GeglOperation       *operation,
 
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass            *operation_class;
   GeglOperationPointRenderClass *point_render_class;
 
-  operation_class = GEGL_OPERATION_CLASS (klass);
+  operation_class    = GEGL_OPERATION_CLASS (klass);
   point_render_class = GEGL_OPERATION_POINT_RENDER_CLASS (klass);
 
-  point_render_class->process = process;
+  point_render_class->process       = process;
   operation_class->get_bounding_box = get_bounding_box;
-  operation_class->prepare = prepare;
-  operation_class->no_cache = TRUE;
+  operation_class->prepare          = prepare;
+  operation_class->no_cache         = TRUE;
 
   gegl_operation_class_set_keys (operation_class,
     "name"        , "gegl:radial-gradient",
diff --git a/operations/common/raw-load.c b/operations/common/raw-load.c
index cae4611..19e4e42 100644
--- a/operations/common/raw-load.c
+++ b/operations/common/raw-load.c
@@ -23,10 +23,8 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_file_path (path, _("File"),
-    "description", _("Path of file to load."),
-    "default", "/tmp/test.raw",
-    NULL)
+property_file_path (path, _("File"), "/tmp/test.raw")
+    description(_("Path of file to load."))
 
 #else
 
diff --git a/operations/common/rectangle.c b/operations/common/rectangle.c
index 1a7cce1..32cb970 100644
--- a/operations/common/rectangle.c
+++ b/operations/common/rectangle.c
@@ -23,36 +23,30 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (x, _("X"),
-    "description", _("Horizontal position"),
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-
-gegl_property_double (y, _("Y"),
-    "description", _("Vertical position"),
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_double (width, _("Width"),
-    "description", _("Horizontal extent"),
-    "min", 0.0, "max", G_MAXDOUBLE,
-    "unit", "pixel-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_double (height, _("Height"),
-    "description", _("Vertical extent"),
-    "min", 0.0, "max", G_MAXDOUBLE,
-    "unit", "pixel-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_color(color, _("Color"),
-    "description", _("Color to render"),
-    "default", "white",
-    NULL)
+property_double (x, _("X"), 0)
+    description(_("Horizontal position"))
+    ui_meta    ("unit", "pixel-coordinate")
+    ui_meta    ("axis", "x")
+
+property_double (y, _("Y"), 0)
+    description(_("Vertical position"))
+    ui_meta    ("unit", "pixel-coordinate")
+    ui_meta    ("axis", "y")
+
+property_double (width, _("Width"), 0)
+    description (_("Horizontal extent"))
+    value_range (0, G_MAXDOUBLE)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "x")
+
+property_double (height, _("Height"), 0)
+    description (_("Vertical extent"))
+    value_range (0, G_MAXDOUBLE)
+    ui_meta     ("unit", "pixel-distance")
+    ui_meta     ("axis", "y")
+
+property_color  (color, _("Color"), "white")
+    description (_("Color to render"))
 
 #else
 
diff --git a/operations/common/red-eye-removal.c b/operations/common/red-eye-removal.c
index f521ef6..bceb91d 100644
--- a/operations/common/red-eye-removal.c
+++ b/operations/common/red-eye-removal.c
@@ -28,10 +28,9 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (threshold, _("Threshold"),
-    "description", _("Red eye threshold"),
-    "default", 0.4, "min", 0.0, "max", 0.8,
-    NULL)
+property_double (threshold, _("Threshold"), 0.4)
+    description (_("Red eye threshold"))
+    value_range (0, 0.8)
 
 #else
 


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