[gegl] Move gegl.h declarations into their own headers.



commit 90e5935f5251df6c45cfcdb01844269e4f1acdc9
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Sat Nov 30 05:25:11 2013 -0800

    Move gegl.h declarations into their own headers.
    
    gegl-init.c -> gegl-init.h
    gegl-apply.c -> gegl-apply.h
    gegl-processor.c -> process/gegl-processor.h
    gegl-c.c -> gegl-c.h
    gegl-node.c -> graph/gegl-node.h
    misc -> gegl-operations-util.h
    
    gegl-c.h is intentionally left out of the documentation
    list because it contains only deprecated functions.
    
    The functions in gegl-operations-util.h are still duplicate
    definitions, but moving them to another file for now is
    necessary to fix the ordering of the documentation html files.
    
    There is a guard against directly including gegl-operations-util.h
    because its future is uncertain and it shouldn't be included
    directly even in internal code.

 docs/Makefile.am                          |    7 +-
 gegl/Makefile.am                          |    9 +-
 gegl/gegl-apply.c                         |    2 +-
 gegl/gegl-apply.h                         |   93 +++-
 gegl/gegl-c.c                             |    2 +-
 gegl/gegl-c.h                             |   62 ++
 gegl/gegl-config.h                        |    2 -
 gegl/gegl-debug.h                         |    1 -
 gegl/gegl-dot-visitor.c                   |    2 +-
 gegl/gegl-dot.c                           |    2 +-
 gegl/gegl-init-private.h                  |   36 ++
 gegl/gegl-init.c                          |    9 +-
 gegl/gegl-init.h                          |   74 ++-
 gegl/gegl-introspection-support.c         |    2 +-
 gegl/gegl-operations-util.h               |   82 +++
 gegl/gegl.h                               |  946 +----------------------------
 gegl/graph/Makefile.am                    |    1 +
 gegl/graph/gegl-node-private.h            |  138 +++++
 gegl/graph/gegl-node.c                    |    3 +-
 gegl/graph/gegl-node.h                    |  796 ++++++++++++++++++------
 gegl/graph/gegl-pad.c                     |    2 +-
 gegl/graph/gegl-visitor.c                 |    2 +-
 gegl/operation/gegl-operation-context.c   |    3 +-
 gegl/operation/gegl-operation-meta.c      |    2 +-
 gegl/operation/gegl-operation.c           |    2 +-
 gegl/process/Makefile.am                  |    3 +-
 gegl/process/gegl-eval-manager.c          |    2 +-
 gegl/process/gegl-graph-traversal-debug.c |    2 +-
 gegl/process/gegl-graph-traversal.c       |    2 +-
 gegl/process/gegl-list-visitor.c          |    2 +-
 gegl/process/gegl-processor-private.h     |   48 ++
 gegl/process/gegl-processor.c             |    6 +-
 gegl/process/gegl-processor.h             |   67 ++-
 operations/common/display.c               |    2 +-
 operations/common/exp-combine.c           |    2 +-
 operations/common/save.c                  |    2 +-
 operations/common/write-buffer.c          |    2 +-
 operations/transform/transform-core.c     |    2 +-
 38 files changed, 1209 insertions(+), 1213 deletions(-)
---
diff --git a/docs/Makefile.am b/docs/Makefile.am
index eec4899..0d0b4f8 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -179,6 +179,10 @@ endif
 
 API_DOC_FILES = \
        $(top_srcdir)/gegl/gegl.h                       \
+       $(top_srcdir)/gegl/gegl-init.h          \
+       $(top_srcdir)/gegl/gegl-operations-util.h       \
+       $(top_srcdir)/gegl/graph/gegl-node.h            \
+       $(top_srcdir)/gegl/process/gegl-processor.h     \
        $(top_builddir)/gegl/gegl-version.h             \
        $(top_srcdir)/gegl/buffer/gegl-buffer.h         \
        $(top_srcdir)/gegl/buffer/gegl-buffer-iterator.h\
@@ -187,7 +191,8 @@ API_DOC_FILES = \
        $(top_srcdir)/gegl/property-types/gegl-color.h  \
        $(top_srcdir)/gegl/gegl-matrix.h                \
        $(top_srcdir)/gegl/property-types/gegl-path.h   \
-       $(top_srcdir)/gegl/property-types/gegl-curve.h
+       $(top_srcdir)/gegl/property-types/gegl-curve.h \
+       $(top_srcdir)/gegl/gegl-apply.h
 
 api.html: $(API_DOC_FILES) \
          $(top_srcdir)/tools/create-reference.rb
diff --git a/gegl/Makefile.am b/gegl/Makefile.am
index 75b3b57..58e1969 100644
--- a/gegl/Makefile.am
+++ b/gegl/Makefile.am
@@ -46,11 +46,14 @@ GEGL_publicdir = $(includedir)/gegl-$(GEGL_API_VERSION)
 GEGL_introspectable_headers =  \
        gegl.h                          \
        gegl-types.h                    \
+       gegl-apply.h                    \
        gegl-enums.h                    \
+       gegl-operations-util.h          \
        gegl-utils.h                    \
        gegl-matrix.h                   \
        gegl-lookup.h                   \
        gegl-random.h                   \
+       gegl-init.h                     \
        gegl-version.h                  \
        buffer/gegl-buffer.h            \
        buffer/gegl-buffer-iterator.h   \
@@ -58,7 +61,9 @@ GEGL_introspectable_headers = \
        buffer/gegl-tile-backend.h              \
        buffer/gegl-tile-handler.h              \
        buffer/gegl-tile-source.h               \
+       graph/gegl-node.h                       \
        process/gegl-graph-debug.h              \
+       process/gegl-processor.h                \
        property-types/gegl-paramspecs.h        \
        property-types/gegl-color.h             \
        property-types/gegl-path.h              \
@@ -66,6 +71,7 @@ GEGL_introspectable_headers = \
 
 GEGL_public_HEADERS = \
        $(GEGL_introspectable_headers)  \
+       gegl-c.h                        \
        gegl-chant.h                    \
        gegl-cpuaccel.h                 \
        gegl-plugin.h                   \
@@ -91,7 +97,6 @@ GEGL_sources = \
        gegl-matrix.c                   \
        \
        gegl-algorithms.h \
-       gegl-apply.h                    \
        gegl-chant.h                    \
        gegl-config.h                   \
        gegl-cpuaccel.h                 \
@@ -99,7 +104,7 @@ GEGL_sources = \
        gegl-debug.h                    \
        gegl-dot.h                      \
        gegl-dot-visitor.h              \
-       gegl-init.h                     \
+       gegl-init-private.h             \
        gegl-instrument.h               \
        gegl-introspection-support.h    \
        gegl-lookup.h                   \
diff --git a/gegl/gegl-apply.c b/gegl/gegl-apply.c
index a5b1bb2..e4da593 100644
--- a/gegl/gegl-apply.c
+++ b/gegl/gegl-apply.c
@@ -29,7 +29,7 @@
 #include "gegl.h"
 #include "gegl-apply.h"
 
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 
 #include "operation/gegl-operation.h"
 #include "operation/gegl-operations.h"
diff --git a/gegl/gegl-apply.h b/gegl/gegl-apply.h
index da09bb3..fb16456 100644
--- a/gegl/gegl-apply.h
+++ b/gegl/gegl-apply.h
@@ -20,11 +20,100 @@
 #ifndef __GEGL_APPLY_H__
 #define __GEGL_APPLY_H__
 
-#include <gegl/buffer/gegl-buffer.h>
-
 G_BEGIN_DECLS
 
+/**
+ * gegl_apply_op:
+ * @buffer: the #GeglBuffer to apply onto
+ * @operation_name: name of the operation to apply
+ * @...: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to buffer, overwritting the contents of buffer.
+ *
+ */
+void        gegl_apply_op  (GeglBuffer    *buffer,
+                            const gchar   *operation_name,
+                            ...) G_GNUC_NULL_TERMINATED;
+
+/**
+ * gegl_filter_op:
+ * @source_buffer: the source #GeglBuffer for the filter
+ * @operation_name: name of the operation to apply
+ * @...: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to source_buffer, returning the result in a new buffer.
+ *
+ * Return value: (transfer full): the result of the filter
+ */
+GeglBuffer *gegl_filter_op (GeglBuffer    *source_buffer,
+                            const gchar   *operation_name,
+                            ...) G_GNUC_NULL_TERMINATED;
+
+
+/**
+ * gegl_render_op:
+ * @source_buffer: the source #GeglBuffer for the filter
+ * @target_buffer: the source #GeglBuffer for the filter
+ * @operation_name: name of the operation to apply
+ * @...: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to source_buffer, writing the results to target_buffer.
+ *
+ */
+void        gegl_render_op (GeglBuffer    *source_buffer,
+                            GeglBuffer    *target_buffer,
+                            const gchar   *operation_name,
+                            ...) G_GNUC_NULL_TERMINATED;
 
+/* the following only exist to make gegl_apply and gegl_filter bindable */
+
+/**
+ * gegl_apply_op_valist:
+ * @buffer: the #GeglBuffer to apply onto
+ * @operation_name: name of the operation to apply
+ * @var_args: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to buffer, overwritting the contents of buffer.
+ *
+ */
+void        gegl_apply_op_valist (GeglBuffer    *buffer,
+                                  const gchar   *operation_name,
+                                  va_list        var_args);
+
+/**
+ * gegl_filter_op_valist:
+ * @source_buffer: the source #GeglBuffer for the filter
+ * @operation_name: name of the operation to apply
+ * @var_args: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to source_buffer, returning the result in a new buffer.
+ *
+ * Return value: (transfer full): the result of the filter
+ */
+GeglBuffer *gegl_filter_op_valist (GeglBuffer   *source_buffer,
+                                   const gchar  *operation_name,
+                                   va_list       var_args);
+
+/**
+ * gegl_render_op_valist:
+ * @source_buffer: the source #GeglBuffer for the filter
+ * @target_buffer: the source #GeglBuffer for the filter
+ * @operation_name: name of the operation to apply
+ * @var_args: the settings for the operation. Zero or more key/value pairs,
+ * ended terminated with NULL.
+ *
+ * Apply the operation to source_buffer, writing the results to target_buffer.
+ *
+ */
+void        gegl_render_op_valist (GeglBuffer   *source_buffer,
+                                   GeglBuffer   *target_buffer,
+                                   const gchar  *operation_name,
+                                   va_list       var_args);
 
 G_END_DECLS
 
diff --git a/gegl/gegl-c.c b/gegl/gegl-c.c
index c383e50..bc4ea50 100644
--- a/gegl/gegl-c.c
+++ b/gegl/gegl-c.c
@@ -25,7 +25,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 
 static void
diff --git a/gegl/gegl-c.h b/gegl/gegl-c.h
new file mode 100644
index 0000000..90c98d5
--- /dev/null
+++ b/gegl/gegl-c.h
@@ -0,0 +1,62 @@
+/* This file is the public GEGL API
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * 2000-2008 © Calvin Williamson, Øyvind Kolås.
+ */
+
+#ifndef __GEGL_C_H__
+#define __GEGL_C_H__
+
+G_BEGIN_DECLS
+
+/**
+ * gegl_node: (skip)
+ * @op_type:  the type of operation to create
+ * @first_property_name:
+ * @...:
+ *
+ * Construct a GEGL node, connecting it to needed input nodes. The
+ * returned node does not have a parent but a single reference it
+ * is meant to be passed to gegl_graph () for gegl_graph () to assume
+ * its ownership. This is syntactic sugar for use from C, similar
+ * conveniences can easily be built externally in other languages.
+ *
+ * gegl_node(op_type, [key, value, [...]], NULL, [input, [aux]])
+ *
+ * Return value: (transfer full): a new Gegl node.
+ */
+GeglNode *gegl_node (const gchar *op_type,
+                     const gchar *first_property_name,
+                     ...) G_GNUC_DEPRECATED;
+
+
+/**
+ * gegl_graph: (skip)
+ * @node: (transfer full): the end result of a composition created with gegl_node()
+ *
+ * Creates a GeglNode containing a free floating graph constructed
+ * using gegl_node(). The GeglGraph adopts all the passed in nodes
+ * making it sufficient to unref the resulting graph.
+ *
+ * gegl_graph (gegl_node ("gegl:over", NULL,
+ *                        gegl_node (..), gegl_node (..)));
+ *
+ * Return value: (transfer full):a GeglNode graph.
+ */
+GeglNode *gegl_graph (GeglNode *node) G_GNUC_DEPRECATED;
+
+G_END_DECLS
+
+#endif  /* __GEGL_C_H__ */
diff --git a/gegl/gegl-config.h b/gegl/gegl-config.h
index c45c0c9..0a170f8 100644
--- a/gegl/gegl-config.h
+++ b/gegl/gegl-config.h
@@ -52,8 +52,6 @@ struct _GeglConfigClass
   GObjectClass parent_class;
 };
 
-GeglConfig   * gegl_config            (void);
-
 G_END_DECLS
 
 #endif
diff --git a/gegl/gegl-debug.h b/gegl/gegl-debug.h
index 0a94090..0d87c7e 100644
--- a/gegl/gegl-debug.h
+++ b/gegl/gegl-debug.h
@@ -2,7 +2,6 @@
 #define __GEGL_DEBUG_H__
 
 #include <glib.h>
-#include "gegl-init.h"
 
 G_BEGIN_DECLS
 
diff --git a/gegl/gegl-dot-visitor.c b/gegl/gegl-dot-visitor.c
index 3af0b3b..8ea8d74 100644
--- a/gegl/gegl-dot-visitor.c
+++ b/gegl/gegl-dot-visitor.c
@@ -24,7 +24,7 @@
 #include "gegl-types-internal.h"
 #include "gegl-dot.h"
 #include "gegl-dot-visitor.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 #include "graph/gegl-visitable.h"
 
diff --git a/gegl/gegl-dot.c b/gegl/gegl-dot.c
index 2b43ac5..116e36a 100644
--- a/gegl/gegl-dot.c
+++ b/gegl/gegl-dot.c
@@ -26,7 +26,7 @@
 
 #include "gegl.h"
 #include "gegl-types-internal.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 #include "graph/gegl-connection.h"
 #include "graph/gegl-visitable.h"
diff --git a/gegl/gegl-init-private.h b/gegl/gegl-init-private.h
new file mode 100644
index 0000000..31e5dba
--- /dev/null
+++ b/gegl/gegl-init-private.h
@@ -0,0 +1,36 @@
+/* This file is part of GEGL
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2003 Calvin Williamson, Øyvind Kolås
+ *           2013 Daniel Sabo
+ */
+
+#ifndef __GEGL_INIT_PRIVATE_H__
+#define __GEGL_INIT_PRIVATE_H__
+
+G_BEGIN_DECLS
+
+/**
+ * gegl_get_debug_enabled:
+ *
+ * Check if gegl has debugging turned on.
+ *
+ * Return value: TRUE if debugging is turned on, FALSE otherwise.
+ */
+gboolean      gegl_get_debug_enabled     (void);
+
+G_END_DECLS
+
+#endif /* __GEGL_INIT_PRIVATE_H__ */
\ No newline at end of file
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index 03d0379..ce27865 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -82,16 +82,17 @@ pid_is_running (gint pid)
 #endif
 
 
-#include <gegl-debug.h>
-
+#include "gegl-debug.h"
 
 guint gegl_debug_flags = 0;
 
+#include "gegl-types.h"
+#include "gegl-types-internal.h"
 #include "gegl-instrument.h"
 #include "gegl-init.h"
+#include "gegl-init-private.h"
 #include "module/geglmodule.h"
 #include "module/geglmoduledb.h"
-#include "gegl-types-internal.h"
 #include "buffer/gegl-buffer.h"
 #include "operation/gegl-operation.h"
 #include "operation/gegl-operations.h"
@@ -102,7 +103,7 @@ guint gegl_debug_flags = 0;
 #include "buffer/gegl-tile-backend-tiledir.h"
 #include "buffer/gegl-tile-backend-file.h"
 #include "gegl-config.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "gegl-random-priv.h"
 
 static gboolean  gegl_post_parse_hook (GOptionContext *context,
diff --git a/gegl/gegl-init.h b/gegl/gegl-init.h
index f855b3f..b72519c 100644
--- a/gegl/gegl-init.h
+++ b/gegl/gegl-init.h
@@ -14,6 +14,7 @@
  * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
  *
  * Copyright 2003 Calvin Williamson, Øyvind Kolås
+ *           2013 Daniel Sabo
  */
 
 #ifndef __GEGL_INIT_H__
@@ -21,34 +22,50 @@
 
 G_BEGIN_DECLS
 
+/***
+ * Initialization:
+ *
+ * Before GEGL can be used the engine should be initialized by either calling
+ * #gegl_init or through the use of #gegl_get_option_group. To shut down the
+ * GEGL engine call #gegl_exit.
+ *
+ * ---Code sample:
+ * #include <gegl.h>
+ *
+ * int main(int argc, char **argv)
+ * {
+ *   gegl_init (&argc, &argv);
+ *       # other GEGL code
+ *   gegl_exit ();
+ * }
+ */
+
 /**
  * gegl_init:
  * @argc: (inout): a pointer to the number of command line arguments.
  * @argv: (inout) (array length=argc) (allow-none): a pointer to the array of command line arguments.
  *
- * Call this function before using any other GEGL functions. It will initialize
- * everything needed to operate GEGL and parses some standard command line
- * options.  @argc and @argv are adjusted accordingly so your own code will
- * never see those standard arguments.
+ * Call this function before using any other GEGL functions. It will
+ * initialize everything needed to operate GEGL and parses some
+ * standard command line options.  @argc and @argv are adjusted
+ * accordingly so your own code will never see those standard
+ * arguments.
  *
- * Note that there is an alternative ways to initialize GEGL: if you are
- * calling g_option_context_parse() with the option group returned by
- * gegl_get_option_group(), you don't have to call gegl_init().
+ * Note that there is an alternative way to initialize GEGL: if you
+ * are calling g_option_context_parse() with the option group returned
+ * by #gegl_get_option_group(), you don't have to call #gegl_init().
  **/
-void           gegl_init              (gint    *argc,
-                                       gchar ***argv);
-
+void          gegl_init                  (gint          *argc,
+                                          gchar       ***argv);
 /**
  * gegl_get_option_group: (skip)
  *
- * Returns a #GOptionGroup for the commandline arguments recognized
- * by GEGL. You should add this group to your #GOptionContext
- * with g_option_context_add_group(), if you are using
+ * Returns a GOptionGroup for the commandline arguments recognized
+ * by GEGL. You should add this group to your GOptionContext
+ * with g_option_context_add_group() if you are using
  * g_option_context_parse() to parse your commandline arguments.
- *
- * Returns a #GOptionGroup for the commandline arguments recognized by GEGL.
  */
-GOptionGroup * gegl_get_option_group  (void);
+GOptionGroup *gegl_get_option_group      (void);
 
 /**
  * gegl_exit:
@@ -57,22 +74,25 @@ GOptionGroup * gegl_get_option_group  (void);
  * caches and write/dump debug information if the correct debug flags
  * are set.
  */
-void           gegl_exit              (void);
+void          gegl_exit                  (void);
 
 /**
- * gegl_get_debug_enabled:
+ * gegl_load_module_directory:
+ * @path: the directory to load modules from
  *
- * Check if gegl has debugging turned on.
- *
- * Return value: TRUE if debugging is turned on, FALSE otherwise.
+ * Load all gegl modules found in the given directory.
  */
-gboolean       gegl_get_debug_enabled (void); /* should be moved into config */
-
-void           gegl_get_version          (int *major,
-                                          int *minor,
-                                          int *micro);
+void          gegl_load_module_directory (const gchar *path);
 
-void           gegl_load_module_directory (const gchar *path);
+/**
+ * gegl_config:
+ *
+ * Returns a GeglConfig object with properties that can be manipulated to control
+ * GEGLs behavior.
+ *
+ * Return value: (transfer none): a #GeglConfig
+ */
+GeglConfig   *gegl_config                (void);
 
 G_END_DECLS
 
diff --git a/gegl/gegl-introspection-support.c b/gegl/gegl-introspection-support.c
index a9a57ab..e8db676 100644
--- a/gegl/gegl-introspection-support.c
+++ b/gegl/gegl-introspection-support.c
@@ -31,7 +31,7 @@
 #include "gegl-types-internal.h"
 
 #include "gegl.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "gegl-introspection-support.h"
 
 GValue *
diff --git a/gegl/gegl-operations-util.h b/gegl/gegl-operations-util.h
new file mode 100644
index 0000000..e2d734d
--- /dev/null
+++ b/gegl/gegl-operations-util.h
@@ -0,0 +1,82 @@
+/* This file is the public GEGL API
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * 2000-2008 © Calvin Williamson, Øyvind Kolås.
+ */
+
+#ifndef __GEGL_OPERATIONS_UTIL_H__
+#define __GEGL_OPERATIONS_UTIL_H__
+
+#if !defined (__GEGL_H_INSIDE__)
+#error "This file can not be included directly, use <gegl.h> instead."
+#endif
+
+G_BEGIN_DECLS
+
+/***
+ * Available operations:
+ * Gegl provides means to check for available processing operations that
+ * can be used with nodes using #gegl_list_operations and #gegl_has_operation.
+ * For a specified op, you can get a list of properties with
+ * #gegl_operation_list_properties.
+ */
+
+/**
+ * gegl_list_operations:
+ * @n_operations_p: (out caller-allocates): return location for number of operations.
+ *
+ * Return value: (transfer container) (array length=n_operations_p): An
+ * alphabetically sorted array of available operation names. This excludes any
+ * compat-name registered by operations. The list should be freed with g_free
+ * after use.
+ * ---
+ * gchar **operations;
+ * guint   n_operations;
+ * gint i;
+ *
+ * operations = gegl_list_operations (&n_operations);
+ * g_print ("Available operations:\n");
+ * for (i=0; i < n_operations; i++)
+ *   {
+ *     g_print ("\t%s\n", operations[i]);
+ *   }
+ * g_free (operations);
+ */
+gchar        **gegl_list_operations         (guint *n_operations_p);
+
+/**
+ * gegl_has_operation:
+ * @operation_type: the name of the operation
+ *
+ * Return value: A boolean telling whether the operation is present or not. This
+ * also returns true for any compat-name registered by operations.
+ */
+
+gboolean       gegl_has_operation           (const gchar *operation_type);
+
+/**
+ * gegl_operation_list_properties:
+ * @operation_type: the name of the operation type we want to query to properties of.
+ * @n_properties_p: (out caller-allocates): return location for number of properties.
+ *
+ * Return value: (transfer container) (array length=n_properties_p): An allocated array of #GParamSpecs 
describing the properties
+ * of the operation available when a node has operation_type set. The list should be freed with g_free after 
use.
+ */
+GParamSpec** gegl_operation_list_properties (const gchar   *operation_type,
+                                             guint         *n_properties_p);
+
+G_END_DECLS
+
+#endif /* __GEGL_OPERATIONS_UTIL_H__ */
\ No newline at end of file
diff --git a/gegl/gegl.h b/gegl/gegl.h
index e6738d2..32f8d33 100644
--- a/gegl/gegl.h
+++ b/gegl/gegl.h
@@ -22,6 +22,9 @@
 #include <glib-object.h>
 #include <babl/babl.h>
 
+
+#define __GEGL_H_INSIDE__
+
 #include <gegl-types.h>
 
 #include <gegl-buffer.h>
@@ -30,9 +33,16 @@
 #include <gegl-path.h>
 #include <gegl-matrix.h>
 #include <gegl-utils.h>
+#include <gegl-operations-util.h>
+#include <gegl-init.h>
 #include <gegl-version.h>
 #include <gegl-random.h>
+#include <gegl-node.h>
+#include <gegl-processor.h>
+#include <gegl-apply.h>
+#include <gegl-c.h>
 
+#undef __GEGL_H_INSIDE__
 
 /***
  * The GEGL API:
@@ -61,942 +71,6 @@ G_BEGIN_DECLS
  * determine the smallest buffers needed at each stage of processing.
  */
 
-/***
- * Initialization:
- *
- * Before GEGL can be used the engine should be initialized by either calling
- * #gegl_init or through the use of #gegl_get_option_group. To shut down the
- * GEGL engine call #gegl_exit.
- *
- * ---Code sample:
- * #include <gegl.h>
- *
- * int main(int argc, char **argv)
- * {
- *   gegl_init (&argc, &argv);
- *       # other GEGL code
- *   gegl_exit ();
- * }
- */
-
-/**
- * gegl_init:
- * @argc: (inout): a pointer to the number of command line arguments.
- * @argv: (inout) (array length=argc) (allow-none): a pointer to the array of command line arguments.
- *
- * Call this function before using any other GEGL functions. It will
- * initialize everything needed to operate GEGL and parses some
- * standard command line options.  @argc and @argv are adjusted
- * accordingly so your own code will never see those standard
- * arguments.
- *
- * Note that there is an alternative way to initialize GEGL: if you
- * are calling g_option_context_parse() with the option group returned
- * by #gegl_get_option_group(), you don't have to call #gegl_init().
- **/
-void           gegl_init                 (gint          *argc,
-                                          gchar       ***argv);
-/**
- * gegl_get_option_group: (skip)
- *
- * Returns a GOptionGroup for the commandline arguments recognized
- * by GEGL. You should add this group to your GOptionContext
- * with g_option_context_add_group() if you are using
- * g_option_context_parse() to parse your commandline arguments.
- */
-GOptionGroup * gegl_get_option_group     (void);
-
-/**
- * gegl_exit:
- *
- * Call this function when you're done using GEGL. It will clean up
- * caches and write/dump debug information if the correct debug flags
- * are set.
- */
-void           gegl_exit                 (void);
-
-
-/***
- * Available operations:
- * Gegl provides means to check for available processing operations that
- * can be used with nodes using #gegl_list_operations and #gegl_has_operation.
- * For a specified op, you can get a list of properties with
- * #gegl_operation_list_properties.
- */
-
-/**
- * gegl_list_operations:
- * @n_operations_p: (out caller-allocates): return location for number of operations.
- *
- * Return value: (transfer container) (array length=n_operations_p): An
- * alphabetically sorted array of available operation names. This excludes any
- * compat-name registered by operations. The list should be freed with g_free
- * after use.
- * ---
- * gchar **operations;
- * guint   n_operations;
- * gint i;
- *
- * operations = gegl_list_operations (&n_operations);
- * g_print ("Available operations:\n");
- * for (i=0; i < n_operations; i++)
- *   {
- *     g_print ("\t%s\n", operations[i]);
- *   }
- * g_free (operations);
- */
-gchar        **gegl_list_operations         (guint *n_operations_p);
-
-/**
- * gegl_has_operation:
- * @operation_type: the name of the operation
- *
- * Return value: A boolean telling whether the operation is present or not. This
- * also returns true for any compat-name registered by operations.
- */
-
-gboolean       gegl_has_operation           (const gchar *operation_type);
-
-/**
- * gegl_operation_list_properties:
- * @operation_type: the name of the operation type we want to query to properties of.
- * @n_properties_p: (out caller-allocates): return location for number of properties.
- *
- * Return value: (transfer container) (array length=n_properties_p): An allocated array of #GParamSpecs 
describing the properties
- * of the operation available when a node has operation_type set. The list should be freed with g_free after 
use.
- */
-GParamSpec** gegl_operation_list_properties (const gchar   *operation_type,
-                                             guint         *n_properties_p);
-
-/***
- * GeglNode:
- *
- * The Node is the image processing primitive connected to create compositions
- * in GEGL. The toplevel #GeglNode which contains a graph of #GeglNodes is
- * created with #gegl_node_new. Using this toplevel node we can create children
- * of this node which are individual processing elements using #gegl_node_new_child
- *
- * A node either has an associated operation or is a parent for other nodes,
- * that are connected to their parent through proxies created with
- * #gegl_node_get_input_proxy and #gegl_node_get_output_proxy.
- *
- * The properties available on a node depends on which <a
- * href='operations.html'>operation</a> is specified.
- *
- * ---
- * GeglNode *gegl, *load, *bcontrast;
- *
- * gegl = gegl_node_new ();
- * load = gegl_node_new_child (gegl,
- *                             "operation", "load",
- *                             "path",      "input.png",
- *                             NULL);
- * bcontrast = gegl_node_new_child (gegl,
- *                                  "operation", "brightness-contrast",
- *                                  "brightness", 0.2,
- *                                  "contrast",   1.5,
- *                                  NULL);
- */
-
-/**
- * gegl_node_new:
- *
- * Create a new graph that can contain further processing nodes.
- *
- * Return value: (transfer full): A new top level #GeglNode (which can be used as a graph). When you
- * are done using this graph instance it should be unreferenced with g_object_unref.
- * This will also free any sub nodes created from this node.
- */
-GeglNode     * gegl_node_new             (void);
-
-/**
- * gegl_node_new_child:
- * @parent: a #GeglNode
- * @first_property_name: the first property name
- * @...: first property value, optionally followed by more key/value pairs, ended
- * terminated with NULL.
- *
- * Creates a new processing node that performs the specified operation with
- * a NULL terminated list of key/value pairs for initial parameter values
- * configuring the operation. Usually the first pair should be "operation"
- * and the type of operation to be associated. If no operation is provided
- * the node doesn't have an initial operation and can be used to construct
- * a subgraph with special middle-man routing nodes created with
- * #gegl_node_get_output_proxy and #gegl_node_get_input_proxy.
- *
- * Return value: (transfer none): A newly created #GeglNode. The node will be destroyed by the parent.
- * Calling g_object_unref on a node will cause the node to be dropped by the
- * parent. (You may also add additional references using
- * g_object_ref/g_object_unref, but in general relying on the parents reference
- * counting is easiest.)
- */
-GeglNode    * gegl_node_new_child        (GeglNode      *parent,
-                                          const gchar   *first_property_name,
-                                          ...) G_GNUC_NULL_TERMINATED;
-
-/***
- * Making connections:
- *
- * Nodes in GEGL are connected to each other. The resulting graph of nodes
- * represents the image processing pipeline to be processed.
- *
- * ---
- * gegl_node_link_many (background, over, png_save, NULL);
- * gegl_node_connect_to (translate, "output", over, "aux");
- * gegl_node_link_many (text, blur, translate, NULL);
- */
-
-/**
- * gegl_node_connect_from:
- * @sink: the node we're connecting an input to
- * @input_pad_name: the name of the input pad we are connecting to
- * @source: the node producing data we want to connect.
- * @output_pad_name: the output pad we want to use on the source.
- *
- * Makes a connection between the pads of two nodes.
- *
- * Returns TRUE if the connection was succesfully made.
- */
-
-gboolean      gegl_node_connect_from     (GeglNode      *sink,
-                                          const gchar   *input_pad_name,
-                                          GeglNode      *source,
-                                          const gchar   *output_pad_name);
-
-/**
- * gegl_node_connect_to:
- * @source: the node producing data we want to connect.
- * @output_pad_name: the output pad we want to use on the source.
- * @sink: the node we're connecting an input to
- * @input_pad_name: the name of the input pad we are connecting to
- *
- * Makes a connection between the pads of two nodes.
- *
- * Returns TRUE if the connection was succesfully made.
- */
-gboolean      gegl_node_connect_to       (GeglNode      *source,
-                                          const gchar   *output_pad_name,
-                                          GeglNode      *sink,
-                                          const gchar   *input_pad_name);
-
-
-/**
- * gegl_node_link:
- * @source: the producer of data.
- * @sink: the consumer of data.
- *
- * Synthetic sugar for linking the "output" pad of @source to the "input"
- * pad of @sink.
- */
-void          gegl_node_link             (GeglNode      *source,
-                                          GeglNode      *sink);
-
-/**
- * gegl_node_link_many:
- * @source: the producer of data.
- * @first_sink: the first consumer of data.
- * @...: NULL, or optionally more consumers followed by NULL.
- *
- * Synthetic sugar for linking a chain of nodes with "input"->"output". The
- * list is NULL terminated.
- */
-void          gegl_node_link_many        (GeglNode      *source,
-                                          GeglNode      *first_sink,
-                                          ...) G_GNUC_NULL_TERMINATED;
-
-/**
- * gegl_node_disconnect:
- * @node: a #GeglNode
- * @input_pad: the input pad to disconnect.
- *
- * Disconnects node connected to @input_pad of @node (if any).
- *
- * Returns TRUE if a connection was broken.
- */
-gboolean      gegl_node_disconnect       (GeglNode      *node,
-                                          const gchar   *input_pad);
-
-/***
- * Properties:
- *
- * Properties can be set either when creating the node with
- * #gegl_node_new_child as well as later when changing the initial
- * value with #gegl_node_set.
- *
- * To see what properties are available for a given operation look in the <a
- * href='operations.html'>Operations reference</a> or use
- * #gegl_node_get.
- */
-
-/**
- * gegl_node_set:
- * @node: a #GeglNode
- * @first_property_name: name of the first property to set
- * @...: value for the first property, followed optionally by more name/value
- * pairs, followed by NULL.
- *
- * Set properties on a node, possible properties to be set are the properties
- * of the currently set operations as well as <em>"name"</em> and
- * <em>"operation"</em>. <em>"operation"</em> changes the current operations
- * set for the node, <em>"name"</em> doesn't have any role internally in
- * GEGL.
- * ---
- * gegl_node_set (node, "brightness", -0.2,
- *                      "contrast",   2.0,
- *                      NULL);
- */
-void          gegl_node_set              (GeglNode      *node,
-                                          const gchar   *first_property_name,
-                                          ...) G_GNUC_NULL_TERMINATED;
-
-/**
- * gegl_node_set_valist:
- * @node: a #GeglNode
- * @first_property_name: name of the first property to set
- * @args: value for the first property, followed optionally by more name/value
- * pairs, followed by NULL.
- *
- * valist version of #gegl_node_set
- */
-void          gegl_node_set_valist       (GeglNode      *node,
-                                          const gchar   *first_property_name,
-                                          va_list        args);
-
-/**
- * gegl_node_get:
- * @node: a #GeglNode
- * @first_property_name: name of the first property to get.
- * @...: return location for the first property, followed optionally by more
- * name/value pairs, followed by NULL.
- *
- * Gets properties of a #GeglNode.
- * ---
- * double level;
- * char  *path;
- *
- * gegl_node_get (png_save, "path", &path, NULL);
- * gegl_node_get (threshold, "level", &level, NULL);
- */
-void          gegl_node_get              (GeglNode      *node,
-                                          const gchar   *first_property_name,
-                                          ...) G_GNUC_NULL_TERMINATED;
-
-/**
- * gegl_node_get_valist:
- * @node: a #GeglNode
- * @first_property_name: name of the first property to get.
- * @args: return location for the first property, followed optionally by more
- * name/value pairs, followed by NULL.
- *
- * valist version of #gegl_node_get
- */
-void          gegl_node_get_valist       (GeglNode      *node,
-                                          const gchar   *first_property_name,
-                                          va_list        args);
-
-
-/***
- * Processing:
- *
- * There are two different ways to do processing with GEGL, either you
- * query any node providing output for a rectangular region to be rendered
- * using #gegl_node_blit, or you use #gegl_node_process on a sink node (A
- * display node, an image file writer or similar). To do iterative processing
- * you need to use a #GeglProcessor. See #gegl_processor_work for a code
- * sample.
- */
-
-/**
- * gegl_node_blit: (skip)
- * @node: a #GeglNode
- * @scale: the scale to render at 1.0 is default, other values changes the
- * width/height of the sampled region.
- * @roi: the rectangle to render from the node, the coordinate system used is
- * coordinates after scale has been applied.
- * @format: the #BablFormat desired.
- * @destination_buf: a memory buffer large enough to contain the data, can be
- * left as NULL when forcing a rendering of a region.
- * @rowstride: rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the
- * rowstride based on the width and bytes per pixel for the specified format.
- * @flags: an or'ed combination of GEGL_BLIT_DEFAULT, GEGL_BLIT_CACHE and
- * GEGL_BLIT_DIRTY. if cache is enabled, a cache will be set up for subsequent
- * requests of image data from this node. By passing in GEGL_BLIT_DIRTY the
- * function will return with the latest rendered results in the cache without
- * regard to wheter the regions has been rendered or not.
- *
- * Render a rectangular region from a node.
- */
-void          gegl_node_blit             (GeglNode            *node,
-                                          gdouble              scale,
-                                          const GeglRectangle *roi,
-                                          const Babl          *format,
-                                          gpointer             destination_buf,
-                                          gint                 rowstride,
-                                          GeglBlitFlags        flags);
-
-/**
- * gegl_node_blit_buffer:
- * @node: a #GeglNode
- * @buffer: (transfer none) (allow-none): the #GeglBuffer to render to.
- * @roi: (allow-none): the rectangle to render.
- *
- * Render a rectangular region from a node to the given buffer.
- */
-void          gegl_node_blit_buffer      (GeglNode            *node,
-                                          GeglBuffer          *buffer,
-                                          const GeglRectangle *roi);
-
-/**
- * gegl_node_process:
- * @sink_node: a #GeglNode without outputs.
- *
- * Render a composition. This can be used for instance on a node with a "png-save"
- * operation to render all neccesary data, and make it be written to file. This
- * function wraps the usage of a GeglProcessor in a single blocking function
- * call. If you need a non-blocking operation, then make a direct use of
- * #gegl_processor_work. See #GeglProcessor.
- *
- * ---
- * GeglNode      *gegl;
- * GeglRectangle  roi;
- * GeglNode      *png_save;
- * unsigned char *buffer;
- *
- * gegl = gegl_parse_xml (xml_data);
- * roi      = gegl_node_get_bounding_box (gegl);
- * # create png_save from the graph, the parent/child relationship
- * # only mean anything when it comes to memory management.
- * png_save = gegl_node_new_child (gegl,
- *                                 "operation", "png-save",
- *                                 "path",      "output.png",
- *                                 NULL);
- *
- * gegl_node_link (gegl, png_save);
- * gegl_node_process (png_save);
- *
- * buffer = malloc (roi.w*roi.h*4);
- * gegl_node_blit (gegl,
- *                 &roi,
- *                 1.0,
- *                 babl_format("R'G'B'A u8",
- *                 roi.w*4,
- *                 buffer,
- *                 GEGL_BLIT_DEFAULT);
- */
-void          gegl_node_process          (GeglNode      *sink_node);
-
-
-/***
- * Reparenting:
- *
- * Sometimes it is useful to be able to move nodes between graphs or even
- * handle orphaned nods that are not part of a graph. gegl_node_adopt_child
- * and gegl_node_get_parent are provided to handle such cases.
- */
-
-/**
- * gegl_node_add_child:
- * @graph: a GeglNode (graph)
- * @child: a GeglNode.
- *
- * Make the GeglNode @graph, take a reference on child. This reference
- * will be dropped when the reference count on the graph reaches zero.
- *
- * Return value: (transfer none): the child.
- */
-GeglNode *    gegl_node_add_child           (GeglNode      *graph,
-                                             GeglNode      *child);
-
-/**
- * gegl_node_remove_child:
- * @graph: a GeglNode (graph)
- * @child: a GeglNode.
- *
- * Removes a child from a GeglNode. The reference previously held will be
- * dropped so increase the reference count before removing when reparenting
- * a child between two graphs.
- *
- * Return value: (transfer none): the child.
- */
-GeglNode *    gegl_node_remove_child        (GeglNode      *graph,
-                                             GeglNode      *child);
-
-/**
- * gegl_node_get_parent:
- * @node: a #GeglNode
- *
- * Returns a GeglNode that keeps a reference on a child.
- *
- * Return value: (transfer none): the parent of a node or NULL.
- */
-GeglNode    * gegl_node_get_parent         (GeglNode      *node);
-
-
-/***
- * State queries:
- *
- * This section lists functions that retrieve information, mostly needed
- * for interacting with a graph in a GUI, not creating one from scratch.
- *
- * You can figure out what the bounding box of a node is with #gegl_node_get_bounding_box,
- * retrieve the values of named properties using #gegl_node_get.
- */
-
-
-
-/**
- * gegl_node_detect:
- * @node: a #GeglNode
- * @x: x coordinate
- * @y: y coordinate
- *
- * Performs hit detection by returning the node providing data at a given
- * coordinate pair. Currently operates only on bounding boxes and not
- * pixel data.
- *
- * Return value: (transfer none): the GeglNode providing the 
- * data ending up at @x,@y in the output of @node.
- */
-GeglNode    * gegl_node_detect           (GeglNode      *node,
-                                          gint           x,
-                                          gint           y);
-
-
-/**
- * gegl_node_find_property:
- * @node: the node to lookup a paramspec on
- * @property_name: the name of the property to get a paramspec for.
- *
- * Return value: (transfer none): the GParamSpec of property or NULL
- * if no such property exists.
- */
-GParamSpec  * gegl_node_find_property    (GeglNode      *node,
-                                          const gchar   *property_name);
-
-
-
-/**
- * gegl_node_get_bounding_box: (skip)
- * @node: a #GeglNode
- *
- * Returns the position and dimensions of a rectangle spanning the area
- * defined by a node.
- */
-GeglRectangle gegl_node_get_bounding_box (GeglNode      *node);
-
-/**
- * gegl_node_get_children:
- * @node: the node to retrieve the children of.
- *
- * Return value: (element-type Gegl.Node) (transfer container): a list
- * of the nodes contained within a GeglNode that is a subgraph.
- * Use g_list_free () on the list when done.
- */
-GSList      * gegl_node_get_children     (GeglNode      *node);
-
-/**
- * gegl_node_get_consumers:
- * @node: the node we are querying.
- * @output_pad: the output pad we want to know who uses.
- * @nodes: (out callee-allocates) (array zero-terminated=1) (allow-none): optional return location for array 
of nodes.
- * @pads: (out callee-allocates) (array zero-terminated=1) (allow-none): optional return location for array 
of pad names.
- *
- * Retrieve which pads on which nodes are connected to a named output_pad,
- * and the number of connections. Both the location for the generated
- * nodes array and pads array can be left as NULL. If they are non NULL
- * both should be freed with g_free. The arrays are NULL terminated.
- *
- * Returns the number of consumers connected to this output_pad.
- */
-gint          gegl_node_get_consumers    (GeglNode      *node,
-                                          const gchar   *output_pad,
-                                          GeglNode    ***nodes,
-                                          const gchar ***pads);
-
-/**
- * gegl_node_get_input_proxy:
- * @node: a #GeglNode
- * @pad_name: the name of the pad.
- *
- * Proxies are used to route between nodes of a subgraph contained within
- * a node.
- *
- * Return value: (transfer none): Returns an input proxy for the named pad.
- * If no input proxy exists with this name a new one will be created.
- */
-GeglNode    * gegl_node_get_input_proxy  (GeglNode      *node,
-                                          const gchar   *pad_name);
-
-/**
- * gegl_node_get_operation:
- * @node: a #GeglNode
- *
- * Return value: The type of processing operation associated with this
- * node, or NULL if there is no op associated. The special name
- * "GraphNode" is returned if the node is the container of a subgraph.
- */
-const gchar * gegl_node_get_operation    (const GeglNode *node);
-
-/**
- * gegl_node_get_output_proxy:
- * @node: a #GeglNode
- * @pad_name: the name of the pad.
- *
- * Proxies are used to route between nodes of a subgraph contained within
- * a node.
- *
- * Return value: (transfer none):  Returns a output proxy for the named pad.
- * If no output proxy exists with this name a new one will be created.
- */
-GeglNode    * gegl_node_get_output_proxy (GeglNode      *node,
-                                          const gchar   *pad_name);
-
-/**
- * gegl_node_get_producer:
- * @node: the node we are querying
- * @input_pad_name: the input pad we want to get the producer for
- * @output_pad_name: (allow-none): optional pointer to a location where we can store a
- *                   freshly allocated string with the name of the output pad.
- *
- * Return value: (transfer none): the node providing data
- * or NULL if no node is connected to the input_pad.
- */
-GeglNode    * gegl_node_get_producer     (GeglNode      *node,
-                                          gchar         *input_pad_name,
-                                          gchar        **output_pad_name);
-
-/**
- * gegl_node_has_pad:
- * @node: the node we are querying
- * @pad_name: the pad name we are looking for
- *
- * Returns TRUE if the node has a pad with the specified name
- */
-gboolean      gegl_node_has_pad          (GeglNode      *node,
-                                          const gchar   *pad_name);
-
-
-/***
- * Binding conveniences:
- *
- * The following functions are mostly included to make it easier to create
- * language bindings for the nodes. The varargs versions will in most cases
- * lead to both more efficient and readable code from C.
- */
-
-/**
- * gegl_node_create_child:
- * @parent: a #GeglNode
- * @operation: the type of node to create.
- *
- * Creates a new processing node that performs the specified operation.
- * All properties of the operation will have their default values. This
- * is included as an addiiton to #gegl_node_new_child in the public API to have
- * a non varargs entry point for bindings as well as sometimes simpler more
- * readable code.
- *
- * Return value: (transfer none):a newly created node. The node will be destroyed by the parent.
- * Calling g_object_unref on a node will cause the node to be dropped by the
- * parent. (You may also add additional references using
- * g_object_ref/g_object_unref, but in general relying on the parents reference
- * counting is easiest.)
- */
-
-GeglNode     * gegl_node_create_child    (GeglNode      *parent,
-                                          const gchar   *operation);
-
-
-/**
- * gegl_node_get_property: (skip)
- * @node: the node to get a property from
- * @property_name: the name of the property to get
- * @value: (out): pointer to a GValue where the value of the property should be stored
- *
- * This is mainly included for language bindings. Using #gegl_node_get is
- * more convenient when programming in C.
- *
- */
-void          gegl_node_get_property     (GeglNode      *node,
-                                          const gchar   *property_name,
-                                          GValue        *value);
-
-/**
- * gegl_node_set_property:
- * @node: a #GeglNode
- * @property_name: the name of the property to set
- * @value: (in): a GValue containing the value to be set in the property.
- *
- * This is mainly included for language bindings. Using #gegl_node_set is
- * more convenient when programming in C.
- */
-void          gegl_node_set_property     (GeglNode      *node,
-                                          const gchar   *property_name,
-                                          const GValue  *value);
-
-/***
- * XML:
- * The XML format used by GEGL is not stable and should not be relied on
- * for anything but testing purposes yet.
- */
-
-/**
- * gegl_node_new_from_xml:
- * @xmldata: a \0 terminated string containing XML data to be parsed.
- * @path_root: a file system path that relative paths in the XML will be
- * resolved in relation to.
- *
- * The #GeglNode returned contains the graph described by the tree of stacks
- * in the XML document. The tree is connected to the "output" pad of the
- * returned node and thus can be used directly for processing.
- *
- * Return value: (transfer full): a GeglNode containing the parsed XML as a subgraph.
- */
-GeglNode    * gegl_node_new_from_xml     (const gchar   *xmldata,
-                                          const gchar   *path_root);
-
-/**
- * gegl_node_new_from_file:
- * @path: the path to a file on the local file system to be parsed.
- *
- * The #GeglNode returned contains the graph described by the tree of stacks
- * in the XML document. The tree is connected to the "output" pad of the
- * returned node and thus can be used directly for processing.
- *
- * Return value: (transfer full): a GeglNode containing the parsed XML as a subgraph.
- */
-GeglNode    * gegl_node_new_from_file    (const gchar   *path);
-
-/**
- * gegl_node_to_xml:
- * @node: a #GeglNode
- * @path_root: filesystem path to construct relative paths from.
- *
- * Returns a freshly allocated \0 terminated string containing a XML
- * serialization of the composition produced by a node (and thus also
- * the nodes contributing data to the specified node). To export a
- * gegl graph, connect the internal output node to an output proxy (see
- * #gegl_node_get_output_proxy.) and use the proxy node as the basis
- * for the serialization.
- */
-gchar       * gegl_node_to_xml           (GeglNode      *node,
-                                          const gchar   *path_root);
-/***
- * GeglProcessor:
- *
- * A #GeglProcessor, is a worker that can be used for background rendering
- * of regions in a node's cache. Or for processing a sink node. For most
- * non GUI tasks using #gegl_node_blit and #gegl_node_process directly
- * should be sufficient. See #gegl_processor_work for a code sample.
- *
- */
-
-/**
- * gegl_node_new_processor:
- * @node: a #GeglNode
- * @rectangle: the #GeglRectangle to work on or NULL to work on all available
- * data.
- *
- * Return value: (transfer full): a new #GeglProcessor.
- */
-GeglProcessor *gegl_node_new_processor      (GeglNode            *node,
-                                             const GeglRectangle *rectangle);
-
-/**
- * gegl_processor_set_rectangle:
- * @processor: a #GeglProcessor
- * @rectangle: the new #GeglRectangle the processor shold work on or NULL
- * to make it work on all data in the buffer.
- *
- * Change the rectangle a #GeglProcessor is working on.
- */
-void           gegl_processor_set_rectangle (GeglProcessor       *processor,
-                                             const GeglRectangle *rectangle);
-
-
-/**
- * gegl_processor_work:
- * @processor: a #GeglProcessor
- * @progress: (out caller-allocates): a location to store the (estimated) percentage complete.
- *
- * Do an iteration of work for the processor.
- *
- * Returns TRUE if there is more work to be done.
- *
- * ---
- * GeglProcessor *processor = gegl_node_new_processor (node, &roi);
- * double         progress;
- *
- * while (gegl_processor_work (processor, &progress))
- *   g_warning ("%f%% complete", progress);
- * g_object_unref (processor);
- */
-gboolean       gegl_processor_work          (GeglProcessor *processor,
-                                             gdouble       *progress);
-
-
-/***
- * GeglConfig:
- *
- * GEGL uses a singleton configuration object
- */
-
-/**
- * gegl_config:
- *
- * Returns a GeglConfig object with properties that can be manipulated to control
- * GEGLs behavior. Properties available on the object are:
- *
- * "tile-cache-size" "quality" and "swap", the first is a 64-bit integer denoting
- * number of bytes, the second a double value between 0 and 1 and the last
- * the path of the directory to swap to (or "ram" to not use diskbased swap)
- *
- * Return value: (transfer none): a #GeglConfig
- */
-GeglConfig      * gegl_config (void);
-
-/**
- * gegl_load_module_directory:
- * @path: the directory to load modules from
- *
- * Load all gegl modules found in the given directory.
- */
-void gegl_load_module_directory (const gchar *path);
-
-/**
- * gegl_apply_op:
- * @buffer: the #GeglBuffer to apply onto
- * @operation_name: name of the operation to apply
- * @...: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to buffer, overwritting the contents of buffer.
- *
- */
-void        gegl_apply_op  (GeglBuffer    *buffer,
-                            const gchar   *operation_name,
-                            ...) G_GNUC_NULL_TERMINATED;
-
-/**
- * gegl_filter_op:
- * @source_buffer: the source #GeglBuffer for the filter
- * @operation_name: name of the operation to apply
- * @...: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to source_buffer, returning the result in a new buffer.
- *
- * Return value: (transfer full): the result of the filter
- */
-GeglBuffer *gegl_filter_op (GeglBuffer    *source_buffer,
-                            const gchar   *operation_name,
-                            ...) G_GNUC_NULL_TERMINATED;
-
-
-/**
- * gegl_render_op:
- * @source_buffer: the source #GeglBuffer for the filter
- * @target_buffer: the source #GeglBuffer for the filter
- * @operation_name: name of the operation to apply
- * @...: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to source_buffer, writing the results to target_buffer.
- *
- */
-void        gegl_render_op (GeglBuffer    *source_buffer,
-                            GeglBuffer    *target_buffer,
-                            const gchar   *operation_name,
-                            ...) G_GNUC_NULL_TERMINATED;
-
-/* the following only exist to make gegl_apply and gegl_filter bindable */
-
-/**
- * gegl_apply_op_valist:
- * @buffer: the #GeglBuffer to apply onto
- * @operation_name: name of the operation to apply
- * @var_args: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to buffer, overwritting the contents of buffer.
- *
- */
-void        gegl_apply_op_valist (GeglBuffer    *buffer,
-                                  const gchar   *operation_name,
-                                  va_list        var_args);
-
-/**
- * gegl_filter_op_valist:
- * @source_buffer: the source #GeglBuffer for the filter
- * @operation_name: name of the operation to apply
- * @var_args: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to source_buffer, returning the result in a new buffer.
- *
- * Return value: (transfer full): the result of the filter
- */
-GeglBuffer *gegl_filter_op_valist (GeglBuffer   *source_buffer,
-                                   const gchar  *operation_name,
-                                   va_list       var_args);
-
-/**
- * gegl_render_op_valist:
- * @source_buffer: the source #GeglBuffer for the filter
- * @target_buffer: the source #GeglBuffer for the filter
- * @operation_name: name of the operation to apply
- * @var_args: the settings for the operation. Zero or more key/value pairs,
- * ended terminated with NULL.
- *
- * Apply the operation to source_buffer, writing the results to target_buffer.
- *
- */
-void        gegl_render_op_valist (GeglBuffer   *source_buffer,
-                                   GeglBuffer   *target_buffer,
-                                   const gchar  *operation_name,
-                                   va_list       var_args);
-
-
-
-
-
-
-/**
- * gegl_node: (skip)
- * @op_type:  the type of operation to create
- * @first_property_name:
- * @...:
- *
- * Construct a GEGL node, connecting it to needed input nodes. The
- * returned node does not have a parent but a single reference it
- * is meant to be passed to gegl_graph () for gegl_graph () to assume
- * its ownership. This is syntactic sugar for use from C, similar
- * conveniences can easily be built externally in other languages.
- *
- * gegl_node(op_type, [key, value, [...]], NULL, [input, [aux]])
- *
- * Return value: (transfer full): a new Gegl node.
- */
-GeglNode *gegl_node (const gchar *op_type,
-                     const gchar *first_property_name,
-                     ...) G_GNUC_DEPRECATED;
-
-
-/**
- * gegl_graph: (skip)
- * @node: (transfer full): the end result of a composition created with gegl_node()
- *
- * Creates a GeglNode containing a free floating graph constructed
- * using gegl_node(). The GeglGraph adopts all the passed in nodes
- * making it sufficient to unref the resulting graph.
- *
- * gegl_graph (gegl_node ("gegl:over", NULL,
- *                        gegl_node (..), gegl_node (..)));
- *
- * Return value: (transfer full):a GeglNode graph.
- */
-GeglNode *gegl_graph (GeglNode *node) G_GNUC_DEPRECATED;
-
-
 #define GEGL_ALIGNED __restrict__ __attribute__((__aligned__ (16)))
 
 G_END_DECLS
diff --git a/gegl/graph/Makefile.am b/gegl/graph/Makefile.am
index 34c9516..d02e7ad 100644
--- a/gegl/graph/Makefile.am
+++ b/gegl/graph/Makefile.am
@@ -31,6 +31,7 @@ libgraph_la_SOURCES = \
        \
        gegl-connection.h       \
        gegl-node.h             \
+       gegl-node-private.h     \
        gegl-pad.h              \
        gegl-visitor.h          \
        gegl-visitable.h
diff --git a/gegl/graph/gegl-node-private.h b/gegl/graph/gegl-node-private.h
new file mode 100644
index 0000000..80076b7
--- /dev/null
+++ b/gegl/graph/gegl-node-private.h
@@ -0,0 +1,138 @@
+/* This file is part of GEGL
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2003 Calvin Williamson
+ *           2006 Øyvind Kolås
+ */
+
+#ifndef __GEGL_NODE_PRIVATE_H__
+#define __GEGL_NODE_PRIVATE_H__
+
+#include "gegl-buffer.h"
+#include "gegl-cache.h"
+#include "gegl-node.h"
+
+G_BEGIN_DECLS
+
+#define GEGL_NODE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_NODE, GeglNodeClass))
+#define GEGL_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_NODE))
+#define GEGL_NODE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_NODE, GeglNodeClass))
+/* The rest is in gegl-types.h */
+
+
+typedef struct _GeglNodeClass   GeglNodeClass;
+typedef struct _GeglNodePrivate GeglNodePrivate;
+
+struct _GeglNode
+{
+  GObject         parent_instance;
+
+  /* The current operation associated with this node */
+  GeglOperation  *operation;
+
+  /* The region for which this node provides pixel data */
+  GeglRectangle   have_rect;
+
+  /* If TRUE the above have_rect is correct and can be returned
+   * directly instead of computed
+   */
+  gboolean        valid_have_rect;
+
+  /* All the pads on this node, depends on operation */
+  GSList         *pads;
+
+  /* The input pads */
+  GSList         *input_pads;
+
+  /* The output pads */
+  GSList         *output_pads;
+
+  /* If a node is a graph it means it has children. Typically the
+   * children connect to the input/output proxies of their graph
+   * node. This results in that the graph node can more or less be
+   * transparently treated as a normal node in most contexts
+   */
+  gboolean        is_graph;
+
+  /* For a node, the cache should be created at first demand if
+   * applicable, and the cache object reused for all subsequent
+   * requests for the cache object.
+   */
+  GeglCache      *cache;
+
+  /* Whether result is cached or not, inherited by children */
+  gboolean        dont_cache;
+
+  gboolean        use_opencl;
+
+  GMutex          mutex;
+
+  /*< private >*/
+  GeglNodePrivate *priv;
+};
+
+struct _GeglNodeClass
+{
+  GObjectClass parent_class;
+};
+
+/* functions below are internal to gegl */
+
+GType         gegl_node_get_type            (void) G_GNUC_CONST;
+
+void          gegl_node_add_pad             (GeglNode      *self,
+                                             GeglPad       *pad);
+void          gegl_node_remove_pad          (GeglNode      *self,
+                                             GeglPad       *pad);
+GeglPad     * gegl_node_get_pad             (GeglNode      *self,
+                                             const gchar   *name);
+GSList      * gegl_node_get_pads            (GeglNode      *self);
+GSList      * gegl_node_get_input_pads      (GeglNode      *self);
+GSList      * gegl_node_get_sinks           (GeglNode      *self);
+gint          gegl_node_get_num_sinks       (GeglNode      *self);
+
+void          gegl_node_dump_depends_on     (GeglNode      *self);
+void          gegl_node_set_property        (GeglNode      *object,
+                                             const gchar   *property_name,
+                                             const GValue  *value);
+
+/* Graph related member functions of the GeglNode class */
+GeglNode *    gegl_node_get_nth_child       (GeglNode      *self,
+                                             gint           n);
+void          gegl_node_remove_children     (GeglNode      *self);
+gint          gegl_node_get_num_children    (GeglNode      *self);
+
+const gchar * gegl_node_get_debug_name      (GeglNode      *node);
+
+void          gegl_node_insert_before       (GeglNode      *self,
+                                             GeglNode      *to_be_inserted);
+
+GeglCache   * gegl_node_get_cache           (GeglNode      *node);
+void          gegl_node_invalidated         (GeglNode      *node,
+                                             const GeglRectangle *rect,
+                                             gboolean             clean_cache);
+
+const gchar * gegl_node_get_name            (GeglNode      *self);
+void          gegl_node_set_name            (GeglNode      *self,
+                                             const gchar   *name);
+void
+gegl_node_emit_computed (GeglNode *node,
+                         const GeglRectangle *rect);
+
+#define GEGL_MAX_THREADS 16
+
+G_END_DECLS
+
+#endif /* __GEGL_NODE_PRIVATE_H__ */
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index bc44da6..2514dc0 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -29,7 +29,7 @@
 
 #include "gegl.h"
 #include "gegl-debug.h"
-#include "gegl-node.h"
+#include "gegl-node-private.h"
 #include "gegl-connection.h"
 #include "gegl-pad.h"
 #include "gegl-utils.h"
@@ -43,7 +43,6 @@
 #include "operation/gegl-operation-meta.h"
 
 #include "process/gegl-eval-manager.h"
-#include "process/gegl-processor.h"
 
 enum
 {
diff --git a/gegl/graph/gegl-node.h b/gegl/graph/gegl-node.h
index 9e11716..e649571 100644
--- a/gegl/graph/gegl-node.h
+++ b/gegl/graph/gegl-node.h
@@ -20,210 +20,620 @@
 #ifndef __GEGL_NODE_H__
 #define __GEGL_NODE_H__
 
-#include <gegl/buffer/gegl-buffer.h>
-#include <gegl/buffer/gegl-cache.h>
-
 G_BEGIN_DECLS
 
-#define GEGL_NODE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_NODE, GeglNodeClass))
-#define GEGL_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_NODE))
-#define GEGL_NODE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_NODE, GeglNodeClass))
-/* The rest is in gegl-types.h */
+/***
+ * GeglNode:
+ *
+ * The Node is the image processing primitive connected to create compositions
+ * in GEGL. The toplevel #GeglNode which contains a graph of #GeglNodes is
+ * created with #gegl_node_new. Using this toplevel node we can create children
+ * of this node which are individual processing elements using #gegl_node_new_child
+ *
+ * A node either has an associated operation or is a parent for other nodes,
+ * that are connected to their parent through proxies created with
+ * #gegl_node_get_input_proxy and #gegl_node_get_output_proxy.
+ *
+ * The properties available on a node depends on which <a
+ * href='operations.html'>operation</a> is specified.
+ *
+ * ---
+ * GeglNode *gegl, *load, *bcontrast;
+ *
+ * gegl = gegl_node_new ();
+ * load = gegl_node_new_child (gegl,
+ *                             "operation", "load",
+ *                             "path",      "input.png",
+ *                             NULL);
+ * bcontrast = gegl_node_new_child (gegl,
+ *                                  "operation", "brightness-contrast",
+ *                                  "brightness", 0.2,
+ *                                  "contrast",   1.5,
+ *                                  NULL);
+ */
+
+/**
+ * gegl_node_new:
+ *
+ * Create a new graph that can contain further processing nodes.
+ *
+ * Return value: (transfer full): A new top level #GeglNode (which can be used as a graph). When you
+ * are done using this graph instance it should be unreferenced with g_object_unref.
+ * This will also free any sub nodes created from this node.
+ */
+GeglNode     * gegl_node_new             (void);
+
+/**
+ * gegl_node_new_child:
+ * @parent: a #GeglNode
+ * @first_property_name: the first property name
+ * @...: first property value, optionally followed by more key/value pairs, ended
+ * terminated with NULL.
+ *
+ * Creates a new processing node that performs the specified operation with
+ * a NULL terminated list of key/value pairs for initial parameter values
+ * configuring the operation. Usually the first pair should be "operation"
+ * and the type of operation to be associated. If no operation is provided
+ * the node doesn't have an initial operation and can be used to construct
+ * a subgraph with special middle-man routing nodes created with
+ * #gegl_node_get_output_proxy and #gegl_node_get_input_proxy.
+ *
+ * Return value: (transfer none): A newly created #GeglNode. The node will be destroyed by the parent.
+ * Calling g_object_unref on a node will cause the node to be dropped by the
+ * parent. (You may also add additional references using
+ * g_object_ref/g_object_unref, but in general relying on the parents reference
+ * counting is easiest.)
+ */
+GeglNode    * gegl_node_new_child        (GeglNode      *parent,
+                                          const gchar   *first_property_name,
+                                          ...) G_GNUC_NULL_TERMINATED;
 
+/***
+ * Making connections:
+ *
+ * Nodes in GEGL are connected to each other. The resulting graph of nodes
+ * represents the image processing pipeline to be processed.
+ *
+ * ---
+ * gegl_node_link_many (background, over, png_save, NULL);
+ * gegl_node_connect_to (translate, "output", over, "aux");
+ * gegl_node_link_many (text, blur, translate, NULL);
+ */
 
-typedef struct _GeglNodeClass   GeglNodeClass;
-typedef struct _GeglNodePrivate GeglNodePrivate;
+/**
+ * gegl_node_connect_from:
+ * @sink: the node we're connecting an input to
+ * @input_pad_name: the name of the input pad we are connecting to
+ * @source: the node producing data we want to connect.
+ * @output_pad_name: the output pad we want to use on the source.
+ *
+ * Makes a connection between the pads of two nodes.
+ *
+ * Returns TRUE if the connection was succesfully made.
+ */
 
-struct _GeglNode
-{
-  GObject         parent_instance;
+gboolean      gegl_node_connect_from     (GeglNode      *sink,
+                                          const gchar   *input_pad_name,
+                                          GeglNode      *source,
+                                          const gchar   *output_pad_name);
+
+/**
+ * gegl_node_connect_to:
+ * @source: the node producing data we want to connect.
+ * @output_pad_name: the output pad we want to use on the source.
+ * @sink: the node we're connecting an input to
+ * @input_pad_name: the name of the input pad we are connecting to
+ *
+ * Makes a connection between the pads of two nodes.
+ *
+ * Returns TRUE if the connection was succesfully made.
+ */
+gboolean      gegl_node_connect_to       (GeglNode      *source,
+                                          const gchar   *output_pad_name,
+                                          GeglNode      *sink,
+                                          const gchar   *input_pad_name);
 
-  /* The current operation associated with this node */
-  GeglOperation  *operation;
 
-  /* The region for which this node provides pixel data */
-  GeglRectangle   have_rect;
+/**
+ * gegl_node_link:
+ * @source: the producer of data.
+ * @sink: the consumer of data.
+ *
+ * Synthetic sugar for linking the "output" pad of @source to the "input"
+ * pad of @sink.
+ */
+void          gegl_node_link             (GeglNode      *source,
+                                          GeglNode      *sink);
+
+/**
+ * gegl_node_link_many:
+ * @source: the producer of data.
+ * @first_sink: the first consumer of data.
+ * @...: NULL, or optionally more consumers followed by NULL.
+ *
+ * Synthetic sugar for linking a chain of nodes with "input"->"output". The
+ * list is NULL terminated.
+ */
+void          gegl_node_link_many        (GeglNode      *source,
+                                          GeglNode      *first_sink,
+                                          ...) G_GNUC_NULL_TERMINATED;
+
+/**
+ * gegl_node_disconnect:
+ * @node: a #GeglNode
+ * @input_pad: the input pad to disconnect.
+ *
+ * Disconnects node connected to @input_pad of @node (if any).
+ *
+ * Returns TRUE if a connection was broken.
+ */
+gboolean      gegl_node_disconnect       (GeglNode      *node,
+                                          const gchar   *input_pad);
 
-  /* If TRUE the above have_rect is correct and can be returned
-   * directly instead of computed
-   */
-  gboolean        valid_have_rect;
+/***
+ * Properties:
+ *
+ * Properties can be set either when creating the node with
+ * #gegl_node_new_child as well as later when changing the initial
+ * value with #gegl_node_set.
+ *
+ * To see what properties are available for a given operation look in the <a
+ * href='operations.html'>Operations reference</a> or use
+ * #gegl_node_get.
+ */
 
-  /* All the pads on this node, depends on operation */
-  GSList         *pads;
-
-  /* The input pads */
-  GSList         *input_pads;
-
-  /* The output pads */
-  GSList         *output_pads;
-
-  /* If a node is a graph it means it has children. Typically the
-   * children connect to the input/output proxies of their graph
-   * node. This results in that the graph node can more or less be
-   * transparently treated as a normal node in most contexts
-   */
-  gboolean        is_graph;
-
-  /* For a node, the cache should be created at first demand if
-   * applicable, and the cache object reused for all subsequent
-   * requests for the cache object.
-   */
-  GeglCache      *cache;
-
-  /* Whether result is cached or not, inherited by children */
-  gboolean        dont_cache;
-
-  gboolean        use_opencl;
-
-  GMutex          mutex;
-
-  /*< private >*/
-  GeglNodePrivate *priv;
-};
-
-struct _GeglNodeClass
-{
-  GObjectClass parent_class;
-};
-
-/* renders the desired region of interest to a buffer of the specified
- * bablformat */
-void          gegl_node_blit                (GeglNode            *node,
-                                             gdouble              scale,
-                                             const GeglRectangle *roi,
-                                             const Babl          *format,
-                                             gpointer             destination_buf,
-                                             gint                 rowstride,
-                                             GeglBlitFlags        flags);
-
-void          gegl_node_blit_buffer         (GeglNode            *self,
-                                             GeglBuffer          *buffer,
-                                             const GeglRectangle *roi);
-
-void          gegl_node_process             (GeglNode      *self);
-void          gegl_node_link                (GeglNode      *source,
-                                             GeglNode      *sink);
-
-void          gegl_node_link_many           (GeglNode      *source,
-                                             GeglNode      *dest,
-                                             ...) G_GNUC_NULL_TERMINATED;
-
-gboolean      gegl_node_connect_from        (GeglNode      *self,
-                                             const gchar   *input_pad_name,
-                                             GeglNode      *source,
-                                             const gchar   *output_pad_name);
-
-gboolean      gegl_node_connect_to          (GeglNode      *self,
-                                             const gchar   *output_pad_name,
-                                             GeglNode      *sink,
-                                             const gchar   *input_pad_name);
-
-gboolean      gegl_node_disconnect          (GeglNode      *self,
-                                             const gchar   *input_pad_name);
-
-void          gegl_node_set                 (GeglNode      *self,
-                                             const gchar   *first_property_name,
-                                             ...) G_GNUC_NULL_TERMINATED;
-void          gegl_node_get                 (GeglNode      *self,
-                                             const gchar   *first_property_name,
-                                             ...) G_GNUC_NULL_TERMINATED;
-
-
-
-GeglNode    * gegl_node_get_parent          (GeglNode      *self);
-
-/* functions below are internal to gegl */
-
-GType         gegl_node_get_type            (void) G_GNUC_CONST;
-
-void          gegl_node_add_pad             (GeglNode      *self,
-                                             GeglPad       *pad);
-void          gegl_node_remove_pad          (GeglNode      *self,
-                                             GeglPad       *pad);
-gboolean      gegl_node_has_pad             (GeglNode      *self,
-                                             const gchar   *name);
-GeglPad     * gegl_node_get_pad             (GeglNode      *self,
-                                             const gchar   *name);
-GSList      * gegl_node_get_pads            (GeglNode      *self);
-GSList      * gegl_node_get_input_pads      (GeglNode      *self);
-GSList      * gegl_node_get_sinks           (GeglNode      *self);
-gint          gegl_node_get_num_sinks       (GeglNode      *self);
-GeglNode    * gegl_node_get_producer        (GeglNode      *self,
-                                             gchar         *pad_name,
-                                             gchar        **output_pad);
-void          gegl_node_dump_depends_on     (GeglNode      *self);
-void          gegl_node_set_valist          (GeglNode      *object,
-                                             const gchar   *first_property_name,
-                                             va_list        var_args);
-void          gegl_node_get_valist          (GeglNode      *object,
-                                             const gchar   *first_property_name,
-                                             va_list        var_args);
-void          gegl_node_set_property        (GeglNode      *object,
-                                             const gchar   *property_name,
-                                             const GValue  *value);
-void          gegl_node_get_property        (GeglNode      *object,
-                                             const gchar   *property_name,
-                                             GValue        *value);
-GParamSpec *  gegl_node_find_property       (GeglNode      *self,
-                                             const gchar   *property_name);
-void          gegl_node_set_need_rect       (GeglNode      *node,
-                                             gpointer       context_id,
-                                             const GeglRectangle *rect);
-
-
-/* Graph related member functions of the GeglNode class */
-
-GeglNode *    gegl_node_add_child           (GeglNode      *self,
+/**
+ * gegl_node_set:
+ * @node: a #GeglNode
+ * @first_property_name: name of the first property to set
+ * @...: value for the first property, followed optionally by more name/value
+ * pairs, followed by NULL.
+ *
+ * Set properties on a node, possible properties to be set are the properties
+ * of the currently set operations as well as <em>"name"</em> and
+ * <em>"operation"</em>. <em>"operation"</em> changes the current operations
+ * set for the node, <em>"name"</em> doesn't have any role internally in
+ * GEGL.
+ * ---
+ * gegl_node_set (node, "brightness", -0.2,
+ *                      "contrast",   2.0,
+ *                      NULL);
+ */
+void          gegl_node_set              (GeglNode      *node,
+                                          const gchar   *first_property_name,
+                                          ...) G_GNUC_NULL_TERMINATED;
+
+/**
+ * gegl_node_set_valist:
+ * @node: a #GeglNode
+ * @first_property_name: name of the first property to set
+ * @args: value for the first property, followed optionally by more name/value
+ * pairs, followed by NULL.
+ *
+ * valist version of #gegl_node_set
+ */
+void          gegl_node_set_valist       (GeglNode      *node,
+                                          const gchar   *first_property_name,
+                                          va_list        args);
+
+/**
+ * gegl_node_get:
+ * @node: a #GeglNode
+ * @first_property_name: name of the first property to get.
+ * @...: return location for the first property, followed optionally by more
+ * name/value pairs, followed by NULL.
+ *
+ * Gets properties of a #GeglNode.
+ * ---
+ * double level;
+ * char  *path;
+ *
+ * gegl_node_get (png_save, "path", &path, NULL);
+ * gegl_node_get (threshold, "level", &level, NULL);
+ */
+void          gegl_node_get              (GeglNode      *node,
+                                          const gchar   *first_property_name,
+                                          ...) G_GNUC_NULL_TERMINATED;
+
+/**
+ * gegl_node_get_valist:
+ * @node: a #GeglNode
+ * @first_property_name: name of the first property to get.
+ * @args: return location for the first property, followed optionally by more
+ * name/value pairs, followed by NULL.
+ *
+ * valist version of #gegl_node_get
+ */
+void          gegl_node_get_valist       (GeglNode      *node,
+                                          const gchar   *first_property_name,
+                                          va_list        args);
+
+
+/***
+ * Processing:
+ *
+ * There are two different ways to do processing with GEGL, either you
+ * query any node providing output for a rectangular region to be rendered
+ * using #gegl_node_blit, or you use #gegl_node_process on a sink node (A
+ * display node, an image file writer or similar). To do iterative processing
+ * you need to use a #GeglProcessor. See #gegl_processor_work for a code
+ * sample.
+ */
+
+/**
+ * gegl_node_blit: (skip)
+ * @node: a #GeglNode
+ * @scale: the scale to render at 1.0 is default, other values changes the
+ * width/height of the sampled region.
+ * @roi: the rectangle to render from the node, the coordinate system used is
+ * coordinates after scale has been applied.
+ * @format: the #BablFormat desired.
+ * @destination_buf: a memory buffer large enough to contain the data, can be
+ * left as NULL when forcing a rendering of a region.
+ * @rowstride: rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the
+ * rowstride based on the width and bytes per pixel for the specified format.
+ * @flags: an or'ed combination of GEGL_BLIT_DEFAULT, GEGL_BLIT_CACHE and
+ * GEGL_BLIT_DIRTY. if cache is enabled, a cache will be set up for subsequent
+ * requests of image data from this node. By passing in GEGL_BLIT_DIRTY the
+ * function will return with the latest rendered results in the cache without
+ * regard to wheter the regions has been rendered or not.
+ *
+ * Render a rectangular region from a node.
+ */
+void          gegl_node_blit             (GeglNode            *node,
+                                          gdouble              scale,
+                                          const GeglRectangle *roi,
+                                          const Babl          *format,
+                                          gpointer             destination_buf,
+                                          gint                 rowstride,
+                                          GeglBlitFlags        flags);
+
+/**
+ * gegl_node_blit_buffer:
+ * @node: a #GeglNode
+ * @buffer: (transfer none) (allow-none): the #GeglBuffer to render to.
+ * @roi: (allow-none): the rectangle to render.
+ *
+ * Render a rectangular region from a node to the given buffer.
+ */
+void          gegl_node_blit_buffer      (GeglNode            *node,
+                                          GeglBuffer          *buffer,
+                                          const GeglRectangle *roi);
+
+/**
+ * gegl_node_process:
+ * @sink_node: a #GeglNode without outputs.
+ *
+ * Render a composition. This can be used for instance on a node with a "png-save"
+ * operation to render all neccesary data, and make it be written to file. This
+ * function wraps the usage of a GeglProcessor in a single blocking function
+ * call. If you need a non-blocking operation, then make a direct use of
+ * #gegl_processor_work. See #GeglProcessor.
+ *
+ * ---
+ * GeglNode      *gegl;
+ * GeglRectangle  roi;
+ * GeglNode      *png_save;
+ * unsigned char *buffer;
+ *
+ * gegl = gegl_parse_xml (xml_data);
+ * roi      = gegl_node_get_bounding_box (gegl);
+ * # create png_save from the graph, the parent/child relationship
+ * # only mean anything when it comes to memory management.
+ * png_save = gegl_node_new_child (gegl,
+ *                                 "operation", "png-save",
+ *                                 "path",      "output.png",
+ *                                 NULL);
+ *
+ * gegl_node_link (gegl, png_save);
+ * gegl_node_process (png_save);
+ *
+ * buffer = malloc (roi.w*roi.h*4);
+ * gegl_node_blit (gegl,
+ *                 &roi,
+ *                 1.0,
+ *                 babl_format("R'G'B'A u8",
+ *                 roi.w*4,
+ *                 buffer,
+ *                 GEGL_BLIT_DEFAULT);
+ */
+void          gegl_node_process          (GeglNode      *sink_node);
+
+
+/***
+ * Reparenting:
+ *
+ * Sometimes it is useful to be able to move nodes between graphs or even
+ * handle orphaned nods that are not part of a graph. gegl_node_adopt_child
+ * and gegl_node_get_parent are provided to handle such cases.
+ */
+
+/**
+ * gegl_node_add_child:
+ * @graph: a GeglNode (graph)
+ * @child: a GeglNode.
+ *
+ * Make the GeglNode @graph, take a reference on child. This reference
+ * will be dropped when the reference count on the graph reaches zero.
+ *
+ * Return value: (transfer none): the child.
+ */
+GeglNode *    gegl_node_add_child           (GeglNode      *graph,
                                              GeglNode      *child);
-GeglNode *    gegl_node_remove_child        (GeglNode      *self,
+
+/**
+ * gegl_node_remove_child:
+ * @graph: a GeglNode (graph)
+ * @child: a GeglNode.
+ *
+ * Removes a child from a GeglNode. The reference previously held will be
+ * dropped so increase the reference count before removing when reparenting
+ * a child between two graphs.
+ *
+ * Return value: (transfer none): the child.
+ */
+GeglNode *    gegl_node_remove_child        (GeglNode      *graph,
                                              GeglNode      *child);
-GeglNode *    gegl_node_get_nth_child       (GeglNode      *self,
-                                             gint           n);
-GSList   *    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_child           (GeglNode      *self,
-                                             const gchar   *first_property_name,
-                                             ...) G_GNUC_NULL_TERMINATED;
-GeglNode *    gegl_node_create_child        (GeglNode      *self,
-                                             const gchar   *operation);
-GeglNode *    gegl_node_get_input_proxy     (GeglNode      *graph,
-                                             const gchar   *name);
-GeglNode *    gegl_node_get_output_proxy    (GeglNode      *graph,
-                                             const gchar   *name);
-
-const gchar * gegl_node_get_operation       (const GeglNode*node);
-
-const gchar * gegl_node_get_debug_name      (GeglNode      *node);
-
-GeglNode    * gegl_node_detect              (GeglNode      *root,
-                                             gint           x,
-                                             gint           y);
-void          gegl_node_insert_before       (GeglNode      *self,
-                                             GeglNode      *to_be_inserted);
-gint          gegl_node_get_consumers       (GeglNode      *node,
-                                             const gchar   *output_pad,
-                                             GeglNode    ***nodes,
-                                             const gchar ***pads);
-
-GeglCache   * gegl_node_get_cache           (GeglNode      *node);
-void          gegl_node_invalidated         (GeglNode      *node,
-                                             const GeglRectangle *rect,
-                                             gboolean             clean_cache);
-GeglRectangle gegl_node_get_bounding_box    (GeglNode      *root);
-
-const gchar * gegl_node_get_name            (GeglNode      *self);
-void          gegl_node_set_name            (GeglNode      *self,
-                                             const gchar   *name);
-void
-gegl_node_emit_computed (GeglNode *node,
-                         const GeglRectangle *rect);
-
-#define GEGL_MAX_THREADS 16
+
+/**
+ * gegl_node_get_parent:
+ * @node: a #GeglNode
+ *
+ * Returns a GeglNode that keeps a reference on a child.
+ *
+ * Return value: (transfer none): the parent of a node or NULL.
+ */
+GeglNode    * gegl_node_get_parent         (GeglNode      *node);
+
+
+/***
+ * State queries:
+ *
+ * This section lists functions that retrieve information, mostly needed
+ * for interacting with a graph in a GUI, not creating one from scratch.
+ *
+ * You can figure out what the bounding box of a node is with #gegl_node_get_bounding_box,
+ * retrieve the values of named properties using #gegl_node_get.
+ */
+
+
+
+/**
+ * gegl_node_detect:
+ * @node: a #GeglNode
+ * @x: x coordinate
+ * @y: y coordinate
+ *
+ * Performs hit detection by returning the node providing data at a given
+ * coordinate pair. Currently operates only on bounding boxes and not
+ * pixel data.
+ *
+ * Return value: (transfer none): the GeglNode providing the
+ * data ending up at @x,@y in the output of @node.
+ */
+GeglNode    * gegl_node_detect           (GeglNode      *node,
+                                          gint           x,
+                                          gint           y);
+
+
+/**
+ * gegl_node_find_property:
+ * @node: the node to lookup a paramspec on
+ * @property_name: the name of the property to get a paramspec for.
+ *
+ * Return value: (transfer none): the GParamSpec of property or NULL
+ * if no such property exists.
+ */
+GParamSpec  * gegl_node_find_property    (GeglNode      *node,
+                                          const gchar   *property_name);
+
+
+
+/**
+ * gegl_node_get_bounding_box: (skip)
+ * @node: a #GeglNode
+ *
+ * Returns the position and dimensions of a rectangle spanning the area
+ * defined by a node.
+ */
+GeglRectangle gegl_node_get_bounding_box (GeglNode      *node);
+
+/**
+ * gegl_node_get_children:
+ * @node: the node to retrieve the children of.
+ *
+ * Return value: (element-type Gegl.Node) (transfer container): a list
+ * of the nodes contained within a GeglNode that is a subgraph.
+ * Use g_list_free () on the list when done.
+ */
+GSList      * gegl_node_get_children     (GeglNode      *node);
+
+/**
+ * gegl_node_get_consumers:
+ * @node: the node we are querying.
+ * @output_pad: the output pad we want to know who uses.
+ * @nodes: (out callee-allocates) (array zero-terminated=1) (allow-none): optional return location for array 
of nodes.
+ * @pads: (out callee-allocates) (array zero-terminated=1) (allow-none): optional return location for array 
of pad names.
+ *
+ * Retrieve which pads on which nodes are connected to a named output_pad,
+ * and the number of connections. Both the location for the generated
+ * nodes array and pads array can be left as NULL. If they are non NULL
+ * both should be freed with g_free. The arrays are NULL terminated.
+ *
+ * Returns the number of consumers connected to this output_pad.
+ */
+gint          gegl_node_get_consumers    (GeglNode      *node,
+                                          const gchar   *output_pad,
+                                          GeglNode    ***nodes,
+                                          const gchar ***pads);
+
+/**
+ * gegl_node_get_input_proxy:
+ * @node: a #GeglNode
+ * @pad_name: the name of the pad.
+ *
+ * Proxies are used to route between nodes of a subgraph contained within
+ * a node.
+ *
+ * Return value: (transfer none): Returns an input proxy for the named pad.
+ * If no input proxy exists with this name a new one will be created.
+ */
+GeglNode    * gegl_node_get_input_proxy  (GeglNode      *node,
+                                          const gchar   *pad_name);
+
+/**
+ * gegl_node_get_operation:
+ * @node: a #GeglNode
+ *
+ * Return value: The type of processing operation associated with this
+ * node, or NULL if there is no op associated. The special name
+ * "GraphNode" is returned if the node is the container of a subgraph.
+ */
+const gchar * gegl_node_get_operation    (const GeglNode *node);
+
+/**
+ * gegl_node_get_output_proxy:
+ * @node: a #GeglNode
+ * @pad_name: the name of the pad.
+ *
+ * Proxies are used to route between nodes of a subgraph contained within
+ * a node.
+ *
+ * Return value: (transfer none):  Returns a output proxy for the named pad.
+ * If no output proxy exists with this name a new one will be created.
+ */
+GeglNode    * gegl_node_get_output_proxy (GeglNode      *node,
+                                          const gchar   *pad_name);
+
+/**
+ * gegl_node_get_producer:
+ * @node: the node we are querying
+ * @input_pad_name: the input pad we want to get the producer for
+ * @output_pad_name: (allow-none): optional pointer to a location where we can store a
+ *                   freshly allocated string with the name of the output pad.
+ *
+ * Return value: (transfer none): the node providing data
+ * or NULL if no node is connected to the input_pad.
+ */
+GeglNode    * gegl_node_get_producer     (GeglNode      *node,
+                                          gchar         *input_pad_name,
+                                          gchar        **output_pad_name);
+
+/**
+ * gegl_node_has_pad:
+ * @node: the node we are querying
+ * @pad_name: the pad name we are looking for
+ *
+ * Returns TRUE if the node has a pad with the specified name
+ */
+gboolean      gegl_node_has_pad          (GeglNode      *node,
+                                          const gchar   *pad_name);
+
+
+/***
+ * Binding conveniences:
+ *
+ * The following functions are mostly included to make it easier to create
+ * language bindings for the nodes. The varargs versions will in most cases
+ * lead to both more efficient and readable code from C.
+ */
+
+/**
+ * gegl_node_create_child:
+ * @parent: a #GeglNode
+ * @operation: the type of node to create.
+ *
+ * Creates a new processing node that performs the specified operation.
+ * All properties of the operation will have their default values. This
+ * is included as an addiiton to #gegl_node_new_child in the public API to have
+ * a non varargs entry point for bindings as well as sometimes simpler more
+ * readable code.
+ *
+ * Return value: (transfer none):a newly created node. The node will be destroyed by the parent.
+ * Calling g_object_unref on a node will cause the node to be dropped by the
+ * parent. (You may also add additional references using
+ * g_object_ref/g_object_unref, but in general relying on the parents reference
+ * counting is easiest.)
+ */
+
+GeglNode     * gegl_node_create_child    (GeglNode      *parent,
+                                          const gchar   *operation);
+
+
+/**
+ * gegl_node_get_property: (skip)
+ * @node: the node to get a property from
+ * @property_name: the name of the property to get
+ * @value: (out): pointer to a GValue where the value of the property should be stored
+ *
+ * This is mainly included for language bindings. Using #gegl_node_get is
+ * more convenient when programming in C.
+ *
+ */
+void          gegl_node_get_property     (GeglNode      *node,
+                                          const gchar   *property_name,
+                                          GValue        *value);
+
+/**
+ * gegl_node_set_property:
+ * @node: a #GeglNode
+ * @property_name: the name of the property to set
+ * @value: (in): a GValue containing the value to be set in the property.
+ *
+ * This is mainly included for language bindings. Using #gegl_node_set is
+ * more convenient when programming in C.
+ */
+void          gegl_node_set_property     (GeglNode      *node,
+                                          const gchar   *property_name,
+                                          const GValue  *value);
+
+/***
+ * XML:
+ * The XML format used by GEGL is not stable and should not be relied on
+ * for anything but testing purposes yet.
+ */
+
+/**
+ * gegl_node_new_from_xml:
+ * @xmldata: a \0 terminated string containing XML data to be parsed.
+ * @path_root: a file system path that relative paths in the XML will be
+ * resolved in relation to.
+ *
+ * The #GeglNode returned contains the graph described by the tree of stacks
+ * in the XML document. The tree is connected to the "output" pad of the
+ * returned node and thus can be used directly for processing.
+ *
+ * Return value: (transfer full): a GeglNode containing the parsed XML as a subgraph.
+ */
+GeglNode    * gegl_node_new_from_xml     (const gchar   *xmldata,
+                                          const gchar   *path_root);
+
+/**
+ * gegl_node_new_from_file:
+ * @path: the path to a file on the local file system to be parsed.
+ *
+ * The #GeglNode returned contains the graph described by the tree of stacks
+ * in the XML document. The tree is connected to the "output" pad of the
+ * returned node and thus can be used directly for processing.
+ *
+ * Return value: (transfer full): a GeglNode containing the parsed XML as a subgraph.
+ */
+GeglNode    * gegl_node_new_from_file    (const gchar   *path);
+
+/**
+ * gegl_node_to_xml:
+ * @node: a #GeglNode
+ * @path_root: filesystem path to construct relative paths from.
+ *
+ * Returns a freshly allocated \0 terminated string containing a XML
+ * serialization of the composition produced by a node (and thus also
+ * the nodes contributing data to the specified node). To export a
+ * gegl graph, connect the internal output node to an output proxy (see
+ * #gegl_node_get_output_proxy.) and use the proxy node as the basis
+ * for the serialization.
+ */
+gchar       * gegl_node_to_xml           (GeglNode      *node,
+                                          const gchar   *path_root);
 
 G_END_DECLS
 
diff --git a/gegl/graph/gegl-pad.c b/gegl/graph/gegl-pad.c
index 8b978fc..7613280 100644
--- a/gegl/graph/gegl-pad.c
+++ b/gegl/graph/gegl-pad.c
@@ -24,7 +24,7 @@
 #include "gegl.h"
 #include "gegl-types-internal.h"
 #include "gegl-buffer-types.h"
-#include "gegl-node.h"
+#include "gegl-node-private.h"
 #include "gegl-pad.h"
 #include "gegl-visitor.h"
 #include "gegl-utils.h"
diff --git a/gegl/graph/gegl-visitor.c b/gegl/graph/gegl-visitor.c
index 2e02aa4..98bd2ab 100644
--- a/gegl/graph/gegl-visitor.c
+++ b/gegl/graph/gegl-visitor.c
@@ -23,7 +23,7 @@
 #include "gegl-types-internal.h"
 
 #include "gegl.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 #include "gegl-visitor.h"
 #include "gegl-visitable.h"
diff --git a/gegl/operation/gegl-operation-context.c b/gegl/operation/gegl-operation-context.c
index 0f879b1..b15d762 100644
--- a/gegl/operation/gegl-operation-context.c
+++ b/gegl/operation/gegl-operation-context.c
@@ -25,11 +25,10 @@
 #include <glib-object.h>
 
 #include "gegl.h"
-#include "gegl/gegl-utils.h"
 #include "gegl-types-internal.h"
 #include "gegl-operation-context.h"
 #include "gegl-operation-context-private.h"
-#include "gegl/graph/gegl-node.h"
+#include "gegl-node-private.h"
 #include "gegl-config.h"
 
 #include "operation/gegl-operation.h"
diff --git a/gegl/operation/gegl-operation-meta.c b/gegl/operation/gegl-operation-meta.c
index 5bddbe0..a07bd04 100644
--- a/gegl/operation/gegl-operation-meta.c
+++ b/gegl/operation/gegl-operation-meta.c
@@ -23,7 +23,7 @@
 
 #include "gegl.h"
 #include "gegl-operation-meta.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 
 static void       finalize     (GObject       *self_object);
 static GeglNode * detect       (GeglOperation *operation,
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index baee12c..75e274f 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -26,7 +26,7 @@
 #include "gegl-types-internal.h"
 #include "gegl-operation.h"
 #include "gegl-operation-context.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-connection.h"
 #include "graph/gegl-pad.h"
 #include "gegl-operations.h"
diff --git a/gegl/process/Makefile.am b/gegl/process/Makefile.am
index dcea0d1..7a11de2 100644
--- a/gegl/process/Makefile.am
+++ b/gegl/process/Makefile.am
@@ -34,6 +34,7 @@ libprocess_la_SOURCES = \
        gegl-graph-traversal.h          \
        gegl-graph-traversal-private.h  \
        gegl-list-visitor.h             \
-       gegl-processor.h
+       gegl-processor.h                \
+       gegl-processor-private.h
 
 #libprocess_la_SOURCES = $(lib_process_sources) $(libprocess_public_HEADERS)
diff --git a/gegl/process/gegl-eval-manager.c b/gegl/process/gegl-eval-manager.c
index 3fd78f2..67ab41c 100644
--- a/gegl/process/gegl-eval-manager.c
+++ b/gegl/process/gegl-eval-manager.c
@@ -27,7 +27,7 @@
 #include "gegl-eval-manager.h"
 #include "gegl-instrument.h"
 
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 
 #include "process/gegl-graph-traversal.h"
 
diff --git a/gegl/process/gegl-graph-traversal-debug.c b/gegl/process/gegl-graph-traversal-debug.c
index 1890753..bd2f6af 100644
--- a/gegl/process/gegl-graph-traversal-debug.c
+++ b/gegl/process/gegl-graph-traversal-debug.c
@@ -24,7 +24,7 @@
 #include "gegl.h"
 #include "gegl-utils.h"
 
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 
 #include "process/gegl-graph-debug.h"
diff --git a/gegl/process/gegl-graph-traversal.c b/gegl/process/gegl-graph-traversal.c
index cf73315..3c281cd 100644
--- a/gegl/process/gegl-graph-traversal.c
+++ b/gegl/process/gegl-graph-traversal.c
@@ -29,7 +29,7 @@
 
 #include "buffer/gegl-region.h"
 
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 #include "graph/gegl-visitable.h"
 #include "graph/gegl-connection.h"
diff --git a/gegl/process/gegl-list-visitor.c b/gegl/process/gegl-list-visitor.c
index 8d9a6c3..4ac5883 100644
--- a/gegl/process/gegl-list-visitor.c
+++ b/gegl/process/gegl-list-visitor.c
@@ -25,7 +25,7 @@
 #include "gegl-debug.h"
 #include "gegl-types-internal.h"
 #include "gegl-list-visitor.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 #include "graph/gegl-visitable.h"
 #include "gegl-instrument.h"
diff --git a/gegl/process/gegl-processor-private.h b/gegl/process/gegl-processor-private.h
new file mode 100644
index 0000000..872bd82
--- /dev/null
+++ b/gegl/process/gegl-processor-private.h
@@ -0,0 +1,48 @@
+/* This file is part of GEGL
+ *
+ * GEGL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * GEGL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright 2007 Øyvind Kolås
+ */
+
+#ifndef __GEGL_PROCESSOR_PRIVATE_H__
+#define __GEGL_PROCESSOR_PRIVATE_H__
+
+G_BEGIN_DECLS
+
+#define GEGL_PROCESSOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_PROCESSOR, 
GeglProcessorClass))
+#define GEGL_IS_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_PROCESSOR))
+#define GEGL_PROCESSOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_PROCESSOR, 
GeglProcessorClass))
+/* The rest is in gegl-types.h */
+
+
+typedef struct _GeglProcessorClass GeglProcessorClass;
+
+struct _GeglProcessorClass
+{
+  GObjectClass  parent_class;
+};
+
+
+GType          gegl_processor_get_type      (void) G_GNUC_CONST;
+
+GeglProcessor *gegl_node_new_processor      (GeglNode            *node,
+                                             const GeglRectangle *rectangle);
+void           gegl_processor_set_rectangle (GeglProcessor       *processor,
+                                             const GeglRectangle *rectangle);
+gboolean       gegl_processor_work          (GeglProcessor       *processor,
+                                             gdouble             *progress);
+G_END_DECLS
+
+#endif /* __GEGL_PROCESSOR_PRIVATE_H__ */
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 82cf7e0..30097b2 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -21,9 +21,10 @@
 #include <glib-object.h>
 
 #include "gegl.h"
+#include "gegl-types-internal.h"
 #include "gegl-debug.h"
 #include "buffer/gegl-region.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 
 #include "operation/gegl-operation-context.h"
 #include "operation/gegl-operation-context-private.h"
@@ -31,8 +32,7 @@
 
 #include "gegl-config.h"
 #include "gegl-processor.h"
-#include "gegl-types-internal.h"
-#include "gegl-utils.h"
+#include "gegl-processor-private.h"
 
 #include "graph/gegl-visitor.h"
 #include "graph/gegl-visitable.h"
diff --git a/gegl/process/gegl-processor.h b/gegl/process/gegl-processor.h
index a817674..a825a66 100644
--- a/gegl/process/gegl-processor.h
+++ b/gegl/process/gegl-processor.h
@@ -19,32 +19,61 @@
 #ifndef __GEGL_PROCESSOR_H__
 #define __GEGL_PROCESSOR_H__
 
-#include "gegl-types-internal.h"
-
 G_BEGIN_DECLS
 
-#define GEGL_PROCESSOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GEGL_TYPE_PROCESSOR, 
GeglProcessorClass))
-#define GEGL_IS_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_PROCESSOR))
-#define GEGL_PROCESSOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_PROCESSOR, 
GeglProcessorClass))
-/* The rest is in gegl-types.h */
-
-
-typedef struct _GeglProcessorClass GeglProcessorClass;
-
-struct _GeglProcessorClass
-{
-  GObjectClass  parent_class;
-};
-
-
-GType          gegl_processor_get_type      (void) G_GNUC_CONST;
+/***
+ * GeglProcessor:
+ *
+ * A #GeglProcessor, is a worker that can be used for background rendering
+ * of regions in a node's cache. Or for processing a sink node. For most
+ * non GUI tasks using #gegl_node_blit and #gegl_node_process directly
+ * should be sufficient. See #gegl_processor_work for a code sample.
+ *
+ */
 
+/**
+ * gegl_node_new_processor:
+ * @node: a #GeglNode
+ * @rectangle: the #GeglRectangle to work on or NULL to work on all available
+ * data.
+ *
+ * Return value: (transfer full): a new #GeglProcessor.
+ */
 GeglProcessor *gegl_node_new_processor      (GeglNode            *node,
                                              const GeglRectangle *rectangle);
+
+/**
+ * gegl_processor_set_rectangle:
+ * @processor: a #GeglProcessor
+ * @rectangle: the new #GeglRectangle the processor shold work on or NULL
+ * to make it work on all data in the buffer.
+ *
+ * Change the rectangle a #GeglProcessor is working on.
+ */
 void           gegl_processor_set_rectangle (GeglProcessor       *processor,
                                              const GeglRectangle *rectangle);
-gboolean       gegl_processor_work          (GeglProcessor       *processor,
-                                             gdouble             *progress);
+
+
+/**
+ * gegl_processor_work:
+ * @processor: a #GeglProcessor
+ * @progress: (out caller-allocates): a location to store the (estimated) percentage complete.
+ *
+ * Do an iteration of work for the processor.
+ *
+ * Returns TRUE if there is more work to be done.
+ *
+ * ---
+ * GeglProcessor *processor = gegl_node_new_processor (node, &roi);
+ * double         progress;
+ *
+ * while (gegl_processor_work (processor, &progress))
+ *   g_warning ("%f%% complete", progress);
+ * g_object_unref (processor);
+ */
+gboolean       gegl_processor_work          (GeglProcessor *processor,
+                                             gdouble       *progress);
+
 G_END_DECLS
 
 #endif /* __GEGL_PROCESSOR_H__ */
diff --git a/operations/common/display.c b/operations/common/display.c
index 85e88a4..933ee9f 100644
--- a/operations/common/display.c
+++ b/operations/common/display.c
@@ -27,7 +27,7 @@ gegl_chant_string  (window_title, _(""), "window_title",
 #define GEGL_CHANT_C_FILE       "display.c"
 
 #include "gegl-plugin.h"
-#include "gegl/graph/gegl-node.h"
+#include "gegl-node-private.h"
 
 /* gegl:display
  * Meta operation for displaying the output of a buffer.
diff --git a/operations/common/exp-combine.c b/operations/common/exp-combine.c
index d0dc799..678b4fd 100644
--- a/operations/common/exp-combine.c
+++ b/operations/common/exp-combine.c
@@ -58,7 +58,7 @@ GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_FILTER)
 #include <stdio.h>
 
 #include "gegl-debug.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 #include "graph/gegl-pad.h"
 
 
diff --git a/operations/common/save.c b/operations/common/save.c
index 9e7bf33..9887c3b 100644
--- a/operations/common/save.c
+++ b/operations/common/save.c
@@ -29,7 +29,7 @@ gegl_chant_file_path (path, _("File"), "", _("Path of file to save."))
 #define GEGL_CHANT_C_FILE       "save.c"
 
 #include "gegl-plugin.h"
-#include "gegl/graph/gegl-node.h"
+#include "gegl-node-private.h"
 
 struct _GeglChant
 {
diff --git a/operations/common/write-buffer.c b/operations/common/write-buffer.c
index 19a91ff..8536f6f 100644
--- a/operations/common/write-buffer.c
+++ b/operations/common/write-buffer.c
@@ -31,7 +31,7 @@ gegl_chant_object (buffer, _("Buffer location"),
 #define GEGL_CHANT_C_FILE       "write-buffer.c"
 
 #include "gegl-chant.h"
-#include "graph/gegl-node.h"
+#include "graph/gegl-node-private.h"
 
 #include "gegl/gegl-debug.h"
 #include "opencl/gegl-cl.h"
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 534cc7d..92457ce 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -32,8 +32,8 @@
 #include <math.h>
 #include <gegl.h>
 #include <gegl-plugin.h>
+#include <graph/gegl-node-private.h>
 #include <graph/gegl-pad.h>
-#include <graph/gegl-node.h>
 #include <graph/gegl-connection.h>
 
 #include "transform-core.h"


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