From d3270ed648c971b5708c84188e6d7ce184801468 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 15 Sep 2008 20:23:02 +0000 Subject: Add libpng support. Default to off. svn path=/trunk/netsurf/; revision=5330 --- content/content.c | 20 +++++++++++++++++--- content/content.h | 10 ++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index e9bcf8c10..89de53c4b 100644 --- a/content/content.c +++ b/content/content.c @@ -75,6 +75,9 @@ #ifdef WITH_ARTWORKS #include "riscos/artworks.h" #endif +#ifdef WITH_PNG +#include "image/png.h" +#endif #include "utils/log.h" #include "utils/messages.h" #include "utils/talloc.h" @@ -144,7 +147,7 @@ static const struct mime_entry mime_map[] = { #ifdef WITH_JPEG {"image/pjpeg", CONTENT_JPEG}, #endif -#ifdef WITH_MNG +#if defined(WITH_MNG) || defined(WITH_PNG) {"image/png", CONTENT_PNG}, #endif #if defined(WITH_NS_SVG) || defined (WITH_RSVG) @@ -203,8 +206,10 @@ const char * const content_type_name[] = { "BMP", "ICO", #endif -#ifdef WITH_MNG +#if defined(WITH_MNG) || defined(WITH_PNG) "PNG", +#endif +#ifdef WITH_MNG "JNG", "MNG", #endif @@ -289,10 +294,19 @@ static const struct handler_entry handler_map[] = { {nsico_create, 0, nsico_convert, 0, nsico_destroy, 0, nsico_redraw, nsico_redraw_tiled, 0, 0, false}, #endif + +#ifdef WITH_PNG + {nspng_create, nspng_process_data, nspng_convert, + 0, nspng_destroy, 0, nspng_redraw, nspng_redraw_tiled, + 0, 0, false}, +#else #ifdef WITH_MNG {nsmng_create, nsmng_process_data, nsmng_convert, 0, nsmng_destroy, 0, nsmng_redraw, nsmng_redraw_tiled, - 0, 0, false}, + 0, 0, false}, +#endif +#endif +#ifdef WITH_MNG {nsmng_create, nsmng_process_data, nsmng_convert, 0, nsmng_destroy, 0, nsmng_redraw, nsmng_redraw_tiled, 0, 0, false}, diff --git a/content/content.h b/content/content.h index 2161a07f9..d444f6ed8 100644 --- a/content/content.h +++ b/content/content.h @@ -26,6 +26,13 @@ #ifndef _NETSURF_DESKTOP_CONTENT_H_ #define _NETSURF_DESKTOP_CONTENT_H_ +/* Irritatingly this must come first, or odd include errors + * will occur to do with setjmp.h. + */ +#ifdef WITH_PNG +#include "image/png.h" +#endif + #include #include "utils/config.h" #include "content/content_type.h" @@ -207,6 +214,9 @@ struct content { #endif #ifdef WITH_RSVG struct content_rsvg_data rsvg; +#endif +#ifdef WITH_PNG + struct content_png_data png; #endif } data; -- cgit v1.2.3