Commit 90e5935f authored by Daniel Sabo's avatar Daniel Sabo

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.
parent f5faad8b
......@@ -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
......
......@@ -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 \
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
/* 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__ */
......@@ -52,8 +52,6 @@ struct _GeglConfigClass
GObjectClass parent_class;
};
GeglConfig * gegl_config (void);
G_END_DECLS
#endif
......@@ -2,7 +2,6 @@
#define __GEGL_DEBUG_H__
#include <glib.h>
#include "gegl-init.h"
G_BEGIN_DECLS
......
......@@ -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"
......
......@@ -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"
......
/* 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
......@@ -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,
......
......@@ -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
......
......@@ -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 *
......
/* 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
This diff is collapsed.
......@@ -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
......
/* 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__ */
......@@ -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
{
......
This diff is collapsed.
......@@ -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"
......
......@@ -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"
......
......@@ -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"