[gegl] gegl: Handle sinks in gegl_dot_add_node_and_dependencies()



commit 074469e62cc35bec4327115a2f51f932394bbf6a
Author: Martin Nordholts <martinn src gnome org>
Date:   Tue May 26 21:25:32 2009 +0200

    gegl: Handle sinks in gegl_dot_add_node_and_dependencies()
---
 gegl/gegl-dot.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/gegl/gegl-dot.c b/gegl/gegl-dot.c
index 7b8a1c9..046edf9 100644
--- a/gegl/gegl-dot.c
+++ b/gegl/gegl-dot.c
@@ -251,6 +251,7 @@ gegl_dot_add_node_and_dependencies (GString  *string,
                                     GeglNode *node)
 {
   GeglDotVisitor *dot_visitor;
+  GeglPad        *pad;
   gpointer        context_id = string;
 
   dot_visitor = g_object_new (GEGL_TYPE_DOT_VISITOR,
@@ -265,8 +266,27 @@ gegl_dot_add_node_and_dependencies (GString  *string,
                              GEGL_VISITABLE (node));
 
   /* Add the edges */
+  pad = gegl_node_get_pad (node, "output");
+  if (! pad)
+    {
+      pad = gegl_node_get_pad (node, "input");
+
+      if (pad)
+        {
+          /* This is a sink node, we need to add these edges manually
+           * since no pad depends on this input pad */
+          GSList *iter;
+          for (iter = pad->connections; iter; iter = g_slist_next (iter))
+            {
+              GeglConnection *connection = iter->data;
+              gegl_dot_util_add_connection (string, connection);
+            }
+        }
+    }
+
+
   gegl_visitor_dfs_traverse (GEGL_VISITOR (dot_visitor),
-                             GEGL_VISITABLE (gegl_node_get_pad (node, "output")));
+                             GEGL_VISITABLE (pad));
 
   g_object_unref (dot_visitor);
 }



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