X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=822c6b5c9b8f9c6c6844a49760f405f26e4694d7;hb=37e80366f1930cd7043a79e0dcb1dfd282f678d3;hp=5aec959c740a16a69888d9f5da76ad2d56778528;hpb=d2428259504892b661532ea3d8a4cac0a3a4e8e9;p=pspp diff --git a/src/output/html.c b/src/output/html.c index 5aec959c74..822c6b5c9b 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,7 +39,6 @@ #include "output/table-item.h" #include "output/text-item.h" -#include "error.h" #include "xalloc.h" #include "gettext.h" @@ -49,6 +48,9 @@ struct html_driver { struct output_driver driver; + struct xr_color fg; + struct xr_color bg; + char *file_name; char *chart_file_name; @@ -56,7 +58,8 @@ struct html_driver FILE *file; size_t chart_cnt; - bool in_syntax; + bool css; + bool borders; }; static const struct output_driver_class html_driver_class; @@ -93,6 +96,8 @@ html_create (const char *file_name, enum settings_output_devices device_type, d = &html->driver; output_driver_init (&html->driver, &html_driver_class, file_name, device_type); + html->css = parse_boolean (opt (d, o, "css", "true")); + html->borders = parse_boolean (opt (d, o, "borders", "true")); html->file_name = xstrdup (file_name); html->chart_file_name = parse_chart_file_name (opt (d, o, "charts", @@ -100,10 +105,13 @@ html_create (const char *file_name, enum settings_output_devices device_type, html->file = NULL; html->chart_cnt = 1; + parse_color (d, o, "background-color", "#FFFFFFFFFFFF", &html->bg); + parse_color (d, o, "foreground-color", "#000000000000", &html->fg); + html->file = fn_open (html->file_name, "w"); if (html->file == NULL) { - error (0, errno, _("error opening output file `%s'"), html->file_name); + msg_error (errno, _("error opening output file `%s'"), html->file_name); goto error; } @@ -113,62 +121,66 @@ html_create (const char *file_name, enum settings_output_devices device_type, fputs ("
\n", html->file); print_title_tag (html->file, "TITLE", _("PSPP Output")); fprintf (html->file, "\n", version); - fputs ("\n", - html->file); fputs ("\n", html->file); - fputs ("\n", - html->file); + + if ( html->css) + { + fputs ("\n", + html->file); + fputs ("\n", + html->file); + } fputs ("\n", html->file); fputs ("file); fputs (" LINK=\"#1f00ff\" ALINK=\"#ff0000\" VLINK=\"#9900dd\">\n", html->file); @@ -200,11 +212,6 @@ html_destroy (struct output_driver *driver) if (html->file != NULL) { - if (html->in_syntax) - { - fprintf (html->file, "\n"); - html->in_syntax = false; - } fprintf (html->file, "\n" "