From b0fdba3f596edb61e8f976ae67ad02d641429525 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 27 Mar 2004 00:54:03 +0000 Subject: [project @ 2004-03-27 00:53:19 by bursa] Add imagemap and jpeg to the debug build. svn path=/import/netsurf/; revision=675 --- content/content.c | 6 +++-- content/content.h | 8 +++---- content/content_type.h | 2 +- debug/filetyped.c | 4 ++++ debug/netsurfd.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-- makefile | 14 ++++++----- 6 files changed, 84 insertions(+), 15 deletions(-) diff --git a/content/content.c b/content/content.c index 9c560326e..337b1276d 100644 --- a/content/content.c +++ b/content/content.c @@ -21,10 +21,10 @@ #include "netsurf/css/css.h" #include "netsurf/render/html.h" #include "netsurf/render/textplain.h" -#ifdef riscos #ifdef WITH_JPEG #include "netsurf/riscos/jpeg.h" #endif +#ifdef riscos #ifdef WITH_PNG #include "netsurf/riscos/png.h" #endif @@ -62,10 +62,12 @@ static const struct mime_entry mime_map[] = { #ifdef WITH_GIF {"image/gif", CONTENT_GIF}, #endif +#endif #ifdef WITH_JPEG {"image/jpeg", CONTENT_JPEG}, {"image/pjpeg", CONTENT_JPEG}, #endif +#ifdef riscos #ifdef WITH_PNG {"image/png", CONTENT_PNG}, #endif @@ -114,11 +116,11 @@ static const struct handler_entry handler_map[] = { 0, 0, 0, 0, 0, 0, 0}, {css_create, 0, css_convert, css_revive, 0, css_destroy, 0, 0, 0, 0}, -#ifdef riscos #ifdef WITH_JPEG {nsjpeg_create, 0, nsjpeg_convert, 0, 0, nsjpeg_destroy, nsjpeg_redraw, 0, 0, 0}, #endif +#ifdef riscos #ifdef WITH_PNG {nspng_create, nspng_process_data, nspng_convert, 0, 0, nspng_destroy, nspng_redraw, 0, 0, 0}, diff --git a/content/content.h b/content/content.h index 48a5c1300..b865e6b4c 100644 --- a/content/content.h +++ b/content/content.h @@ -34,13 +34,13 @@ #include "netsurf/render/box.h" #include "netsurf/render/font.h" #include "netsurf/render/html.h" +#ifdef WITH_JPEG +#include "netsurf/riscos/jpeg.h" +#endif #ifdef riscos #ifdef WITH_GIF #include "netsurf/riscos/gif.h" #endif -#ifdef WITH_JPEG -#include "netsurf/riscos/jpeg.h" -#endif #ifdef WITH_PLUGIN #include "netsurf/riscos/plugin.h" #endif @@ -103,10 +103,10 @@ struct content { union { struct content_html_data html; struct content_css_data css; -#ifdef riscos #ifdef WITH_JPEG struct content_jpeg_data jpeg; #endif +#ifdef riscos #ifdef WITH_PNG struct content_png_data png; #endif diff --git a/content/content_type.h b/content/content_type.h index fbafe9e6b..96fa70575 100644 --- a/content/content_type.h +++ b/content/content_type.h @@ -22,10 +22,10 @@ typedef enum { CONTENT_HTML, CONTENT_TEXTPLAIN, CONTENT_CSS, -#ifdef riscos #ifdef WITH_JPEG CONTENT_JPEG, #endif +#ifdef riscos #ifdef WITH_PNG CONTENT_PNG, #endif diff --git a/debug/filetyped.c b/debug/filetyped.c index f3fa37c89..997f407e3 100644 --- a/debug/filetyped.c +++ b/debug/filetyped.c @@ -21,6 +21,10 @@ const char *fetch_filetype(const char *unix_path) l = strlen(unix_path); if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) return "text/css"; + if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0) + return "image/jpeg"; + if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0) + return "image/jpeg"; return "text/html"; } diff --git a/debug/netsurfd.c b/debug/netsurfd.c index a9fe710e4..f45625dc5 100644 --- a/debug/netsurfd.c +++ b/debug/netsurfd.c @@ -5,6 +5,7 @@ * Copyright 2004 James Bursa */ +#include #include #include #include "netsurf/utils/config.h" @@ -14,6 +15,8 @@ #include "netsurf/content/fetchcache.h" #include "netsurf/desktop/options.h" #include "netsurf/utils/log.h" +#include "netsurf/utils/messages.h" +#include "netsurf/utils/url.h" #include "netsurf/utils/utils.h" int done, destroyed; @@ -42,7 +45,9 @@ int main(int argc, char *argv[]) fetch_init(); cache_init(); fetchcache_init(); + url_init(); options_read("options"); + messages_load("messages"); while (1) { puts("=== URL:"); @@ -68,8 +73,10 @@ int main(int argc, char *argv[]) puts("=== FAILURE, dumping cache"); } cache_dump(); - if (!destroyed) + if (!destroyed) { +/* content_reformat(c, 1, 1000); */ content_remove_user(c, callback, 0, 0); + } } options_write("options"); @@ -81,7 +88,7 @@ int main(int argc, char *argv[]) void gui_multitask(void) { - LOG(("-")); +/* putchar('-'); */ } #ifndef riscos @@ -166,3 +173,57 @@ void plugin_reshape_instance(struct content *c, struct browser_window *bw, char *NETSURF_DIR = ""; #endif +int colourtrans_return_colour_number_for_mode(int colour, int mode, + int *dest_palette) +{ + assert(!dest_palette); + return colour; +} + +int *xjpeginfo_dimensions(void) +{ + return 1; +} + +void xcolourtrans_generate_table_for_sprite(void) +{ + assert(0); +} + +os_error *xosspriteop_put_sprite_scaled (osspriteop_flags flags, + osspriteop_area const *area, + osspriteop_id id, + int x, + int y, + osspriteop_action action, + os_factors const *factors, + osspriteop_trans_tab const *trans_tab) +{ + assert(0); +} + +os_error *xos_byte(byte op, int r1, int r2, int *r1_out, int *r2_out) +{ + assert(op == 0x87); + *r2_out = 28; + return 0; +} + +void xjpeg_plot_scaled(void) +{ + assert(0); +} + +void _swix(void) +{ + assert(0); +} + +bool option_filter_sprites = false; +bool option_dither_sprites = false; + +void die(const char *error) +{ + printf("die: %s\n", error); + exit(1); +} diff --git a/makefile b/makefile index 96b30b2e7..3808a1dd3 100644 --- a/makefile +++ b/makefile @@ -9,14 +9,15 @@ CC_DEBUG = gcc OBJECTS_COMMON = cache.o content.o fetch.o fetchcache.o \ css.o css_enum.o parser.o ruleset.o scanner.o \ box.o form.o html.o layout.o textplain.o \ - messages.o utils.o translit.o pool.o url.o + messages.o utils.o translit.o pool.o url.o imagemap.o \ + jpeg.o OBJECTS = $(OBJECTS_COMMON) \ browser.o loginlist.o netsurf.o options.o \ - htmlinstance.o htmlredraw.o imagemap.o \ + htmlinstance.o htmlredraw.o \ 401login.o constdata.o dialog.o download.o frames.o gui.o \ menus.o mouseactions.o \ textselection.o theme.o window.o \ - draw.o gif.o jpeg.o plugin.o png.o sprite.o \ + draw.o gif.o plugin.o png.o sprite.o \ about.o filetype.o font.o uri.o url_protocol.o history.o \ version.o thumbnail.o \ save.o save_complete.o save_draw.o save_text.o schedule.o @@ -27,7 +28,7 @@ OBJECTS_DEBUGRO = $(OBJECTS_COMMON) \ netsurfd.o \ constdata.o \ theme.o \ - draw.o gif.o jpeg.o png.o sprite.o \ + draw.o gif.o png.o sprite.o \ about.o filetype.o \ version.o \ options.o font.o @@ -38,11 +39,12 @@ WARNFLAGS = -W -Wall -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual \ -Wnested-externs -Winline -Wno-unused-parameter -Wuninitialized CFLAGS = -std=c9x -D_BSD_SOURCE -Driscos -DBOOL_DEFINED -O $(WARNFLAGS) -I.. \ -mpoke-function-name -CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE $(WARNFLAGS) -I.. -I/usr/include/libxml2 -g +CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE $(WARNFLAGS) -I.. -I/usr/include/libxml2 -g \ + -I/riscos/include LDFLAGS = -L/riscos/lib -lxml2 -lz -lcurl -lssl -lcrypto -lares -lanim -lpng \ -loslib -ljpeg LDFLAGS_SMALL = -L/riscos/lib -lxml2 -lz -lucurl -lares -lanim -lpng -loslib -ljpeg -LDFLAGS_DEBUG = -L/usr/lib -lxml2 -lz -lm -lcurl -lssl -lcrypto -ldl +LDFLAGS_DEBUG = -L/usr/lib -lxml2 -lz -lm -lcurl -lssl -lcrypto -ldl -ljpeg OBJDIR = $(shell $(CC) -dumpmachine) SOURCES=$(OBJECTS:.o=.c) -- cgit v1.2.3