4 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
5 Free Software Foundation, Inc.
6 Written by James Clark (jjc@jclark.com)
8 This file is part of groff.
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING. If not, write to the Free Software
22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
33 #include "stringclass.h"
37 // PREFIX and PREFIX_CHAR must be the same.
39 #define PREFIX_CHAR '3'
41 // LEADER and LEADER_CHAR must be the same.
43 #define LEADER_CHAR 'a'
50 struct entry_modifier
{
51 inc_number point_size
;
52 inc_number vertical_spacing
;
55 enum { CENTER
, TOP
, BOTTOM
} vertical_alignment
;
75 struct entry_format
: public entry_modifier
{
78 entry_format(format_type
);
80 void debug_print() const;
84 struct horizontal_span
;
94 char decimal_point_char
;
95 vertical_rule
*vrule_list
;
97 horizontal_span
*span_list
;
98 table_entry
*entry_list
;
99 table_entry
**entry_list_tailp
;
100 table_entry
***entry
;
102 char *row_is_all_lines
;
103 string
*minimum_width
;
104 int *column_separation
;
107 int right_separation
;
109 void build_span_list();
110 void do_hspan(int r
, int c
);
111 void do_vspan(int r
, int c
);
112 void allocate(int r
);
113 void compute_widths();
114 void divide_span(int, int);
115 void sum_columns(int, int);
116 void compute_separation_factor();
117 void compute_column_positions();
120 void add_stuff(stuff
*);
123 void do_vertical_rules();
124 void build_vrule_list();
125 void add_vertical_rule(int, int, int, int);
126 void define_bottom_macro();
127 int vline_spanned(int r
, int c
);
128 int row_begins_section(int);
129 int row_ends_section(int);
130 void make_columns_equal();
131 void compute_vrule_top_adjust(int, int, string
&);
132 void compute_vrule_bot_adjust(int, int, string
&);
133 void determine_row_type();
145 table(int nc
, unsigned flags
, int linesize
, char decimal_point_char
);
148 void add_text_line(int r
, const string
&, const char *, int);
149 void add_single_hline(int r
);
150 void add_double_hline(int r
);
151 void add_entry(int r
, int c
, const string
&, const entry_format
*,
152 const char *, int lineno
);
153 void add_vlines(int r
, const char *);
156 void set_minimum_width(int c
, const string
&w
);
157 void set_column_separation(int c
, int n
);
158 void set_equal_column(int c
);
159 void set_delim(char c1
, char c2
);
160 void print_single_hline(int r
);
161 void print_double_hline(int r
);
165 void set_troff_location(const char *, int);
167 extern int compatible_flag
;