~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to src/Typeset/Concat/concater.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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
******************************************************************************/
 
14
 
 
15
#ifndef CONCATER_H
 
16
#define CONCATER_H
 
17
#include "typesetter.hpp"
 
18
#include "Format/line_item.hpp"
 
19
#include "Boxes/construct.hpp"
 
20
 
 
21
#define MODE_JUSTIFY   0
 
22
#define MODE_LEFT      1
 
23
#define MODE_CENTER    2
 
24
#define MODE_RIGHT     3
 
25
 
 
26
class concater_rep {
 
27
  edit_env              env;        // the environment
 
28
  array<line_item>      a;          // the line items
 
29
 
 
30
  // useful subroutines
 
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);
 
42
 
 
43
  // textual markup
 
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);
 
60
 
 
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);
 
78
 
 
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);
 
90
 
 
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);
 
104
 
 
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);
 
118
 
 
119
  // graphical markup
 
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);
 
130
 
 
131
  // postprocessing of brackets and scripts
 
132
  int  prec (int i);
 
133
  int  succ (int i);
 
134
  void pre_glue ();
 
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 ();
 
141
  void kill_spaces ();
 
142
 
 
143
public:
 
144
  concater_rep (edit_env env);
 
145
  void typeset (tree t, path ip, bool active_flag= true);
 
146
  void finish ();
 
147
 
 
148
  friend class liner_rep;
 
149
  friend class par_line_rep;
 
150
  friend class typesetter_rep;
 
151
  friend class document_rep;
 
152
 
 
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,
 
156
                                                int i1, int i2);
 
157
  friend array<line_item> typeset_marker (edit_env env, path ip);
 
158
};
 
159
 
 
160
typedef concater_rep* concater;
 
161
 
 
162
#endif // defined CONCATER_H