From 3371a27391e828c6417e6d805572cf261b138785 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 3 Sep 2004 22:44:48 +0000 Subject: [project @ 2004-09-03 22:44:47 by bursa] Add generic bitmap functions. Move jpeg and mng code from riscos/ to image/ and update to use bitmap. Note: background tiling and drawfile export for jpeg and mng/png are broken. svn path=/import/netsurf/; revision=1265 --- content/content.c | 23 +++++++++-------------- content/content.h | 14 ++++++-------- content/content_type.h | 4 +--- 3 files changed, 16 insertions(+), 25 deletions(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index 4fd6c9b71..cf15364e7 100644 --- a/content/content.c +++ b/content/content.c @@ -22,17 +22,15 @@ #include "netsurf/content/fetch.h" #include "netsurf/content/fetchcache.h" #include "netsurf/css/css.h" +#include "netsurf/image/bitmap.h" #include "netsurf/desktop/options.h" #include "netsurf/render/html.h" #include "netsurf/render/textplain.h" #ifdef WITH_JPEG -#include "netsurf/riscos/jpeg.h" -#endif -#ifdef WITH_PNG -#include "netsurf/riscos/png.h" +#include "netsurf/image/jpeg.h" #endif #ifdef WITH_MNG -#include "netsurf/riscos/mng.h" +#include "netsurf/image/mng.h" #endif #ifdef WITH_GIF #include "netsurf/riscos/gif.h" @@ -82,7 +80,7 @@ static const struct mime_entry mime_map[] = { #ifdef WITH_JPEG {"image/pjpeg", CONTENT_JPEG}, #endif -#ifdef WITH_PNG +#ifdef WITH_MNG {"image/png", CONTENT_PNG}, #endif #ifdef WITH_DRAW @@ -115,10 +113,8 @@ const char *content_type_name[] = { #ifdef WITH_GIF "GIF", #endif -#ifdef WITH_PNG - "PNG", -#endif #ifdef WITH_MNG + "PNG", "JNG", "MNG", #endif @@ -173,18 +169,16 @@ static const struct handler_entry handler_map[] = { 0, 0, 0, 0, 0, 0, true}, {0, 0, css_convert, 0, css_destroy, 0, 0, 0, 0, false}, #ifdef WITH_JPEG - {nsjpeg_create, 0, nsjpeg_convert, - 0, nsjpeg_destroy, 0, nsjpeg_redraw, 0, 0, false}, + {0, 0, nsjpeg_convert, + 0, nsjpeg_destroy, 0, bitmap_redraw, 0, 0, false}, #endif #ifdef WITH_GIF {nsgif_create, 0, nsgif_convert, 0, nsgif_destroy, 0, nsgif_redraw, 0, 0, false}, #endif -#ifdef WITH_PNG +#ifdef WITH_MNG {nsmng_create, nsmng_process_data, nsmng_convert, 0, nsmng_destroy, 0, nsmng_redraw, 0, 0, false}, -#endif -#ifdef WITH_MNG {nsmng_create, nsmng_process_data, nsmng_convert, 0, nsmng_destroy, 0, nsmng_redraw, 0, 0, false}, {nsmng_create, nsmng_process_data, nsmng_convert, @@ -270,6 +264,7 @@ struct content * content_create(const char *url) c->width = 0; c->height = 0; c->available_width = 0; + c->bitmap = 0; c->fresh = false; c->size = sizeof(struct content); c->title = 0; diff --git a/content/content.h b/content/content.h index 4a28eb442..19d60fe6e 100644 --- a/content/content.h +++ b/content/content.h @@ -102,7 +102,7 @@ #include "netsurf/css/css.h" #include "netsurf/render/html.h" #ifdef WITH_JPEG -#include "netsurf/riscos/jpeg.h" +#include "netsurf/image/jpeg.h" #endif #ifdef WITH_GIF #include "netsurf/riscos/gif.h" @@ -110,11 +110,8 @@ #ifdef WITH_PLUGIN #include "netsurf/riscos/plugin.h" #endif -#ifdef WITH_PNG -#include "netsurf/riscos/png.h" -#endif #ifdef WITH_MNG -#include "netsurf/riscos/mng.h" +#include "netsurf/image/mng.h" #endif #ifdef WITH_SPRITE #include "netsurf/riscos/sprite.h" @@ -124,6 +121,7 @@ #endif +struct bitmap; struct box; struct browser_window; struct content; @@ -208,9 +206,6 @@ struct content { #ifdef WITH_GIF struct content_gif_data gif; #endif -#ifdef WITH_PNG - struct content_png_data png; -#endif #ifdef WITH_MNG struct content_mng_data mng; #endif @@ -225,6 +220,9 @@ struct content { #endif } data; + /** Bitmap, for various image contents. */ + struct bitmap *bitmap; + /** This content may be given to new users. Indicates that the content * was fetched using a simple GET, has not expired, and may be * shared between users. */ diff --git a/content/content_type.h b/content/content_type.h index 661a116a8..484a877a6 100644 --- a/content/content_type.h +++ b/content/content_type.h @@ -28,10 +28,8 @@ typedef enum { #ifdef WITH_GIF CONTENT_GIF, #endif -#ifdef WITH_PNG - CONTENT_PNG, -#endif #ifdef WITH_MNG + CONTENT_PNG, CONTENT_JNG, CONTENT_MNG, #endif -- cgit v1.2.3