Commit 7ee6bd48 authored by Øyvind Kolås's avatar Øyvind Kolås

Merged GeglGraph class into GeglNode class. (more API cleanup to

follow).
* bin/editor-optype.c: (chain_in_operation):
* bin/editor.c: (cb_introspect):
* bin/export.c: (get_input_rect):
* bin/gegl-store.c: (gegl_store_set_gegl):
* bin/gegl-tree-editor-action.c: (add_sibling_op), (add_child_op):
* bin/gegl-tree-editor.c: (tree_editor_get_active):
* bin/gegl.c: (main):
* gegl/gegl-dot.c: (gegl_add_graph):
* gegl/gegl-graph.c: (gegl_node_remove_children),
(gegl_node_add_child), (gegl_node_remove_child),
(gegl_node_get_num_children), (gegl_node_get_nth_child),
(gegl_node_get_children), (gegl_node_new_node),
(gegl_node_create_node), (gegl_node_get_pad_proxy),
(gegl_node_input), (gegl_node_output), (gegl_node_new):
* gegl/gegl-graph.h:
* gegl/gegl-node-dynamic.h:
* gegl/gegl-node.c: (gegl_node_class_init), (gegl_node_init),
(dispose), (gegl_node_get_depends_on), (gegl_node_get),
(gegl_node_get_valist), (gegl_node_set_property),
(gegl_node_get_property):
* gegl/gegl-node.h:
* gegl/gegl-operation.c: (get_defined_region),
(get_affected_region), (calc_source_regions):
* gegl/gegl-xml.c: (start_element), (end_element), (gegl_to_xml):
* gegl/gegl.h:
* operations/file-io/load.c: (attach), (refresh_cache):
* operations/meta/dropshadow.c: (attach):
* operations/meta/layer.c: (attach), (refresh_cache):
* operations/meta/tonemap.c: (attach):
* operations/meta/unsharp-mask.c: (attach):
* operations/render/introspect.c: (process):
* operations/workshop/dog.c: (attach):
* tests/dfspadvisitortest.c: (test_dfs_pad_visitor):
* tests/graphtest.c: (test_graph), (test_graph_properties),
(test_graph_property_visitors):
* tests/mockimageoperationtest.c:
(test_mock_image_operation_g_object_properties),
(test_mock_image_operation_chain):
* tests/updatepadtest.c: (test_update_pad):
* tools/introspect.c: (stuff):

svn path=/trunk/; revision=1122
parent 909d8e88
2007-01-04 Øyvind Kolås <pippin@gimp.org>
Merged GeglGraph class into GeglNode class. (more API cleanup to
follow).
* bin/editor-optype.c: (chain_in_operation):
* bin/editor.c: (cb_introspect):
* bin/export.c: (get_input_rect):
* bin/gegl-store.c: (gegl_store_set_gegl):
* bin/gegl-tree-editor-action.c: (add_sibling_op), (add_child_op):
* bin/gegl-tree-editor.c: (tree_editor_get_active):
* bin/gegl.c: (main):
* gegl/gegl-dot.c: (gegl_add_graph):
* gegl/gegl-graph.c: (gegl_node_remove_children),
(gegl_node_add_child), (gegl_node_remove_child),
(gegl_node_get_num_children), (gegl_node_get_nth_child),
(gegl_node_get_children), (gegl_node_new_node),
(gegl_node_create_node), (gegl_node_get_pad_proxy),
(gegl_node_input), (gegl_node_output), (gegl_node_new):
* gegl/gegl-graph.h:
* gegl/gegl-node-dynamic.h:
* gegl/gegl-node.c: (gegl_node_class_init), (gegl_node_init),
(dispose), (gegl_node_get_depends_on), (gegl_node_get),
(gegl_node_get_valist), (gegl_node_set_property),
(gegl_node_get_property):
* gegl/gegl-node.h:
* gegl/gegl-operation.c: (get_defined_region),
(get_affected_region), (calc_source_regions):
* gegl/gegl-xml.c: (start_element), (end_element), (gegl_to_xml):
* gegl/gegl.h:
* operations/file-io/load.c: (attach), (refresh_cache):
* operations/meta/dropshadow.c: (attach):
* operations/meta/layer.c: (attach), (refresh_cache):
* operations/meta/tonemap.c: (attach):
* operations/meta/unsharp-mask.c: (attach):
* operations/render/introspect.c: (process):
* operations/workshop/dog.c: (attach):
* tests/dfspadvisitortest.c: (test_dfs_pad_visitor):
* tests/graphtest.c: (test_graph), (test_graph_properties),
(test_graph_property_visitors):
* tests/mockimageoperationtest.c:
(test_mock_image_operation_g_object_properties),
(test_mock_image_operation_chain):
* tests/updatepadtest.c: (test_update_pad):
* tools/introspect.c: (stuff):
2007-01-01 Kevin Cozens <kcozens@cvs.gnome.org>
Some changes to fix build problems in FreeBSD and Windows.
......
......@@ -66,9 +66,9 @@ chain_in_operation (const gchar *op_type)
GeglNode *iter;
GeglNode *new;
proxy = gegl_graph_output (editor.gegl, "output");
proxy = gegl_node_output (editor.gegl, "output");
iter = gegl_node_get_connected_to (proxy, "input");
new = gegl_graph_new_node (editor.gegl, "operation", op_type, NULL);
new = gegl_node_new_node (editor.gegl, "operation", op_type, NULL);
if (iter)
{
gegl_node_link_many (iter, new, proxy, NULL);
......
......@@ -715,8 +715,8 @@ cb_introspect (GtkAction *action)
GeglNode *dot;
GeglRectangle bounding_box;
gegl = gegl_graph_new ();
dot = gegl_graph_new_node (gegl,
gegl = gegl_node_new ();
dot = gegl_node_new_node (gegl,
"operation", "introspect",
"node", editor.gegl,
NULL);
......
......@@ -40,7 +40,7 @@ static void button_defined_clicked (GtkButton *button,
static GeglRectangle get_input_rect (void)
{
GeglNode *iter = gegl_graph_output (editor.gegl, "output");
GeglNode *iter = gegl_node_output (editor.gegl, "output");
gegl_node_get_bounding_box (editor.gegl); /* to trigger defined setting for all */
while (iter &&
gegl_node_get_connected_to (iter, "input")){
......
......@@ -861,5 +861,5 @@ gegl_store_set_gegl (GeglStore *gegl_store,
{
g_return_if_fail (IS_GEGL_STORE (gegl_store));
gegl_store->gegl = gegl;
gegl_store->root = gegl_graph_output (gegl, "output");
gegl_store->root = gegl_node_output (gegl, "output");
}
......@@ -372,7 +372,7 @@ add_sibling_op (GtkAction *action, gpointer userdata)
{
GeglNode *previous = gegl_previous_sibling (item);
new_item = gegl_graph_new_node (GEGL_STORE (model)->gegl,
new_item = gegl_node_new_node (GEGL_STORE (model)->gegl,
"operation", "nop",
NULL);
......@@ -435,7 +435,7 @@ add_child_op (GtkAction *action, gpointer userdata)
}
else
{
new_item = gegl_graph_new_node (GEGL_STORE (model)->gegl,
new_item = gegl_node_new_node (GEGL_STORE (model)->gegl,
"operation", "blank",
NULL);
gegl_node_connect_from (item, "aux", new_item, "output");
......
......@@ -139,7 +139,7 @@ tree_editor_get_active (GtkWidget *tree_editor)
if (!gtk_tree_selection_get_selected (tree_selection, &model, &iter))
{
GeglNode *proxy = gegl_graph_output (editor.gegl, "output");
GeglNode *proxy = gegl_node_output (editor.gegl, "output");
return gegl_node_get_connected_to (proxy, "input");
}
......
......@@ -41,7 +41,7 @@
/*FIXME: this should be in gegl.h*/
GeglNode * gegl_graph_output (GeglNode *graph,
GeglNode * gegl_node_output (GeglNode *graph,
const gchar *name);
......@@ -142,12 +142,12 @@ main (gint argc,
GeglNode *iter;
gchar **operation = o->rest;
proxy = gegl_graph_output (gegl, "output");
proxy = gegl_node_output (gegl, "output");
iter = gegl_node_get_connected_to (proxy, "input");
while (*operation)
{
GeglNode *new = gegl_graph_new_node (gegl, "operation", *operation, NULL);
GeglNode *new = gegl_node_new_node (gegl, "operation", *operation, NULL);
if (iter)
{
gegl_node_link_many (iter, new, proxy, NULL);
......@@ -185,11 +185,11 @@ main (gint argc,
break;
case GEGL_RUN_MODE_PNG:
{
GeglNode *output = gegl_graph_new_node (gegl,
GeglNode *output = gegl_node_new_node (gegl,
"operation", "png-save",
"path", o->output,
NULL);
gegl_node_connect_from (output, "input", gegl_graph_output (gegl, "output"), "output");
gegl_node_connect_from (output, "input", gegl_node_output (gegl, "output"), "output");
gegl_node_process (output);
g_object_unref (gegl);
......
......@@ -26,12 +26,12 @@ gegl_add_graph (GString *string,
GeglNode *node,
const gchar *label)
{
GeglGraph *graph = GEGL_GRAPH (node);
GeglNode *graph = node;
g_string_append_printf (string, "subgraph cluster_%s%p { graph [ label=\"%s %p\" fontsize=\"10\" ranksep=\"0.3\" nodesep=\"0.3\"]; node [ fontsize=\"10\" ];\n", label, node, label, node);
{
GList *nodes = gegl_graph_get_children (graph);
GList *nodes = gegl_node_get_children (graph);
GList *entry = nodes;
while (entry)
......@@ -157,7 +157,7 @@ gegl_add_graph (GString *string,
}
{
GList *nodes = gegl_graph_get_children (graph);
GList *nodes = gegl_node_get_children (graph);
GList *entry = nodes;
while (entry)
......
......@@ -23,7 +23,6 @@
#include <glib-object.h>
#include <string.h>
#include "gegl-types.h"
#include "gegl-graph.h"
#include "gegl-node.h"
#include "gegl-visitable.h"
#include "gegl-pad.h"
......@@ -31,90 +30,63 @@
#include "gegl-connection.h"
#include "gegl-node.h"
static void gegl_graph_class_init (GeglGraphClass *klass);
static void gegl_graph_init (GeglGraph *self);
static void dispose (GObject *object);
G_DEFINE_TYPE(GeglGraph, gegl_graph, GEGL_TYPE_OBJECT)
static void
gegl_graph_class_init (GeglGraphClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = dispose;
}
static void
gegl_graph_init (GeglGraph *self)
{
self->children = NULL;
}
static void
dispose (GObject *object)
{
GeglGraph *self = GEGL_GRAPH (object);
gegl_graph_remove_children (self);
G_OBJECT_CLASS (gegl_graph_parent_class)->dispose (object);
}
void
gegl_graph_remove_children (GeglGraph *self)
gegl_node_remove_children (GeglNode *self)
{
g_return_if_fail (GEGL_IS_GRAPH (self));
g_return_if_fail (GEGL_IS_NODE (self));
while (TRUE)
{
GeglNode *child = gegl_graph_get_nth_child (self, 0);
GeglNode *child = gegl_node_get_nth_child (self, 0);
if (child)
gegl_graph_remove_child (self, child);
gegl_node_remove_child (self, child);
else
break;
}
}
GeglNode *
gegl_graph_add_child (GeglGraph *self,
gegl_node_add_child (GeglNode *self,
GeglNode *child)
{
g_return_val_if_fail (GEGL_IS_GRAPH (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (child), NULL);
self->children = g_list_append (self->children, g_object_ref (child));
self->is_graph = TRUE;
return child;
}
GeglNode *
gegl_graph_remove_child (GeglGraph *self,
gegl_node_remove_child (GeglNode *self,
GeglNode *child)
{
g_return_val_if_fail (GEGL_IS_GRAPH (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (child), NULL);
self->children = g_list_remove (self->children, child);
g_object_unref (child);
if (self->children == NULL)
self->is_graph = FALSE;
return child;
}
gint
gegl_graph_get_num_children (GeglGraph *self)
gegl_node_get_num_children (GeglNode *self)
{
g_return_val_if_fail (GEGL_IS_GRAPH (self), -1);
g_return_val_if_fail (GEGL_IS_NODE (self), -1);
return g_list_length (self->children);
}
GeglNode *
gegl_graph_get_nth_child (GeglGraph *self,
gegl_node_get_nth_child (GeglNode *self,
gint n)
{
g_return_val_if_fail (GEGL_IS_GRAPH (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
return g_list_nth_data (self->children, n);
}
......@@ -123,9 +95,9 @@ gegl_graph_get_nth_child (GeglGraph *self,
* Returns a copy of the graphs internal list of nodes
*/
GList *
gegl_graph_get_children (GeglGraph *self)
gegl_node_get_children (GeglNode *self)
{
g_return_val_if_fail (GEGL_IS_GRAPH (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
return g_list_copy (self->children);
}
......@@ -134,18 +106,18 @@ gegl_graph_get_children (GeglGraph *self)
* returns a freshly created node, owned by the graph, and thus freed with it
*/
GeglNode *
gegl_graph_new_node (GeglNode *node,
gegl_node_new_node (GeglNode *node,
const gchar *first_property_name,
...)
{
GeglGraph *self = GEGL_GRAPH (node);
GeglNode *self = node;
va_list var_args;
const gchar *name;
g_return_val_if_fail (GEGL_IS_GRAPH (self), NULL);
g_return_val_if_fail (GEGL_IS_NODE (self), NULL);
node = g_object_new (GEGL_TYPE_NODE, NULL);
gegl_graph_add_child (self, node);
gegl_node_add_child (self, node);
name = first_property_name;
va_start (var_args, first_property_name);
......@@ -156,10 +128,10 @@ gegl_graph_new_node (GeglNode *node,
return node;
}
GeglNode * gegl_graph_create_node (GeglNode *self,
GeglNode * gegl_node_create_node (GeglNode *self,
const gchar *operation)
{
return gegl_graph_new_node (self, "operation", operation, NULL);
return gegl_node_new_node (self, "operation", operation, NULL);
}
static void
......@@ -191,11 +163,11 @@ source_invalidated (GeglNode *source,
static GeglNode *
gegl_graph_get_pad_proxy (GeglGraph *graph,
gegl_node_get_pad_proxy (GeglNode *graph,
const gchar *name,
gboolean is_graph_input)
{
GeglNode *node = GEGL_NODE (graph);
GeglNode *node = graph;
GeglPad *pad;
pad = gegl_node_get_pad (node, name);
......@@ -203,7 +175,7 @@ gegl_graph_get_pad_proxy (GeglGraph *graph,
{
GeglNode *nop = g_object_new (GEGL_TYPE_NODE, "operation", "nop", "name", is_graph_input?"proxynop-input":"proxynop-output", NULL);
GeglPad *nop_pad = gegl_node_get_pad (nop, is_graph_input?"input":"output");
gegl_graph_add_child (graph, nop);
gegl_node_add_child (graph, nop);
{
GeglPad *new_pad = g_object_new (GEGL_TYPE_PAD, NULL);
......@@ -218,7 +190,6 @@ gegl_graph_get_pad_proxy (GeglGraph *graph,
}
g_object_set_data (G_OBJECT (nop), "graph", graph);
node->is_graph = TRUE;
if (!is_graph_input)
{
......@@ -231,21 +202,21 @@ gegl_graph_get_pad_proxy (GeglGraph *graph,
}
GeglNode *
gegl_graph_input (GeglNode *node,
gegl_node_input (GeglNode *node,
const gchar *name)
{
return gegl_graph_get_pad_proxy (GEGL_GRAPH (node), name, TRUE);
return gegl_node_get_pad_proxy (node, name, TRUE);
}
GeglNode *
gegl_graph_output (GeglNode *node,
gegl_node_output (GeglNode *node,
const gchar *name)
{
return gegl_graph_get_pad_proxy (GEGL_GRAPH (node), name, FALSE);
return gegl_node_get_pad_proxy (node, name, FALSE);
}
GeglNode *
gegl_graph_new (void)
gegl_node_new (void)
{
return g_object_new (GEGL_TYPE_GRAPH, NULL);
return g_object_new (GEGL_TYPE_NODE, NULL);
}
......@@ -23,56 +23,31 @@
#include "gegl-object.h"
G_BEGIN_DECLS
#define GEGL_TYPE_GRAPH (gegl_graph_get_type ())
#define GEGL_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_GRAPH, GeglGraph))
#define GEGL_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEGL_TYPE_GRAPH, GeglGraphClass))
#define GEGL_IS_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEGL_TYPE_GRAPH))
#define GEGL_IS_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_GRAPH))
#define GEGL_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEGL_TYPE_GRAPH, GeglGraphClass))
typedef struct _GeglGraphClass GeglGraphClass;
struct _GeglGraph
{
GeglObject parent_instance;
/* graph related methods of gegl_node class */
/*< private >*/
GList *children;
};
struct _GeglGraphClass
{
GeglObjectClass parent_class;
};
GType gegl_graph_get_type (void) G_GNUC_CONST;
GeglNode * gegl_graph_add_child (GeglGraph *self,
GeglNode *child);
GeglNode * gegl_graph_remove_child (GeglGraph *self,
GeglNode *child);
GeglNode * gegl_graph_get_nth_child (GeglGraph *self,
gint n);
GList * gegl_graph_get_children (GeglGraph *self);
void gegl_graph_remove_children (GeglGraph *self);
gint gegl_graph_get_num_children (GeglGraph *self);
GeglNode * gegl_graph_new (void);
G_BEGIN_DECLS
GeglNode * gegl_graph_new_node (GeglNode *self,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
GeglNode * gegl_graph_create_node (GeglNode *self,
const gchar *operation);
GeglNode * gegl_graph_input (GeglNode *graph,
const gchar *name);
GeglNode * gegl_graph_output (GeglNode *graph,
const gchar *name);
GeglNode * gegl_node_add_child (GeglNode *self,
GeglNode *child);
GeglNode * gegl_node_remove_child (GeglNode *self,
GeglNode *child);
GeglNode * gegl_node_get_nth_child (GeglNode *self,
gint n);
GList * gegl_node_get_children (GeglNode *self);
void gegl_node_remove_children (GeglNode *self);
gint gegl_node_get_num_children (GeglNode *self);
GeglNode * gegl_node_new (void);
GeglNode * gegl_node_new_node (GeglNode *self,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
GeglNode * gegl_node_create_node (GeglNode *self,
const gchar *operation);
GeglNode * gegl_node_input (GeglNode *graph,
const gchar *name);
GeglNode * gegl_node_output (GeglNode *graph,
const gchar *name);
G_END_DECLS
#endif /* __GEGL_GRAPH_H__ */
......@@ -22,7 +22,6 @@
#ifndef __GEGL_NODE_DYNAMIC_H__
#define __GEGL_NODE_DYNAMIC_H__
#include "gegl-graph.h"
#include <gegl/buffer/gegl-buffer.h>
G_BEGIN_DECLS
......
......@@ -56,6 +56,7 @@ guint gegl_node_signals[GEGL_NODE_LAST_SIGNAL] = {0};
static void gegl_node_class_init (GeglNodeClass *klass);
static void gegl_node_init (GeglNode *self);
static void finalize (GObject *self_object);
static void dispose (GObject *self_object);
static void set_property (GObject *gobject,
guint prop_id,
const GValue *value,
......@@ -87,7 +88,7 @@ static void property_changed (GObject *gobject,
GParamSpec *arg1,
gpointer user_data);
G_DEFINE_TYPE_WITH_CODE (GeglNode, gegl_node, GEGL_TYPE_GRAPH,
G_DEFINE_TYPE_WITH_CODE (GeglNode, gegl_node, GEGL_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GEGL_TYPE_VISITABLE,
visitable_init))
......@@ -98,6 +99,7 @@ gegl_node_class_init (GeglNodeClass * klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = finalize;
gobject_class->dispose = dispose;
gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
......@@ -139,6 +141,7 @@ gegl_node_init (GeglNode *self)
self->operation = NULL;
self->enabled = TRUE;
self->is_graph = FALSE;
self->children = NULL;
}
static void
......@@ -152,6 +155,16 @@ visitable_init (gpointer ginterface,
visitable_class->needs_visiting = visitable_needs_visiting;
}
static void
dispose (GObject *gobject)
{
GeglNode *self = GEGL_NODE (gobject);
gegl_node_remove_children (self);
G_OBJECT_CLASS (gegl_node_parent_class)->dispose (gobject);
}
static void
finalize (GObject *gobject)
{
......@@ -759,7 +772,7 @@ gegl_node_get_depends_on (GeglNode *self)
if (source_node->is_graph)
{
GeglNode *proxy = gegl_graph_output (source_node, "output");
GeglNode *proxy = gegl_node_output (source_node, "output");
if (! g_list_find (depends_on, proxy))
depends_on = g_list_append (depends_on, proxy);
......@@ -1017,7 +1030,7 @@ gegl_node_get (GeglNode *self,
va_list var_args;
g_return_if_fail (GEGL_IS_NODE (self));
g_return_if_fail (GEGL_IS_GRAPH (self) || GEGL_IS_OPERATION (self->operation));
g_return_if_fail (self->is_graph || GEGL_IS_OPERATION (self->operation));
va_start (var_args, first_property_name);
gegl_node_get_valist (self, first_property_name, var_args);
......@@ -1154,7 +1167,7 @@ gegl_node_get_valist (GeglNode *self,
{
pspec = g_object_class_find_property (
G_OBJECT_GET_CLASS (G_OBJECT (
gegl_graph_output (self, "output")->operation)), property_name);
gegl_node_output (self, "output")->operation)), property_name);
if (!pspec)
{
pspec = g_object_class_find_property (
......@@ -1224,7 +1237,7 @@ gegl_node_set_property (GeglNode *self,
{
g_warning ("set_property for graph,. hmm");
/* FIXME: should this really be "input")? is_graph doesn't seem to be used,.. */
g_object_set_property (G_OBJECT (gegl_graph_input (self, "input")->operation),
g_object_set_property (G_OBJECT (gegl_node_input (self, "input")->operation),
property_name, value);
}
else
......@@ -1256,7 +1269,7 @@ gegl_node_get_property (GeglNode *self,
!strcmp (property_name, "output"))
{
g_warning ("Eeek");
g_object_get_property (G_OBJECT (gegl_graph_output (self, "output")->operation),
g_object_get_property (G_OBJECT (gegl_node_output (self, "output")->operation),
property_name, value);
}
else
......
......@@ -40,33 +40,29 @@ typedef struct _GeglNodeClass GeglNodeClass;
struct _GeglNode
{
GeglGraph parent_instance;
/*< private >*/
GeglObject parent_instance;
GeglOperation *operation;
GeglRectangle have_rect;
GList *pads;
GList *input_pads;
GList *output_pads;
GList *sources;
GList *sinks;
gboolean is_root;
gboolean is_graph; /*< a node that is a graph,
needs a bit special treatment */
gboolean enabled;
GSList *dynamic; /*< list of GeglNodeDynamic's corresponding to
evaluation contexts */
gboolean is_graph;
/*< private >*/
GList *children; /* used for children */
};
struct _GeglNodeClass
{
GeglGraphClass parent_class;
GeglObjectClass parent_class;
};
/* renders the desired region of interest to a buffer of the specified
......
......@@ -30,6 +30,7 @@
#include "gegl-connection.h"
#include "gegl-pad.h"
#include "gegl-utils.h"
#include "gegl-graph.h"
static void gegl_operation_class_init (GeglOperationClass *klass);
static void gegl_operation_init (GeglOperation *self);
......@@ -252,7 +253,7 @@ get_defined_region (GeglOperation *self)
if (self->node->is_graph)
{
return gegl_operation_get_defined_region (
gegl_graph_output (self->node, "output")->operation);
gegl_node_output (self->node, "output")->operation);
}
g_warning ("Op '%s' has no defined_region method",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS(self)));
......@@ -267,7 +268,7 @@ get_affected_region (GeglOperation *self,
if (self->node->is_graph)
{
return gegl_operation_get_affected_region (
gegl_graph_output (self->node, "output")->operation,
gegl_node_output (self->node, "output")->operation,
input_pad,
region);
}
......@@ -281,7 +282,7 @@ calc_source_regions (GeglOperation *self,
if (self->node->is_graph)
{
return gegl_operation_calc_source_regions (
gegl_graph_output (self->node, "output")->operation,
gegl_node_output (self->node, "output")->operation,
context_id);
}
......
......@@ -96,10 +96,10 @@ static void start_element (GMarkupParseContext *context,
pd->state=STATE_TREE_NORMAL;
pd->parent = g_list_prepend (pd->parent, new);
gegl_graph_output (new, "output"); /* creates the pad if it doesn't exist */
gegl_node_output (new, "output"); /* creates the pad if it doesn't exist */
if (pd->iter)
gegl_node_connect_from (pd->iter, "input", new, "output");
pd->iter = gegl_graph_output (new, "output");
pd->iter = gegl_node_output (new, "output");
}
else if (!strcmp (element_name, "graph"))
{
......@@ -111,13 +111,13 @@ static void start_element (GMarkupParseContext *context,
if (!strcmp (element_name, "node"))
{
new = gegl_graph_new_node (pd->gegl,
new = gegl_node_new_node (pd->gegl,
"operation", name2val (a, v, "operation"),
NULL);
}
else
{
new = gegl_graph_new_node (pd->gegl,
new = gegl_node_new_node (pd->gegl,
"operation", element_name,
NULL);
}
......@@ -236,8 +236,8 @@ static void end_element (GMarkupParseContext *context,
if (gegl_node_get_pad (pd->iter, "input"))
{
gegl_node_connect_from (pd->iter, "input",
gegl_graph_input (GEGL_NODE (pd->parent->data), "input"), "output");
pd->iter = gegl_graph_input (GEGL_NODE (pd->parent->data), "input");
gegl_node_input (GEGL_NODE (pd->parent->data), "input"), "output");
pd->iter = gegl_node_input (GEGL_NODE (pd->parent->data), "input");
}
else
{
......@@ -586,7 +586,7 @@ gegl_to_xml (GeglNode *gegl)
ss->clones = g_hash_table_new (NULL, NULL);
ss->terse = TRUE;
gegl = gegl_graph_output (gegl, "output");
gegl = gegl_node_output (gegl, "output");
g_string_append (ss->buf, "<?xml version='1.0' encoding='UTF-8'?>\n");
g_string_append (ss->buf, "<gegl>\n");
......
......@@ -55,15 +55,15 @@ void gegl_init (gint *argc,
void gegl_exit (void);
/* Create a new gegl graph */
GeglNode * gegl_graph_new (void);
GeglNode * gegl_node_new (void);
/* create a new node belonging to a graph */
GeglNode * gegl_graph_create_node (GeglNode *graph,
GeglNode * gegl_node_create_node (GeglNode *graph,
const gchar *operation);
/* create a new node belonging to a graph, with key/value pairs for properties,
* terminated by NULL (remember to set "operation") */
GeglNode * gegl_graph_new_node (GeglNode *graph,
GeglNode * gegl_node_new_node (GeglNode *graph,
const gchar *first_property_name,
...) G_GNUC_NULL_TERMINATED;
/* connect the output pad of a different node to this nodes input pad,
......@@ -149,11 +149,11 @@ const gchar * gegl_node_get_operation (GeglNode *node);
/* aquire the attached ghost output pad of a Graph node,
* create it if it does not exist */
GeglNode * gegl_graph_output (GeglNode *graph,
GeglNode * gegl_node_output (GeglNode *graph,
const gchar *name);
/* aquire the attached ghost input pad of a Graph node,
* create it if it does not exist */
GeglNode * gegl_graph_input (GeglNode *graph,
GeglNode * gegl_node_input (GeglNode *graph,
const gchar *name);
/* create a geglgraph from parsed XML data */
......
......@@ -157,9 +157,9 @@ static void attach (GeglOperation *operation)
priv->self = GEGL_OPERATION (self)->node;
priv->output = gegl_graph_output (priv->self, "output");
priv->output = gegl_node_output (priv->self, "output");
priv->load = gegl_graph_new_node (priv->self,