gegl-serialize: api hack permitting returning a pointer

Allow inserting a return pointer using the error pointer, this to be used as a
hack for the commandline permitting specifying a sink op as last member of
chain.
parent 9fa211b6
...@@ -103,6 +103,14 @@ gegl_create_chain_argv (char **ops, ...@@ -103,6 +103,14 @@ gegl_create_chain_argv (char **ops,
GHashTable *ht = NULL; GHashTable *ht = NULL;
GeglPath *path = NULL; GeglPath *path = NULL;
GString *string = NULL; GString *string = NULL;
GeglNode **ret_sinkp = NULL;
if (error && *error)
{
GeglNode **an = (void*)error;
ret_sinkp = *an;
*error = NULL;
}
remove_in_betweens (start, proxy); remove_in_betweens (start, proxy);
...@@ -110,6 +118,8 @@ gegl_create_chain_argv (char **ops, ...@@ -110,6 +118,8 @@ gegl_create_chain_argv (char **ops,
ht = g_hash_table_new (g_str_hash, g_str_equal); ht = g_hash_table_new (g_str_hash, g_str_equal);
while (*arg) while (*arg)
{ {
if (in_keyframes) if (in_keyframes)
...@@ -627,10 +637,17 @@ gegl_create_chain_argv (char **ops, ...@@ -627,10 +637,17 @@ gegl_create_chain_argv (char **ops,
proxy), "operation", proxy), "operation",
level_op[level], NULL); level_op[level], NULL);
if (iter[level] && gegl_node_has_pad (new, "input")) if (gegl_node_has_pad (new, "output"))
gegl_node_link_many (iter[level], new, proxy, NULL); {
if (iter[level] && gegl_node_has_pad (new, "input"))
gegl_node_link_many (iter[level], new, proxy, NULL);
else
gegl_node_link_many (new, proxy, NULL);
}
else else
gegl_node_link_many (new, proxy, NULL); {
gegl_node_link_many (iter[level], new, NULL);
}
iter[level] = new; iter[level] = new;
} }
else if (error) else if (error)
...@@ -695,7 +712,17 @@ gegl_create_chain_argv (char **ops, ...@@ -695,7 +712,17 @@ gegl_create_chain_argv (char **ops,
g_free (prop); g_free (prop);
g_hash_table_unref (ht); g_hash_table_unref (ht);
gegl_node_link_many (iter[level], proxy, NULL);
if (gegl_node_has_pad (iter[level], "output"))
gegl_node_link_many (iter[level], proxy, NULL);
else
{
if (ret_sinkp)
{
*ret_sinkp = iter[level];
}
}
} }
void void
......
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