|
Packit Service |
2781ba |
/* This file is part of GEGL.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
2781ba |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
2781ba |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
2781ba |
* version 3 of the License, or (at your option) any later version.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
2781ba |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
2781ba |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
2781ba |
* Lesser General Public License for more details.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
2781ba |
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
2781ba |
*
|
|
Packit Service |
2781ba |
* Copyright 2006, 2007 Øyvind Kolås <pippin@gimp.org>
|
|
Packit Service |
2781ba |
*/
|
|
Packit Service |
2781ba |
#include "config.h"
|
|
Packit Service |
2781ba |
#include <glib.h>
|
|
Packit Service |
2781ba |
#include <glib-object.h>
|
|
Packit Service |
2781ba |
#include <string.h>
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
#include "gegl-buffer-types.h"
|
|
Packit Service |
2781ba |
#include "gegl-tile-handler.h"
|
|
Packit Service |
2781ba |
#include "gegl-tile-handler-log.h"
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
G_DEFINE_TYPE (GeglTileHandlerLog, gegl_tile_handler_log, GEGL_TYPE_TILE_HANDLER)
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static const char *commands[] =
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
"idle",
|
|
Packit Service |
2781ba |
"set",
|
|
Packit Service |
2781ba |
"get",
|
|
Packit Service |
2781ba |
"is_cached",
|
|
Packit Service |
2781ba |
"exist",
|
|
Packit Service |
2781ba |
"-", /*void*/
|
|
Packit Service |
2781ba |
"flush",
|
|
Packit Service |
2781ba |
"refetch",
|
|
Packit Service |
2781ba |
"last command",
|
|
Packit Service |
2781ba |
"eeek",
|
|
Packit Service |
2781ba |
NULL
|
|
Packit Service |
2781ba |
};
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static gpointer
|
|
Packit Service |
2781ba |
gegl_tile_handler_log_command (GeglTileSource *gegl_tile_source,
|
|
Packit Service |
2781ba |
GeglTileCommand command,
|
|
Packit Service |
2781ba |
gint x,
|
|
Packit Service |
2781ba |
gint y,
|
|
Packit Service |
2781ba |
gint z,
|
|
Packit Service |
2781ba |
gpointer data)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
GeglTileHandler *handler = GEGL_TILE_HANDLER (gegl_tile_source);
|
|
Packit Service |
2781ba |
gpointer result = NULL;
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
result = gegl_tile_handler_source_command (handler, command, x, y, z, data);
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
switch (command)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
case GEGL_TILE_IDLE:
|
|
Packit Service |
2781ba |
/* idle messages clutter logging output */
|
|
Packit Service |
2781ba |
break;
|
|
Packit Service |
2781ba |
default:
|
|
Packit Service |
2781ba |
if (result)
|
|
Packit Service |
2781ba |
g_print ("(%s %p %p %i·%i·%i ⇒%p)",
|
|
Packit Service |
2781ba |
commands[command], GINT_TO_POINTER(GPOINTER_TO_INT(gegl_tile_source)&0xffff), GINT_TO_POINTER(GPOINTER_TO_INT(data)&0xffff), x, y, z,
|
|
Packit Service |
2781ba |
result);
|
|
Packit Service |
2781ba |
else
|
|
Packit Service |
2781ba |
g_print ("(%s %p %p %i·%i·%i ☹)",
|
|
Packit Service |
2781ba |
commands[command], GINT_TO_POINTER(GPOINTER_TO_INT(gegl_tile_source)&0xffff), data, x, y, z);
|
|
Packit Service |
2781ba |
}
|
|
Packit Service |
2781ba |
return result;
|
|
Packit Service |
2781ba |
}
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static void
|
|
Packit Service |
2781ba |
gegl_tile_handler_log_class_init (GeglTileHandlerLogClass *klass)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
}
|
|
Packit Service |
2781ba |
|
|
Packit Service |
2781ba |
static void
|
|
Packit Service |
2781ba |
gegl_tile_handler_log_init (GeglTileHandlerLog *self)
|
|
Packit Service |
2781ba |
{
|
|
Packit Service |
2781ba |
((GeglTileSource*)self)->command = gegl_tile_handler_log_command;
|
|
Packit Service |
2781ba |
}
|