gegl r3044 - trunk/gegl



Author: martinn
Date: Sat Apr 11 15:34:41 2009
New Revision: 3044
URL: http://svn.gnome.org/viewvc/gegl?rev=3044&view=rev

Log:
Add gegl_dot_util_add_connection()

Refactor a bit and add gegl_dot_util_add_connection()

Modified:
   trunk/gegl/gegl-dot.c
   trunk/gegl/gegl-dot.h

Modified: trunk/gegl/gegl-dot.c
==============================================================================
--- trunk/gegl/gegl-dot.c	(original)
+++ trunk/gegl/gegl-dot.c	Sat Apr 11 15:34:41 2009
@@ -154,22 +154,29 @@
   for (iter = connections; iter; iter = g_slist_next (iter))
     {
       GeglConnection *connection = iter->data;
-      GeglNode       *source;
-      GeglNode       *sink;
-      GeglPad        *source_pad;
-      GeglPad        *sink_pad;
-
-      source     = gegl_connection_get_source_node (connection);
-      sink       = gegl_connection_get_sink_node (connection);
-      source_pad = gegl_connection_get_source_pad (connection);
-      sink_pad   = gegl_connection_get_sink_pad (connection);
-
-      g_string_append_printf (string, "op_%p:%s -> op_%p:%s;\n",
-                              source, gegl_pad_get_name (source_pad),
-                              sink,   gegl_pad_get_name (sink_pad));
+      gegl_dot_util_add_connection (string, connection);
     }
 }
 
+void
+gegl_dot_util_add_connection (GString        *string,
+                              GeglConnection *connection)
+{
+  GeglNode *source;
+  GeglNode *sink;
+  GeglPad  *source_pad;
+  GeglPad  *sink_pad;
+
+  source     = gegl_connection_get_source_node (connection);
+  sink       = gegl_connection_get_sink_node (connection);
+  source_pad = gegl_connection_get_source_pad (connection);
+  sink_pad   = gegl_connection_get_sink_pad (connection);
+
+  g_string_append_printf (string, "op_%p:%s -> op_%p:%s;\n",
+                          source, gegl_pad_get_name (source_pad),
+                          sink,   gegl_pad_get_name (sink_pad));
+}
+
 static void
 gegl_dot_add_graph (GString     *string,
                     GeglNode    *node,

Modified: trunk/gegl/gegl-dot.h
==============================================================================
--- trunk/gegl/gegl-dot.h	(original)
+++ trunk/gegl/gegl-dot.h	Sat Apr 11 15:34:41 2009
@@ -22,11 +22,13 @@
 #include "gegl.h"
 
 
-gchar *gegl_to_dot                       (GeglNode *node);
-void   gegl_dot_util_add_node            (GString  *string,
-                                          GeglNode *node);
-void   gegl_dot_util_add_node_sink_edges (GString  *string,
-                                          GeglNode *node);
+gchar *gegl_to_dot                       (GeglNode       *node);
+void   gegl_dot_util_add_node            (GString        *string,
+                                          GeglNode       *node);
+void   gegl_dot_util_add_node_sink_edges (GString        *string,
+                                          GeglNode       *node);
+void   gegl_dot_util_add_connection      (GString        *string,
+                                          GeglConnection *connection);
 
 
 #endif



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