[gegl] Added gegl_node_has_pad



commit 0a4faaeade85a2f766a20110b1d9bb51142c497e
Author: �yvind Kolås <pippin gimp org>
Date:   Sun Oct 31 02:00:36 2010 +0000

    Added gegl_node_has_pad
    
    A function to query a node whether it has a named pad or not.

 gegl/gegl.h            |   10 ++++++++++
 gegl/graph/gegl-node.c |    7 +++++++
 gegl/graph/gegl-node.h |    2 ++
 3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gegl/gegl.h b/gegl/gegl.h
index 4ef71e9..bc9fa49 100644
--- a/gegl/gegl.h
+++ b/gegl/gegl.h
@@ -658,6 +658,16 @@ GeglNode    * gegl_node_get_producer     (GeglNode      *node,
                                           gchar         *input_pad_name,
                                           gchar        **output_pad_name);
 
+/**
+ * gegl_node_has_pad:
+ * @node: the node we are querying
+ * @pad_name: the pad name we are looking for
+ *
+ * Returns TRUE if the node has a pad with the specified name
+ */
+gboolean      gegl_node_has_pad          (GeglNode      *node,
+                                          const gchar   *pad_name);
+
 
 /***
  * Binding conveniences:
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index acc85d9..1447e32 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -390,6 +390,13 @@ gegl_node_get_pad (GeglNode    *self,
   return NULL;
 }
 
+gboolean
+gegl_node_has_pad (GeglNode      *self,
+                   const gchar   *name)
+{
+  return gegl_node_get_pad (self, name) != NULL;
+}
+
 /**
  * gegl_node_get_pads:
  * @self: a #GeglNode.
diff --git a/gegl/graph/gegl-node.h b/gegl/graph/gegl-node.h
index 2e9263d..ec037c2 100644
--- a/gegl/graph/gegl-node.h
+++ b/gegl/graph/gegl-node.h
@@ -143,6 +143,8 @@ void          gegl_node_add_pad             (GeglNode      *self,
                                              GeglPad       *pad);
 void          gegl_node_remove_pad          (GeglNode      *self,
                                              GeglPad       *pad);
+gboolean      gegl_node_has_pad             (GeglNode      *self,
+                                             const gchar   *name);
 GeglPad     * gegl_node_get_pad             (GeglNode      *self,
                                              const gchar   *name);
 GSList      * gegl_node_get_pads            (GeglNode      *self);



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