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