[gimp/goat-invasion] app: move gimp_temp_buf_create_buffer() to temp-buf.[ch]



commit 53f6d4c4f72c9024bb27d68920758de98b69953d
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 8 19:06:06 2012 +0200

    app: move gimp_temp_buf_create_buffer() to temp-buf.[ch]
    
    TempBuf will soon be promoted to be a core/ citizen.

 app/base/pixel-region.c       |    3 +--
 app/base/temp-buf.c           |   28 ++++++++++++++++++++++++++--
 app/base/temp-buf.h           |    3 +++
 app/core/gimpbrush-boundary.c |    2 +-
 app/gegl/gimp-gegl-utils.c    |   26 --------------------------
 app/gegl/gimp-gegl-utils.h    |    2 --
 app/paint-funcs/Makefile.am   |    2 +-
 app/paint-funcs/paint-funcs.c |    3 +--
 8 files changed, 33 insertions(+), 36 deletions(-)
---
diff --git a/app/base/pixel-region.c b/app/base/pixel-region.c
index f581168..bf43053 100644
--- a/app/base/pixel-region.c
+++ b/app/base/pixel-region.c
@@ -20,8 +20,7 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include <babl/babl.h>
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "base-types.h"
 
diff --git a/app/base/temp-buf.c b/app/base/temp-buf.c
index 8f5802a..98ce366 100644
--- a/app/base/temp-buf.c
+++ b/app/base/temp-buf.c
@@ -23,9 +23,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <babl/babl.h>
 #include <cairo.h>
-#include <glib-object.h>
+#include <gegl.h>
 #include <glib/gstdio.h>
 
 #include "base-types.h"
@@ -244,3 +243,28 @@ temp_buf_dump (TempBuf     *buf,
 
   close (fd);
 }
+
+GeglBuffer  *
+gimp_temp_buf_create_buffer (TempBuf  *temp_buf,
+                             gboolean  take_ownership)
+{
+  GeglBuffer *buffer;
+
+  g_return_val_if_fail (temp_buf != NULL, NULL);
+
+  buffer =
+    gegl_buffer_linear_new_from_data (temp_buf_get_data (temp_buf),
+                                      temp_buf->format,
+                                      GEGL_RECTANGLE (0, 0,
+                                                      temp_buf->width,
+                                                      temp_buf->height),
+                                      GEGL_AUTO_ROWSTRIDE,
+                                      take_ownership ?
+                                      (GDestroyNotify) temp_buf_free : NULL,
+                                      take_ownership ?
+                                      temp_buf : NULL);
+
+  g_object_set_data (G_OBJECT (buffer), "gimp-temp-buf", temp_buf);
+
+  return buffer;
+}
diff --git a/app/base/temp-buf.h b/app/base/temp-buf.h
index a16c7cb..decea08 100644
--- a/app/base/temp-buf.h
+++ b/app/base/temp-buf.h
@@ -51,5 +51,8 @@ gsize     temp_buf_get_memsize   (TempBuf       *buf);
 void      temp_buf_dump          (TempBuf       *buf,
                                   const gchar   *filename);
 
+GeglBuffer * gimp_temp_buf_create_buffer (TempBuf  *temp_buf,
+                                          gboolean  take_ownership);
+
 
 #endif  /*  __TEMP_BUF_H__  */
diff --git a/app/core/gimpbrush-boundary.c b/app/core/gimpbrush-boundary.c
index af0d980..14fe9e8 100644
--- a/app/core/gimpbrush-boundary.c
+++ b/app/core/gimpbrush-boundary.c
@@ -22,7 +22,7 @@
 
 #include "core-types.h"
 
-#include "gegl/gimp-gegl-utils.h"
+#include "base/temp-buf.h"
 
 #include "gimpbezierdesc.h"
 #include "gimpboundary.h"
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 9d1f853..763ea36 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -24,7 +24,6 @@
 
 #include "gimp-gegl-types.h"
 
-#include "base/temp-buf.h"
 #include "base/tile-manager.h"
 
 #include "core/gimpprogress.h"
@@ -245,31 +244,6 @@ gimp_gegl_buffer_get_tiles (GeglBuffer *buffer)
   return gimp_tile_backend_tile_manager_get_tiles (backend);
 }
 
-GeglBuffer  *
-gimp_temp_buf_create_buffer (TempBuf  *temp_buf,
-                             gboolean  take_ownership)
-{
-  GeglBuffer *buffer;
-
-  g_return_val_if_fail (temp_buf != NULL, NULL);
-
-  buffer =
-    gegl_buffer_linear_new_from_data (temp_buf_get_data (temp_buf),
-                                      temp_buf->format,
-                                      GEGL_RECTANGLE (0, 0,
-                                                      temp_buf->width,
-                                                      temp_buf->height),
-                                      GEGL_AUTO_ROWSTRIDE,
-                                      take_ownership ?
-                                      (GDestroyNotify) temp_buf_free : NULL,
-                                      take_ownership ?
-                                      temp_buf : NULL);
-
-  g_object_set_data (G_OBJECT (buffer), "gimp-temp-buf", temp_buf);
-
-  return buffer;
-}
-
 TempBuf *
 gimp_gegl_buffer_get_temp_buf (GeglBuffer *buffer)
 {
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index f0707a3..eb05728 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -41,8 +41,6 @@ GeglBuffer  * gimp_tile_manager_create_buffer    (TileManager           *tm,
                                                   const Babl            *format);
 TileManager * gimp_gegl_buffer_get_tiles         (GeglBuffer            *buffer);
 
-GeglBuffer  * gimp_temp_buf_create_buffer        (TempBuf               *temp_buf,
-                                                  gboolean               take_ownership);
 TempBuf     * gimp_gegl_buffer_get_temp_buf      (GeglBuffer            *buffer);
 
 GeglBuffer  * gimp_pixbuf_create_buffer          (GdkPixbuf             *pixbuf);
diff --git a/app/paint-funcs/Makefile.am b/app/paint-funcs/Makefile.am
index 08c4f85..d1e4be3 100644
--- a/app/paint-funcs/Makefile.am
+++ b/app/paint-funcs/Makefile.am
@@ -15,7 +15,7 @@ INCLUDES = \
 	-I$(top_srcdir)/app	\
 	$(BABL_CFLAGS)		\
 	$(CAIRO_CFLAGS)		\
-	$(GLIB_CFLAGS)		\
+	$(GEGL_CFLAGS)		\
 	-I$(includedir)
 
 noinst_LIBRARIES = libapppaint-funcs.a
diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c
index 041ce1f..40f3407 100644
--- a/app/paint-funcs/paint-funcs.c
+++ b/app/paint-funcs/paint-funcs.c
@@ -19,9 +19,8 @@
 
 #include <string.h>
 
-#include <babl/babl.h>
 #include <cairo.h>
-#include <glib-object.h>
+#include <gegl.h>
 
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"



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