Commit d3a8ec0c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

configure.in gimpthumb-1.3.pc.in libgimpthumb/Makefile.am

2003-11-26  Sven Neumann  <sven@gimp.org>

	* Makefile.am:
	* configure.in
	* gimpthumb-1.3.pc.in
	* libgimpthumb/Makefile.am
	* libgimpthumb/gimpthumb-enums.h
	* libgimpthumb/gimpthumb-types.h
	* libgimpthumb/gimpthumb.def
	* libgimpthumb/gimpthumb.h
	* libgimpthumb/gimpthumb-utils.[ch]
	* libgimpthumb/gimpthumbnail.[ch]: added a first draft of
	libgimpthumb. The API isn't final and the implementation is
	incomplete. It compiles but don't attempt to use it yet.
parent 8d6a05ef
......@@ -15,6 +15,7 @@ gimp.spec
gimptool-1.3
gimptool-win32.c
gimp-1.3.pc
gimpthumb-1.3.pc
gimpui-1.3.pc
gimp-zip
intltool-extract
......
2003-11-26 Sven Neumann <sven@gimp.org>
* Makefile.am:
* configure.in
* gimpthumb-1.3.pc.in
* libgimpthumb/Makefile.am
* libgimpthumb/gimpthumb-enums.h
* libgimpthumb/gimpthumb-types.h
* libgimpthumb/gimpthumb.def
* libgimpthumb/gimpthumb.h
* libgimpthumb/gimpthumb-utils.[ch]
* libgimpthumb/gimpthumbnail.[ch]: added a first draft of
libgimpthumb. The API isn't final and the implementation is
incomplete. It compiles but don't attempt to use it yet.
2003-11-25 Sven Neumann <sven@gimp.org>
* libgimpbase/gimplimits.h: added GIMP_MAX_MEMSIZE, an arbitrary
......@@ -28,7 +28,10 @@ SUBDIRS = \
bin_SCRIPTS = gimptool-$(LT_RELEASE) @GIMPINSTALL@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gimp-$(LT_RELEASE).pc gimpui-$(LT_RELEASE).pc
pkgconfig_DATA = \
gimp-$(LT_RELEASE).pc \
gimpthumb-$(LT_RELEASE).pc \
gimpui-$(LT_RELEASE).pc
EXTRA_SCRIPTS = gimpinstall-$(LT_RELEASE)
......
......@@ -1376,6 +1376,7 @@ libgimpbase/Makefile
libgimpcolor/Makefile
libgimpmath/Makefile
libgimpmodule/Makefile
libgimpthumb/Makefile
libgimpwidgets/Makefile
app/Makefile
app/base/Makefile
......@@ -1481,6 +1482,7 @@ po-plug-ins/Makefile.in
po-script-fu/Makefile.in
gimptool-1.3
gimp-1.3.pc
gimpthumb-1.3.pc
gimpui-1.3.pc
gimp.spec
gimp-zip
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: GIMP Thumb
Description: GIMP Thumbnail Library
Version: @VERSION@
Requires: gdk-pixbuf-2.0
Libs: -L${libdir} -lgimpmath-1.3 -lgimpthumb-1.3
Cflags: -I${includedir}/gimp-1.3
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: GIMP Thumb
Description: GIMP Thumbnail Library
Version: @VERSION@
Requires: gdk-pixbuf-2.0
Libs: -L${libdir} -lgimpmath-1.3 -lgimpthumb-1.3
Cflags: -I${includedir}/gimp-1.3
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: GIMP Thumb
Description: GIMP Thumbnail Library
Version: @VERSION@
Requires: gdk-pixbuf-2.0
Libs: -L${libdir} -lgimpmath-1.3 -lgimpthumb-1.3
Cflags: -I${includedir}/gimp-1.3
Makefile
Makefile.in
makefile.mingw
gimpthumb-enums.c
*.lo
_libs
.libs
.deps
*.la
*.lib
*.exp
## Process this file with automake to produce Makefile.in
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
if OS_WIN32
gimpthumb_def = gimpthumb.def
libgimpthumb_export_symbols = -export-symbols gimpthumb.def
install-libtool-import-lib:
$(INSTALL) .libs/libgimpthumb-$(LT_RELEASE).dll.a $(DESTDIR)$(libdir)
uninstall-libtool-import-lib:
-rm $(DESTDIR)$(libdir)/libgimpthumb-$(LT_RELEASE).dll.a
else
install-libtool-import-lib:
uninstall-libtool-import-lib:
endif
if MS_LIB_AVAILABLE
noinst_DATA = gimpthumb-$(LT_RELEASE).lib
install-ms-lib:
$(INSTALL) gimpthumb-$(LT_RELEASE).lib $(DESTDIR)$(libdir)
uninstall-ms-lib:
-rm $(DESTDIR)$(libdir)/gimpthumb-$(LT_RELEASE).lib
gimpthumb-@LT_RELEASE@.lib: gimpthumb.def
lib -name:libgimpthumb-$(LT_RELEASE)-@LT_CURRENT_MINUS_AGE@.dll -def:gimpthumb.def -out:$@
else
install-ms-lib:
uninstall-ms-lib:
endif
libgimpthumbincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimpthumb
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"LibGimpThumb\" \
@GIMP_THREAD_FLAGS@
INCLUDES = \
-I$(top_srcdir) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
EXTRA_DIST = \
makefile.msc \
gimpthumb.def
lib_LTLIBRARIES = libgimpthumb-1.3.la
libgimpthumb_1_3_la_SOURCES = \
gimpthumb.h \
gimpthumb-enums.c \
gimpthumb-enums.h \
gimpthumb-types.h \
gimpthumb-utils.c \
gimpthumb-utils.h \
gimpthumbnail.c \
gimpthumbnail.h
libgimpthumbinclude_HEADERS = \
gimpthumb.h \
gimpthumb-enums.h \
gimpthumb-types.h \
gimpthumbnail.h
libgimpthumb_1_3_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
$(no_undefined) \
$(libgimpthumb_export_symbols)
libgimpthumb_1_3_la_LIBADD = $(libgimpmath) $(GDK_PIXBUF_LIBS)
install-data-local: install-ms-lib install-libtool-import-lib
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
#
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/gimpthumb-enums.c: $(srcdir)/gimpthumb-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"gimpthumb-enums.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/gimpthumb-enums.h > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_THUMB_ENUMS_H__
#define __GIMP_THUMB_ENUMS_H__
#define GIMP_TYPE_THUMB_SIZE (gimp_thumb_size_get_type ())
GType gimp_thumb_size_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_THUMB_SIZE_FAIL = 0,
GIMP_THUMB_SIZE_NORMAL = 128,
GIMP_THUMB_SIZE_LARGE = 256
} GimpThumbSize;
#define GIMP_TYPE_THUMB_STATE (gimp_thumb_state_get_type ())
GType gimp_thumb_state_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_THUMB_STATE_UNKNOWN,
GIMP_THUMB_STATE_REMOTE,
GIMP_THUMB_STATE_NOT_FOUND,
GIMP_THUMB_STATE_EXISTS,
GIMP_THUMB_STATE_THUMBNAIL_NOT_FOUND,
GIMP_THUMB_STATE_THUMBNAIL_EXISTS,
GIMP_THUMB_STATE_THUMBNAIL_OLD,
GIMP_THUMB_STATE_THUMBNAIL_FAILED,
GIMP_THUMB_STATE_THUMBNAIL_OK
} GimpThumbState;
#endif /* __GIMP_THUMB_ENUMS_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_THUMB_TYPES_H__
#define __GIMP_THUMB_TYPES_H__
#include <libgimpthumb/gimpthumb-enums.h>
G_BEGIN_DECLS
typedef struct _GimpThumbnail GimpThumbnail;
G_END_DECLS
#endif /* __GIMP_THUMB_TYPES_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
#ifdef G_OS_WIN32
#include <libgimpbase/gimpwin32-io.h>
#endif
#include "libgimpmath/gimpmath.h"
#include "gimpthumb-types.h"
#include "gimpthumb-utils.h"
static const gchar * gimp_thumb_png_name (const gchar *uri);
static void gimp_thumb_exit (void);
static gboolean gimp_thumb_initialized = FALSE;
static gint thumb_num_sizes = 0;
static gint *thumb_sizes = NULL;
static gchar *thumb_dir = NULL;
static gchar **thumb_subdirs = NULL;
static gchar *thumb_fail_subdir = NULL;
gboolean
gimp_thumb_init (const gchar *creator,
const gchar *thumb_basedir)
{
GEnumClass *enum_class;
GEnumValue *enum_value;
gint i;
g_return_val_if_fail (creator != NULL, FALSE);
if (gimp_thumb_initialized)
gimp_thumb_exit ();
thumb_dir = (thumb_basedir ?
g_strdup (thumb_basedir) :
g_build_filename (g_get_home_dir(), ".thumbnails", NULL));
enum_class = g_type_class_ref (GIMP_TYPE_THUMB_SIZE);
thumb_num_sizes = enum_class->n_values;
thumb_subdirs = g_new (gchar *, thumb_num_sizes);
for (i = 0, enum_value = enum_class->values;
i < enum_class->n_values;
i++, enum_value++)
{
thumb_sizes[i] = enum_value->value;
thumb_subdirs[i] = g_build_filename (thumb_dir,
enum_value->value_nick, NULL);
}
thumb_fail_subdir = thumb_subdirs[0];
thumb_subdirs[0] = g_build_filename (thumb_fail_subdir, creator, NULL);
gimp_thumb_initialized = TRUE;
return gimp_thumb_initialized;
}
gchar *
gimp_thumb_png_thumb_path (const gchar *uri,
GimpThumbSize *size)
{
const gchar *name;
gchar *thumb_name = NULL;
gint i = 0;
g_return_val_if_fail (gimp_thumb_initialized, NULL);
if (strstr (uri, "/.thumbnails/"))
return NULL;
name = gimp_thumb_png_name (uri);
if (*size != GIMP_THUMB_SIZE_FAIL)
{
for (i = 1;
i < thumb_num_sizes && thumb_sizes[i] < *size;
i++)
/* nothing */;
if (i == thumb_num_sizes)
i--;
}
*size = thumb_sizes[i];
if (! g_file_test (thumb_subdirs[i], G_FILE_TEST_IS_DIR))
{
if (g_file_test (thumb_dir, G_FILE_TEST_IS_DIR) ||
(mkdir (thumb_dir, S_IRUSR | S_IWUSR | S_IXUSR) == 0))
{
if (i == 0)
mkdir (thumb_fail_subdir, S_IRUSR | S_IWUSR | S_IXUSR);
mkdir (thumb_subdirs[i], S_IRUSR | S_IWUSR | S_IXUSR);
}
if (! g_file_test (thumb_subdirs[i], G_FILE_TEST_IS_DIR))
{
g_message ("Failed to create thumbnail folder '%s'.",
thumb_subdirs[i]);
return NULL;
}
}
thumb_name = g_build_filename (thumb_subdirs[i], name, NULL);
return thumb_name;
}
gchar *
gimp_thumbnail_find_png_thumb (const gchar *uri,
GimpThumbSize *size)
{
const gchar *name;
gchar *thumb_name;
gint i, n;
g_return_val_if_fail (gimp_thumb_initialized, NULL);
name = gimp_thumb_png_name (uri);
for (i = 1; i < thumb_num_sizes && thumb_sizes[i] < *size; i++)
/* do nothing */;
n = i;
for (; i < thumb_num_sizes; i++)
{
thumb_name = g_build_filename (thumb_subdirs[i], name, NULL);
if (gimp_thumb_file_test (thumb_name, NULL, NULL))
{
*size = thumb_sizes[i];
return thumb_name;
}
g_free (thumb_name);
}
for (i = n - 1; i >= 0; i--)
{
thumb_name = g_build_filename (thumb_subdirs[i], name, NULL);
if (gimp_thumb_file_test (thumb_name, NULL, NULL))
{
*size = thumb_sizes[i];
return thumb_name;
}
g_free (thumb_name);
}
return NULL;
}
gboolean
gimp_thumb_file_test (const gchar *filename,
gint64 *mtime,
gint64 *size)
{
struct stat s;
if (stat (filename, &s) == 0 && (S_ISREG (s.st_mode)))
{
if (mtime)
*mtime = s.st_mtime;
if (size)
*size = s.st_size;
return TRUE;
}
return FALSE;
}
static void
gimp_thumb_exit (void)
{
gint i;
g_free (thumb_dir);
g_free (thumb_sizes);
for (i = 0; i < thumb_num_sizes; i++)
g_free (thumb_subdirs[i]);
g_free (thumb_subdirs);
g_free (thumb_fail_subdir);
thumb_num_sizes = 0;
thumb_sizes = NULL;
thumb_dir = NULL;
thumb_subdirs = NULL;
thumb_fail_subdir = NULL;
gimp_thumb_initialized = FALSE;
}
static const gchar *
gimp_thumb_png_name (const gchar *uri)
{
static gchar name[40];
guchar digest[16];
guchar n;
gint i;
gimp_md5_get_digest (uri, -1, digest);
for (i = 0; i < 16; i++)
{
n = (digest[i] >> 4) & 0xF;
name[i * 2] = (n > 9) ? 'a' + n - 10 : '0' + n;
n = digest[i] & 0xF;
name[i * 2 + 1] = (n > 9) ? 'a' + n - 10 : '0' + n;
}
strncpy (name + 32, ".png", 5);
return (const gchar *) name;
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_THUMB_UTILS_H__
#define __GIMP_THUMB_UTILS_H__
G_BEGIN_DECLS
gboolean gimp_thumb_init (const gchar *creator,
const gchar *thumb_basedir);
gchar * gimp_thumb_png_thumb_path (const gchar *uri,
GimpThumbSize *size);
gchar * gimp_thumbnail_find_png_thumb (const gchar *uri,
GimpThumbSize *size);
gboolean gimp_thumb_file_test (const gchar *filename,
gint64 *mtime,
gint64 *size);
G_END_DECLS
#endif /* __GIMP_THUMB_UTILS_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_THUMB_H__
#define __GIMP_THUMB_H__
#include <libgimpthumb/gimpthumb-types.h>
#include <libgimpthumb/gimpthumb-utils.h>
#include <libgimpthumb/gimpthumbnail.h>
#endif /* __GIMP_THUMB_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Thumbnail handling according to the Thumbnail Managing Standard.
* http://triq.net/~pearl/thumbnail-spec/
*
* Copyright (C) 2001-2003 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gimpthumb-types.h"
#include "gimpthumb-utils.h"
#include "gimpthumbnail.h"
#define TAG_DESCRIPTION "tEXt::Description"
#define TAG_SOFTWARE "tEXt::Software"
#define TAG_THUMB_URI "tEXt::Thumb::URI"
#define TAG_THUMB_MTIME "tEXt::Thumb::MTime"
#define TAG_THUMB_FILESIZE "tEXt::Thumb::Size"
#define TAG_THUMB_IMAGE_WIDTH "tEXt::Thumb::Image::Width"
#define TAG_THUMB_IMAGE_HEIGHT "tEXt::Thumb::Image::Height"
#define TAG_THUMB_GIMP_TYPE "tEXt::Thumb::X-GIMP::Type"
#define TAG_THUMB_GIMP_LAYERS "tEXt::Thumb::X-GIMP::Layers"
enum
{
PROP_0,
PROP_URI,
PROP_STATE,
PROP_MTIME,
PROP_FILESIZE,
PROP_WIDTH,
PROP_HEIGHT,
PROP_TYPE,
PROP_NUM_LAYERS
};
static void gimp_thumbnail_class_init (GimpThumbnailClass *klass);
static void gimp_thumbnail_init (GimpThumbnail *thumbnail);
static void gimp_thumbnail_finalize (GObject *object);
static void gimp_thumbnail_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_thumbnail_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_thumbnail_reset_info (GimpThumbnail *thumbnail);
static GdkPixbuf * gimp_thumbnail_read_png_thumb (GimpThumbnail *thumbnail,
GimpThumbSize thumb_size,
GError **error);
static GObjectClass *parent_class = NULL;
GType
gimp_thumbnail_get_type (void)
{
static GType thumbnail_type = 0;
if (!thumbnail_type)
{
static const GTypeInfo thumbnail_info =
{
sizeof (GimpThumbnailClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_thumbnail_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpThumbnail),