[gegl] Add gegl-operation-context-private.h



commit 5cb282fbab53e8155451bf3d0a578b96b20eebaf
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Tue Nov 19 16:24:07 2013 -0800

    Add gegl-operation-context-private.h
    
    Move the actually private parts of OperationContext to their
    own header, in preparation for making gegl-operation-context.h
    a public header.

 gegl/operation/Makefile.am                      |    3 +-
 gegl/operation/gegl-operation-context-private.h |   89 +++++++++++++++++++++++
 gegl/operation/gegl-operation-context.c         |    2 +
 gegl/operation/gegl-operation-context.h         |   68 ++----------------
 gegl/process/gegl-graph-traversal-debug.c       |    1 +
 gegl/process/gegl-graph-traversal.c             |    1 +
 gegl/process/gegl-processor.c                   |    1 +
 7 files changed, 101 insertions(+), 64 deletions(-)
---
diff --git a/gegl/operation/Makefile.am b/gegl/operation/Makefile.am
index d1b34b5..d5dd70f 100644
--- a/gegl/operation/Makefile.am
+++ b/gegl/operation/Makefile.am
@@ -18,6 +18,7 @@ liboperation_public_HEADERS = \
        gegl-operation-area-filter.h     \
        gegl-operation-composer.h        \
        gegl-operation-composer3.h       \
+       gegl-operation-context.h         \
        gegl-operation-filter.h          \
        gegl-operation-meta.h            \
        gegl-operation-point-composer.h  \
@@ -44,9 +45,9 @@ liboperation_sources = \
        gegl-operation-source.c                 \
        gegl-operation-temporal.c               \
        gegl-operation-context.c                \
+       gegl-operation-context-private.h \
        gegl-operations.c                       \
        gegl-extension-handler.h                \
-       gegl-operation-context.h                \
        gegl-operations.h
 
 noinst_LTLIBRARIES = liboperation.la
diff --git a/gegl/operation/gegl-operation-context-private.h b/gegl/operation/gegl-operation-context-private.h
new file mode 100644
index 0000000..35c8024
--- /dev/null
+++ b/gegl/operation/gegl-operation-context-private.h
@@ -0,0 +1,89 @@
+/* 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-2008 Øyvind Kolås
+ *           2013 Daniel Sabo
+ */
+
+#ifndef __GEGL_OPERATION_CONTEXT_PRIVATE_H__
+#define __GEGL_OPERATION_CONTEXT_PRIVATE_H__
+
+G_BEGIN_DECLS
+
+
+/**
+ * When a node in a GEGL graph does processing, it needs context such
+ * as inputs. This structure holds this stuff and is passed to the
+ * node during processing. The data in a context is bound to one
+ * specific rendering/processing job/thread.
+ */
+struct _GeglOperationContext
+{
+  GeglOperation *operation;
+
+  GSList        *property;    /* used internally for data being exchanged */
+  GeglRectangle  need_rect;   /* the rectangle needed from the operation */
+  GeglRectangle  result_rect; /* the result computation rectangle for the operation ,
+                                 (will differ if the needed rect extends beyond
+                                 the defined rectangle, some operations might
+                                 force/suggest expansion of the result
+                                 rect, like contrast stretching.
+                               */
+
+
+  gboolean       cached;       /* true if the cache can be used directly, and
+                                  recomputation of inputs is unneccesary) */
+
+  gint           refs;         /* set to number of nodes that depends on it
+                                  before evaluation begins, each time data is
+                                  fetched from the op the reference count is
+                                  dropped, when it drops to zero, the op is
+                                  asked to clean it's pads, FIXME: should be
+                                  incorporated into the refcount of
+                                  GeglOperationContext?
+                                */
+  gint           level;         /* subdivision level to render at, 0 = 1:1,
+                                                                   1 = 1:2,
+                                                                   2 = 1:4,
+                                                                   4 = 1:8,
+                                                                   6 = 1:16 .. */
+};
+
+GeglOperationContext *gegl_operation_context_new       (GeglOperation        *operation);
+void                  gegl_operation_context_destroy   (GeglOperationContext *self);
+
+void            gegl_operation_context_set_property    (GeglOperationContext *self,
+                                                        const gchar          *name,
+                                                        const GValue         *value) G_GNUC_DEPRECATED;
+void            gegl_operation_context_get_property    (GeglOperationContext *self,
+                                                        const gchar          *name,
+                                                        GValue               *value) G_GNUC_DEPRECATED;
+void            gegl_operation_context_remove_property (GeglOperationContext *self,
+                                                        const gchar          *name) G_GNUC_DEPRECATED;
+
+GValue         *gegl_operation_context_get_value       (GeglOperationContext *self,
+                                                        const gchar          *name);
+
+GeglRectangle  *gegl_operation_context_get_need_rect   (GeglOperationContext *self);
+void            gegl_operation_context_set_need_rect   (GeglOperationContext *self,
+                                                        const GeglRectangle  *rect);
+GeglRectangle  *gegl_operation_context_get_result_rect (GeglOperationContext *node);
+void            gegl_operation_context_set_result_rect (GeglOperationContext *node,
+                                                        const GeglRectangle  *rect);
+
+G_END_DECLS
+
+#endif /* __GEGL_OPERATION_CONTEXT_PRIVATE_H__ */
diff --git a/gegl/operation/gegl-operation-context.c b/gegl/operation/gegl-operation-context.c
index eaa7fd7..0f879b1 100644
--- a/gegl/operation/gegl-operation-context.c
+++ b/gegl/operation/gegl-operation-context.c
@@ -15,6 +15,7 @@
  *
  * Copyright 2003 Calvin Williamson
  *           2006-2008 Øyvind Kolås
+ *           2013 Daniel Sabo
  */
 
 #include "config.h"
@@ -27,6 +28,7 @@
 #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-config.h"
 
diff --git a/gegl/operation/gegl-operation-context.h b/gegl/operation/gegl-operation-context.h
index a6340fd..fa8f011 100644
--- a/gegl/operation/gegl-operation-context.h
+++ b/gegl/operation/gegl-operation-context.h
@@ -15,92 +15,34 @@
  *
  * Copyright 2003 Calvin Williamson
  *           2006-2008 Øyvind Kolås
+ *           2013 Daniel Sabo
  */
 
 #ifndef __GEGL_OPERATION_CONTEXT_H__
 #define __GEGL_OPERATION_CONTEXT_H__
 
-#include <gegl/buffer/gegl-buffer.h>
-
 G_BEGIN_DECLS
 
-/**
- * When a node in a GEGL graph does processing, it needs context such
- * as inputs. This structure holds this stuff and is passed to the
- * node during processing. The data in a context is bound to one
- * specific rendering/processing job/thread.
- */
-struct _GeglOperationContext
-{
-  GeglOperation *operation;
-
-  GSList        *property;    /* used internally for data being exchanged */
-  GeglRectangle  need_rect;   /* the rectangle needed from the operation */
-  GeglRectangle  result_rect; /* the result computation rectangle for the operation ,
-                                 (will differ if the needed rect extends beyond
-                                 the defined rectangle, some operations might
-                                 force/suggest expansion of the result
-                                 rect, like contrast stretching.
-                               */
-
-
-  gboolean       cached;       /* true if the cache can be used directly, and
-                                  recomputation of inputs is unneccesary) */
-
-  gint           refs;         /* set to number of nodes that depends on it
-                                  before evaluation begins, each time data is
-                                  fetched from the op the reference count is
-                                  dropped, when it drops to zero, the op is
-                                  asked to clean it's pads, FIXME: should be
-                                  incorporated into the refcount of
-                                  GeglOperationContext?
-                                */
-  gint           level;         /* subdivision level to render at, 0 = 1:1,
-                                                                   1 = 1:2,
-                                                                   2 = 1:4,
-                                                                   4 = 1:8,
-                                                                   6 = 1:16 .. */
-};
-
 GeglBuffer     *gegl_operation_context_get_target      (GeglOperationContext *self,
                                                         const gchar          *padname);
 GeglBuffer     *gegl_operation_context_get_source      (GeglOperationContext *self,
                                                         const gchar          *padname);
 GObject        *gegl_operation_context_get_object      (GeglOperationContext *context,
                                                         const gchar          *padname);
+
 void            gegl_operation_context_set_object      (GeglOperationContext *context,
                                                         const gchar          *padname,
                                                         GObject              *data);
 void            gegl_operation_context_take_object     (GeglOperationContext *context,
                                                         const gchar          *padname,
                                                         GObject              *data);
-void            gegl_operation_context_set_property    (GeglOperationContext *self,
-                                                        const gchar          *name,
-                                                        const GValue         *value);
-GValue        * gegl_operation_context_get_value       (GeglOperationContext *self,
-                                                        const gchar          *property_name);
-void            gegl_operation_context_get_property    (GeglOperationContext *self,
-                                                        const gchar          *name,
-                                                        GValue               *value);
 
 void            gegl_operation_context_purge           (GeglOperationContext *self);
 
-/* the rest of these functions are for internal use only */
-
-void            gegl_operation_context_remove_property (GeglOperationContext *self,
-                                                        const gchar          *name);
-GeglRectangle * gegl_operation_context_get_need_rect   (GeglOperationContext *self);
-void            gegl_operation_context_set_need_rect   (GeglOperationContext *self,
-                                                        const GeglRectangle  *rect);
-GeglRectangle * gegl_operation_context_get_result_rect (GeglOperationContext *node);
-void            gegl_operation_context_set_result_rect (GeglOperationContext *node,
-                                                        const GeglRectangle  *rect);
-
-gint            gegl_operation_context_get_level (GeglOperationContext *ctxt);
+gint            gegl_operation_context_get_level       (GeglOperationContext *self);
 
-GeglOperationContext *gegl_operation_context_new (GeglOperation *operation);
-void gegl_operation_context_destroy (GeglOperationContext *opcontext);
+/* the rest of these functions are for internal use only */
 
 G_END_DECLS
 
-#endif /* __GEGL_NODE_H__ */
+#endif /* __GEGL_OPERATION_CONTEXT_H__ */
diff --git a/gegl/process/gegl-graph-traversal-debug.c b/gegl/process/gegl-graph-traversal-debug.c
index 51094bf..1890753 100644
--- a/gegl/process/gegl-graph-traversal-debug.c
+++ b/gegl/process/gegl-graph-traversal-debug.c
@@ -33,6 +33,7 @@
 
 #include "operation/gegl-operation.h"
 #include "operation/gegl-operation-context.h"
+#include "operation/gegl-operation-context-private.h"
 
 #include <stdio.h>
 
diff --git a/gegl/process/gegl-graph-traversal.c b/gegl/process/gegl-graph-traversal.c
index 8d21db9..cf73315 100644
--- a/gegl/process/gegl-graph-traversal.c
+++ b/gegl/process/gegl-graph-traversal.c
@@ -40,6 +40,7 @@
 
 #include "operation/gegl-operation.h"
 #include "operation/gegl-operation-context.h"
+#include "operation/gegl-operation-context-private.h"
 
 typedef struct
 {
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 9bca0ee..82cf7e0 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -26,6 +26,7 @@
 #include "graph/gegl-node.h"
 
 #include "operation/gegl-operation-context.h"
+#include "operation/gegl-operation-context-private.h"
 #include "operation/gegl-operation-sink.h"
 
 #include "gegl-config.h"


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