Add support for charts to ASCII driver. Bug #16364.
[pspp-builds.git] / src / output / ChangeLog
1 2007-08-12  Ben Pfaff  <blp@gnu.org>
2
3         Add support for charts to ASCII driver.  Bug #16364.
4         Thanks to John Darrington for review.
5         
6         * ascii.c (struct ascii_driver_ext): Add chart_type,
7         chart_file_name, chart_cnt members.
8         (ascii_open_driver): Initialize new members.
9         (static array option_tab): Add new options, reorganize slightly.
10         (handle_option): Handle new options.
11         (ascii_submit): New function.
12         (ascii_chart_initialise): Implement.
13         (ascii_chart_finalise): Implement.
14
15         * chart.c (chart_init_separate): New function.
16         (chart_finalise_separate): New function.
17         
18         * dummy-chart.c (chart_init_separate): New function.
19         (chart_finalise_separate): New function.
20
21         * html.c (html_open_driver): Don't free chart_file_name.
22         (html_close_driver): Do free chart_file_name.
23         (handle_option): Only give an error for chart-files options that
24         don't contain "#".
25         (html_initialise_chart): Use new chart_init_separate.
26         (html_finalise_chart): Use new chart_finalise_separate.
27
28 2007-07-25  Ben Pfaff  <blp@gnu.org>
29
30         Allow the user to specify an initialization string to write at the
31         beginning of an ASCII output file.
32         * ascii.c (struct ascii_driver_ext): New member `init'.
33         (ascii_open_driver): Initialize `init'.
34         (ascii_close_driver): Parse `init'.
35         (ascii_open_page): Write `init' to output file.
36
37         * output.c (get_option_token): Fix parsing of octal constants.
38
39 2007-07-25  Ben Pfaff  <blp@gnu.org>
40
41         Make interactive output go to the terminal (bug #17213), by
42         causing the UI to flush output to the user when it prompts for a
43         command.
44
45         * ascii.c (ascii_open_driver): Move the file open into
46         ascii_open_page, so that we can re-open after a flush.
47         (ascii_close_driver): Close file using ascii_flush.
48         (ascii_open_page): Open the output file if it's not already open.
49         Use fn_open so that we can support pipes.
50         (ascii_close_page): Do nothing if output file not open.
51         (ascii_flush): New function.
52         (static var ascii_class): Add ascii_flush.
53
54         * manager.c (som_flush): New function.
55
56         * output.c (outp_flush): New function.
57
58 Tue Feb 20 07:03:48 2007  Ben Pfaff  <blp@gnu.org>
59
60         * html.c: Don't need to include "getlogin_r.h" anymore, because
61         gnulib merged it into <unistd.h>.
62
63 Sun Feb 18 11:20:35 2007  Ben Pfaff  <blp@gnu.org>
64
65         * postscript.c: Add missing _() around message.
66
67 Sun Feb 11 17:59:30 2007  Ben Pfaff  <blp@gnu.org>
68
69         * html.c (html_initialise_chart): Mark `this' parameter UNUSED to
70         account for NO_CHARTS case.
71
72 Sat Feb  3 21:56:46 2007  Ben Pfaff  <blp@gnu.org>
73
74         * table.c (tab_hline): Allow t->nr as y argument, so that we can
75         draw a line below the bottom row of the table.
76
77 Wed Feb  7 21:38:12 2007  Ben Pfaff  <blp@gnu.org>
78
79         * afm.c: Add #include <limits.h>.  Thanks to John McCabe-Dansted
80         <gmatht@gmail.com> for pointing out the need.
81
82 Sun Oct  8 07:09:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
83
84         * table.c (tab_destroy): Freed title, since this is not allocated
85         from the pool.
86
87         * html.c (html_open_driver): Freed chart_file_name.
88
89 Wed Jul 12 21:03:37 2006  Ben Pfaff  <blp@gnu.org>
90
91         * table.c (tab_natural_width): Get rid of warning on empty column,
92         which tended to just trigger false positives because we handle
93         joined cells so badly.  We need a real fix, and the warning is not
94         helpful.
95
96         * table.c (tab_offset): [DEBUGGING] Let row, col arguments be as
97         big as row or column count.
98         
99 Wed Jul 12 20:58:19 2006  Ben Pfaff  <blp@gnu.org>
100
101         * output.c (outp_drivers): [DEBUGGING] Delete unused declaration.
102
103 Sat Jul  1 17:20:03 2006  Ben Pfaff  <blp@gnu.org>
104
105         Make the destination for charts configurable in the HTML driver.
106         Fixes bug #15723, "HTML driver creates .png files insecurely".
107
108         * htmlP.h: (struct html_driver_ext) Add chart_file_name, chart_cnt
109         members.
110         
111         * html.c: (html_open_driver) Initialize new members.
112         (option_tab var) Add "chart-files" option.
113         (handle_option) Parse "chart-files" option.
114         (html_initialise_chart) Name file based on "chart-files" option.
115         
116 Sat Jul  1 22:41:26 2006  Ben Pfaff  <blp@gnu.org>
117
118         Fix bug #16644: Output Driver crashes in DISPLAY VARIABLES.
119         
120         * table.c (tab_create): Don't allocate t->hrh, t->wrv yet, because
121         the table size might change before we're ready to use them.
122         (tabi_table) Allocate them here instead.
123
124 Fri Jun  9 14:42:35 2006  Ben Pfaff  <blp@gnu.org>
125
126         Reform string library.
127         
128         * output.c (init_default_drivers): Update call to
129         configure_driver() to new interface.
130         (get_option_token) Use a modifiable substring in interface instead
131         of a separate position parameter.  Use ss_get_*() functions.
132         (configure_driver) Take and work with substrings.
133         (configure_driver_line) Update call to configure_driver() to new
134         interface.
135         (outp_get_paper_size) Use substrings.
136
137         * output.h (struct outp_class): Change open_driver interface to
138         use substring.  Update all implementations.
139
140         * table.c (text_format): Change to return substring.
141         (tab_title) Use xvasprintf().
142
143         * table.h (struct tab_table): Change title member to char *.
144
145 Thu May 25 18:02:53 WST 2006 John Darrington <john@darrington.wattle.id.au>
146
147         * table.c: Removed redundant extern declaration.
148
149 Sun May 14 14:03:56 2006  Ben Pfaff  <blp@gnu.org>
150
151         * output.c (outp_eject_page): Always make sure that a page is open
152         upon return.
153
154 Sun May 14 13:54:58 2006  Ben Pfaff  <blp@gnu.org>
155
156         * postscript.c: (ps_chart_finalise) Fix format of %%EndDocument
157         comment, which screwed up gv's idea of where one page ended and
158         the next one began.  Thanks to John Darrington for pointing out
159         the bug.
160
161 Sun Apr 16 11:48:25 2006  Ben Pfaff  <blp@gnu.org>
162
163         Start reforming error message support.  In this phase, we get rid
164         of "installation errors" and change all uses of msg() in the
165         output drivers to uses of error() or error_at_line().
166
167         * Removed all inclusion of <libpspp/message.h> in this directory.
168
169         * output.c: Changed all uses of msg() to error() or
170         error_at_line().
171         (outp_read_devices) Maintain line number in int variable instead
172         of "struct file_locator".
173         (tokener) Renamed get_option_token(), rewritten, changed interface.
174         (outp_parse_options) Change `options' argument to type const
175         struct string *.  Rewritten.
176         (configure_driver) Passes a struct string * to ->open_driver()
177         instead of char *.
178         (outp_get_paper_size) Maintain line number in int variable instead
179         of "struct file_locator".  Removed stupid cache.
180
181         * output.h: (struct outp_class) Change `open_driver' function to
182         take const struct string * instead of const char *.  Updated all
183         implementations.
184
185 Mon Apr  3 11:14:38 2006  Ben Pfaff  <blp@gnu.org>
186
187         Rewrite a lot of the output drivers and infrastructure.
188         Started transitioning from msg() to error().
189         Vertical rules in tables now default to putting a small gap
190         between columns, instead of no gap or rule at all.
191         See NEWS for user-visible changes.
192
193         * automake.mk: (output_sources) Add afm.c, afm.h.  Remove font.h,
194         groff-font.c.
195         
196         * afm.c, afm.h: New files.
197
198         * font.h: Removed.
199
200         * groff-font.c: Removed.
201         
202         * ascii.c: Rewrote and simplified.
203
204         * html.c: Ditto.
205
206         * postscript.c: Ditto.
207
208         * output.c: (struct outp_driver_class_list) Move here from
209         output.h.  Remove ref_count member and all references to it.
210         (outp_init) Remove epsf_class references.
211         (init_default_drivers) Use new configure_driver_line() interface.
212         (parse_options) Renamed outp_parse_options(), changed interface.
213         (configure_driver) Changed args from `const char *'s to `const
214         struct string *'s.  Rewrote.  Don't call ->open_global().  Now
215         just calls ->open_driver() instead of ->preopen_driver(),
216         ->option(), ->postopen_driver().
217         (configure_driver_line) Adapt to new configure_driver() interface.
218         (destroy_driver) Don't call ->close_global().
219         (option_cmp) Removed.
220         (outp_match_keyword) Rewrite for simplicity.
221         (outp_open_page) New function.  Changed all equivalent
222         functionality to use this function instead.
223         (outp_close_page) Ditto.
224         (outp_eject_page) Use above functions.
225         (outp_string_width) Add font argument and change all callers to
226         pass one.
227
228         * output.h: (struct rect) Removed.
229         (OUTP_L_*) Name this enumeration "enum outp_line_style".
230         (OUTP_L_SPECIAL) Removed.
231         (struct color) Removed.
232         (OUTP_F_*) Removed.
233         (struct outp_styles) Removed.
234         (OUTP_T_*) Removed.
235         (enum outp_justification) New, containing OUTP_RIGHT, OUTP_LEFT,
236         OUTP_CENTER.
237         (enum outp_font) New, containing OUTP_FIXED, OUTP_PROPORTIONAL,
238         and OUTP_EMPHASIS.
239         (struct outp_text) Replaced `options' member by `font' and
240         `justification'.  Renamed `s' to `string'.  Removed `w', `l'.
241         Updated all usages.
242         (struct outp_class) Removed `magic', `open_global',
243         `close_global', `font_sizes', `preopen_driver', `option',
244         `postopen_driver', `line_horz', `line_vert', `line_intersection',
245         `box', `polyline_begin', `polyline_point', `polyline_end',
246         `text_set_font_by_name', `text_set_font_by_position',
247         `text_set_font_family', `text_get_font_name',
248         `text_get_font_family', `text_set_Size', and `text_get_size'
249         members.  Added `open_driver', `close_driver', `line' members.
250         Changed interface of `open_page', `close_page', `text_metrics',
251         `text_draw' members.  Updated all usages.
252         (struct outp_driver) Rearranged members.  Removed `driver_open',
253         `res', `horiz', `vert', `horiz_line_spacing', `vert_line_spacing'
254         members.
255         (struct outp_option_info) Removed.
256         (struct outp_driver_class_list) Removed.
257         (outp_match_keyword) Changed interface.
258
259         * table.c: (tab_create) Now ignores reallocable argument: tables
260         can always be reallocated.  Use pool_create_container().
261         Initialize vertical rules to UCHAR_MAX.
262         (options_to_font) New function.
263         (tab_destroy) Remove futile assignment.
264         (tab_realloc) Initialize vertical rules to UCHAR_MAX.
265         (text_format) Use xvasprintf() instead of local_alloc().
266         (tab_title) Always format the argument, and drop the option
267         argument.  Change all callers to agree.
268         (tab_natural_width) Adapt to new ->text_metrics() interface.
269         (tab_natural_height) Ditto.
270         (tab_joint_text) Clear rules within the joined cell.  Now
271         necessary because of the default to put spacing between cells.
272         (tab_output_text) Use xvasprintf() instead of local_alloc().
273         Remove special cases for fixed-width font.
274         (rule_to_spacing_type) New function.
275         (tabi_driver) Calculate rule widths manually now that we don't
276         have ->trh or ->trv.  Implement new default for vertical rules.
277         (render_rows) New function.
278         (tabi_render) Rewrite in terms of render_rows() for clarity.
279         (translate_justification) New function.
280         (rule_to_draw_type) New function.
281         (get_hrule) New function.
282         (get_vrule) New function.
283         (render_horz_rule) New function.
284         (render_vert_rule) New function.
285         (render_rule_intersection) New function.
286         (strip_width) New function.
287         (strip_height) New function.
288         (render_cell) New function.
289         (render_strip) Rewrite in terms of new functions.
290
291         * table.h: (TAB_EMPH) New flag.
292         (TAB_FIX) New flag.
293         (TAL_3) Removed.
294         (TAL_GAP) Added.
295         (TAL_SPACING) Removed.
296         (struct tab_table) Members `trh', `hrv', `hr_tot', `vr_tot'
297         removed.
298         [DEBUGGING] (reallocable) Removed.
299         (TAT_FIX) Removed.  All references replaced by TAB_FIX.
300         (TAT_TITLE) Now implies TAB_EMPH.
301                 
302 Thu Mar 30 16:26:56 2006  Ben Pfaff  <blp@gnu.org>
303
304         * output.c: (colon_tokenize) Removed.
305         (configure_driver_line) Rewrote to use ds_separate().  Fixed leak.
306
307 Tue Mar 28 13:50:53 WST 2006 John Darrington <john@darrington.wattle.id.au>
308
309         * html.c, postscript.c, output.c:  Changed to fit the new signature 
310         of fn_interp_vars
311         
312 Sun Mar  5 13:19:32 2006  Ben Pfaff  <blp@gnu.org>
313
314         * postscript.c: (postopen) Fix segfault when the active file has
315         no title.
316
317 Sat Mar  4 13:48:16 2006  Ben Pfaff  <blp@gnu.org>
318
319         We didn't provide a way to define these macros, so obviously
320         there's little demand for them.
321
322         * html.c: Don't test for NO_HTML.
323
324         * postscript.c: Don't test for NO_POSTSCRIPT.
325
326         * output.c: Don't test for either of those.
327
328 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
329         
330         * Moved files from src directory