2 /* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2007, 2008
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License along
19 with groff; see the file COPYING. If not, write to the Free Software
20 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
31 #include "stringclass.h"
35 // PREFIX and PREFIX_CHAR must be the same.
37 #define PREFIX_CHAR '3'
39 // LEADER and LEADER_CHAR must be the same.
41 #define LEADER_CHAR 'a'
48 struct entry_modifier
{
49 inc_number point_size
;
50 inc_number vertical_spacing
;
53 enum { CENTER
, TOP
, BOTTOM
} vertical_alignment
;
73 struct entry_format
: public entry_modifier
{
76 entry_format(format_type
);
78 void debug_print() const;
82 struct horizontal_span
;
91 char decimal_point_char
;
92 vertical_rule
*vrule_list
;
94 horizontal_span
*span_list
;
95 table_entry
*entry_list
;
96 table_entry
**entry_list_tailp
;
99 char *row_is_all_lines
;
100 string
*minimum_width
;
101 int *column_separation
;
104 int right_separation
;
105 int total_separation
;
107 void build_span_list();
108 void compute_expand_width();
109 void do_hspan(int r
, int c
);
110 void do_vspan(int r
, int c
);
111 void allocate(int r
);
112 void compute_widths();
113 void divide_span(int, int);
114 void sum_columns(int, int, int);
115 void compute_total_separation();
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();
134 int count_expand_columns();
142 DOUBLEBOX
= 0x00000010,
144 NOSPACES
= 0x00000040,
145 EXPERIMENTAL
= 0x80000000 // undocumented; use as a hook for experiments
148 table(int nc
, unsigned flags
, int linesize
, char decimal_point_char
);
151 void add_text_line(int r
, const string
&, const char *, int);
152 void add_single_hline(int r
);
153 void add_double_hline(int r
);
154 void add_entry(int r
, int c
, const string
&, const entry_format
*,
155 const char *, int lineno
);
156 void add_vlines(int r
, const char *);
159 void set_minimum_width(int c
, const string
&w
);
160 void set_column_separation(int c
, int n
);
161 void set_equal_column(int c
);
162 void set_expand_column(int c
);
163 void set_delim(char c1
, char c2
);
164 void print_single_hline(int r
);
165 void print_double_hline(int r
);
169 void set_troff_location(const char *, int);
171 extern int compatible_flag
;