2 /* Copyright (C) 1989, 1990, 1991, 1992, 2004, 2005
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 virtual void debug_print() = 0;
34 virtual int compute_metrics(int);
35 virtual void compute_subscript_kern();
36 virtual void compute_skew();
37 virtual void output();
39 virtual list_box
*to_list_box();
40 virtual int is_simple();
41 virtual int is_char();
42 virtual int left_is_italic();
43 virtual int right_is_italic();
44 virtual void handle_char_type(int, int);
45 enum { FOUND_NOTHING
= 0, FOUND_MARK
= 1, FOUND_LINEUP
= 2 };
46 void set_spacing_type(char *type
);
47 virtual void hint(unsigned);
48 virtual void check_tabs(int);
61 void list_check_tabs(int);
62 void list_debug_print(const char *sep
);
63 friend class list_box
;
66 // declarations to avoid friend name injection problems
67 box
*make_script_box(box
*, box
*, box
*);
68 box
*make_mark_box(box
*);
69 box
*make_lineup_box(box
*);
71 class list_box
: public box
{
78 int compute_metrics(int);
79 void compute_subscript_kern();
83 list_box
*to_list_box();
84 void handle_char_type(int, int);
85 void compute_sublist_width(int n
);
86 friend box
*make_script_box(box
*, box
*, box
*);
87 friend box
*make_mark_box(box
*);
88 friend box
*make_lineup_box(box
*);
91 enum alignment
{ LEFT_ALIGN
, RIGHT_ALIGN
, CENTER_ALIGN
};
93 class column
: public box_list
{
98 void set_alignment(alignment
);
100 void debug_print(const char *);
102 friend class matrix_box
;
103 friend class pile_box
;
106 class pile_box
: public box
{
110 int compute_metrics(int);
113 void check_tabs(int);
114 void set_alignment(alignment a
) { col
.set_alignment(a
); }
115 void set_space(int n
) { col
.set_space(n
); }
116 void append(box
*p
) { col
.append(p
); }
119 class matrix_box
: public box
{
125 matrix_box(column
*);
127 void append(column
*);
128 int compute_metrics(int);
130 void check_tabs(int);
134 class pointer_box
: public box
{
140 int compute_metrics(int);
141 void compute_subscript_kern();
143 void debug_print() = 0;
144 void check_tabs(int);
147 class vcenter_box
: public pointer_box
{
150 int compute_metrics(int);
155 class simple_box
: public box
{
157 int compute_metrics(int);
158 void compute_subscript_kern();
161 void debug_print() = 0;
165 class quoted_text_box
: public simple_box
{
168 quoted_text_box(char *);
174 class half_space_box
: public simple_box
{
181 class space_box
: public simple_box
{
188 class tab_box
: public box
{
194 void check_tabs(int);
197 class size_box
: public pointer_box
{
201 size_box(char *, box
*);
203 int compute_metrics(int);
208 class font_box
: public pointer_box
{
212 font_box(char *, box
*);
214 int compute_metrics(int);
219 class fat_box
: public pointer_box
{
222 int compute_metrics(int);
227 class vmotion_box
: public pointer_box
{
231 vmotion_box(int, box
*);
232 int compute_metrics(int);
237 class hmotion_box
: public pointer_box
{
240 hmotion_box(int, box
*);
241 int compute_metrics(int);
246 box
*split_text(char *);
247 box
*make_delim_box(char *, box
*, char *);
248 box
*make_sqrt_box(box
*);
249 box
*make_prime_box(box
*);
250 box
*make_over_box(box
*, box
*);
251 box
*make_small_over_box(box
*, box
*);
252 box
*make_limit_box(box
*, box
*, box
*);
253 box
*make_accent_box(box
*, box
*);
254 box
*make_uaccent_box(box
*, box
*);
255 box
*make_overline_box(box
*);
256 box
*make_underline_box(box
*);
257 box
*make_special_box(char *, box
*);
260 int set_gsize(const char *);
261 void set_gfont(const char *);
262 void set_grfont(const char *);
263 void set_gbfont(const char *);
264 const char *get_gfont();
265 const char *get_grfont();
266 const char *get_gbfont();
268 void output_string();
269 void do_text(const char *);
270 void restore_compatibility();
271 void set_script_reduction(int n
);
272 void set_minimum_size(int n
);
273 void set_param(const char *name
, int value
);
275 void set_char_type(const char *type
, char *ch
);
277 void init_char_table();
278 void init_extensible();
279 void define_extensible(const char *name
, const char *ext
, const char *top
= 0,
280 const char *mid
= 0, const char *bot
= 0);