gegl r2167 - in trunk: . gegl/buffer
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2167 - in trunk: . gegl/buffer
- Date: Mon, 14 Apr 2008 22:05:28 +0100 (BST)
Author: ok
Date: Mon Apr 14 22:05:28 2008
New Revision: 2167
URL: http://svn.gnome.org/viewvc/gegl?rev=2167&view=rev
Log:
Changed the tile message/manipulation bus to return a gpointer instead
of a gboolean for the calls.
* gegl/buffer/gegl-provider.c: (message):
* gegl/buffer/gegl-provider.h:
* gegl/buffer/gegl-handler-cache.c: (message):
* gegl/buffer/gegl-handler-log.c: (message):
* gegl/buffer/gegl-handler-zoom.c:
* gegl/buffer/gegl-handler.c: (gegl_handler_chain_up):
* gegl/buffer/gegl-handler.h:
* gegl/buffer/gegl-handlers.c:
* gegl/buffer/gegl-storage.c: (gegl_storage_constructor):
* gegl/buffer/gegl-tile-disk.c: (set_tile), (void_tile),
(exist_tile), (message):
* gegl/buffer/gegl-tile-gio.c: (set_tile), (void_tile), (message):
* gegl/buffer/gegl-tile-mem.c: (message):
* gegl/buffer/gegl-tile.c: (gegl_tile_store):
Modified:
trunk/ChangeLog
trunk/gegl/buffer/gegl-handler-cache.c
trunk/gegl/buffer/gegl-handler-log.c
trunk/gegl/buffer/gegl-handler-zoom.c
trunk/gegl/buffer/gegl-handler.c
trunk/gegl/buffer/gegl-handler.h
trunk/gegl/buffer/gegl-handlers.c
trunk/gegl/buffer/gegl-provider.c
trunk/gegl/buffer/gegl-provider.h
trunk/gegl/buffer/gegl-storage.c
trunk/gegl/buffer/gegl-tile-disk.c
trunk/gegl/buffer/gegl-tile-gio.c
trunk/gegl/buffer/gegl-tile-mem.c
trunk/gegl/buffer/gegl-tile.c
Modified: trunk/gegl/buffer/gegl-handler-cache.c
==============================================================================
--- trunk/gegl/buffer/gegl-handler-cache.c (original)
+++ trunk/gegl/buffer/gegl-handler-cache.c Mon Apr 14 22:05:28 2008
@@ -125,7 +125,7 @@
}
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
@@ -138,13 +138,13 @@
if (message == GEGL_TILE_IS_CACHED)
{
- return gegl_handler_cache_has_tile (cache, x, y, z);
+ return (gpointer)gegl_handler_cache_has_tile (cache, x, y, z);
}
if (message == GEGL_TILE_EXIST)
{
gboolean is_cached = gegl_handler_cache_has_tile (cache, x, y, z);
if (is_cached)
- return TRUE; /* XXX: perhaps we could return an integer/pointer
+ return (gpointer)TRUE; /* XXX: perhaps we could return an integer/pointer
* value over the bus instead of a boolean?
*/
/* otherwise pass on the request */
@@ -154,11 +154,12 @@
{
gboolean action = gegl_handler_cache_wash (cache);
if (action)
- return action;
+ return (gpointer)action;
}
if (message == GEGL_TILE_VOID)
{
gegl_handler_cache_void (cache, x, y, z);
+ return NULL;
}
return gegl_handler_chain_up (handler, message, x, y, z, data);
}
Modified: trunk/gegl/buffer/gegl-handler-log.c
==============================================================================
--- trunk/gegl/buffer/gegl-handler-log.c (original)
+++ trunk/gegl/buffer/gegl-handler-log.c Mon Apr 14 22:05:28 2008
@@ -47,7 +47,7 @@
"void br", "undo start group", "last message", "eeek", NULL
};
-static gboolean
+static gpointer
message (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
@@ -56,7 +56,7 @@
gpointer data)
{
GeglHandler *handler = GEGL_HANDLER (gegl_provider);
- gboolean result = FALSE;
+ gpointer result = NULL;
result = gegl_handler_chain_up (handler, message, x, y, z, data);
Modified: trunk/gegl/buffer/gegl-handler-zoom.c
==============================================================================
--- trunk/gegl/buffer/gegl-handler-zoom.c (original)
+++ trunk/gegl/buffer/gegl-handler-zoom.c Mon Apr 14 22:05:28 2008
@@ -327,7 +327,7 @@
return tile;
}
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
Modified: trunk/gegl/buffer/gegl-handler.c
==============================================================================
--- trunk/gegl/buffer/gegl-handler.c (original)
+++ trunk/gegl/buffer/gegl-handler.c Mon Apr 14 22:05:28 2008
@@ -65,7 +65,7 @@
return tile;
}
-static gboolean
+static gpointer
message (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
@@ -135,7 +135,7 @@
}
}
-gboolean gegl_handler_chain_up (GeglHandler *handler,
+gpointer gegl_handler_chain_up (GeglHandler *handler,
GeglTileMessage message,
gint x,
gint y,
@@ -145,7 +145,7 @@
GeglProvider *provider = gegl_handler_get_provider (handler);
if (provider)
return gegl_provider_message (provider, message, x, y, z, data);
- return FALSE;
+ return NULL;
}
static void
Modified: trunk/gegl/buffer/gegl-handler.h
==============================================================================
--- trunk/gegl/buffer/gegl-handler.h (original)
+++ trunk/gegl/buffer/gegl-handler.h Mon Apr 14 22:05:28 2008
@@ -48,7 +48,7 @@
#define gegl_handler_get_provider(handler) (((GeglHandler*)handler)->provider)
-gboolean gegl_handler_chain_up (GeglHandler *handler,
+gpointer gegl_handler_chain_up (GeglHandler *handler,
GeglTileMessage message,
gint x,
gint y,
Modified: trunk/gegl/buffer/gegl-handlers.c
==============================================================================
--- trunk/gegl/buffer/gegl-handlers.c (original)
+++ trunk/gegl/buffer/gegl-handlers.c Mon Apr 14 22:05:28 2008
@@ -104,7 +104,7 @@
return tile;
}
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
Modified: trunk/gegl/buffer/gegl-provider.c
==============================================================================
--- trunk/gegl/buffer/gegl-provider.c (original)
+++ trunk/gegl/buffer/gegl-provider.c Mon Apr 14 22:05:28 2008
@@ -31,7 +31,7 @@
return NULL;
}
-static gboolean
+static gpointer
message (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
@@ -39,8 +39,8 @@
gint z,
gpointer data)
{
- g_warning ("Unhandled message: %i, %i, %i, %p", message, x, y, data);
- return FALSE;
+ g_warning ("Unhandled message: %s %i, %i, %i, %p", G_STRFUNC, message, x, y, data);
+ return NULL;
}
static void
@@ -77,13 +77,13 @@
return klass->get_tile (gegl_provider, x, y, z);
}
-gboolean
-gegl_provider_message (GeglProvider *gegl_provider,
- GeglTileMessage message,
- gint x,
- gint y,
- gint z,
- gpointer data)
+gpointer
+gegl_provider_message (GeglProvider *gegl_provider,
+ GeglTileMessage message,
+ gint x,
+ gint y,
+ gint z,
+ gpointer data)
{
GeglProviderClass *klass;
Modified: trunk/gegl/buffer/gegl-provider.h
==============================================================================
--- trunk/gegl/buffer/gegl-provider.h (original)
+++ trunk/gegl/buffer/gegl-provider.h Mon Apr 14 22:05:28 2008
@@ -64,7 +64,7 @@
gint y,
gint z);
- gboolean (*message) (GeglProvider *gegl_provider,
+ gpointer (*message) (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
gint y,
@@ -79,7 +79,7 @@
gint y,
gint z);
-gboolean gegl_provider_message (GeglProvider *gegl_provider,
+gpointer gegl_provider_message (GeglProvider *gegl_provider,
GeglTileMessage message,
gint x,
gint y,
Modified: trunk/gegl/buffer/gegl-storage.c
==============================================================================
--- trunk/gegl/buffer/gegl-storage.c (original)
+++ trunk/gegl/buffer/gegl-storage.c Mon Apr 14 22:05:28 2008
@@ -186,7 +186,7 @@
if (storage->path != NULL)
{
-#if 1
+#if 0
g_object_set (storage,
"provider", g_object_new (GEGL_TYPE_TILE_DISK,
"tile-width", storage->tile_width,
Modified: trunk/gegl/buffer/gegl-tile-disk.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-disk.c (original)
+++ trunk/gegl/buffer/gegl-tile-disk.c Mon Apr 14 22:05:28 2008
@@ -267,7 +267,7 @@
return tile;
}
-static gboolean
+static gpointer
set_tile (GeglProvider *store,
GeglTile *tile,
gint x,
@@ -293,10 +293,10 @@
*/
disk_entry_write (tile_disk, entry, tile->data);
tile->stored_rev = tile->rev;
- return TRUE;
+ return NULL;
}
-static gboolean
+static gpointer
void_tile (GeglProvider *store,
GeglTile *tile,
gint x,
@@ -312,10 +312,10 @@
disk_entry_destroy (entry, tile_disk);
}
- return TRUE;
+ return NULL;
}
-static gboolean
+static gpointer
exist_tile (GeglProvider *store,
GeglTile *tile,
gint x,
@@ -326,7 +326,7 @@
GeglTileDisk *tile_disk = GEGL_TILE_DISK (backend);
DiskEntry *entry = lookup_entry (tile_disk, x, y, z);
- return entry != NULL;
+ return entry!=NULL?((gpointer)0x1):NULL;
}
enum
@@ -335,7 +335,7 @@
PROP_PATH
};
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
@@ -349,7 +349,7 @@
return set_tile (tile_store, data, x, y, z);
case GEGL_TILE_IDLE:
- return FALSE;
+ return NULL;
case GEGL_TILE_VOID:
return void_tile (tile_store, data, x, y, z);
Modified: trunk/gegl/buffer/gegl-tile-gio.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-gio.c (original)
+++ trunk/gegl/buffer/gegl-tile-gio.c Mon Apr 14 22:05:28 2008
@@ -180,7 +180,7 @@
return NULL;
}
-static gboolean
+static gpointer
set_tile (GeglProvider *store,
GeglTile *tile,
gint x,
@@ -197,10 +197,10 @@
*/
gio_entry_write (tile_gio, &entry, tile->data);
tile->stored_rev = tile->rev;
- return TRUE;
+ return NULL;
}
-static gboolean
+static gpointer
void_tile (GeglProvider *store,
GeglTile *tile,
gint x,
@@ -214,7 +214,7 @@
file = make_tile_file (gio, x, y, z);
g_file_delete (file, NULL, NULL);
g_object_unref (file);
- return TRUE;
+ return NULL;
}
static gboolean
@@ -250,7 +250,7 @@
PROP_PATH
};
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
@@ -265,19 +265,19 @@
case GEGL_TILE_IDLE:
/* this backend has nothing to do on idle calls */
- return FALSE;
+ return NULL;
case GEGL_TILE_VOID:
return void_tile (tile_store, data, x, y, z);
case GEGL_TILE_EXIST:
- return exist_tile (tile_store, data, x, y, z);
+ return (gpointer)exist_tile (tile_store, data, x, y, z);
default:
g_assert (message < GEGL_TILE_LAST_MESSAGE &&
message >= 0);
}
- return FALSE;
+ return NULL;
}
static void
Modified: trunk/gegl/buffer/gegl-tile-mem.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-mem.c (original)
+++ trunk/gegl/buffer/gegl-tile-mem.c Mon Apr 14 22:05:28 2008
@@ -226,7 +226,7 @@
PROP_0,
};
-static gboolean
+static gpointer
message (GeglProvider *tile_store,
GeglTileMessage message,
gint x,
@@ -237,16 +237,18 @@
switch (message)
{
case GEGL_TILE_SET:
- return set_tile (tile_store, data, x, y, z);
+ set_tile (tile_store, data, x, y, z);
+ return NULL;
case GEGL_TILE_IDLE:
- return FALSE;
+ return NULL;
case GEGL_TILE_VOID:
- return void_tile (tile_store, data, x, y, z);
+ void_tile (tile_store, data, x, y, z);
+ return NULL;
case GEGL_TILE_EXIST:
- return exist_tile (tile_store, data, x, y, z);
+ return (gpointer)exist_tile (tile_store, data, x, y, z);
default:
g_assert (message < GEGL_TILE_LAST_MESSAGE &&
Modified: trunk/gegl/buffer/gegl-tile.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile.c (original)
+++ trunk/gegl/buffer/gegl-tile.c Mon Apr 14 22:05:28 2008
@@ -406,10 +406,10 @@
{
if (tile->storage == NULL)
return FALSE;
- return gegl_provider_message (GEGL_PROVIDER (tile->storage),
- GEGL_TILE_SET, tile->storage_x,
- tile->storage_y,
- tile->storage_z, tile);
+ return GPOINTER_TO_INT (gegl_provider_message (GEGL_PROVIDER (tile->storage),
+ GEGL_TILE_SET, tile->storage_x,
+ tile->storage_y,
+ tile->storage_z, tile));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]