[gegl] operations/core: migrate to gegl-op.h



commit de1b1ff6df04c89d4745089f335801fa1d91840e
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 20 22:22:12 2014 +0200

    operations/core: migrate to gegl-op.h

 operations/core/cast-format.c    |   22 ++++++------
 operations/core/clone.c          |   14 ++++----
 operations/core/convert-format.c |   18 +++++-----
 operations/core/crop.c           |   64 ++++++++++++++++++++++----------------
 operations/core/nop.c            |   10 +++---
 5 files changed, 69 insertions(+), 59 deletions(-)
---
diff --git a/operations/core/cast-format.c b/operations/core/cast-format.c
index 991fa8d..7f28d70 100644
--- a/operations/core/cast-format.c
+++ b/operations/core/cast-format.c
@@ -22,24 +22,24 @@
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_format (input_format, _("Input Format"),
-                   _("The babl format of the input"))
-gegl_chant_format (output_format, _("Output Format"),
-                   _("The babl format of the output"))
+property_format (input_format, _("Input Format"), NULL)
+    description(_("The babl format of the input"))
+property_format (output_format, _("Output Format"), NULL)
+    description(_("The babl format of the output"))
 
 #else
 
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "cast-format.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "cast-format.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);
 
   if (o->input_format)
     gegl_operation_set_format (operation, "input", o->input_format);
@@ -55,7 +55,7 @@ process (GeglOperation        *operation,
          const GeglRectangle  *roi,
          gint                  level)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
   GeglBuffer *input;
   GeglBuffer *output;
 
@@ -99,7 +99,7 @@ process (GeglOperation        *operation,
 }
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
 
diff --git a/operations/core/clone.c b/operations/core/clone.c
index 901c223..d437466 100644
--- a/operations/core/clone.c
+++ b/operations/core/clone.c
@@ -20,17 +20,17 @@
 #include <glib/gi18n-lib.h>
 
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_string (ref, _("Reference"), "ID",
-                   _("The reference ID used as input (for use in XML)."))
+property_string (ref, _("Reference"), "ID")
+    description (_("The reference ID used as input (for use in XML)."))
 
 #else
 
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "clone.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE       "clone.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 #include <math.h>
 #include <string.h>
 
@@ -94,7 +94,7 @@ process (GeglOperation        *operation,
 
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
 
diff --git a/operations/core/convert-format.c b/operations/core/convert-format.c
index 66ad45a..fb484da 100644
--- a/operations/core/convert-format.c
+++ b/operations/core/convert-format.c
@@ -22,22 +22,22 @@
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_format (format, _("Output Format"),
-                   _("The babl format of the output"))
+property_format (format, _("Output Format"), NULL)
+  description(_("The babl format of the output"))
 
 #else
 
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "convert-format.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "convert-format.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 static void
 prepare (GeglOperation *self)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (self);
+  GeglProperties *o = GEGL_PROPERTIES (self);
 
   if (o->format)
     gegl_operation_set_format (self, "output", o->format);
@@ -52,7 +52,7 @@ process (GeglOperation        *operation,
          const GeglRectangle  *roi,
          gint                  level)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
   GeglBuffer *input;
   GeglBuffer *output;
 
@@ -73,7 +73,7 @@ process (GeglOperation        *operation,
 }
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
 
diff --git a/operations/core/crop.c b/operations/core/crop.c
index d6470b9..a557797 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -20,19 +20,30 @@
 #include <glib/gi18n-lib.h>
 
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
-gegl_chant_double (x,      _("X"),      -G_MAXFLOAT, G_MAXFLOAT,  0.0, _("X"))
-gegl_chant_double (y,      _("Y"),      -G_MAXFLOAT, G_MAXFLOAT,  0.0, _("Y"))
-gegl_chant_double (width,  _("Width"),  -G_MAXFLOAT, G_MAXFLOAT, 10.0, _("Width"))
-gegl_chant_double (height, _("Height"), -G_MAXFLOAT, G_MAXFLOAT, 10.0, _("Height"))
+property_double (x,      _("X"),      0.0)
+  ui_meta       ("unit", "pixel-coordinate")
+  ui_meta       ("axis", "x")
+
+property_double (y,      _("Y"),      0.0)
+  ui_meta       ("unit", "pixel-coordinate")
+  ui_meta       ("axis", "y")
+
+property_double (width,  _("Width"),  10.0 )
+  ui_meta       ("unit", "pixel-distance")
+  ui_meta       ("axis", "x")
+
+property_double (height, _("Height"), 10.0 )
+  ui_meta       ("unit", "pixel-distance")
+  ui_meta       ("axis", "y")
 
 #else
 
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "crop.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "crop.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 #include <math.h>
 
 static void
@@ -49,7 +60,7 @@ gegl_crop_detect (GeglOperation *operation,
                   gint           x,
                   gint           y)
 {
-  GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
   GeglNode   *input_node;
 
   input_node = gegl_operation_get_source_node (operation, "input");
@@ -66,15 +77,15 @@ gegl_crop_detect (GeglOperation *operation,
 static GeglRectangle
 gegl_crop_get_bounding_box (GeglOperation *operation)
 {
-  GeglChantO    *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties      *o = GEGL_PROPERTIES (operation);
   GeglRectangle *in_rect = gegl_operation_source_get_bounding_box (operation, "input");
   GeglRectangle  result  = { 0, 0, 0, 0 };
 
   if (!in_rect)
     return result;
 
-  result.x = o->x;
-  result.y = o->y;
+  result.x      = o->x;
+  result.y      = o->y;
   result.width  = o->width;
   result.height = o->height;
 
@@ -86,7 +97,7 @@ gegl_crop_get_invalidated_by_change (GeglOperation       *operation,
                                      const gchar         *input_pad,
                                      const GeglRectangle *input_region)
 {
-  GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties   *o = GEGL_PROPERTIES (operation);
   GeglRectangle result;
 
   result.x = o->x;
@@ -104,12 +115,12 @@ gegl_crop_get_required_for_output (GeglOperation       *operation,
                                    const gchar         *input_pad,
                                    const GeglRectangle *roi)
 {
-  GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
+  GeglProperties   *o = GEGL_PROPERTIES (operation);
   GeglRectangle result;
 
-  result.x = o->x;
-  result.y = o->y;
-  result.width = o->width;
+  result.x      = o->x;
+  result.y      = o->y;
+  result.width  = o->width;
   result.height = o->height;
 
   gegl_rectangle_intersect (&result, &result, roi);
@@ -123,14 +134,14 @@ gegl_crop_process (GeglOperation        *operation,
                    const GeglRectangle  *result,
                    gint                  level)
 {
-  GeglChantO   *o = GEGL_CHANT_PROPERTIES (operation);
-  GeglBuffer   *input;
-  gboolean      success = FALSE;
-  GeglRectangle extent;
-
-  extent.x = o->x;
-  extent.y = o->y;
-  extent.width = o->width;
+  GeglProperties *o = GEGL_PROPERTIES (operation);
+  GeglBuffer     *input;
+  gboolean        success = FALSE;
+  GeglRectangle   extent;
+
+  extent.x      = o->x;
+  extent.y      = o->y;
+  extent.width  = o->width;
   extent.height = o->height;
 
   input = gegl_operation_context_get_source (context, "input");
@@ -155,9 +166,8 @@ gegl_crop_process (GeglOperation        *operation,
   return success;
 }
 
-
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
   gchar              *composition = "<?xml version='1.0' encoding='UTF-8'?>"
diff --git a/operations/core/nop.c b/operations/core/nop.c
index 84d2ea3..0665fc5 100644
--- a/operations/core/nop.c
+++ b/operations/core/nop.c
@@ -20,16 +20,16 @@
 #include <glib/gi18n-lib.h>
 
 
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
 
    /* no properties */
 
 #else
 
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "nop.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE       "nop.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 static void
 gegl_nop_prepare (GeglOperation *self)
@@ -66,7 +66,7 @@ gegl_nop_process (GeglOperation        *operation,
 }
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass *operation_class;
 


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