[gegl/soc-2012-ops] buffer: formatting and other minor cleanup in GeglTileBackend



commit 9e8a09decab6fcbc19b398eec495ffba9741be10
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 3 13:41:26 2012 +0200

    buffer: formatting and other minor cleanup in GeglTileBackend

 gegl/buffer/gegl-tile-backend.c |   52 ++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 22 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-backend.c b/gegl/buffer/gegl-tile-backend.c
index f2d8350..a64d7fd 100644
--- a/gegl/buffer/gegl-tile-backend.c
+++ b/gegl/buffer/gegl-tile-backend.c
@@ -16,18 +16,20 @@
  * Copyright 2006, 2007 Ãyvind KolÃs <pippin gimp org>
  */
 #include "config.h"
-#include <glib.h>
-#include <glib-object.h>
+
 #include <string.h>
 
 #include <babl/babl.h>
+#include <glib-object.h>
+
 #include "gegl-buffer-types.h"
 #include "gegl-buffer-private.h"
 #include "gegl-tile-source.h"
 #include "gegl-tile-backend.h"
 
 G_DEFINE_TYPE (GeglTileBackend, gegl_tile_backend, GEGL_TYPE_TILE_SOURCE)
-static GObjectClass * parent_class = NULL;
+
+#define parent_class gegl_tile_backend_parent_class
 
 enum
 {
@@ -117,7 +119,6 @@ constructor (GType                  type,
   g_assert (backend->priv->tile_width > 0 && backend->priv->tile_height > 0);
   g_assert (backend->priv->format);
 
-
   backend->priv->px_size = babl_format_get_bytes_per_pixel (backend->priv->format);
   backend->priv->tile_size = backend->priv->tile_width * backend->priv->tile_height * backend->priv->px_size;
 
@@ -129,73 +130,80 @@ gegl_tile_backend_class_init (GeglTileBackendClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  parent_class  = g_type_class_peek_parent (klass);
-
   gobject_class->set_property = set_property;
   gobject_class->get_property = get_property;
   gobject_class->constructor  = constructor;
 
   g_object_class_install_property (gobject_class, PROP_TILE_WIDTH,
-                                   g_param_spec_int ("tile-width", "tile-width", "Tile width in pixels",
+                                   g_param_spec_int ("tile-width", "tile-width",
+                                                     "Tile width in pixels",
                                                      0, G_MAXINT, 0,
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (gobject_class, PROP_TILE_HEIGHT,
-                                   g_param_spec_int ("tile-height", "tile-height", "Tile height in pixels",
+                                   g_param_spec_int ("tile-height", "tile-height",
+                                                     "Tile height in pixels",
                                                      0, G_MAXINT, 0,
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (gobject_class, PROP_TILE_SIZE,
-                                   g_param_spec_int ("tile-size", "tile-size", "Size of the tiles linear buffer in bytes",
+                                   g_param_spec_int ("tile-size", "tile-size",
+                                                     "Size of the tiles linear buffer in bytes",
                                                      0, G_MAXINT, 0,
                                                      G_PARAM_READABLE));
   g_object_class_install_property (gobject_class, PROP_PX_SIZE,
-                                   g_param_spec_int ("px-size", "px-size", "Size of a single pixel in bytes",
+                                   g_param_spec_int ("px-size", "px-size",
+                                                     "Size of a single pixel in bytes",
                                                      0, G_MAXINT, 0,
                                                      G_PARAM_READABLE));
   g_object_class_install_property (gobject_class, PROP_FORMAT,
-                                   g_param_spec_pointer ("format", "format", "babl format",
+                                   g_param_spec_pointer ("format", "format",
+                                                         "babl format",
                                                          G_PARAM_READWRITE |
                                                          G_PARAM_CONSTRUCT_ONLY));
+
   g_type_class_add_private (gobject_class, sizeof (GeglTileBackendPrivate));
 }
 
-#define GEGL_TILE_BACKEND_GET_PRIVATE(obj) \
-    (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GEGL_TYPE_TILE_BACKEND, GeglTileBackendPrivate))
-
-
 static void
 gegl_tile_backend_init (GeglTileBackend *self)
 {
-  self->priv = GEGL_TILE_BACKEND_GET_PRIVATE (self);
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
+                                            GEGL_TYPE_TILE_BACKEND,
+                                            GeglTileBackendPrivate);
   self->priv->shared = FALSE;
 }
 
 
-gint gegl_tile_backend_get_tile_size (GeglTileBackend *tile_backend)
+gint
+gegl_tile_backend_get_tile_size (GeglTileBackend *tile_backend)
 {
   return tile_backend->priv->tile_size;
 }
 
 
-const Babl *gegl_tile_backend_get_format (GeglTileBackend *tile_backend)
+const Babl *
+gegl_tile_backend_get_format (GeglTileBackend *tile_backend)
 {
   return tile_backend->priv->format;
 }
 
 
-void  gegl_tile_backend_set_extent    (GeglTileBackend *tile_backend,
-                                       GeglRectangle   *rectangle)
+void
+gegl_tile_backend_set_extent (GeglTileBackend *tile_backend,
+                              GeglRectangle   *rectangle)
 {
   tile_backend->priv->extent = *rectangle;
 }
 
-GeglRectangle gegl_tile_backend_get_extent (GeglTileBackend *tile_backend)
+GeglRectangle
+gegl_tile_backend_get_extent (GeglTileBackend *tile_backend)
 {
   return tile_backend->priv->extent;
 }
 
-GeglTileSource *gegl_tile_backend_peek_storage (GeglTileBackend *backend)
+GeglTileSource *
+gegl_tile_backend_peek_storage (GeglTileBackend *backend)
 {
   return backend->priv->storage;
 }



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