gegl r2888 - trunk/gegl/operation



Author: martinn
Date: Sun Feb  8 15:48:37 2009
New Revision: 2888
URL: http://svn.gnome.org/viewvc/gegl?rev=2888&view=rev

Log:
Add support for backwards compatibility names of ops

Add a new class field GeglOperation::compat_name that can be used to
specify alternative names for ops, meant to be used for backwards
compatibility.

Modified:
   trunk/gegl/operation/gegl-operation.c
   trunk/gegl/operation/gegl-operation.h
   trunk/gegl/operation/gegl-operations.c

Modified: trunk/gegl/operation/gegl-operation.c
==============================================================================
--- trunk/gegl/operation/gegl-operation.c	(original)
+++ trunk/gegl/operation/gegl-operation.c	Sun Feb  8 15:48:37 2009
@@ -55,6 +55,7 @@
                                              * operation lookup by
                                              * name
                                              */
+  klass->compat_name               = NULL;
   klass->description               = NULL;
   klass->categories                = NULL;
   klass->attach                    = attach;

Modified: trunk/gegl/operation/gegl-operation.h
==============================================================================
--- trunk/gegl/operation/gegl-operation.h	(original)
+++ trunk/gegl/operation/gegl-operation.h	Sun Feb  8 15:48:37 2009
@@ -74,6 +74,8 @@
 
   const gchar    *name;        /* name(string) used to create/indetify
                                     this type of operation in GEGL*/
+  const gchar    *compat_name; /* name used for backwards compatibility
+                                    reasons*/
   const gchar    *description; /* textual description of the operation */
   const gchar    *categories;  /* a colon seperated list of categories */
 

Modified: trunk/gegl/operation/gegl-operations.c
==============================================================================
--- trunk/gegl/operation/gegl-operations.c	(original)
+++ trunk/gegl/operation/gegl-operations.c	Sun Feb  8 15:48:37 2009
@@ -52,6 +52,10 @@
         {
           g_hash_table_insert (hash, g_strdup (operation_class->name), (gpointer) types[no]);
         }
+      if (operation_class->compat_name)
+        {
+          g_hash_table_insert (hash, g_strdup (operation_class->compat_name), (gpointer) types[no]);
+        }
       add_operations (hash, types[no]);
     }
   g_free (types);



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