2 /* Copyright (C) 1989-2018 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
29 virtual void debug_print() = 0;
32 virtual int compute_metrics(int);
33 virtual void compute_subscript_kern();
34 virtual void compute_skew();
35 virtual void output();
37 virtual list_box *to_list_box();
38 virtual int is_simple();
39 virtual int is_char();
40 virtual int left_is_italic();
41 virtual int right_is_italic();
42 virtual void handle_char_type(int, int);
43 enum { FOUND_NOTHING = 0, FOUND_MARK = 1, FOUND_LINEUP = 2 };
44 void set_spacing_type(char *type);
45 virtual void hint(unsigned);
46 virtual void check_tabs(int);
59 void list_check_tabs(int);
60 void list_debug_print(const char *sep);
61 friend class list_box;
64 // declarations to avoid friend name injection problems
65 box *make_script_box(box *, box *, box *);
66 box *make_mark_box(box *);
67 box *make_lineup_box(box *);
69 class list_box : public box {
76 int compute_metrics(int);
77 void compute_subscript_kern();
81 list_box *to_list_box();
82 void handle_char_type(int, int);
83 void compute_sublist_width(int n);
84 friend box *make_script_box(box *, box *, box *);
85 friend box *make_mark_box(box *);
86 friend box *make_lineup_box(box *);
89 enum alignment { LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN };
91 class column : public box_list {
96 void set_alignment(alignment);
98 void debug_print(const char *);
100 friend class matrix_box;
101 friend class pile_box;
104 class pile_box : public box {
108 int compute_metrics(int);
111 void check_tabs(int);
112 void set_alignment(alignment a) { col.set_alignment(a); }
113 void set_space(int n) { col.set_space(n); }
114 void append(box *p) { col.append(p); }
117 class matrix_box : public box {
123 matrix_box(column *);
125 void append(column *);
126 int compute_metrics(int);
128 void check_tabs(int);
132 class pointer_box : public box {
138 int compute_metrics(int);
139 void compute_subscript_kern();
141 void debug_print() = 0;
142 void check_tabs(int);
145 class vcenter_box : public pointer_box {
148 int compute_metrics(int);
153 class simple_box : public box {
155 int compute_metrics(int);
156 void compute_subscript_kern();
159 void debug_print() = 0;
163 class quoted_text_box : public simple_box {
166 quoted_text_box(char *);
172 class half_space_box : public simple_box {
179 class space_box : public simple_box {
186 class tab_box : public box {
192 void check_tabs(int);
195 class size_box : public pointer_box {
199 size_box(char *, box *);
201 int compute_metrics(int);
206 class font_box : public pointer_box {
210 font_box(char *, box *);
212 int compute_metrics(int);
217 class fat_box : public pointer_box {
220 int compute_metrics(int);
225 class vmotion_box : public pointer_box {
229 vmotion_box(int, box *);
230 int compute_metrics(int);
235 class hmotion_box : public pointer_box {
238 hmotion_box(int, box *);
239 int compute_metrics(int);
244 box *split_text(char *);
245 box *make_delim_box(char *, box *, char *);
246 box *make_sqrt_box(box *);
247 box *make_prime_box(box *);
248 box *make_over_box(box *, box *);
249 box *make_small_over_box(box *, box *);
250 box *make_limit_box(box *, box *, box *);
251 box *make_accent_box(box *, box *);
252 box *make_uaccent_box(box *, box *);
253 box *make_overline_box(box *);
254 box *make_underline_box(box *);
255 box *make_special_box(char *, box *);
258 int set_gsize(const char *);
259 void set_gfont(const char *);
260 void set_grfont(const char *);
261 void set_gbfont(const char *);
262 const char *get_gfont();
263 const char *get_grfont();
264 const char *get_gbfont();
266 void output_string();
267 void do_text(const char *);
268 void restore_compatibility();
269 void set_script_reduction(int n);
270 void set_minimum_size(int n);
271 void set_param(const char *name, int value);
273 void set_char_type(const char *type, char *ch);
275 void init_char_table();
276 void init_extensible();
277 void define_extensible(const char *name, const char *ext, const char *top = 0,
278 const char *mid = 0, const char *bot = 0);