[gegl] operation: Add the public function gegl_has_operation.



commit 511a6dc7934ddfa7e00e5964586e7a3991d5c310
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Sep 1 10:52:54 2013 -0400

    operation: Add the public function gegl_has_operation.

 gegl/gegl.h                      |   13 +++++++++++--
 gegl/operation/gegl-operations.c |    6 ++++++
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/gegl/gegl.h b/gegl/gegl.h
index d6ce9c4..e2605b7 100644
--- a/gegl/gegl.h
+++ b/gegl/gegl.h
@@ -117,8 +117,9 @@ void           gegl_exit                 (void);
 /***
  * Available operations:
  * Gegl provides means to check for available processing operations that
- * can be used with nodes using #gegl_list_operations and for a specified
- * op give a list of properties with #gegl_operation_list_properties.
+ * can be used with nodes using #gegl_list_operations and #gegl_has_operation.
+ * For a specified op, you can get a list of properties with
+ * #gegl_operation_list_properties.
  */
 
 /**
@@ -142,6 +143,14 @@ void           gegl_exit                 (void);
  */
 gchar        **gegl_list_operations         (guint *n_operations_p);
 
+/**
+ * gegl_has_operation:
+ * @operation_type: the name of the operation
+ *
+ * Return value: A boolean telling whether the operation is present or not.
+ */
+
+gboolean       gegl_has_operation           (const gchar *operation_type);
 
 /**
  * gegl_operation_list_properties:
diff --git a/gegl/operation/gegl-operations.c b/gegl/operation/gegl-operations.c
index 531fddb..62047a8 100644
--- a/gegl/operation/gegl-operations.c
+++ b/gegl/operation/gegl-operations.c
@@ -104,6 +104,12 @@ gegl_operation_gtype_from_name (const gchar *name)
   return (GType) g_hash_table_lookup (gtype_hash, name);
 }
 
+gboolean
+gegl_has_operation (const gchar *operation_type)
+{
+  return gegl_operation_gtype_from_name (operation_type) != 0;
+}
+
 gchar **gegl_list_operations (guint *n_operations_p)
 {
   gchar **pasp = NULL;


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