From cd554e6f1e42c440c791845a1a635415b23a19a2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 28 Aug 2011 14:29:15 +0000 Subject: make image content handlers build conditional from teh makefile svn path=/trunk/netsurf/; revision=12673 --- image/image.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'image/image.c') diff --git a/image/image.c b/image/image.c index 8ef96eeba..779826a17 100644 --- a/image/image.c +++ b/image/image.c @@ -16,8 +16,13 @@ * along with this program. If not, see . */ -#include "image/image.h" +#include +#include +#include + +#include "utils/errors.h" +#include "image/image.h" #include "image/bmp.h" #include "image/gif.h" #include "image/ico.h" @@ -29,6 +34,8 @@ #include "image/svg.h" #include "image/webp.h" +#include "utils/config.h" + /** * Initialise image content handlers * @@ -38,49 +45,70 @@ nserror image_init(void) { nserror error; +#ifdef WITH_BMP error = nsbmp_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_GIF error = nsgif_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_BMP error = nsico_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_JPEG error = nsjpeg_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_MNG error = nsmng_init(); if (error != NSERROR_OK) return error; - /* Prefer libpng over libmng for pngs by registering later */ error = nsjpng_init(); if (error != NSERROR_OK) return error; +#endif + +#ifdef WITH_PNG + /* Prefer libpng over libmng for pngs by registering later */ error = nspng_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_NSSPRITE error = nssprite_init(); if (error != NSERROR_OK) return error; +#endif /* Prefer rsvg over libsvgtiny for svgs */ +#ifdef WITH_NS_SVG error = svg_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_RSVG error = nsrsvg_init(); if (error != NSERROR_OK) return error; +#endif +#ifdef WITH_WEBP error = webp_init(); if (error != NSERROR_OK) return error; +#endif /* WITH_WEBP */ return NSERROR_OK; } @@ -90,16 +118,45 @@ nserror image_init(void) */ void image_fini(void) { +#ifdef WITH_BMP nsbmp_fini(); +#endif + +#ifdef WITH_GIF nsgif_fini(); +#endif + +#ifdef WITH_BMP nsico_fini(); +#endif + +#ifdef WITH_JPEG nsjpeg_fini(); +#endif + +#ifdef WITH_MNG nsmng_fini(); nsjpng_fini(); +#endif + +#ifdef WITH_NSSPRITE nssprite_fini(); +#endif + +#ifdef WITH_PNG nspng_fini(); +#endif + +#ifdef WITH_RSVG nsrsvg_fini(); +#endif + +#ifdef WITH_NS_SVG svg_fini(); +#endif + +#ifdef WITH_WEBP webp_fini(); +#endif } -- cgit v1.2.3