From 62245d13ec60e3c0fc78221f0a8f754f33c2b6a1 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 5 Jan 2004 02:10:59 +0000 Subject: [project @ 2004-01-05 02:10:59 by jmb] Add ability to turn off browser features in build. This may be useful when hunting down bugs. svn path=/import/netsurf/; revision=480 --- riscos/401login.c | 5 ++++ riscos/about.c | 6 +++++ riscos/about.h | 6 +++++ riscos/constdata.c | 6 +++++ riscos/constdata.h | 6 +++++ riscos/dialog.c | 24 ++++++++++++++++---- riscos/draw.c | 3 +++ riscos/filetype.c | 13 +++++++++++ riscos/frames.c | 4 ++++ riscos/frames.h | 4 ++++ riscos/gif.c | 4 ++++ riscos/gui.c | 63 +++++++++++++++++++++++++++++++++++++++++++-------- riscos/gui.h | 3 +++ riscos/htmlinstance.c | 19 +++++++++++----- riscos/jpeg.c | 5 ++-- riscos/plugin.c | 10 +++++++- riscos/png.c | 4 +++- riscos/sprite.c | 4 ++++ riscos/uri.c | 10 +++++++- riscos/url.c | 7 +++++- riscos/window.c | 13 ++++++++--- 21 files changed, 191 insertions(+), 28 deletions(-) (limited to 'riscos') diff --git a/riscos/401login.c b/riscos/401login.c index 2aa644390..ab59f0f45 100644 --- a/riscos/401login.c +++ b/riscos/401login.c @@ -9,6 +9,7 @@ #include #include #include "oslib/wimp.h" +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/401login.h" @@ -18,6 +19,8 @@ #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" +#ifdef WITH_AUTH + static void get_unamepwd(void); static wimp_window *dialog_401_template; @@ -153,3 +156,5 @@ void get_unamepwd() { login_list_add(url, lidets); } + +#endif diff --git a/riscos/about.c b/riscos/about.c index 0318f5299..1560c6306 100644 --- a/riscos/about.c +++ b/riscos/about.c @@ -17,6 +17,7 @@ #include #include /* for __unixify */ +#include "netsurf/utils/config.h" #include "netsurf/desktop/netsurf.h" #include "netsurf/riscos/about.h" #include "netsurf/utils/log.h" @@ -30,6 +31,8 @@ #include "oslib/osfscontrol.h" #include "oslib/osgbpb.h" +#ifdef WITH_ABOUT + static const char *pabouthdr = "%s
\"Netsurf
 

NetSurf %s

Copyright © 2002, 2003 NetSurf Developers.
 

"; /**< About page header */ static const char *pabtplghd = "The following plugins are installed on your system:
 
"; /**< Plugin table header */ static const char *paboutpl1 = ""; /**< Plugin entry without image */ @@ -261,6 +264,7 @@ void about_create(void) { return; } +#ifdef WITH_COOKIES /** * Creates the cookie list and stores it in .WWW.Netsurf */ @@ -321,6 +325,7 @@ void cookie_create(void) { xfree(cookies); return; } +#endif /** * Clean up created files @@ -331,3 +336,4 @@ void about_quit(void) { xosfile_delete(".WWW.NetSurf.Cookies", 0, 0, 0, 0, 0); } +#endif diff --git a/riscos/about.h b/riscos/about.h index e3ed66a69..e6e9f69b4 100644 --- a/riscos/about.h +++ b/riscos/about.h @@ -8,9 +8,15 @@ #ifndef _NETSURF_RISCOS_ABOUT_H_ #define _NETSURF_RISCOS_ABOUT_H_ +#include "netsurf/utils/config.h" + +#ifdef WITH_ABOUT void about_create(void); +#ifdef WITH_COOKIES void cookie_create(void); +#endif void about_quit(void); +#endif #endif diff --git a/riscos/constdata.c b/riscos/constdata.c index a7f573789..a7589e73e 100644 --- a/riscos/constdata.c +++ b/riscos/constdata.c @@ -7,10 +7,16 @@ * Copyright 2003 John M Bell */ +#include "netsurf/utils/config.h" #include "netsurf/riscos/constdata.h" +#ifdef WITH_ABOUT const char * const ABOUT_URL = "file:///%3CWimp$ScrapDir%3E/WWW/NetSurf/About"; +#ifdef WITH_COOKIES const char * const COOKIE_URL = "file:///%3CWimp$ScrapDir%3E/WWW/NetSurf/Cookies"; +#endif +#endif + const char * const GESTURES_URL = "file:///%3CNetSurf$Dir%3E/Resources/gestures"; const char * const HOME_URL = "file:///%3CNetSurf$Dir%3E/Docs/en/intro"; const char * const HELP_URL = "file:///%3CNetSurf$Dir%3E/Docs/en/index"; diff --git a/riscos/constdata.h b/riscos/constdata.h index f5a6d47aa..088174678 100644 --- a/riscos/constdata.h +++ b/riscos/constdata.h @@ -10,8 +10,14 @@ #ifndef _NETSURF_RISCOS_CONSTDATA_H_ #define _NETSURF_RISCOS_CONSTDATA_H_ +#include "netsurf/utils/config.h" + +#ifdef WITH_ABOUT extern const char * const ABOUT_URL; +#ifdef WITH_COOKIES extern const char * const COOKIE_URL; +#endif +#endif extern const char * const GESTURES_URL; extern const char * const HOME_URL; extern const char * const HELP_URL; diff --git a/riscos/dialog.c b/riscos/dialog.c index b5b54f19e..59addfb49 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -15,6 +15,7 @@ #include "oslib/osgbpb.h" #include "oslib/osspriteop.h" #include "oslib/wimp.h" +#include "netsurf/utils/config.h" #include "netsurf/desktop/netsurf.h" #include "netsurf/riscos/constdata.h" #include "netsurf/riscos/gui.h" @@ -24,8 +25,11 @@ #include "netsurf/utils/utils.h" wimp_w dialog_info, dialog_saveas, dialog_config, dialog_config_br, - dialog_config_prox, dialog_config_th, download_template, - dialog_401li; + dialog_config_prox, dialog_config_th, download_template +#ifdef WITH_AUTH + ,dialog_401li +#endif + ; wimp_menu* theme_menu = NULL; static struct ro_choices choices; @@ -146,8 +150,10 @@ void ro_gui_dialog_open(wimp_w w) bool ro_gui_dialog_keypress(wimp_key *key) { +#ifdef WITH_AUTH if (key->w == dialog_401li) return ro_gui_401login_keypress(key); +#endif return false; } @@ -168,8 +174,10 @@ void ro_gui_dialog_click(wimp_pointer *pointer) ro_gui_dialog_click_config_prox(pointer); else if (pointer->w == dialog_config_th) ro_gui_dialog_click_config_th(pointer); +#ifdef WITH_AUTH else if (pointer->w == dialog_401li) ro_gui_401login_click(pointer); +#endif } @@ -236,7 +244,11 @@ void ro_gui_dialog_click_config_br(wimp_pointer *pointer) break; case ICON_CONFIG_BR_EXPLAIN: bw = create_browser_window(browser_TITLE | browser_TOOLBAR | - browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 320, 256, NULL); + browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 320, 256 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); browser_window_open_location(bw, GESTURES_URL); break; @@ -299,7 +311,11 @@ void ro_gui_dialog_click_config_th(wimp_pointer *pointer) break; case ICON_CONFIG_TH_GET: bw = create_browser_window(browser_TITLE | browser_TOOLBAR | - browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 480, 320, NULL); + browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 480, 320 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); browser_window_open_location(bw, THEMES_URL); break; diff --git a/riscos/draw.c b/riscos/draw.c index c215b38f6..96b63b2b2 100644 --- a/riscos/draw.c +++ b/riscos/draw.c @@ -8,12 +8,14 @@ #include #include #include +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/riscos/draw.h" #include "netsurf/utils/utils.h" #include "netsurf/utils/log.h" #include "oslib/drawfile.h" +#ifdef WITH_DRAW void draw_create(struct content *c, const char *params[]) { c->data.draw.data = xcalloc(0, 1); @@ -106,3 +108,4 @@ void draw_redraw(struct content *c, long x, long y, xfree(matrix); } +#endif diff --git a/riscos/filetype.c b/riscos/filetype.c index d31f4cda1..98c3005bd 100644 --- a/riscos/filetype.c +++ b/riscos/filetype.c @@ -9,6 +9,7 @@ #include #include #include "oslib/osfile.h" +#include "netsurf/utils/config.h" #include "netsurf/content/fetch.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" @@ -19,14 +20,26 @@ struct type_entry { char mime_type[40]; }; static const struct type_entry type_map[] = { +#ifdef WITH_PLUGIN {0x188, "application/x-shockwave-flash"}, +#endif +#ifdef WITH_GIF {0x695, "image/gif"}, +#endif +#ifdef WITH_DRAW {0xaff, "image/x-drawfile"}, +#endif +#ifdef WITH_PNG {0xb60, "image/png"}, +#endif +#ifdef WITH_JPEG {0xc85, "image/jpeg"}, +#endif {0xf79, "text/css"}, {0xfaf, "text/html"}, +#ifdef WITH_SPRITE {0xff9, "image/x-riscos-sprite"}, +#endif {0xfff, "text/plain"}, }; #define TYPE_MAP_COUNT (sizeof(type_map) / sizeof(type_map[0])) diff --git a/riscos/frames.c b/riscos/frames.c index 055d531e5..1c49382ef 100644 --- a/riscos/frames.c +++ b/riscos/frames.c @@ -7,6 +7,7 @@ #include +#include "netsurf/utils/config.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/gui.h" #include "netsurf/riscos/frames.h" @@ -20,6 +21,8 @@ #include "oslib/os.h" #include "oslib/wimp.h" +#ifdef WITH_FRAMES + void frame_add_instance_to_list(struct content *c, struct browser_window *parent, struct content *page, struct box *box, struct object_params *params, void **state, struct browser_window *bw, gui_window *g); void frame_remove_instance_from_list(struct content *c); struct frame_list *frame_get_instance_from_list(struct content *c); @@ -206,3 +209,4 @@ struct frame_list *frame_get_instance_from_list(struct content *c) { return NULL; } +#endif diff --git a/riscos/frames.h b/riscos/frames.h index e65044cc9..eee37d107 100644 --- a/riscos/frames.h +++ b/riscos/frames.h @@ -37,6 +37,7 @@ #ifndef _NETSURF_RISCOS_FRAMES_H_ #define _NETSURF_RISCOS_FRAMES_H_ +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/render/box.h" @@ -44,6 +45,8 @@ #include "oslib/wimp.h" +#ifdef WITH_FRAMES + struct frame_list { struct content *c; @@ -68,3 +71,4 @@ void frame_reshape_instance(struct content *c, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params, void **state); #endif +#endif diff --git a/riscos/gif.c b/riscos/gif.c index 7f2acb40b..1363730fc 100644 --- a/riscos/gif.c +++ b/riscos/gif.c @@ -15,11 +15,14 @@ #include "oslib/colourtrans.h" #include "oslib/os.h" #include "oslib/osspriteop.h" +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/riscos/gif.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" +#ifdef WITH_GIF + static osspriteop_area *create_buffer_sprite(struct content *c, anim a); void nsgif_init(void) @@ -217,3 +220,4 @@ static osspriteop_area *create_buffer_sprite( struct content *c, anim a ) return result; } +#endif diff --git a/riscos/gui.c b/riscos/gui.c index a0524bd91..8f225b540 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -20,19 +20,28 @@ #include "oslib/plugin.h" #include "oslib/wimp.h" #include "oslib/uri.h" +#include "netsurf/utils/config.h" #include "netsurf/desktop/gui.h" #include "netsurf/desktop/netsurf.h" #include "netsurf/desktop/options.h" #include "netsurf/render/font.h" #include "netsurf/render/form.h" #include "netsurf/render/html.h" +#ifdef WITH_ABOUT #include "netsurf/riscos/about.h" +#endif #include "netsurf/riscos/constdata.h" #include "netsurf/riscos/gui.h" +#ifdef WITH_PLUGIN #include "netsurf/riscos/plugin.h" +#endif #include "netsurf/riscos/theme.h" +#ifdef WITH_URI #include "netsurf/riscos/uri.h" +#endif +#ifdef WITH_URL #include "netsurf/riscos/url.h" +#endif #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" @@ -53,8 +62,13 @@ static const wimp_MESSAGE_LIST(25) task_messages = { { message_DATA_SAVE_ACK, message_DATA_LOAD, message_DATA_OPEN, +#ifdef WITH_URI message_URI_PROCESS, +#endif +#ifdef WITH_URL message_INET_SUITE_OPEN_URL, +#endif +#ifdef WITH_PLUGIN message_PLUG_IN_OPENING, message_PLUG_IN_CLOSED, message_PLUG_IN_RESHAPE_REQUEST, @@ -74,6 +88,7 @@ static const wimp_MESSAGE_LIST(25) task_messages = { { message_PLUG_IN_ABORT, message_PLUG_IN_ACTION, /* message_PLUG_IN_INFORMED, (not provided by oslib) */ +#endif 0 } }; struct ro_gui_poll_block { @@ -137,7 +152,9 @@ void gui_init(int argc, char** argv) ro_gui_dialog_init(); ro_gui_download_init(); ro_gui_menus_init(); +#ifdef WITH_AUTH ro_gui_401login_init(); +#endif ro_gui_history_init(); wimp_close_template(); ro_gui_icon_bar_create(); @@ -166,7 +183,9 @@ void ro_gui_icon_bar_create(void) void gui_quit(void) { +#ifdef WITH_ABOUT about_quit(); +#endif ro_gui_history_quit(); wimp_close_down(task_handle); } @@ -258,8 +277,14 @@ void gui_poll(bool active) case wimp_CLOSE_WINDOW_REQUEST : g = ro_lookup_gui_from_w(block.close.w); if (g != NULL) { - browser_window_destroy(g->data.browser.bw, true); + browser_window_destroy(g->data.browser.bw +#ifdef WITH_FRAMES + , true +#endif + ); +#ifdef WITH_COOKIES clean_cookiejar(); +#endif } else ro_gui_dialog_close((wimp_w)(&(block.close.w))); @@ -350,14 +375,17 @@ void gui_poll(bool active) ro_msg_dataopen(&(block.message)); break; +#ifdef WITH_URI case message_URI_PROCESS : ro_uri_message_received(&(block.message)); break; - +#endif +#ifdef WITH_URL case message_INET_SUITE_OPEN_URL: ro_url_message_received(&(block.message)); break; - +#endif +#ifdef WITH_PLUGIN case message_PLUG_IN_OPENING: case message_PLUG_IN_CLOSED: case message_PLUG_IN_RESHAPE_REQUEST: @@ -379,6 +407,7 @@ void gui_poll(bool active) plugin_msg_parse(&(block.message), (event == wimp_USER_MESSAGE_ACKNOWLEDGE ? 1 : 0)); break; +#endif case message_QUIT : netsurf_quit = true; @@ -404,13 +433,13 @@ void gui_multitask(void) switch (event) { case wimp_NULL_REASON_CODE: + ro_gui_throb(); if (over_window != NULL) { wimp_pointer pointer; wimp_get_pointer_info(&pointer); ro_gui_window_mouse_at(&pointer); } - ro_gui_throb(); break; case wimp_REDRAW_WINDOW_REQUEST : @@ -512,14 +541,17 @@ void gui_multitask(void) ro_msg_dataopen(&(block.message)); break; +#ifdef WITH_URI case message_URI_PROCESS : ro_uri_message_received(&(block.message)); break; - +#endif +#ifdef WITH_URL case message_INET_SUITE_OPEN_URL: ro_url_message_received(&(block.message)); break; - +#endif +#ifdef WITH_PLUGIN case message_PLUG_IN_OPENING: case message_PLUG_IN_CLOSED: case message_PLUG_IN_RESHAPE_REQUEST: @@ -541,6 +573,7 @@ void gui_multitask(void) plugin_msg_parse(&(block.message), (event == wimp_USER_MESSAGE_ACKNOWLEDGE ? 1 : 0)); break; +#endif case message_QUIT : netsurf_quit = true; @@ -594,7 +627,11 @@ void ro_gui_icon_bar_click(wimp_pointer* pointer) { struct browser_window* bw; bw = create_browser_window(browser_TITLE | browser_TOOLBAR - | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); browser_window_open_location(bw, HOME_URL); wimp_set_caret_position(bw->window->data.browser.toolbar, @@ -863,7 +900,11 @@ void ro_msg_dataopen(wimp_message *message) /* create a new window with the file */ bw = create_browser_window(browser_TITLE | browser_TOOLBAR | - browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); url = ro_path_to_url(message->data.data_xfer.file_name); browser_window_open_location(bw, url); @@ -907,7 +948,11 @@ void ro_gui_open_help_page (void) struct browser_window *bw; bw = create_browser_window(browser_TITLE | browser_TOOLBAR | browser_SCROLL_X_ALWAYS | - browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); browser_window_open_location(bw, HELP_URL); wimp_set_caret_position(bw->window->data.browser.toolbar, diff --git a/riscos/gui.h b/riscos/gui.h index 6153be6f8..fa0b783c3 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -11,6 +11,7 @@ #include #include "oslib/wimp.h" +#include "netsurf/utils/config.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/netsurf.h" #include "netsurf/desktop/gui.h" @@ -131,10 +132,12 @@ void ro_gui_start_selection(wimp_pointer *pointer, wimp_window_state *state, void ro_gui_drag_end(wimp_dragged* drag); /* in 401login.c */ +#ifdef WITH_AUTH void ro_gui_401login_init(void); void ro_gui_401login_open(char* host, char * realm, char* fetchurl); void ro_gui_401login_click(wimp_pointer *pointer); bool ro_gui_401login_keypress(wimp_key *key); +#endif /* in window.c */ void ro_gui_window_click(gui_window* g, wimp_pointer* mouse); diff --git a/riscos/htmlinstance.c b/riscos/htmlinstance.c index f305beb94..68c03fdeb 100644 --- a/riscos/htmlinstance.c +++ b/riscos/htmlinstance.c @@ -5,6 +5,7 @@ * Copyright 2003 James Bursa */ +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/render/box.h" @@ -20,13 +21,15 @@ void html_add_instance(struct content *c, struct browser_window *bw, for (i = 0; i != c->data.html.object_count; i++) { if (c->data.html.object[i].content == 0) continue; +#ifdef WITH_FRAMES if (c->data.html.object[i].content->type == CONTENT_HTML) - /*frame_add_instance(c->data.html.object[i].content, + frame_add_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, c->data.html.object[i].box->object_params, - &c->data.html.object[i].box->object_state)*/; + &c->data.html.object[i].box->object_state); else +#endif content_add_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, @@ -44,13 +47,15 @@ void html_reshape_instance(struct content *c, struct browser_window *bw, for (i = 0; i != c->data.html.object_count; i++) { if (c->data.html.object[i].content == 0) continue; +#ifdef WITH_FRAMES if (c->data.html.object[i].content->type == CONTENT_HTML) - /*frame_reshape_instance(c->data.html.object[i].content, + frame_reshape_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, c->data.html.object[i].box->object_params, - &c->data.html.object[i].box->object_state)*/; + &c->data.html.object[i].box->object_state); else +#endif content_reshape_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, @@ -67,13 +72,15 @@ void html_remove_instance(struct content *c, struct browser_window *bw, for (i = 0; i != c->data.html.object_count; i++) { if (c->data.html.object[i].content == 0) continue; +#ifdef WITH_FRAMES if (c->data.html.object[i].content->type == CONTENT_HTML) - /*frame_remove_instance(c->data.html.object[i].content, + frame_remove_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, c->data.html.object[i].box->object_params, - &c->data.html.object[i].box->object_state)*/; + &c->data.html.object[i].box->object_state); else +#endif content_remove_instance(c->data.html.object[i].content, bw, c, c->data.html.object[i].box, diff --git a/riscos/jpeg.c b/riscos/jpeg.c index db119484d..3a40e8090 100644 --- a/riscos/jpeg.c +++ b/riscos/jpeg.c @@ -13,12 +13,13 @@ #include #include #include +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/riscos/jpeg.h" #include "netsurf/utils/utils.h" #include "oslib/jpeg.h" - +#ifdef WITH_JPEG void jpeg_create(struct content *c, const char *params[]) { c->data.jpeg.data = xcalloc(0, 1); @@ -85,4 +86,4 @@ void jpeg_redraw(struct content *c, long x, long y, &factors, (int) c->data.jpeg.length, jpeg_SCALE_DITHERED); } - +#endif diff --git a/riscos/plugin.c b/riscos/plugin.c index 4bdbdf4e9..0ec741f93 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -24,6 +24,7 @@ #include #include +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" #include "netsurf/desktop/gui.h" @@ -42,6 +43,8 @@ #include "oslib/plugin.h" #include "oslib/wimp.h" +#ifdef WITH_PLUGIN + /* parameters file creation */ void plugin_write_parameters_file(struct object_params *params); int plugin_calculate_rsize(char* name, char* data, char* mime); @@ -1290,7 +1293,11 @@ void plugin_url_access(wimp_message *message) { struct browser_window *bwnew; bwnew = create_browser_window(browser_TITLE | browser_TOOLBAR | browser_SCROLL_X_ALWAYS - | browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + | browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bwnew->window); bwnew->url = xstrdup(url); browser_window_open_location(bwnew, url); @@ -1375,3 +1382,4 @@ void plugin_force_redraw(struct content *object, struct content *c, because doing so breaks things :-) */ } +#endif diff --git a/riscos/png.c b/riscos/png.c index d56c5d827..8105ebfe7 100644 --- a/riscos/png.c +++ b/riscos/png.c @@ -15,11 +15,13 @@ #include "oslib/colourtrans.h" #include "oslib/os.h" #include "oslib/osspriteop.h" +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/riscos/png.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" +#ifdef WITH_PNG /* libpng uses names starting png_, so use nspng_ here to avoid clashes */ #ifndef NO_IFC @@ -402,4 +404,4 @@ void nspng_redraw(struct content *c, long x, long y, xfree(table); } - +#endif diff --git a/riscos/sprite.c b/riscos/sprite.c index 51c3a057c..44bd39c9a 100644 --- a/riscos/sprite.c +++ b/riscos/sprite.c @@ -8,6 +8,7 @@ #include #include #include +#include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/riscos/sprite.h" #include "netsurf/utils/utils.h" @@ -15,6 +16,8 @@ #include "oslib/colourtrans.h" #include "oslib/osspriteop.h" +#ifdef WITH_SPRITE + void sprite_create(struct content *c, const char *params[]) { c->data.sprite.data = xcalloc(4, 1); @@ -114,3 +117,4 @@ void sprite_redraw(struct content *c, long x, long y, xfree(table); } +#endif diff --git a/riscos/uri.c b/riscos/uri.c index 56780563b..aac943f2a 100644 --- a/riscos/uri.c +++ b/riscos/uri.c @@ -9,6 +9,7 @@ #include #include "oslib/uri.h" #include "oslib/wimp.h" +#include "netsurf/utils/config.h" #include "netsurf/desktop/browser.h" #include "netsurf/riscos/theme.h" #include "netsurf/desktop/gui.h" @@ -16,6 +17,8 @@ #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" +#ifdef WITH_URI + void ro_uri_message_received(uri_full_message_process*); @@ -55,7 +58,11 @@ void ro_uri_message_received(uri_full_message_process* uri_message) xuri_request_uri(0, uri_requested, uri_length, uri_handle, NULL); bw = create_browser_window(browser_TITLE | browser_TOOLBAR - | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); browser_window_open_location(bw, uri_requested); @@ -67,3 +74,4 @@ void ro_uri_message_received(uri_full_message_process* uri_message) xfree(uri_requested); } +#endif diff --git a/riscos/url.c b/riscos/url.c index 011eb9e37..0eba47891 100644 --- a/riscos/url.c +++ b/riscos/url.c @@ -10,6 +10,7 @@ #include #include "oslib/inetsuite.h" #include "oslib/wimp.h" +#include "netsurf/utils/config.h" #include "netsurf/desktop/browser.h" #include "netsurf/riscos/theme.h" #include "netsurf/desktop/gui.h" @@ -99,7 +100,11 @@ void ro_url_message_received(wimp_message* message) /* create new browser window */ bw = create_browser_window(browser_TITLE | browser_TOOLBAR - | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480, NULL); + | browser_SCROLL_X_ALWAYS | browser_SCROLL_Y_ALWAYS, 640, 480 +#ifdef WITH_FRAMES + , NULL +#endif + ); gui_window_show(bw->window); diff --git a/riscos/window.c b/riscos/window.c index ed7dddc5b..dc99f1d8a 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -17,6 +17,7 @@ #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" #include "netsurf/css/css.h" +#include "netsurf/utils/config.h" #include "netsurf/riscos/constdata.h" #include "netsurf/riscos/gui.h" #include "netsurf/riscos/theme.h" @@ -430,7 +431,7 @@ void ro_gui_window_open(gui_window *g, wimp_open *open) void ro_gui_throb(void) { gui_window* g; - float nowtime = (float) (clock() / CLOCKS_PER_SEC); + float nowtime = (float) (clock() / (CLOCKS_PER_SEC/(15*23/theme_throbs))); for (g = window_list; g != NULL; g = g->next) { @@ -444,7 +445,7 @@ void ro_gui_throb(void) { g->throbtime = nowtime; g->throbber++; - if (theme_throbs < (unsigned int)g->throbber) + if (theme_throbs < (float)g->throbber) g->throbber = 0; sprintf(g->throb_buf, "throbber%u", g->throbber); wimp_set_icon_state(g->data.browser.toolbar, @@ -718,8 +719,14 @@ bool ro_gui_window_keypress(gui_window *g, int key, bool toolbar) return true; case wimp_KEY_CONTROL + wimp_KEY_F2: /* Close window. */ - browser_window_destroy(g->data.browser.bw, true); + browser_window_destroy(g->data.browser.bw +#ifdef WITH_FRAMES + , true +#endif + ); +#ifdef WITH_COOKIES clean_cookiejar(); +#endif return true; case wimp_KEY_RETURN: -- cgit v1.2.3
%s%s