gegl r1939 - in trunk: . gegl gegl/operation operations/affine operations/color



Author: ok
Date: Wed Jan 30 17:06:10 2008
New Revision: 1939
URL: http://svn.gnome.org/viewvc/gegl?rev=1939&view=rev

Log:
* gegl/operation/gegl-operation.[ch]: removed
gegl_operation_class_set_name, removed tickle virtual function.
* gegl/gegl-old-chant.h: directly implement
gegl_operation_class_set_name substitution.
* operations/affine/chant.h: directly implement
gegl_operation_class_set_name substitution.
* gegl/gegl-plugin.h: increased GEGL_MODULE_ABI_VERSION to 0x05
* operations/color/remap.c: (gegl_operation_remap_class_init): set
operation_class->name directly instead of using deprecated function.


Modified:
   trunk/ChangeLog
   trunk/gegl/gegl-old-chant.h
   trunk/gegl/gegl-plugin.h
   trunk/gegl/operation/gegl-operation.c
   trunk/gegl/operation/gegl-operation.h
   trunk/operations/affine/chant.h
   trunk/operations/color/remap.c

Modified: trunk/gegl/gegl-old-chant.h
==============================================================================
--- trunk/gegl/gegl-old-chant.h	(original)
+++ trunk/gegl/gegl-old-chant.h	Wed Jan 30 17:06:10 2008
@@ -634,8 +634,8 @@
   operation_class->get_defined_region = get_defined_region;
 #endif
 
-#define M_GEGL_CHANT_SET_NAME_EXTENDED(name) \
-  gegl_operation_class_set_name (operation_class, #name);
+#define M_GEGL_CHANT_SET_NAME_EXTENDED(nam) \
+  operation_class->name=g_strdelimit (g_strdup (#nam), "_", '-');
 #define M_GEGL_CHANT_SET_NAME(name)   M_GEGL_CHANT_SET_NAME_EXTENDED(name)
   M_GEGL_CHANT_SET_NAME (GEGL_CHANT_NAME);
 

Modified: trunk/gegl/gegl-plugin.h
==============================================================================
--- trunk/gegl/gegl-plugin.h	(original)
+++ trunk/gegl/gegl-plugin.h	Wed Jan 30 17:06:10 2008
@@ -40,6 +40,11 @@
 typedef struct _GeglModuleInfo GeglModuleInfo;
 typedef struct _GeglModuleDB   GeglModuleDB;
 
+/***
+ * Writing GEGL operations
+ *
+ */
+
 /*#include <geglmodule.h>*/
 
 /*  increment the ABI version each time one of the following changes:
@@ -48,7 +53,8 @@
  *  - GeglOperation or one of it's base classes changes. (XXX:-
  *    should be extended so a range of abi versions are accepted.
  */
-#define GEGL_MODULE_ABI_VERSION 0x0004
+
+#define GEGL_MODULE_ABI_VERSION 0x0005
 
 struct _GeglModuleInfo
 {

Modified: trunk/gegl/operation/gegl-operation.c
==============================================================================
--- trunk/gegl/operation/gegl-operation.c	(original)
+++ trunk/gegl/operation/gegl-operation.c	Wed Jan 30 17:06:10 2008
@@ -58,7 +58,6 @@
   klass->categories              = NULL;
   klass->attach                  = attach;
   klass->prepare                 = NULL;
-  klass->tickle                  = NULL;
   klass->no_cache                = FALSE;
   klass->get_defined_region      = get_defined_region;
   klass->compute_affected_region = compute_affected_region;
@@ -241,8 +240,6 @@
 
   if (klass->prepare)
     klass->prepare (self);
-  if (klass->tickle)
-    klass->tickle (self);
 }
 
 GeglNode *
@@ -366,18 +363,6 @@
   return *input_region;
 }
 
-void
-gegl_operation_class_set_name (GeglOperationClass *klass,
-                               const gchar        *new_name)
-{
-  gchar *name_copy;
-
-  name_copy = g_strdup (new_name);
-  g_strdelimit (name_copy, "_", '-');
-  klass->name = name_copy;
-}
-
-
 /* returns a freshly allocated list of the properties of the object, does not list
  * the regular gobject properties of GeglNode ('name' and 'operation') */
 GParamSpec **

Modified: trunk/gegl/operation/gegl-operation.h
==============================================================================
--- trunk/gegl/operation/gegl-operation.h	(original)
+++ trunk/gegl/operation/gegl-operation.h	Wed Jan 30 17:06:10 2008
@@ -50,10 +50,10 @@
 {
   GObjectClass  parent_class;
 
-  const gchar      *name;        /* name used to refer to this type of
+  const gchar  *name;            /* name used to refer to this type of
                                     operation in GEGL */
-  gchar            *description; /* textual description of the operation */
-  char             *categories;  /* a colon seperated list of categories */
+  const gchar  *description;     /* textual description of the operation */
+  const gchar  *categories;      /* a colon seperated list of categories */
 
 
   gboolean          no_cache;    /* do not create a cache for this operation */
@@ -63,18 +63,15 @@
    */
   void            (*attach)               (GeglOperation *operation);
 
-  /* called as a refresh before any of the region needs getters, used in
-   * the area base class for instance.
-   */
-  void            (*tickle)               (GeglOperation *operation);
-
-  /* prepare the node for processing (all properties will be set) override this
-   * if you are creating a meta operation (using the node as a GeglGraph).
+  /* prepare() is called on each operation providing data to a node that
+   * is requested to provide a rendered result. When prepare is called all
+   * properties are known. This is the time to set desired pixel formats
+   * for input and output pads.
    */
   void            (*prepare)              (GeglOperation *operation);
 
-  /* Returns a bounding rectangle for the data that is defined by this op. (is
-   * already implemented in GeglOperationPointFilter and
+  /* Returns the bounding rectangle for the data that is defined by this op.
+   * (is already implemented in GeglOperationPointFilter and
    * GeglOperationPointComposer, GeglOperationAreaFilter base classes.
    */
   GeglRectangle   (*get_defined_region)   (GeglOperation *operation);
@@ -102,19 +99,26 @@
   GeglRectangle   (*adjust_result_region)  (GeglOperation       *operation,
                                             const GeglRectangle *roi);
 
-  /* Returns the node providing data for a specific location
+  /* XXX: What is GeglNode doing in this part of the API?
+   * Returns the node providing data for a specific location within the
+   * operations output. Does this recurse?, perhaps it should only point
+   * out which pad the data is coming from?
    */
   GeglNode*       (*detect)                (GeglOperation       *operation,
                                             gint                 x,
                                             gint                 y);
 
+  /* Perform processing for the @output_pad, pad The result_rect provides
+   * the region to process. For sink operations @output_pad can be ignored
+   * but the result_rect is then then indicating the data available for
+   * consumption.
+   */
   gboolean        (*process)               (GeglOperation       *operation,
                                             GeglNodeContext     *context,
                                             const gchar         *output_pad,
                                             const GeglRectangle *result_rect);
 };
 
-/* returns|registers the gtype for GeglOperation */
 GType           gegl_operation_get_type             (void) G_GNUC_CONST;
 
 /* retrieves the bounding box of a connected input */
@@ -129,10 +133,6 @@
                                                      const GeglRectangle *region);
 
 
-/* virtual method invokers that depends only on the set properties of a
- * operation|node
- */
-
 /* retrieves the node providing data to a named input pad */
 GeglNode      * gegl_operation_get_source_node      (GeglOperation *operation,
                                                      const gchar   *pad_name);
@@ -164,13 +164,6 @@
                                                      const gchar         *output_pad,
                                                      const GeglRectangle *result_rect);
 
-GParamSpec   ** gegl_list_properties                (const gchar *operation_type,
-                                                     guint       *n_properties_p);
-
-/* set the name of an operation, transforms all occurences of "_" into "-" */
-void       gegl_operation_class_set_name            (GeglOperationClass *operation,
-                                                     const gchar        *name);
-
 /* create a pad for a specified property for this operation, this method is
  * to be called from the attach method of operations, most operations do not
  * have to care about this since a super class like filter, sink, source or
@@ -185,9 +178,11 @@
 void       gegl_operation_set_format                (GeglOperation *operation,
                                                      const gchar   *pad_name,
                                                      const Babl    *format);
+
+/*
 const Babl * gegl_operation_get_format              (GeglOperation *operation,
                                                      const gchar   *pad_name);
-
+*/
 
 
 G_END_DECLS

Modified: trunk/operations/affine/chant.h
==============================================================================
--- trunk/operations/affine/chant.h	(original)
+++ trunk/operations/affine/chant.h	Wed Jan 30 17:06:10 2008
@@ -276,8 +276,8 @@
   class_init (operation_class);
 #endif
 
-#define M_GEGL_CHANT_SET_NAME_EXTENDED(name) \
-  gegl_operation_class_set_name (operation_class, #name);
+#define M_GEGL_CHANT_SET_NAME_EXTENDED(nam) \
+  operation_class->name=g_strdup(#nam);
 #define M_GEGL_CHANT_SET_NAME(name)   M_GEGL_CHANT_SET_NAME_EXTENDED(name)
   M_GEGL_CHANT_SET_NAME (GEGL_CHANT_NAME);
 

Modified: trunk/operations/color/remap.c
==============================================================================
--- trunk/operations/color/remap.c	(original)
+++ trunk/operations/color/remap.c	Wed Jan 30 17:06:10 2008
@@ -105,6 +105,7 @@
   object_class->get_property             = get_property;
   object_class->set_property             = set_property;
 
+  operation_class->name                  = "remap";
   operation_class->categories            = "core";
   operation_class->no_cache              = TRUE;
   operation_class->process               = process;
@@ -115,7 +116,6 @@
   operation_class->compute_input_request = compute_input_request;
   operation_class->compute_affected_region = compute_affected_region;
 
-  gegl_operation_class_set_name (operation_class, "remap");
 
 
   g_object_class_install_property (object_class, PROP_OUTPUT,



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