2
/******************************************************************************
3
* MODULE : concater.hpp
4
* DESCRIPTION: Typesetting concatenations in two stages.
5
* - produce an array of line items
6
* - handle brackets and scripts
7
* COPYRIGHT : (C) 1999 Joris van der Hoeven
8
*******************************************************************************
9
* This software falls under the GNU general public license and comes WITHOUT
10
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
11
* If you don't have this file, write to the Free Software Foundation, Inc.,
12
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
13
******************************************************************************/
17
#include "typesetter.hpp"
18
#include "Format/line_item.hpp"
19
#include "Boxes/construct.hpp"
21
#define MODE_JUSTIFY 0
27
edit_env env; // the environment
28
array<line_item> a; // the line items
31
void print (int type, box b);
32
void control (tree t, path ip);
33
void marker (path ip);
34
void ghost (string s, path ip);
35
void ghost (string s, path ip, color col);
36
void flag_ok (string s, path ip, color col);
37
void flag (string s, path ip, color col);
38
void print (space spc);
39
void penalty_min (int p);
40
void penalty_max (int p);
41
void with_limits (int status);
44
void typeset_substring (string s, path ip, int pos);
45
void typeset_string (string s, path ip);
46
void typeset_uninit (tree t, path ip);
47
void typeset_error (tree t, path ip);
48
void typeset_document (tree t, path ip);
49
void typeset_paragraph (tree t, path ip);
50
void typeset_surround (tree t, path ip);
51
void typeset_concat (tree t, path ip);
52
void typeset_hspace (tree t, path ip);
53
void typeset_space (tree t, path ip);
54
void typeset_move (tree t, path ip);
55
void typeset_resize (tree t, path ip);
56
void typeset_float (tree t, path ip);
57
void typeset_repeat (tree t, path ip);
58
void typeset_formatting (tree t, path ip, string var);
59
void typeset_decorated_box (tree t, path ip);
61
// mathematical markup
62
void typeset_group (tree t, path ip);
63
void typeset_left (tree t, path ip);
64
void typeset_middle (tree t, path ip);
65
void typeset_right (tree t, path ip);
66
void typeset_bigop (tree t, path ip);
67
void typeset_lprime (tree t, path ip);
68
void typeset_rprime (tree t, path ip);
69
void typeset_below (tree t, path ip);
70
void typeset_above (tree t, path ip);
71
void typeset_script (tree t, path ip, bool right);
72
void typeset_frac (tree t, path ip);
73
void typeset_sqrt (tree t, path ip);
74
void typeset_wide (tree t, path ip, bool above);
75
void typeset_neg (tree t, path ip);
76
void typeset_tree (tree t, path ip);
77
void typeset_table (tree t, path ip);
79
// disactivated markup
80
void typeset_unknown (string which, tree t, path ip, bool flag= false);
81
void typeset_inactive (tree t, path ip);
82
void typeset_inactive (string s, tree t, path ip, int pos1=0, int pos2=0);
83
void typeset_inactive_string (string s, path ip);
84
void typeset_inactive_compound (tree t, path ip);
85
void typeset_inactive_action (string s, tree t, path ip);
86
void typeset_inactive_symbol (tree t, path ip);
87
void typeset_inactive_latex (tree t, path ip);
88
void typeset_inactive_hybrid (tree t, path ip);
89
void typeset_inactive_specific (tree t, path ip);
91
// active macro mechanisms
92
void typeset_assign (tree t, path ip);
93
void typeset_with (tree t, path ip);
94
void typeset_compound (tree t, path ip);
95
void typeset_include (tree t, path ip);
96
void typeset_drd_props (tree t, path ip);
97
void typeset_eval (tree t, path ip);
98
void typeset_value (tree t, path ip);
99
void typeset_argument (tree t, path ip);
100
void typeset_eval_args (tree t, path ip);
101
void typeset_dynamic (tree t, path ip);
102
void typeset_executable (tree t, path ip);
103
void typeset_rewrite (tree t, path ip);
105
// miscellaneous active markup
106
void typeset_if (tree t, path ip);
107
void typeset_var_if (tree t, path ip);
108
void typeset_case (tree t, path ip);
109
void typeset_label (tree t, path ip);
110
void typeset_reference (tree t, path ip, int type);
111
void typeset_write (tree t, path ip);
112
void typeset_specific (tree t, path ip);
113
void typeset_hyperlink (tree t, path ip);
114
void typeset_action (tree t, path ip);
115
void typeset_tag (tree t, path ip);
116
void typeset_meaning (tree t, path ip);
117
void typeset_flag (tree t, path ip);
120
void typeset_graphics (tree t, path ip);
121
void typeset_superpose (tree t, path ip);
122
void typeset_text_at (tree t, path ip);
123
void typeset_point (tree t, path ip);
124
void typeset_line (tree t, path ip, bool close);
125
void typeset_spline (tree t, path ip, bool close);
126
void typeset_var_spline (tree t, path ip);
127
void typeset_cspline (tree t, path ip);
128
void typeset_fill (tree t, path ip);
129
void typeset_postscript (tree t, path ip);
131
// postprocessing of brackets and scripts
135
void glue (box b, int ref, int arg);
136
void glue (box b, int ref, int arg1, int arg2);
137
void clean_and_correct ();
138
void handle_scripts (int start, int end);
139
void handle_matching (int start, int end);
140
void handle_brackets ();
144
concater_rep (edit_env env);
145
void typeset (tree t, path ip, bool active_flag= true);
148
friend class liner_rep;
149
friend class par_line_rep;
150
friend class typesetter_rep;
151
friend class document_rep;
153
friend box typeset_as_concat (edit_env env, tree t, path ip);
154
friend array<line_item> typeset_concat (edit_env env, tree t, path ip);
155
friend array<line_item> typeset_concat_range (edit_env env, tree t, path ip,
157
friend array<line_item> typeset_marker (edit_env env, path ip);
160
typedef concater_rep* concater;
162
#endif // defined CONCATER_H