Commit 4b986e16 authored by Martin Nordholts's avatar Martin Nordholts

Add gegl_dot_util_add_connection()

Refactor a bit and add gegl_dot_util_add_connection()

svn path=/trunk/; revision=3044
parent 89351e9e
......@@ -154,22 +154,29 @@ gegl_dot_util_add_node_sink_edges (GString *string,
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,
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment