[gimp/metadata-browser] app: Add GimpTileBackendTileManagerPrivate
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: Add GimpTileBackendTileManagerPrivate
- Date: Fri, 2 Dec 2011 01:59:06 +0000 (UTC)
commit 6898a3adc6ef5314580c2eb20eb96c972feedc87
Author: Martin Nordholts <martinn src gnome org>
Date: Fri Sep 30 10:28:18 2011 +0200
app: Add GimpTileBackendTileManagerPrivate
Also do some minor cleanup.
app/gegl/gimp-gegl-types.h | 5 +++++
app/gegl/gimptilebackendtilemanager.c | 21 ++++++++++++++++-----
app/gegl/gimptilebackendtilemanager.h | 6 +++---
3 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-types.h b/app/gegl/gimp-gegl-types.h
index af17404..4f066f5 100644
--- a/app/gegl/gimp-gegl-types.h
+++ b/app/gegl/gimp-gegl-types.h
@@ -84,6 +84,11 @@ typedef struct _GimpPosterizeConfig GimpPosterizeConfig;
typedef struct _GimpThresholdConfig GimpThresholdConfig;
+/* temporary stuff */
+
+typedef struct _GimpTileBackendTileManager GimpTileBackendTileManager;
+
+
/* non-object types */
typedef struct _GimpCagePoint GimpCagePoint;
diff --git a/app/gegl/gimptilebackendtilemanager.c b/app/gegl/gimptilebackendtilemanager.c
index 0ad17aa..56d9518 100644
--- a/app/gegl/gimptilebackendtilemanager.c
+++ b/app/gegl/gimptilebackendtilemanager.c
@@ -34,6 +34,12 @@
#include "gimptilebackendtilemanager.h"
+struct _GimpTileBackendTileManagerPrivate
+{
+ GHashTable *entries;
+};
+
+
typedef struct _RamEntry RamEntry;
struct _RamEntry
@@ -99,6 +105,8 @@ gimp_tile_backend_tile_manager_class_init (GimpTileBackendTileManagerClass *klas
object_class->finalize = gimp_tile_backend_tile_manager_finalize;
object_class->get_property = gimp_tile_backend_tile_manager_get_property;
object_class->set_property = gimp_tile_backend_tile_manager_set_property;
+
+ g_type_class_add_private (klass, sizeof (GimpTileBackendTileManagerPrivate));
}
static void
@@ -106,9 +114,12 @@ gimp_tile_backend_tile_manager_init (GimpTileBackendTileManager *backend)
{
GeglTileSource *source = GEGL_TILE_SOURCE (backend);
+ backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend,
+ GIMP_TYPE_TILE_BACKEND_TILE_MANAGER,
+ GimpTileBackendTileManagerPrivate);
source->command = gimp_tile_backend_tile_manager_command;
- backend->entries = g_hash_table_new (hash_func, equal_func);
+ backend->priv->entries = g_hash_table_new (hash_func, equal_func);
}
static void
@@ -116,7 +127,7 @@ gimp_tile_backend_tile_manager_finalize (GObject *object)
{
GimpTileBackendTileManager *backend = GIMP_TILE_BACKEND_TILE_MANAGER (object);
- g_hash_table_unref (backend->entries);
+ g_hash_table_unref (backend->priv->entries);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -190,7 +201,7 @@ gimp_tile_backend_tile_manager_command (GeglTileSource *tile_store,
entry->y = y;
entry->z = z;
- g_hash_table_insert (backend_tm->entries, entry, entry);
+ g_hash_table_insert (backend_tm->priv->entries, entry, entry);
}
ram_entry_write (backend_tm, entry, gegl_tile_get_data (tile));
@@ -263,7 +274,7 @@ lookup_entry (GimpTileBackendTileManager *self,
key.z = z;
key.offset = 0;
- return g_hash_table_lookup (self->entries, &key);
+ return g_hash_table_lookup (self->priv->entries, &key);
}
static guint
@@ -400,7 +411,7 @@ ram_entry_destroy (RamEntry *entry,
{
gint tile_size = gegl_tile_backend_get_tile_size (GEGL_TILE_BACKEND (ram));
g_free (entry->offset);
- g_hash_table_remove (ram->entries, entry);
+ g_hash_table_remove (ram->priv->entries, entry);
dbg_dealloc (tile_size);
g_slice_free (RamEntry, entry);
diff --git a/app/gegl/gimptilebackendtilemanager.h b/app/gegl/gimptilebackendtilemanager.h
index 1aff9c5..ba54636 100644
--- a/app/gegl/gimptilebackendtilemanager.h
+++ b/app/gegl/gimptilebackendtilemanager.h
@@ -21,7 +21,7 @@
#ifndef __GIMP_TILE_BACKEND_TILE_MANAGER_H__
#define __GIMP_TILE_BACKEND_TILE_MANAGER_H__
-#include "gegl-buffer-backend.h"
+#include <gegl-buffer-backend.h>
G_BEGIN_DECLS
@@ -32,14 +32,14 @@ G_BEGIN_DECLS
#define GIMP_IS_TILE_BACKEND_TILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER))
#define GIMP_TILE_BACKEND_TILE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER, GimpTileBackendTileManagerClass))
-typedef struct _GimpTileBackendTileManager GimpTileBackendTileManager;
typedef struct _GimpTileBackendTileManagerClass GimpTileBackendTileManagerClass;
+typedef struct _GimpTileBackendTileManagerPrivate GimpTileBackendTileManagerPrivate;
struct _GimpTileBackendTileManager
{
GeglTileBackend parent_instance;
- GHashTable *entries;
+ GimpTileBackendTileManagerPrivate *priv;
};
struct _GimpTileBackendTileManagerClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]