diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2008-09-15 20:23:02 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2008-09-15 20:23:02 +0000 |
commit | d3270ed648c971b5708c84188e6d7ce184801468 (patch) | |
tree | 6ca2aa5596c1e405d2e1859bdc5e14524d5a89d9 /content | |
parent | 5c9f7937f5b4779e903eb39385907f3f793a723e (diff) | |
download | netsurf-d3270ed648c971b5708c84188e6d7ce184801468.tar.gz netsurf-d3270ed648c971b5708c84188e6d7ce184801468.tar.bz2 |
Add libpng support. Default to off.
svn path=/trunk/netsurf/; revision=5330
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 20 | ||||
-rw-r--r-- | content/content.h | 10 |
2 files changed, 27 insertions, 3 deletions
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 <stdint.h> #include "utils/config.h" #include "content/content_type.h" @@ -208,6 +215,9 @@ struct content { #ifdef WITH_RSVG struct content_rsvg_data rsvg; #endif +#ifdef WITH_PNG + struct content_png_data png; +#endif } data; /**< URL for refresh request, in standard form as from url_join. */ |