[gegl] grid: use gegl-op.h



commit f293c3d95d1f3b003a0b51ba4709a2462f1dec52
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri May 16 17:07:38 2014 +0200

    grid: use gegl-op.h

 operations/common/grid.c |   82 +++++++++++++++++++++++++++++++++------------
 1 files changed, 60 insertions(+), 22 deletions(-)
---
diff --git a/operations/common/grid.c b/operations/common/grid.c
index c5590ab..f73653a 100644
--- a/operations/common/grid.c
+++ b/operations/common/grid.c
@@ -19,29 +19,68 @@
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
-#ifdef GEGL_CHANT_PROPERTIES
-
-gegl_chant_int_ui   (x,        _("Width"),  1, G_MAXINT, 32, 1, 128, 1.0,
-                  _("Horizontal width of cells pixels"))
-gegl_chant_int_ui   (y,        _("Height"), 1, G_MAXINT, 32, 1, 128, 1.0,
-                  _("Vertical width of cells in pixels"))
-gegl_chant_int_ui  (x_offset, _("X offset"), -G_MAXINT, G_MAXINT, 0, -64, 64, 1.0,
-                  _("Horizontal offset (from origin) for start of grid"))
-gegl_chant_int_ui  (y_offset, _("Y offset"), -G_MAXINT, G_MAXINT, 0, -64, 64, 1.0,
-                  _("Vertical offset (from origin) for start of grid"))
-gegl_chant_int_ui  (line_width, _("Line Width"),  0, G_MAXINT, 4, 0, 16, 1.0,
-                  _("Width of grid lines in pixels"))
-gegl_chant_int_ui  (line_height, _("Line Height"), 0, G_MAXINT, 4, 0, 16, 1.0,
-                  _("Height of grid lines in pixels"))
-gegl_chant_color (line_color,   _("Color"), "black",
-                  _("Color of the grid lines"))
+#ifdef GEGL_PROPERTIES
+
+gegl_property_int (x, "nick", _("Width"),
+    "blurb", _("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, "nick", _("Height"),
+    "blurb", _("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, "nick", _("X offset"),
+    "blurb", _("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, "nick", _("Y offset"),
+    "blurb", _("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, "nick", _("Line width"),
+    "blurb", _("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, "nick", _("Line height"),
+    "blurb", _("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, "nick", _("Color"),
+    "blurb", _("Color of the grid lines"),
+    "default", "black",
+    "role",    "color-primary",
+    NULL)
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_RENDER
-#define GEGL_CHANT_C_FILE       "grid.c"
+#define GEGL_OP_POINT_RENDER
+#define GEGL_OP_C_FILE       "grid.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 static void
 prepare (GeglOperation *operation)
@@ -62,7 +101,7 @@ process (GeglOperation       *operation,
          const GeglRectangle *roi,
          gint                 level)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
   gfloat     *out_pixel = out_buf;
   gfloat      line_color[4];
   gint        x = roi->x; /* initial x         */
@@ -109,9 +148,8 @@ process (GeglOperation       *operation,
   return  TRUE;
 }
 
-
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass            *operation_class;
   GeglOperationPointRenderClass *point_render_class;


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