2 /* Copyright (C) 1989, 1990, 1991, 1992, 2004, 2005, 2009
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 3 of the License, or
11 (at your option) any later version.
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
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
30 virtual void debug_print() = 0;
33 virtual int compute_metrics(int);
34 virtual void compute_subscript_kern();
35 virtual void compute_skew();
36 virtual void output();
38 virtual list_box *to_list_box();
39 virtual int is_simple();
40 virtual int is_char();
41 virtual int left_is_italic();
42 virtual int right_is_italic();
43 virtual void handle_char_type(int, int);
44 enum { FOUND_NOTHING = 0, FOUND_MARK = 1, FOUND_LINEUP = 2 };
45 void set_spacing_type(char *type);
46 virtual void hint(unsigned);
47 virtual void check_tabs(int);
60 void list_check_tabs(int);
61 void list_debug_print(const char *sep);
62 friend class list_box;
65 // declarations to avoid friend name injection problems
66 box *make_script_box(box *, box *, box *);
67 box *make_mark_box(box *);
68 box *make_lineup_box(box *);
70 class list_box : public box {
77 int compute_metrics(int);
78 void compute_subscript_kern();
82 list_box *to_list_box();
83 void handle_char_type(int, int);
84 void compute_sublist_width(int n);
85 friend box *make_script_box(box *, box *, box *);
86 friend box *make_mark_box(box *);
87 friend box *make_lineup_box(box *);
90 enum alignment { LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN };
92 class column : public box_list {
97 void set_alignment(alignment);
99 void debug_print(const char *);
101 friend class matrix_box;
102 friend class pile_box;
105 class pile_box : public box {
109 int compute_metrics(int);
112 void check_tabs(int);
113 void set_alignment(alignment a) { col.set_alignment(a); }
114 void set_space(int n) { col.set_space(n); }
115 void append(box *p) { col.append(p); }
118 class matrix_box : public box {
124 matrix_box(column *);
126 void append(column *);
127 int compute_metrics(int);
129 void check_tabs(int);
133 class pointer_box : public box {
139 int compute_metrics(int);
140 void compute_subscript_kern();
142 void debug_print() = 0;
143 void check_tabs(int);
146 class vcenter_box : public pointer_box {
149 int compute_metrics(int);
154 class simple_box : public box {
156 int compute_metrics(int);
157 void compute_subscript_kern();
160 void debug_print() = 0;
164 class quoted_text_box : public simple_box {
167 quoted_text_box(char *);
173 class half_space_box : public simple_box {
180 class space_box : public simple_box {
187 class tab_box : public box {
193 void check_tabs(int);
196 class size_box : public pointer_box {
200 size_box(char *, box *);
202 int compute_metrics(int);
207 class font_box : public pointer_box {
211 font_box(char *, box *);
213 int compute_metrics(int);
218 class fat_box : public pointer_box {
221 int compute_metrics(int);
226 class vmotion_box : public pointer_box {
230 vmotion_box(int, box *);
231 int compute_metrics(int);
236 class hmotion_box : public pointer_box {
239 hmotion_box(int, box *);
240 int compute_metrics(int);
245 box *split_text(char *);
246 box *make_delim_box(char *, box *, char *);
247 box *make_sqrt_box(box *);
248 box *make_prime_box(box *);
249 box *make_over_box(box *, box *);
250 box *make_small_over_box(box *, box *);
251 box *make_limit_box(box *, box *, box *);
252 box *make_accent_box(box *, box *);
253 box *make_uaccent_box(box *, box *);
254 box *make_overline_box(box *);
255 box *make_underline_box(box *);
256 box *make_special_box(char *, box *);
259 int set_gsize(const char *);
260 void set_gfont(const char *);
261 void set_grfont(const char *);
262 void set_gbfont(const char *);
263 const char *get_gfont();
264 const char *get_grfont();
265 const char *get_gbfont();
267 void output_string();
268 void do_text(const char *);
269 void restore_compatibility();
270 void set_script_reduction(int n);
271 void set_minimum_size(int n);
272 void set_param(const char *name, int value);
274 void set_char_type(const char *type, char *ch);
276 void init_char_table();
277 void init_extensible();
278 void define_extensible(const char *name, const char *ext, const char *top = 0,
279 const char *mid = 0, const char *bot = 0);