Commit 0c6bd292 authored by Bastien Nocera's avatar Bastien Nocera Committed by Emmanuele Bassi

core: Split off the initialisation sections

Separate the builtin loaders setup from the external loaders
initialisation from the loaders.cache file.

https://bugzilla.gnome.org/show_bug.cgi?id=786035
parent d73be6ca
......@@ -383,8 +383,8 @@ static gboolean
gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
GError **error);
static void
gdk_pixbuf_io_init (void)
static void
gdk_pixbuf_io_init_modules (void)
{
#ifdef USE_GMODULE
GIOChannel *channel;
......@@ -400,75 +400,6 @@ gdk_pixbuf_io_init (void)
GError *error = NULL;
#endif
#define load_one_builtin_module(format) G_STMT_START { \
GdkPixbufModule *__builtin_module = g_new0 (GdkPixbufModule, 1); \
__builtin_module->module_name = #format; \
if (gdk_pixbuf_load_module_unlocked (__builtin_module, NULL)) \
file_formats = g_slist_prepend (file_formats, __builtin_module); \
else \
g_free (__builtin_module); } G_STMT_END
#ifdef INCLUDE_ani
load_one_builtin_module (ani);
#endif
#ifdef INCLUDE_png
load_one_builtin_module (png);
#endif
#ifdef INCLUDE_bmp
load_one_builtin_module (bmp);
#endif
#ifdef INCLUDE_gif
load_one_builtin_module (gif);
#endif
#ifdef INCLUDE_ico
load_one_builtin_module (ico);
#endif
#ifdef INCLUDE_jpeg
load_one_builtin_module (jpeg);
#endif
#ifdef INCLUDE_pnm
load_one_builtin_module (pnm);
#endif
#ifdef INCLUDE_tiff
load_one_builtin_module (tiff);
#endif
#ifdef INCLUDE_xpm
load_one_builtin_module (xpm);
#endif
#ifdef INCLUDE_xbm
load_one_builtin_module (xbm);
#endif
#ifdef INCLUDE_tga
load_one_builtin_module (tga);
#endif
#ifdef INCLUDE_icns
load_one_builtin_module (icns);
#endif
#ifdef INCLUDE_jasper
load_one_builtin_module (jasper);
#endif
#ifdef INCLUDE_qtif
load_one_builtin_module (qtif);
#endif
#ifdef INCLUDE_gdiplus
/* We don't bother having the GDI+ loaders individually selectable
* for building in or not.
*/
load_one_builtin_module (ico);
load_one_builtin_module (wmf);
load_one_builtin_module (emf);
load_one_builtin_module (bmp);
load_one_builtin_module (gif);
load_one_builtin_module (jpeg);
load_one_builtin_module (tiff);
#endif
#ifdef INCLUDE_gdip_png
/* Except the gdip-png loader which normally isn't built at all even */
load_one_builtin_module (png);
#endif
#undef load_one_builtin_module
#ifdef USE_GMODULE
channel = g_io_channel_new_file (filename, "r", &error);
if (!channel) {
......@@ -623,6 +554,85 @@ gdk_pixbuf_io_init (void)
#endif
}
static void
gdk_pixbuf_io_init_builtin (void)
{
#define load_one_builtin_module(format) G_STMT_START { \
GdkPixbufModule *__builtin_module = g_new0 (GdkPixbufModule, 1); \
__builtin_module->module_name = #format; \
if (gdk_pixbuf_load_module_unlocked (__builtin_module, NULL)) \
file_formats = g_slist_prepend (file_formats, __builtin_module); \
else \
g_free (__builtin_module); } G_STMT_END
#ifdef INCLUDE_ani
load_one_builtin_module (ani);
#endif
#ifdef INCLUDE_png
load_one_builtin_module (png);
#endif
#ifdef INCLUDE_bmp
load_one_builtin_module (bmp);
#endif
#ifdef INCLUDE_gif
load_one_builtin_module (gif);
#endif
#ifdef INCLUDE_ico
load_one_builtin_module (ico);
#endif
#ifdef INCLUDE_jpeg
load_one_builtin_module (jpeg);
#endif
#ifdef INCLUDE_pnm
load_one_builtin_module (pnm);
#endif
#ifdef INCLUDE_tiff
load_one_builtin_module (tiff);
#endif
#ifdef INCLUDE_xpm
load_one_builtin_module (xpm);
#endif
#ifdef INCLUDE_xbm
load_one_builtin_module (xbm);
#endif
#ifdef INCLUDE_tga
load_one_builtin_module (tga);
#endif
#ifdef INCLUDE_icns
load_one_builtin_module (icns);
#endif
#ifdef INCLUDE_jasper
load_one_builtin_module (jasper);
#endif
#ifdef INCLUDE_qtif
load_one_builtin_module (qtif);
#endif
#ifdef INCLUDE_gdiplus
/* We don't bother having the GDI+ loaders individually selectable
* for building in or not.
*/
load_one_builtin_module (ico);
load_one_builtin_module (wmf);
load_one_builtin_module (emf);
load_one_builtin_module (bmp);
load_one_builtin_module (gif);
load_one_builtin_module (jpeg);
load_one_builtin_module (tiff);
#endif
#ifdef INCLUDE_gdip_png
/* Except the gdip-png loader which normally isn't built at all even */
load_one_builtin_module (png);
#endif
#undef load_one_builtin_module
}
static void
gdk_pixbuf_io_init (void)
{
gdk_pixbuf_io_init_builtin ();
gdk_pixbuf_io_init_modules ();
}
#define module(type) \
extern void _gdk_pixbuf__##type##_fill_info (GdkPixbufFormat *info); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment