diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-06 12:34:47 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-06 12:34:47 +0000 |
commit | 64699fb3f05c7169dcca414f52a2502698b25666 (patch) | |
tree | bdb07c86478e9340b790db287f4cedf07eeddb3d | |
parent | 727db7f3d64ca9479c6cac2149a80bea8af4a39b (diff) | |
download | netsurf-64699fb3f05c7169dcca414f52a2502698b25666.tar.gz netsurf-64699fb3f05c7169dcca414f52a2502698b25666.tar.bz2 |
[project @ 2004-03-06 12:34:47 by jmb]
Save Source support.
svn path=/import/netsurf/; revision=588
-rw-r--r-- | makefile | 3 | ||||
-rw-r--r-- | riscos/save.c | 8 | ||||
-rw-r--r-- | riscos/save_html.c | 25 | ||||
-rw-r--r-- | riscos/save_html.h | 15 |
4 files changed, 48 insertions, 3 deletions
@@ -18,7 +18,8 @@ OBJECTS = $(OBJECTS_COMMON) \ textselection.o theme.o window.o \ draw.o gif.o jpeg.o plugin.o png.o sprite.o \ about.o filetype.o font.o uri.o url_protocol.o history.o \ - version.o save_draw.o save_complete.o thumbnail.o save.o + version.o thumbnail.o \ + save.o save_complete.o save_draw.o save_html.o OBJECTS_DEBUG = $(OBJECTS_COMMON) \ netsurfd.o \ options.o filetyped.o fontd.o diff --git a/riscos/save.c b/riscos/save.c index b7adf6fb4..f3bb35213 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -15,6 +15,7 @@ #include "oslib/wimp.h" #include "netsurf/riscos/gui.h" #include "netsurf/riscos/save_draw.h" +#include "netsurf/riscos/save_html.h" #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" @@ -111,8 +112,11 @@ void ro_gui_save_datasave_ack(wimp_message *message) switch (gui_current_save_type) { case GUI_SAVE_SOURCE: - warn_user("Not implemented yet!"); - return; + if (!current_gui->data.browser.bw->current_content) + return; + save_as_html(current_gui->data.browser.bw-> + current_content, path); + break; case GUI_SAVE_DRAW: if (!current_gui->data.browser.bw->current_content) diff --git a/riscos/save_html.c b/riscos/save_html.c new file mode 100644 index 000000000..13c594db2 --- /dev/null +++ b/riscos/save_html.c @@ -0,0 +1,25 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2004 John M Bell <jmb202@ecs.soton.ac.uk> + */ + +#include <stdbool.h> +#include <string.h> + +#include "oslib/osfile.h" + +#include "netsurf/utils/config.h" +#include "netsurf/content/content.h" +#include "netsurf/riscos/save_html.h" + +void save_as_html(struct content *c, char *path) { + + if (c->type != CONTENT_HTML) { + return; + } + + xosfile_save_stamped(path, 0xfaf, (byte*)c->data.html.source, + (byte*)c->data.html.source+c->data.html.length); +} diff --git a/riscos/save_html.h b/riscos/save_html.h new file mode 100644 index 000000000..99f0af9bb --- /dev/null +++ b/riscos/save_html.h @@ -0,0 +1,15 @@ +/* + * This file is part of NetSurf, http://netsurf.sourceforge.net/ + * Licensed under the GNU General Public License, + * http://www.opensource.org/licenses/gpl-license + * Copyright 2004 John M Bell <jmb202@ecs.soton.ac.uk> + */ + +#ifndef _NETSURF_RISCOS_SAVE_HTML_H_ +#define _NETSURF_RISCOS_SAVE_HTML_H_ + +struct content; + +void save_as_html(struct content *c, char *path); + +#endif |