4 /* Copyright (C) 1989, 1990, 1991, 1992, 2004, 2005
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 virtual void debug_print() = 0;
36 virtual int compute_metrics(int);
37 virtual void compute_subscript_kern();
38 virtual void compute_skew();
39 virtual void output();
41 virtual list_box
*to_list_box();
42 virtual int is_simple();
43 virtual int is_char();
44 virtual int left_is_italic();
45 virtual int right_is_italic();
46 virtual void handle_char_type(int, int);
47 enum { FOUND_NOTHING
= 0, FOUND_MARK
= 1, FOUND_LINEUP
= 2 };
48 void set_spacing_type(char *type
);
49 virtual void hint(unsigned);
50 virtual void check_tabs(int);
63 void list_check_tabs(int);
64 void list_debug_print(const char *sep
);
65 friend class list_box
;
68 // declarations to avoid friend name injection problems
69 box
*make_script_box(box
*, box
*, box
*);
70 box
*make_mark_box(box
*);
71 box
*make_lineup_box(box
*);
73 class list_box
: public box
{
80 int compute_metrics(int);
81 void compute_subscript_kern();
85 list_box
*to_list_box();
86 void handle_char_type(int, int);
87 void compute_sublist_width(int n
);
88 friend box
*make_script_box(box
*, box
*, box
*);
89 friend box
*make_mark_box(box
*);
90 friend box
*make_lineup_box(box
*);
93 enum alignment
{ LEFT_ALIGN
, RIGHT_ALIGN
, CENTER_ALIGN
};
95 class column
: public box_list
{
100 void set_alignment(alignment
);
102 void debug_print(const char *);
104 friend class matrix_box
;
105 friend class pile_box
;
108 class pile_box
: public box
{
112 int compute_metrics(int);
115 void check_tabs(int);
116 void set_alignment(alignment a
) { col
.set_alignment(a
); }
117 void set_space(int n
) { col
.set_space(n
); }
118 void append(box
*p
) { col
.append(p
); }
121 class matrix_box
: public box
{
127 matrix_box(column
*);
129 void append(column
*);
130 int compute_metrics(int);
132 void check_tabs(int);
136 class pointer_box
: public box
{
142 int compute_metrics(int);
143 void compute_subscript_kern();
145 void debug_print() = 0;
146 void check_tabs(int);
149 class vcenter_box
: public pointer_box
{
152 int compute_metrics(int);
157 class simple_box
: public box
{
159 int compute_metrics(int);
160 void compute_subscript_kern();
163 void debug_print() = 0;
167 class quoted_text_box
: public simple_box
{
170 quoted_text_box(char *);
176 class half_space_box
: public simple_box
{
183 class space_box
: public simple_box
{
190 class tab_box
: public box
{
196 void check_tabs(int);
199 class size_box
: public pointer_box
{
203 size_box(char *, box
*);
205 int compute_metrics(int);
210 class font_box
: public pointer_box
{
214 font_box(char *, box
*);
216 int compute_metrics(int);
221 class fat_box
: public pointer_box
{
224 int compute_metrics(int);
229 class vmotion_box
: public pointer_box
{
233 vmotion_box(int, box
*);
234 int compute_metrics(int);
239 class hmotion_box
: public pointer_box
{
242 hmotion_box(int, box
*);
243 int compute_metrics(int);
248 box
*split_text(char *);
249 box
*make_delim_box(char *, box
*, char *);
250 box
*make_sqrt_box(box
*);
251 box
*make_prime_box(box
*);
252 box
*make_over_box(box
*, box
*);
253 box
*make_small_over_box(box
*, box
*);
254 box
*make_limit_box(box
*, box
*, box
*);
255 box
*make_accent_box(box
*, box
*);
256 box
*make_uaccent_box(box
*, box
*);
257 box
*make_overline_box(box
*);
258 box
*make_underline_box(box
*);
259 box
*make_special_box(char *, box
*);
262 int set_gsize(const char *);
263 void set_gfont(const char *);
264 void set_grfont(const char *);
265 void set_gbfont(const char *);
266 const char *get_gfont();
267 const char *get_grfont();
268 const char *get_gbfont();
270 void output_string();
271 void do_text(const char *);
272 void restore_compatibility();
273 void set_script_reduction(int n
);
274 void set_minimum_size(int n
);
275 void set_param(const char *name
, int value
);
277 void set_char_type(const char *type
, char *ch
);
279 void init_char_table();
280 void init_extensible();
281 void define_extensible(const char *name
, const char *ext
, const char *top
= 0,
282 const char *mid
= 0, const char *bot
= 0);