gegl r2927 - in trunk: . gegl gegl/buffer



Author: martinn
Date: Sat Feb 21 09:19:02 2009
New Revision: 2927
URL: http://svn.gnome.org/viewvc/gegl?rev=2927&view=rev

Log:
Add GeglConfig to the API

Add GeglConfig to the API as an opaque struct so that we don't need to
have different interfaces publicly and internally for gegl_config()

Modified:
   trunk/ChangeLog
   trunk/gegl/buffer/gegl-tile-handler-cache.c
   trunk/gegl/gegl-config.c
   trunk/gegl/gegl-config.h
   trunk/gegl/gegl-init.c
   trunk/gegl/gegl-types-internal.h
   trunk/gegl/gegl.h

Modified: trunk/gegl/buffer/gegl-tile-handler-cache.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-handler-cache.c	(original)
+++ trunk/gegl/buffer/gegl-tile-handler-cache.c	Sat Feb 21 09:19:02 2009
@@ -21,8 +21,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include "gegl-config.h"
 #include "../gegl-types-internal.h"
+#include "gegl-config.h"
 #include "gegl-buffer.h"
 #include "gegl-buffer-private.h"
 #include "gegl-tile.h"

Modified: trunk/gegl/gegl-config.c
==============================================================================
--- trunk/gegl/gegl-config.c	(original)
+++ trunk/gegl/gegl-config.c	Sat Feb 21 09:19:02 2009
@@ -17,10 +17,12 @@
  */
 #include <glib.h>
 #include <glib-object.h>
-#include "gegl-config.h"
 #include <string.h>
 #include <glib/gprintf.h>
 
+#include "gegl-types-internal.h"
+#include "gegl-config.h"
+
 G_DEFINE_TYPE (GeglConfig, gegl_config, G_TYPE_OBJECT);
 
 static GObjectClass * parent_class = NULL;

Modified: trunk/gegl/gegl-config.h
==============================================================================
--- trunk/gegl/gegl-config.h	(original)
+++ trunk/gegl/gegl-config.h	Sat Feb 21 09:19:02 2009
@@ -31,7 +31,6 @@
 #define GEGL_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GEGL_TYPE_CONFIG))
 #define GEGL_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),  GEGL_TYPE_CONFIG, GeglConfigClass))
 
-typedef struct _GeglConfig GeglConfig;
 typedef struct _GeglConfigClass GeglConfigClass;
 
 struct _GeglConfig
@@ -53,9 +52,9 @@
 };
 
 GType gegl_config_get_type (void) G_GNUC_CONST;
-#ifndef __GEGL_INIT_H__
+
 GeglConfig   * gegl_config            (void);
-#endif
+
 G_END_DECLS
 
 #endif

Modified: trunk/gegl/gegl-init.c
==============================================================================
--- trunk/gegl/gegl-init.c	(original)
+++ trunk/gegl/gegl-init.c	Sat Feb 21 09:19:02 2009
@@ -249,8 +249,7 @@
   return group;
 }
 
-GObject *gegl_config (void);
-GObject *gegl_config (void)
+GeglConfig *gegl_config (void)
 {
   if (!config)
     {
@@ -272,7 +271,7 @@
       if (gegl_swap_dir())
         config->swap = g_strdup(gegl_swap_dir ());
     }
-  return G_OBJECT (config);
+  return GEGL_CONFIG (config);
 }
 
 void gegl_tile_backend_ram_stats (void);

Modified: trunk/gegl/gegl-types-internal.h
==============================================================================
--- trunk/gegl/gegl-types-internal.h	(original)
+++ trunk/gegl/gegl-types-internal.h	Sat Feb 21 09:19:02 2009
@@ -24,6 +24,7 @@
 
 #ifndef __GEGL_H__
 typedef struct _GeglColor            GeglColor;
+typedef struct _GeglConfig           GeglConfig;
 typedef struct _GeglCurve            GeglCurve;
 typedef struct _GeglNode             GeglNode;
 typedef struct _GeglPath             GeglPath;

Modified: trunk/gegl/gegl.h
==============================================================================
--- trunk/gegl/gegl.h	(original)
+++ trunk/gegl/gegl.h	Sat Feb 21 09:19:02 2009
@@ -827,17 +827,27 @@
  */
 void           gegl_processor_destroy       (GeglProcessor *processor);
 
+
+/***
+ * GeglConfig:
+ *
+ * GEGL uses a singleton configuration object
+ */
+#ifndef GEGL_INTERNAL
+typedef struct _GeglConfig GeglConfig;
+#endif
+
 /**
  * gegl_config:
  *
- * Returns a GObject with properties that can be manipulated to control
+ * Returns a GeglConfig object with properties that can be manipulated to control
  * GEGLs behavior. Properties available on the object are:
  *
  * "cache-size" "quality" and "swap", the two first is an integer denoting
  * number of bytes, the secons 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)
  */
-GObject      * gegl_config (void);
+GeglConfig      * gegl_config (void);
 
 
 #ifndef GEGL_INTERNAL



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