[gimp] app: Add gimp_pdb_get_deprecated_procedures()



commit 3474a385f28050e14cc899135dd0d68fb0a9182c
Author: Martin Nordholts <martinn src gnome org>
Date:   Mon May 2 18:17:02 2011 +0200

    app: Add gimp_pdb_get_deprecated_procedures()

 app/pdb/gimppdb.c |   38 ++++++++++++++++++++++++++++++++++++++
 app/pdb/gimppdb.h |    2 ++
 2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c
index 22b28e7..875b37e 100644
--- a/app/pdb/gimppdb.c
+++ b/app/pdb/gimppdb.c
@@ -454,6 +454,44 @@ gimp_pdb_execute_procedure_by_name (GimpPDB       *pdb,
   return return_vals;
 }
 
+/**
+ * gimp_pdb_get_deprecated_procedures:
+ * @pdb:
+ *
+ * Returns: A new #GList with the deprecated procedures. Free with
+ *          g_list_free().
+ **/
+GList *
+gimp_pdb_get_deprecated_procedures (GimpPDB *pdb)
+{
+  GList *result = NULL;
+  GList *procs;
+  GList *iter;
+
+  g_return_val_if_fail (GIMP_IS_PDB (pdb), NULL);
+
+  procs = g_hash_table_get_values (pdb->procedures);
+
+  for (iter = procs;
+       iter;
+       iter = g_list_next (iter))
+    {
+      GList *proc_list = iter->data;
+
+      /* Only care about the first procedure in the list */
+      GimpProcedure *procedure = GIMP_PROCEDURE (proc_list->data);
+
+      if (procedure->deprecated)
+        result = g_list_prepend (result, procedure);
+    }
+
+  result = g_list_sort (result, (GCompareFunc) gimp_procedure_name_compare);
+
+  g_list_free (procs);
+
+  return result;
+}
+
 
 /*  private functions  */
 
diff --git a/app/pdb/gimppdb.h b/app/pdb/gimppdb.h
index 01ac9eb..203181d 100644
--- a/app/pdb/gimppdb.h
+++ b/app/pdb/gimppdb.h
@@ -84,5 +84,7 @@ GValueArray   * gimp_pdb_execute_procedure_by_name      (GimpPDB       *pdb,
                                                          const gchar   *name,
                                                          ...);
 
+GList         * gimp_pdb_get_deprecated_procedures      (GimpPDB       *pdb);
+
 
 #endif  /*  __GIMP_PDB_H__  */



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