]> git.lyx.org Git - lyx.git/blob - src/mathed/fonts_as_insets.diff
838c942472389d36c44d6bda8192d42ceb97b018
[lyx.git] / src / mathed / fonts_as_insets.diff
1 ? index.html
2 ? symbols.tex
3 ? symbols.log
4 ? symbols.idx
5 ? symbols.aux
6 ? symbols.toc
7 ? symbols.dvi
8 ? symbols-a4_ps.zip
9 ? symbol.diff
10 ? fonts_as_insets.diff
11 ? math_symbolinset.h.new
12 ? math_symbolinset.C.new
13 Index: Makefile.am
14 ===================================================================
15 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/Makefile.am,v
16 retrieving revision 1.86
17 diff -u -p -r1.86 Makefile.am
18 --- Makefile.am 25 Mar 2002 11:15:27 -0000      1.86
19 +++ Makefile.am 25 Mar 2002 12:01:57 -0000
20 @@ -54,6 +54,8 @@ libmathed_la_SOURCES = \
21         math_exintinset.h \
22         math_factory.C \
23         math_factory.h \
24 +       math_fontinset.C \
25 +       math_fontinset.h \
26         math_fracinset.C \
27         math_fracinset.h \
28         math_fracbase.C \
29 Index: formula.C
30 ===================================================================
31 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.C,v
32 retrieving revision 1.187
33 diff -u -p -r1.187 formula.C
34 --- formula.C   21 Mar 2002 17:42:54 -0000      1.187
35 +++ formula.C   25 Mar 2002 12:01:57 -0000
36 @@ -353,16 +353,16 @@ void InsetFormula::draw(BufferView * bv,
37         int w = par_->width();
38         int h = par_->height();
39         int a = par_->ascent();
40 -       Painter & pain = bv->painter();
41 +       MathPainterInfo pain = MathPainterInfo(bv->painter());
42  
43         if (lcolor.getX11Name(LColor::mathbg)!=lcolor.getX11Name(LColor::background))
44 -               pain.fillRectangle(x, y - a, w, h, LColor::mathbg);
45 +               pain.pain.fillRectangle(x, y - a, w, h, LColor::mathbg);
46  
47         if (mathcursor &&
48                         const_cast<InsetFormulaBase const *>(mathcursor->formula()) == this)
49         {
50                 mathcursor->drawSelection(pain);
51 -               pain.rectangle(x, y - a, w, h, LColor::mathframe);
52 +               pain.pain.rectangle(x, y - a, w, h, LColor::mathframe);
53         }
54  
55         par_->draw(pain, x, y);
56 @@ -546,7 +546,7 @@ void InsetFormula::handleExtern(const st
57                 mathcursor->last();
58                 mathcursor->stripFromLastEqualSign();
59                 ar = mathcursor->cursor().cell();
60 -               mathcursor->insert(MathAtom(new MathCharInset('=', LM_TC_VAR)));
61 +               mathcursor->insert('=');
62                 //lyxerr << "use whole cell: " << ar << "\n";
63         }
64  
65 Index: formulabase.C
66 ===================================================================
67 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
68 retrieving revision 1.135
69 diff -u -p -r1.135 formulabase.C
70 --- formulabase.C       21 Mar 2002 17:42:55 -0000      1.135
71 +++ formulabase.C       25 Mar 2002 12:01:57 -0000
72 @@ -74,7 +74,7 @@ void handleFont(BufferView * bv, string 
73  {
74         if (mathcursor->selection())
75                 bv->lockedInsetStoreUndo(Undo::EDIT);
76 -       mathcursor->handleFont(t);
77 +       //mathcursor->handleFont(t);
78         for (string::const_iterator it = arg.begin(); it != arg.end(); ++it)
79                 mathcursor->insert(*it);
80  }
81 @@ -103,6 +103,7 @@ InsetFormulaBase::InsetFormulaBase()
82         //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << "\n";
83         //lyxerr << "sizeof(MathMetricsInfo): " << sizeof(MathMetricsInfo) << "\n";
84         //lyxerr << "sizeof(MathCharInset): " << sizeof(MathCharInset) << "\n";
85 +       //lyxerr << "sizeof(LyXFont): " << sizeof(LyXFont) << "\n";
86  }
87  
88  
89 Index: formulamacro.C
90 ===================================================================
91 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v
92 retrieving revision 1.90
93 diff -u -p -r1.90 formulamacro.C
94 --- formulamacro.C      21 Mar 2002 17:42:55 -0000      1.90
95 +++ formulamacro.C      25 Mar 2002 12:01:57 -0000
96 @@ -167,7 +167,7 @@ MathInsetTypes InsetFormulaMacro::getTyp
97  void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
98                              int y, float & x, bool /*cleared*/) const
99  {
100 -       Painter & pain = bv->painter();
101 +       MathPainterInfo pain = MathPainterInfo(bv->painter());
102         LyXFont font(f);
103  
104         // label
105 @@ -178,14 +178,14 @@ void InsetFormulaMacro::draw(BufferView 
106         int const h = ascent(bv, font) + descent(bv, font) - 2;
107  
108         // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too
109 -       pain.fillRectangle(int(x), a , w, h, LColor::mathmacrobg);
110 -       pain.rectangle(int(x), a, w, h, LColor::mathframe);
111 +       pain.pain.fillRectangle(int(x), a , w, h, LColor::mathmacrobg);
112 +       pain.pain.rectangle(int(x), a, w, h, LColor::mathframe);
113  
114         if (mathcursor &&
115                         const_cast<InsetFormulaBase const *>(mathcursor->formula()) == this)
116                 mathcursor->drawSelection(pain);
117  
118 -       pain.text(int(x + 2), y, prefix(), font);
119 +       pain.pain.text(int(x + 2), y, prefix(), font);
120         x += width(bv, font);
121  
122         // formula
123 Index: math_amsarrayinset.C
124 ===================================================================
125 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_amsarrayinset.C,v
126 retrieving revision 1.5
127 diff -u -p -r1.5 math_amsarrayinset.C
128 --- math_amsarrayinset.C        21 Mar 2002 17:42:55 -0000      1.5
129 +++ math_amsarrayinset.C        25 Mar 2002 12:01:57 -0000
130 @@ -66,7 +66,7 @@ void MathAMSArrayInset::metrics(MathMetr
131  }
132  
133  
134 -void MathAMSArrayInset::draw(Painter & pain, int x, int y) const
135 +void MathAMSArrayInset::draw(MathPainterInfo & pain, int x, int y) const
136  {
137         MathGridInset::draw(pain, x + 6, y);
138         int yy = y - ascent_;
139 Index: math_amsarrayinset.h
140 ===================================================================
141 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_amsarrayinset.h,v
142 retrieving revision 1.2
143 diff -u -p -r1.2 math_amsarrayinset.h
144 --- math_amsarrayinset.h        21 Mar 2002 17:42:55 -0000      1.2
145 +++ math_amsarrayinset.h        25 Mar 2002 12:01:57 -0000
146 @@ -20,7 +20,7 @@ public:
147         ///
148         void metrics(MathMetricsInfo const & st) const;
149         ///
150 -       void draw(Painter & pain, int x, int y) const;
151 +       void draw(MathPainterInfo & pain, int x, int y) const;
152         ///
153         MathAMSArrayInset * asAMSArrayInset() { return this; }
154  
155 Index: math_biginset.C
156 ===================================================================
157 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_biginset.C,v
158 retrieving revision 1.5
159 diff -u -p -r1.5 math_biginset.C
160 --- math_biginset.C     21 Mar 2002 17:42:55 -0000      1.5
161 +++ math_biginset.C     25 Mar 2002 12:01:57 -0000
162 @@ -52,7 +52,7 @@ void MathBigInset::metrics(MathMetricsIn
163  }
164  
165  
166 -void MathBigInset::draw(Painter & pain, int x, int y) const
167 +void MathBigInset::draw(MathPainterInfo & pain, int x, int y) const
168  {
169         mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
170  }
171 Index: math_biginset.h
172 ===================================================================
173 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_biginset.h,v
174 retrieving revision 1.3
175 diff -u -p -r1.3 math_biginset.h
176 --- math_biginset.h     21 Mar 2002 17:42:55 -0000      1.3
177 +++ math_biginset.h     25 Mar 2002 12:01:57 -0000
178 @@ -20,7 +20,7 @@ public:
179         ///
180         MathInset * clone() const;
181         ///
182 -       void draw(Painter &, int x, int y) const;
183 +       void draw(MathPainterInfo &, int x, int y) const;
184         ///
185         void write(WriteStream & os) const;
186         ///
187 Index: math_binaryopinset.C
188 ===================================================================
189 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_binaryopinset.C,v
190 retrieving revision 1.7
191 diff -u -p -r1.7 math_binaryopinset.C
192 --- math_binaryopinset.C        21 Mar 2002 17:42:55 -0000      1.7
193 +++ math_binaryopinset.C        25 Mar 2002 12:01:57 -0000
194 @@ -5,7 +5,7 @@
195  #endif
196  
197  #include "math_binaryopinset.h"
198 -#include "Painter.h"
199 +#include "MathPainterInfo.h"
200  #include "support/LOstream.h"
201  #include "math_support.h"
202  #include "math_mathmlstream.h"
203 @@ -42,7 +42,7 @@ void MathBinaryOpInset::metrics(MathMetr
204  }
205  
206  
207 -void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
208 +void MathBinaryOpInset::draw(MathPainterInfo & pain, int x, int y) const
209  {
210         xcell(0).draw(pain, x, y);
211         drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_);
212 Index: math_binaryopinset.h
213 ===================================================================
214 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_binaryopinset.h,v
215 retrieving revision 1.3
216 diff -u -p -r1.3 math_binaryopinset.h
217 --- math_binaryopinset.h        9 Nov 2001 08:35:55 -0000       1.3
218 +++ math_binaryopinset.h        25 Mar 2002 12:01:57 -0000
219 @@ -19,7 +19,7 @@ public:
220         ///
221         MathInset * clone() const;
222         ///
223 -       void draw(Painter &, int x, int y) const;
224 +       void draw(MathPainterInfo &, int x, int y) const;
225         ///
226         void write(WriteStream & os) const;
227         ///
228 Index: math_binominset.C
229 ===================================================================
230 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_binominset.C,v
231 retrieving revision 1.12
232 diff -u -p -r1.12 math_binominset.C
233 --- math_binominset.C   21 Mar 2002 17:42:55 -0000      1.12
234 +++ math_binominset.C   25 Mar 2002 12:01:57 -0000
235 @@ -46,7 +46,7 @@ void MathBinomInset::metrics(MathMetrics
236  }
237  
238  
239 -void MathBinomInset::draw(Painter & pain, int x, int y) const
240 +void MathBinomInset::draw(MathPainterInfo & pain, int x, int y) const
241  {
242         int m = x + width() / 2;
243         xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 3 - 5);
244 Index: math_binominset.h
245 ===================================================================
246 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_binominset.h,v
247 retrieving revision 1.5
248 diff -u -p -r1.5 math_binominset.h
249 --- math_binominset.h   21 Mar 2002 17:42:55 -0000      1.5
250 +++ math_binominset.h   25 Mar 2002 12:01:57 -0000
251 @@ -24,7 +24,7 @@ public:
252         ///
253         void metrics(MathMetricsInfo const & st) const;
254         ///
255 -       void draw(Painter &, int x, int y) const;
256 +       void draw(MathPainterInfo &, int x, int y) const;
257  private:
258         ///
259         int dw() const;
260 Index: math_boxinset.C
261 ===================================================================
262 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_boxinset.C,v
263 retrieving revision 1.10
264 diff -u -p -r1.10 math_boxinset.C
265 --- math_boxinset.C     3 Jan 2002 12:02:53 -0000       1.10
266 +++ math_boxinset.C     25 Mar 2002 12:01:57 -0000
267 @@ -41,7 +41,7 @@ void MathBoxInset::rebreak()
268  }
269  
270  
271 -void MathBoxInset::draw(Painter & pain, int x, int y) const
272 +void MathBoxInset::draw(MathPainterInfo & pain, int x, int y) const
273  {
274         MathGridInset::draw(pain, x, y);
275         mathed_draw_framebox(pain, x, y, this);
276 Index: math_boxinset.h
277 ===================================================================
278 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_boxinset.h,v
279 retrieving revision 1.7
280 diff -u -p -r1.7 math_boxinset.h
281 --- math_boxinset.h     18 Dec 2001 12:21:32 -0000      1.7
282 +++ math_boxinset.h     25 Mar 2002 12:01:57 -0000
283 @@ -30,7 +30,7 @@ public:
284         ///
285         void normalize(NormalStream &) const;
286         ///
287 -       void draw(Painter &, int x, int y) const;
288 +       void draw(MathPainterInfo &, int x, int y) const;
289  
290  private:
291         ///
292 Index: math_braceinset.C
293 ===================================================================
294 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_braceinset.C,v
295 retrieving revision 1.7
296 diff -u -p -r1.7 math_braceinset.C
297 --- math_braceinset.C   21 Mar 2002 17:42:55 -0000      1.7
298 +++ math_braceinset.C   25 Mar 2002 12:01:57 -0000
299 @@ -36,7 +36,7 @@ void MathBraceInset::metrics(MathMetrics
300  }
301  
302  
303 -void MathBraceInset::draw(Painter & pain, int x, int y) const
304 +void MathBraceInset::draw(MathPainterInfo & pain, int x, int y) const
305  {
306         drawChar(pain, font_, x, y, '{');
307         xcell(0).draw(pain, x + wid_, y);
308 Index: math_braceinset.h
309 ===================================================================
310 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_braceinset.h,v
311 retrieving revision 1.6
312 diff -u -p -r1.6 math_braceinset.h
313 --- math_braceinset.h   21 Mar 2002 17:42:55 -0000      1.6
314 +++ math_braceinset.h   25 Mar 2002 12:01:57 -0000
315 @@ -22,7 +22,7 @@ public:
316         ///
317         MathBraceInset * asBraceInset() { return this; }
318         ///
319 -       void draw(Painter &, int x, int y) const;
320 +       void draw(MathPainterInfo &, int x, int y) const;
321         ///
322         void write(WriteStream & os) const;
323         /// write normalized content
324 Index: math_casesinset.C
325 ===================================================================
326 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_casesinset.C,v
327 retrieving revision 1.6
328 diff -u -p -r1.6 math_casesinset.C
329 --- math_casesinset.C   21 Mar 2002 17:42:55 -0000      1.6
330 +++ math_casesinset.C   25 Mar 2002 12:01:57 -0000
331 @@ -8,7 +8,6 @@
332  #include "math_parser.h"
333  #include "math_mathmlstream.h"
334  #include "math_support.h"
335 -#include "Painter.h"
336  
337  
338  MathCasesInset::MathCasesInset(row_type n)
339 @@ -29,7 +28,7 @@ void MathCasesInset::metrics(MathMetrics
340  }
341  
342  
343 -void MathCasesInset::draw(Painter & pain, int x, int y) const
344 +void MathCasesInset::draw(MathPainterInfo & pain, int x, int y) const
345  {
346         mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
347         MathGridInset::draw(pain, x + 8, y);
348 Index: math_casesinset.h
349 ===================================================================
350 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_casesinset.h,v
351 retrieving revision 1.2
352 diff -u -p -r1.2 math_casesinset.h
353 --- math_casesinset.h   21 Mar 2002 17:42:55 -0000      1.2
354 +++ math_casesinset.h   25 Mar 2002 12:01:57 -0000
355 @@ -18,7 +18,7 @@ public:
356         ///
357         void metrics(MathMetricsInfo const & st) const;
358         ///
359 -       void draw(Painter & pain, int x, int y) const;
360 +       void draw(MathPainterInfo & pain, int x, int y) const;
361  
362         ///
363         void normalize(NormalStream &) const;
364 Index: math_charinset.C
365 ===================================================================
366 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_charinset.C,v
367 retrieving revision 1.38
368 diff -u -p -r1.38 math_charinset.C
369 --- math_charinset.C    21 Mar 2002 17:42:55 -0000      1.38
370 +++ math_charinset.C    25 Mar 2002 12:01:57 -0000
371 @@ -5,8 +5,6 @@
372  #endif
373  
374  #include "math_charinset.h"
375 -#include "LColor.h"
376 -#include "Painter.h"
377  #include "support/LOstream.h"
378  #include "font.h"
379  #include "debug.h"
380 @@ -27,33 +25,29 @@ using std::strchr;
381  #endif
382  
383  
384 -bool isBinaryOp(char c, MathTextCodes type)
385 -{
386 -       return type < LM_TC_SYMB && strchr("+-<>=/*", c);
387 -}
388 +namespace {
389  
390 +       bool isBinaryOp(char c, MathTextCodes type)
391 +       {
392 +               return type < LM_TC_SYMB && strchr("+-<>=/*", c);
393 +       }
394  
395 -MathCharInset::MathCharInset(char c)
396 -       : char_(c), code_(nativeCode(c))
397 -{
398 -//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
399 -}
400  
401 +       MathTextCodes nativeCode(char c)
402 +       {
403 +               if (isalpha(c))
404 +                       return LM_TC_VAR;
405 +               //if (strchr("0123456789;:!|[]().,?+/-*<>=", c)
406 +               return LM_TC_CONST;
407 +       }
408  
409 -MathCharInset::MathCharInset(char c, MathTextCodes t)
410 -       : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t)
411 -{
412 -//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
413  }
414  
415  
416 -MathTextCodes MathCharInset::nativeCode(char c)
417 -{
418 -       if (isalpha(c))
419 -               return LM_TC_VAR;
420 -       //if (strchr("0123456789;:!|[]().,?+/-*<>=", c)
421 -       return LM_TC_CONST;
422 -}
423 +MathCharInset::MathCharInset(char c)
424 +       : char_(c)
425 +{}
426 +
427  
428  
429  MathInset * MathCharInset::clone() const
430 @@ -64,19 +58,18 @@ MathInset * MathCharInset::clone() const
431  
432  void MathCharInset::metrics(MathMetricsInfo const & mi) const
433  {
434 -       whichFont(font_, code_, mi);
435 -       mathed_char_dim(font_, char_, ascent_, descent_, width_);
436 -       if (isBinaryOp(char_, code_))
437 -               width_ += 2 * lyxfont::width(' ', font_);
438 +       mathed_char_dim(mi.font, char_, ascent_, descent_, width_);
439 +       if (isBinaryOp(char_, mi.code))
440 +               width_ += 2 * lyxfont::width(' ', mi.font);
441  }
442  
443  
444 -void MathCharInset::draw(Painter & pain, int x, int y) const
445 +void MathCharInset::draw(MathPainterInfo & pain, int x, int y) const
446  {
447         //lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
448 -       if (isBinaryOp(char_, code_))
449 -               x += lyxfont::width(' ', font_);
450 -       drawChar(pain, font_, x, y, char_);
451 +       if (isBinaryOp(char_, pain.code))
452 +               x += lyxfont::width(' ', pain.font);
453 +       drawChar(pain, pain.font, x, y, char_);
454  }
455  
456  
457 @@ -95,31 +88,9 @@ void MathCharInset::drawT(TextPainter & 
458  }
459  
460  
461 -void MathCharInset::writeHeader(ostream & os) const
462 -{
463 -       if (math_font_name(code_))
464 -               os << '\\' << math_font_name(code_) << '{';
465 -}
466 -
467 -
468 -void MathCharInset::writeTrailer(ostream & os) const
469 -{
470 -       if (math_font_name(code_))
471 -               os << '}';
472 -}
473 -
474 -
475 -void MathCharInset::writeRaw(ostream & os) const
476 -{
477 -       os << char_;
478 -}
479 -
480 -
481  void MathCharInset::write(WriteStream & os) const
482  {
483 -       writeHeader(os.os());
484 -       writeRaw(os.os());
485 -       writeTrailer(os.os());
486 +       os << char_;
487  }
488  
489  
490 @@ -135,23 +106,8 @@ bool MathCharInset::isRelOp() const
491  }
492  
493  
494 -void MathCharInset::handleFont(MathTextCodes t)
495 -{
496 -       code_ = (code_ == t) ? LM_TC_VAR : t;
497 -}
498 -
499 -
500 -void MathCharInset::validate(LaTeXFeatures & features) const
501 -{
502 -       // Make sure amssymb is put in preamble if Blackboard Bold or
503 -       // Fraktur used:
504 -       if ((code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK))
505 -               features.require("amssymb");
506 -}
507 -
508 -
509  bool MathCharInset::match(MathInset * p) const
510  {
511         MathCharInset const * q = p->asCharInset();
512 -       return q && char_ == q->char_ && code_ == q->code_;
513 +       return q && char_ == q->char_;
514  }
515 Index: math_charinset.h
516 ===================================================================
517 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_charinset.h,v
518 retrieving revision 1.20
519 diff -u -p -r1.20 math_charinset.h
520 --- math_charinset.h    21 Mar 2002 06:57:13 -0000      1.20
521 +++ math_charinset.h    25 Mar 2002 12:01:57 -0000
522 @@ -17,15 +17,11 @@ public:
523         ///
524         explicit MathCharInset(char c);
525         ///
526 -       MathCharInset(char c, MathTextCodes t);
527 -       ///
528         MathInset * clone() const;
529         ///
530 -       static MathTextCodes nativeCode(char c);
531 -       ///
532         void metrics(MathMetricsInfo const & st) const;
533         ///
534 -       void draw(Painter &, int x, int y) const;
535 +       void draw(MathPainterInfo &, int x, int y) const;
536         ///
537         void metricsT(TextMetricsInfo const & st) const;
538         ///
539 @@ -33,26 +29,14 @@ public:
540         ///
541         void write(WriteStream & os) const;
542         ///
543 -       void writeHeader(std::ostream &) const;
544 -       ///
545 -       void writeTrailer(std::ostream &) const;
546 -       ///
547 -       void writeRaw(std::ostream &) const;
548 -       ///
549         void normalize(NormalStream &) const;
550         /// identifies Charinsets
551         MathCharInset const * asCharInset() const { return this; }
552         ///
553         char getChar() const { return char_; }
554         ///
555 -       MathTextCodes code() const { return code_; }
556 -       ///
557         bool isRelOp() const;
558         ///
559 -       void validate(LaTeXFeatures & features) const;
560 -       ///
561 -       void handleFont(MathTextCodes t);
562 -       ///
563         bool match(MathInset *) const;
564         /// identifies complicated things that need braces if used as arg
565         bool needsBraces() const { return false; }
566 @@ -60,9 +44,5 @@ public:
567  private:
568         /// the character
569         char char_;
570 -       /// the font to be used on screen
571 -       MathTextCodes code_;
572 -       ///
573 -       mutable LyXFont font_;
574  };
575  #endif
576 Index: math_cursor.C
577 ===================================================================
578 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v
579 retrieving revision 1.248
580 diff -u -p -r1.248 math_cursor.C
581 --- math_cursor.C       22 Mar 2002 09:31:26 -0000      1.248
582 +++ math_cursor.C       25 Mar 2002 12:01:57 -0000
583 @@ -171,7 +171,7 @@ Selection theSelection;
584  
585  
586  MathCursor::MathCursor(InsetFormulaBase * formula, bool left)
587 -       : formula_(formula), lastcode_(LM_TC_MIN), selection_(false)
588 +       : formula_(formula), selection_(false)
589  {
590         left ? first() : last();
591  }
592 @@ -299,11 +299,9 @@ bool MathCursor::left(bool sel)
593         dump("Left 1");
594         if (inMacroMode()) {
595                 macroModeClose();
596 -               lastcode_ = LM_TC_MIN;
597                 return true;
598         }
599         selHandle(sel);
600 -       lastcode_ = LM_TC_MIN;
601  
602         if (hasPrevAtom() && openable(prevAtom(), sel)) {
603                 if (prevAtom()->isHyperActive()) {
604 @@ -322,11 +320,9 @@ bool MathCursor::right(bool sel)
605         dump("Right 1");
606         if (inMacroMode()) {
607                 macroModeClose();
608 -               lastcode_ = LM_TC_MIN;
609                 return true;
610         }
611         selHandle(sel);
612 -       lastcode_ = LM_TC_MIN;
613  
614         if (hasNextAtom() && openable(nextAtom(), sel)) {
615                 if (nextAtom()->isHyperActive()) {
616 @@ -395,7 +391,6 @@ void MathCursor::home(bool sel)
617         dump("home 1");
618         selHandle(sel);
619         macroModeClose();
620 -       lastcode_ = LM_TC_MIN;
621         if (!par()->idxHome(idx(), pos()))
622                 popLeft();
623         dump("home 2");
624 @@ -407,7 +402,6 @@ void MathCursor::end(bool sel)
625         dump("end 1");
626         selHandle(sel);
627         macroModeClose();
628 -       lastcode_ = LM_TC_MIN;
629         if (!par()->idxEnd(idx(), pos()))
630                 popRight();
631         dump("end 2");
632 @@ -423,7 +417,7 @@ void MathCursor::plainErase()
633  void MathCursor::markInsert()
634  {
635         //lyxerr << "inserting mark\n";
636 -       array().insert(pos(), MathAtom(new MathCharInset(0, lastcode_)));
637 +       array().insert(pos(), MathAtom(new MathCharInset(0)));
638  }
639  
640  
641 @@ -441,16 +435,10 @@ void MathCursor::plainInsert(MathAtom co
642  }
643  
644  
645 -void MathCursor::insert(char c, MathTextCodes t)
646 -{
647 -       //lyxerr << "inserting '" << c << "'\n";
648 -       plainInsert(MathAtom(new MathCharInset(c, t)));
649 -}
650 -
651 -
652  void MathCursor::insert(char c)
653  {
654 -       insert(c, lastcode_);
655 +       //lyxerr << "inserting '" << c << "'\n";
656 +       plainInsert(MathAtom(new MathCharInset(c)));
657  }
658  
659  
660 @@ -741,7 +729,7 @@ void MathCursor::selGet(MathArray & ar)
661  
662  
663  
664 -void MathCursor::drawSelection(Painter & pain) const
665 +void MathCursor::drawSelection(MathPainterInfo & pain) const
666  {
667         if (!selection_)
668                 return;
669 @@ -756,7 +744,7 @@ void MathCursor::drawSelection(Painter &
670                 int y1 = c.yo() - c.ascent();
671                 int x2 = c.xo() + c.pos2x(i2.pos_);
672                 int y2 = c.yo() + c.descent();
673 -               pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
674 +               pain.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
675         } else {
676                 vector<MathInset::idx_type> indices
677                         = i1.par_->idxBetween(i1.idx_, i2.idx_);
678 @@ -766,7 +754,7 @@ void MathCursor::drawSelection(Painter &
679                         int y1 = c.yo() - c.ascent();
680                         int x2 = c.xo() + c.width();
681                         int y2 = c.yo() + c.descent();
682 -                       pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
683 +                       pain.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
684                 }
685         }
686  
687 @@ -784,23 +772,6 @@ void MathCursor::drawSelection(Painter &
688  }
689  
690  
691 -void MathCursor::handleFont(MathTextCodes t)
692 -{
693 -       macroModeClose();
694 -       if (selection_) {
695 -               MathCursorPos i1;
696 -               MathCursorPos i2;
697 -               getSelection(i1, i2);
698 -               if (i1.idx_ == i2.idx_) {
699 -                       MathArray & ar = i1.cell();
700 -                       for (MathInset::pos_type pos = i1.pos_; pos != i2.pos_; ++pos)
701 -                               ar.at(pos)->handleFont(t);
702 -               }
703 -       } else
704 -               lastcode_ = (lastcode_ == t) ? LM_TC_VAR : t;
705 -}
706 -
707 -
708  void MathCursor::handleDelim(string const & l, string const & r)
709  {
710         handleNest(new MathDelimInset(l, r));
711 @@ -866,7 +837,7 @@ MathCursor::pos_type & MathCursor::pos()
712  
713  bool MathCursor::inMacroMode() const
714  {
715 -       return macroNamePos() != -1;
716 +       return false;
717  }
718  
719  
720 @@ -1369,11 +1340,6 @@ bool MathCursor::interpret(string const 
721                 return true;
722         }
723  
724 -       latexkeys const * l = in_word_set(s.substr(1));
725 -       if (l && (l->token == LM_TK_FONT || l->token == LM_TK_OLDFONT)) {
726 -               lastcode_ = static_cast<MathTextCodes>(l->id);
727 -               return true;
728 -       }
729  
730         // prevent entering of recursive macros
731         if (formula()->lyxCode() == Inset::MATHMACRO_CODE
732 @@ -1423,7 +1389,7 @@ bool MathCursor::interpret(char c)
733                 int n = c - '0';
734                 MathMacroTemplate * p = formula()->par()->asMacroTemplate();
735                 if (p && 1 <= n && n <= p->numargs())
736 -                       insert(MathAtom(new MathMacroArgument(c - '0', lastcode_)));
737 +                       insert(MathAtom(new MathMacroArgument(c - '0')));
738                 else {
739                         insert(MathAtom(new MathSpecialCharInset('#')));
740                         interpret(c); // try again
741 @@ -1442,12 +1408,12 @@ bool MathCursor::interpret(char c)
742                 }
743  
744                 if (isalpha(c)) {
745 -                       insert(c, LM_TC_TEX);
746 +                       insert(c); //  LM_TC_TEX;
747                         return true;
748                 }
749  
750                 if (name == "\\") {
751 -                       insert(c, LM_TC_TEX);
752 +                       insert(c); // LM_TC_TEX;
753                         macroModeClose();
754                         return true;
755                 }
756 @@ -1455,9 +1421,9 @@ bool MathCursor::interpret(char c)
757                 macroModeClose();
758  
759                 if (c == '\\')
760 -                       insert(c, LM_TC_TEX);
761 +                       insert(c); //  LM_TC_TEX;
762                 else if (c != ' ')
763 -                       insert(c, lastcode_);
764 +                       insert(c); //  lastcode_;
765  
766                 return true;
767         }
768 @@ -1469,13 +1435,13 @@ bool MathCursor::interpret(char c)
769                 // fall through in the other cases
770         }
771  
772 -       if (lastcode_ == LM_TC_TEXTRM || par()->asBoxInset()) {
773 +       if ( /*lastcode_ == LM_TC_TEXTRM || */par()->asBoxInset()) {
774                 // suppress direct insertion of two spaces in a row
775                 // the still allows typing  '<space>a<space>' and deleting the 'a', but
776                 // it is better than nothing...
777                 if (c == ' ' && hasPrevAtom() && prevAtom()->getChar() == ' ')
778                         return true;
779 -               insert(c, LM_TC_TEXTRM);
780 +               insert(c); // LM_TC_TEXTRM;
781                 return true;
782         }
783  
784 @@ -1491,13 +1457,13 @@ bool MathCursor::interpret(char c)
785         }
786  
787         if (c == '#') {
788 -               insert(c, LM_TC_TEX);
789 +               insert(c); // LM_TC_TEX;
790                 return true;
791         }
792  
793  /*
794         if (c == '{' || c == '}', c)) {
795 -               insert(c, LM_TC_TEX);
796 +               insert(c); // LM_TC_TEX;
797                 return true;
798         }
799  */
800 @@ -1513,10 +1479,10 @@ bool MathCursor::interpret(char c)
801  
802         if (c == '$' || c == '%') {
803                 insert(MathAtom(new MathSpecialCharInset(c)));
804 -               lastcode_ = LM_TC_VAR;
805                 return true;
806         }
807  
808 +/*
809         if (isalpha(c) && lastcode_ == LM_TC_GREEK) {
810                 insert(c, LM_TC_VAR);
811                 return true;
812 @@ -1533,10 +1499,10 @@ bool MathCursor::interpret(char c)
813                 //bv->owner()->message(_("TeX mode"));
814                 return true;
815         }
816 +*/
817  
818         // no special circumstances, so insert the character without any fuss
819 -       insert(c, lastcode_ == LM_TC_MIN ? MathCharInset::nativeCode(c) : lastcode_);
820 -       lastcode_ = LM_TC_MIN;
821 +       insert(c);
822         return true;
823  }
824  
825 Index: math_cursor.h
826 ===================================================================
827 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.h,v
828 retrieving revision 1.103
829 diff -u -p -r1.103 math_cursor.h
830 --- math_cursor.h       21 Mar 2002 17:42:55 -0000      1.103
831 +++ math_cursor.h       25 Mar 2002 12:01:57 -0000
832 @@ -27,7 +27,7 @@
833  #include "LString.h"
834  
835  class InsetFormulaBase;
836 -class Painter;
837 +class MathPainterInfo;
838  class Selection;
839  
840  /**
841 @@ -149,9 +149,7 @@ public:
842         ///
843         void selGet(MathArray & ar);
844         ///
845 -       void drawSelection(Painter & pain) const;
846 -       ///
847 -       void handleFont(MathTextCodes t);
848 +       void drawSelection(MathPainterInfo & pain) const;
849         ///
850         void handleDelim(string const & l, string const & r);
851         ///
852 @@ -163,14 +161,12 @@ public:
853         /// read contents of line into an array
854         void readLine(MathArray & ar) const;
855         /// remove this as soon as LyXFunc::getStatus is "localized"
856 -       MathTextCodes getLastCode() const { return lastcode_; }
857 +       MathTextCodes getLastCode() const { return LM_TC_MIN; }
858         ///
859         void pullArg(bool goright);
860         ///
861         bool isInside(MathInset const *) const;
862         ///
863 -       MathTextCodes nextCode() const;
864 -       ///
865         char valign() const;
866         ///
867         char halign() const;
868 @@ -266,8 +262,6 @@ private:
869         string macroName() const;
870         ///
871         MathInset::difference_type macroNamePos() const;
872 -       ///
873 -       void insert(char, MathTextCodes t);
874         /// can we enter the inset?
875         bool openable(MathAtom const &, bool selection) const;
876         /// write access to cursor cell position
877 @@ -281,11 +275,11 @@ private:
878         mutable cursor_type Anchor_;
879         /// pointer to enclsing LyX inset
880         InsetFormulaBase * formula_;
881 -       /// text code of last char entered
882 -       MathTextCodes lastcode_;
883         // Selection stuff
884         /// do we currently select
885         bool selection_;
886 +       /// are we entering a macro name?
887 +       bool macromode_;
888  };
889  
890  extern MathCursor * mathcursor;
891 Index: math_decorationinset.C
892 ===================================================================
893 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_decorationinset.C,v
894 retrieving revision 1.44
895 diff -u -p -r1.44 math_decorationinset.C
896 --- math_decorationinset.C      21 Mar 2002 17:42:55 -0000      1.44
897 +++ math_decorationinset.C      25 Mar 2002 12:01:57 -0000
898 @@ -94,7 +94,7 @@ void MathDecorationInset::metrics(MathMe
899  }
900  
901  
902 -void MathDecorationInset::draw(Painter & pain, int x, int y) const
903 +void MathDecorationInset::draw(MathPainterInfo & pain, int x, int y) const
904  {
905         xcell(0).draw(pain, x, y);
906         if (wide())
907 Index: math_decorationinset.h
908 ===================================================================
909 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_decorationinset.h,v
910 retrieving revision 1.25
911 diff -u -p -r1.25 math_decorationinset.h
912 --- math_decorationinset.h      19 Mar 2002 16:55:58 -0000      1.25
913 +++ math_decorationinset.h      25 Mar 2002 12:01:57 -0000
914 @@ -20,7 +20,7 @@ public:
915         ///
916         MathInset * clone() const;
917         ///
918 -       void draw(Painter &, int x, int y) const;
919 +       void draw(MathPainterInfo &, int x, int y) const;
920         ///
921         void write(WriteStream & os) const;
922         ///
923 Index: math_deliminset.C
924 ===================================================================
925 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_deliminset.C,v
926 retrieving revision 1.48
927 diff -u -p -r1.48 math_deliminset.C
928 --- math_deliminset.C   21 Mar 2002 17:42:55 -0000      1.48
929 +++ math_deliminset.C   25 Mar 2002 12:01:57 -0000
930 @@ -67,7 +67,7 @@ void MathDelimInset::metrics(MathMetrics
931  }
932  
933  
934 -void MathDelimInset::draw(Painter & pain, int x, int y) const
935 +void MathDelimInset::draw(MathPainterInfo & pain, int x, int y) const
936  {
937         int const w = dw();
938         int const b = y - ascent_;
939 Index: math_deliminset.h
940 ===================================================================
941 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_deliminset.h,v
942 retrieving revision 1.25
943 diff -u -p -r1.25 math_deliminset.h
944 --- math_deliminset.h   14 Feb 2002 12:38:02 -0000      1.25
945 +++ math_deliminset.h   25 Mar 2002 12:01:57 -0000
946 @@ -32,7 +32,7 @@ public:
947         ///
948         void metrics(MathMetricsInfo const & st) const;
949         ///
950 -       void draw(Painter &, int x, int y) const;
951 +       void draw(MathPainterInfo &, int x, int y) const;
952  
953         ///
954         void write(WriteStream & os) const;
955 Index: math_diffinset.C
956 ===================================================================
957 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_diffinset.C,v
958 retrieving revision 1.2
959 diff -u -p -r1.2 math_diffinset.C
960 --- math_diffinset.C    21 Mar 2002 17:42:55 -0000      1.2
961 +++ math_diffinset.C    25 Mar 2002 12:01:57 -0000
962 @@ -38,7 +38,7 @@ void MathDiffInset::metrics(MathMetricsI
963  }
964  
965  
966 -void MathDiffInset::draw(Painter &, int, int) const
967 +void MathDiffInset::draw(MathPainterInfo &, int, int) const
968  {
969         lyxerr << "should not happen\n";
970  }
971 Index: math_diffinset.h
972 ===================================================================
973 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_diffinset.h,v
974 retrieving revision 1.1
975 diff -u -p -r1.1 math_diffinset.h
976 --- math_diffinset.h    13 Nov 2001 16:27:06 -0000      1.1
977 +++ math_diffinset.h    25 Mar 2002 12:01:57 -0000
978 @@ -18,7 +18,7 @@ public:
979         ///
980         void metrics(MathMetricsInfo const & st) const;
981         ///
982 -       void draw(Painter &, int x, int y) const;
983 +       void draw(MathPainterInfo &, int x, int y) const;
984  
985         ///
986         void normalize(NormalStream &) const;
987 Index: math_dotsinset.C
988 ===================================================================
989 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_dotsinset.C,v
990 retrieving revision 1.27
991 diff -u -p -r1.27 math_dotsinset.C
992 --- math_dotsinset.C    21 Mar 2002 17:42:55 -0000      1.27
993 +++ math_dotsinset.C    25 Mar 2002 12:01:57 -0000
994 @@ -35,7 +35,7 @@ void MathDotsInset::metrics(MathMetricsI
995  }
996  
997  
998 -void MathDotsInset::draw(Painter & pain, int x, int y) const
999 +void MathDotsInset::draw(MathPainterInfo & pain, int x, int y) const
1000  {
1001         mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
1002         char const c = name_[0];
1003 Index: math_dotsinset.h
1004 ===================================================================
1005 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_dotsinset.h,v
1006 retrieving revision 1.18
1007 diff -u -p -r1.18 math_dotsinset.h
1008 --- math_dotsinset.h    21 Mar 2002 17:42:55 -0000      1.18
1009 +++ math_dotsinset.h    25 Mar 2002 12:01:57 -0000
1010 @@ -17,7 +17,7 @@ public:
1011         ///
1012         MathInset * clone() const;
1013         ///
1014 -       void draw(Painter &, int x, int y) const;
1015 +       void draw(MathPainterInfo &, int x, int y) const;
1016         ///
1017         void write(WriteStream & os) const;
1018         ///
1019 Index: math_exfuncinset.C
1020 ===================================================================
1021 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_exfuncinset.C,v
1022 retrieving revision 1.12
1023 diff -u -p -r1.12 math_exfuncinset.C
1024 --- math_exfuncinset.C  21 Mar 2002 17:42:55 -0000      1.12
1025 +++ math_exfuncinset.C  25 Mar 2002 12:01:57 -0000
1026 @@ -24,7 +24,7 @@ void MathExFuncInset::metrics(MathMetric
1027  }
1028  
1029  
1030 -void MathExFuncInset::draw(Painter & pain, int x, int y) const
1031 +void MathExFuncInset::draw(MathPainterInfo & pain, int x, int y) const
1032  {
1033         drawStr(pain, font_, x, y, name_);
1034  }
1035 Index: math_exfuncinset.h
1036 ===================================================================
1037 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_exfuncinset.h,v
1038 retrieving revision 1.8
1039 diff -u -p -r1.8 math_exfuncinset.h
1040 --- math_exfuncinset.h  19 Mar 2002 16:55:58 -0000      1.8
1041 +++ math_exfuncinset.h  25 Mar 2002 12:01:57 -0000
1042 @@ -16,7 +16,7 @@ public:
1043         ///
1044         void metrics(MathMetricsInfo const & st) const;
1045         ///
1046 -       void draw(Painter &, int x, int y) const;
1047 +       void draw(MathPainterInfo &, int x, int y) const;
1048  
1049         ///
1050         void normalize(NormalStream &) const;
1051 Index: math_exintinset.C
1052 ===================================================================
1053 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_exintinset.C,v
1054 retrieving revision 1.16
1055 diff -u -p -r1.16 math_exintinset.C
1056 --- math_exintinset.C   21 Mar 2002 17:42:55 -0000      1.16
1057 +++ math_exintinset.C   25 Mar 2002 12:01:57 -0000
1058 @@ -55,7 +55,7 @@ void MathExIntInset::metrics(MathMetrics
1059  }
1060  
1061  
1062 -void MathExIntInset::draw(Painter &, int, int) const
1063 +void MathExIntInset::draw(MathPainterInfo &, int, int) const
1064  {
1065         lyxerr << "should not happen" << endl;
1066  }
1067 Index: math_exintinset.h
1068 ===================================================================
1069 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_exintinset.h,v
1070 retrieving revision 1.8
1071 diff -u -p -r1.8 math_exintinset.h
1072 --- math_exintinset.h   15 Nov 2001 14:14:37 -0000      1.8
1073 +++ math_exintinset.h   25 Mar 2002 12:01:57 -0000
1074 @@ -19,7 +19,7 @@ public:
1075         ///
1076         void metrics(MathMetricsInfo const & st) const;
1077         ///
1078 -       void draw(Painter &, int x, int y) const;
1079 +       void draw(MathPainterInfo &, int x, int y) const;
1080  
1081         ///
1082         void normalize(NormalStream &) const;
1083 Index: math_extern.C
1084 ===================================================================
1085 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_extern.C,v
1086 retrieving revision 1.21
1087 diff -u -p -r1.21 math_extern.C
1088 --- math_extern.C       21 Mar 2002 17:42:55 -0000      1.21
1089 +++ math_extern.C       25 Mar 2002 12:01:57 -0000
1090 @@ -118,16 +118,10 @@ MathScriptInset const * asScript(MathArr
1091  // returns sequence of char with same code starting at it up to end
1092  // it might be less, though...
1093  MathArray::const_iterator charSequence(MathArray::const_iterator it,
1094 -       MathArray::const_iterator end, string & s, MathTextCodes & c)
1095 +       MathArray::const_iterator end, string & s)
1096  {
1097 -       MathCharInset const * p = (*it)->asCharInset();
1098 -       c = p->code();
1099 -       for (; it != end; ++it) {
1100 -               p = (*it)->asCharInset();
1101 -               if (!p || p->code() != c)
1102 -                       break;
1103 -               s += p->getChar();
1104 -       }
1105 +       for (; it != end && (*it)->asCharInset(); ++it)
1106 +               s += (*it)->getChar();
1107         return it;
1108  }
1109  
1110 @@ -143,7 +137,7 @@ void extractStrings(MathArray & ar)
1111                 // create proper string inset
1112                 MathStringInset * p = new MathStringInset;
1113                 MathArray::const_iterator
1114 -                       jt = charSequence(it, ar.end(), p->str_, p->code_);
1115 +                       jt = charSequence(it, ar.end(), p->str_);
1116  
1117                 // clean up
1118                 (*it).reset(p);
1119 @@ -196,8 +190,7 @@ bool extractString(MathInset * p, string
1120  bool extractNumber(MathArray const & ar, int & i)
1121  {
1122         string s;
1123 -       MathTextCodes c;
1124 -       charSequence(ar.begin(), ar.end(), s, c);
1125 +       charSequence(ar.begin(), ar.end(), s);
1126         istringstream is(s.c_str());
1127         is >> i;
1128         return is;
1129 Index: math_factory.C
1130 ===================================================================
1131 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_factory.C,v
1132 retrieving revision 1.32
1133 diff -u -p -r1.32 math_factory.C
1134 --- math_factory.C      21 Mar 2002 17:42:55 -0000      1.32
1135 +++ math_factory.C      25 Mar 2002 12:01:57 -0000
1136 @@ -8,6 +8,7 @@
1137  #include "math_casesinset.h"
1138  #include "math_decorationinset.h"
1139  #include "math_dotsinset.h"
1140 +#include "math_fontinset.h"
1141  #include "math_funcinset.h"
1142  #include "math_funcliminset.h"
1143  #include "math_fracinset.h"
1144 @@ -82,6 +83,9 @@ MathAtom createMathInset(latexkeys const
1145                 return MathAtom(new MathFuncInset(l->name));
1146         case LM_TK_STY:
1147                 return MathAtom(new MathSizeInset(l));
1148 +       case LM_TK_FONT:
1149 +       case LM_TK_OLDFONT:
1150 +               return MathAtom(new MathFontInset(static_cast<MathTextCodes>(l->id)));
1151         default:
1152                 return MathAtom(new MathUnknownInset(l->name));
1153         }
1154 Index: math_fontinset.C
1155 ===================================================================
1156 RCS file: math_fontinset.C
1157 diff -N math_fontinset.C
1158 --- /dev/null   1 Jan 1970 00:00:00 -0000
1159 +++ math_fontinset.C    25 Mar 2002 12:01:57 -0000
1160 @@ -0,0 +1,86 @@
1161 +#include <config.h>
1162 +
1163 +#ifdef __GNUG__
1164 +#pragma implementation
1165 +#endif
1166 +
1167 +#include "math_fontinset.h"
1168 +#include "support/LOstream.h"
1169 +#include "debug.h"
1170 +#include "math_mathmlstream.h"
1171 +#include "math_support.h"
1172 +#include "LaTeXFeatures.h"
1173 +#include "textpainter.h"
1174 +
1175 +
1176 +MathFontInset::MathFontInset(MathTextCodes code)
1177 +       : MathNestInset(1), code_(code)
1178 +{}
1179 +
1180 +
1181 +MathInset * MathFontInset::clone() const
1182 +{
1183 +       return new MathFontInset(*this);
1184 +}
1185 +
1186 +
1187 +void MathFontInset::metrics(MathMetricsInfo const & mi) const
1188 +{
1189 +       MathMetricsInfo m = mi;
1190 +       whichFont(m.font, code_, mi);
1191 +       font_ = mi.font;
1192 +       xcell(0).metrics(m);
1193 +       width_   = xcell(0).width();
1194 +       ascent_  = xcell(0).ascent();
1195 +       descent_ = xcell(0).descent();
1196 +}
1197 +
1198 +
1199 +void MathFontInset::draw(MathPainterInfo & pain, int x, int y) const
1200 +{
1201 +       lyxerr << "MathFontInset::draw\n";
1202 +       xcell(0).draw(pain, x, y);
1203 +}
1204 +
1205 +
1206 +void MathFontInset::metricsT(TextMetricsInfo const & mi) const
1207 +{
1208 +       xcell(0).metricsT(mi);
1209 +       width_   = xcell(0).width();
1210 +       ascent_  = xcell(0).ascent();
1211 +       descent_ = xcell(0).descent();
1212 +}
1213 +
1214 +
1215 +void MathFontInset::drawT(TextPainter & pain, int x, int y) const
1216 +{
1217 +       //lyxerr << "drawing font code: " << code_ << '\n';
1218 +       xcell(0).drawT(pain, x, y);
1219 +}
1220 +
1221 +
1222 +void MathFontInset::write(WriteStream & os) const
1223 +{
1224 +       os << math_font_name(code_) << '{' << cell(0) << '}';
1225 +}
1226 +
1227 +
1228 +void MathFontInset::normalize(NormalStream & os) const
1229 +{
1230 +       os << "[font_ " << code_ << " " << cell(0) << "]";
1231 +}
1232 +
1233 +
1234 +void MathFontInset::handleFont(MathTextCodes t)
1235 +{
1236 +       code_ = (code_ == t) ? LM_TC_VAR : t;
1237 +}
1238 +
1239 +
1240 +void MathFontInset::validate(LaTeXFeatures & features) const
1241 +{
1242 +       // Make sure amssymb is put in preamble if Blackboard Bold or
1243 +       // Fraktur used:
1244 +       if ((code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK))
1245 +               features.require("amssymb");
1246 +}
1247 Index: math_fontinset.h
1248 ===================================================================
1249 RCS file: math_fontinset.h
1250 diff -N math_fontinset.h
1251 --- /dev/null   1 Jan 1970 00:00:00 -0000
1252 +++ math_fontinset.h    25 Mar 2002 12:01:57 -0000
1253 @@ -0,0 +1,48 @@
1254 +// -*- C++ -*-
1255 +#ifndef MATH_FONTINSET_H
1256 +#define MATH_FONTINSET_H
1257 +
1258 +#include "math_nestinset.h"
1259 +
1260 +#ifdef __GNUG__
1261 +#pragma interface
1262 +#endif
1263 +
1264 +/** The base character inset.
1265 +    \author André Pönitz
1266 + */
1267 +
1268 +class MathFontInset : public MathNestInset {
1269 +public:
1270 +       ///
1271 +       explicit MathFontInset(MathTextCodes t);
1272 +       ///
1273 +       MathInset * clone() const;
1274 +       ///
1275 +       void metrics(MathMetricsInfo const & st) const;
1276 +       ///
1277 +       void draw(MathPainterInfo &, int x, int y) const;
1278 +       ///
1279 +       void metricsT(TextMetricsInfo const & st) const;
1280 +       ///
1281 +       void drawT(TextPainter &, int x, int y) const;
1282 +       ///
1283 +       void write(WriteStream & os) const;
1284 +       ///
1285 +       void normalize(NormalStream &) const;
1286 +       /// identifies Fontinsets
1287 +       MathFontInset const * asFontInset() const { return this; }
1288 +       ///
1289 +       MathTextCodes code() const { return code_; }
1290 +       ///
1291 +       void validate(LaTeXFeatures & features) const;
1292 +       ///
1293 +       void handleFont(MathTextCodes t);
1294 +
1295 +private:
1296 +       /// the font to be used on screen
1297 +       MathTextCodes code_;
1298 +       ///
1299 +       mutable LyXFont font_;
1300 +};
1301 +#endif
1302 Index: math_fracinset.C
1303 ===================================================================
1304 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_fracinset.C,v
1305 retrieving revision 1.44
1306 diff -u -p -r1.44 math_fracinset.C
1307 --- math_fracinset.C    21 Mar 2002 17:42:55 -0000      1.44
1308 +++ math_fracinset.C    25 Mar 2002 12:01:57 -0000
1309 @@ -41,13 +41,13 @@ void MathFracInset::metrics(MathMetricsI
1310  }
1311  
1312  
1313 -void MathFracInset::draw(Painter & pain, int x, int y) const
1314 +void MathFracInset::draw(MathPainterInfo & pain, int x, int y) const
1315  {
1316         int m = x + width() / 2;
1317         xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 2 - 5);
1318         xcell(1).draw(pain, m - xcell(1).width() / 2, y + xcell(1).ascent()  + 2 - 5);
1319         if (!atop_)
1320 -               pain.line(x, y - 5, x + width(), y - 5, LColor::math);
1321 +               pain.pain.line(x, y - 5, x + width(), y - 5, LColor::math);
1322  }
1323  
1324  
1325 Index: math_fracinset.h
1326 ===================================================================
1327 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_fracinset.h,v
1328 retrieving revision 1.28
1329 diff -u -p -r1.28 math_fracinset.h
1330 --- math_fracinset.h    21 Mar 2002 06:57:13 -0000      1.28
1331 +++ math_fracinset.h    25 Mar 2002 12:01:57 -0000
1332 @@ -20,7 +20,7 @@ public:
1333         ///
1334         void metrics(MathMetricsInfo const & mi) const;
1335         ///
1336 -       void draw(Painter &, int x, int y) const;
1337 +       void draw(MathPainterInfo &, int x, int y) const;
1338         ///
1339         void metricsT(TextMetricsInfo const & mi) const;
1340         ///
1341 Index: math_funcinset.C
1342 ===================================================================
1343 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_funcinset.C,v
1344 retrieving revision 1.37
1345 diff -u -p -r1.37 math_funcinset.C
1346 --- math_funcinset.C    21 Mar 2002 17:42:55 -0000      1.37
1347 +++ math_funcinset.C    25 Mar 2002 12:01:57 -0000
1348 @@ -6,7 +6,6 @@
1349  
1350  #include "math_funcinset.h"
1351  #include "font.h"
1352 -#include "Painter.h"
1353  #include "math_support.h"
1354  #include "math_mathmlstream.h"
1355  #include "math_streamstr.h"
1356 @@ -45,7 +44,7 @@ void MathFuncInset::metrics(MathMetricsI
1357  }
1358  
1359  
1360 -void MathFuncInset::draw(Painter & pain, int x, int y) const
1361 +void MathFuncInset::draw(MathPainterInfo & pain, int x, int y) const
1362  {
1363         drawStr(pain, font_, x, y, name_);
1364  }
1365 Index: math_funcinset.h
1366 ===================================================================
1367 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_funcinset.h,v
1368 retrieving revision 1.26
1369 diff -u -p -r1.26 math_funcinset.h
1370 --- math_funcinset.h    19 Mar 2002 16:55:58 -0000      1.26
1371 +++ math_funcinset.h    25 Mar 2002 12:01:57 -0000
1372 @@ -21,7 +21,7 @@ public:
1373         ///
1374         void metrics(MathMetricsInfo const & st) const;
1375         ///
1376 -       void draw(Painter &, int x, int y) const;
1377 +       void draw(MathPainterInfo &, int x, int y) const;
1378         ///
1379         string const & name() const;
1380         /// identifies FuncInsets
1381 Index: math_funcliminset.C
1382 ===================================================================
1383 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_funcliminset.C,v
1384 retrieving revision 1.14
1385 diff -u -p -r1.14 math_funcliminset.C
1386 --- math_funcliminset.C 21 Mar 2002 17:42:55 -0000      1.14
1387 +++ math_funcliminset.C 25 Mar 2002 12:01:57 -0000
1388 @@ -43,7 +43,7 @@ void MathFuncLimInset::metrics(MathMetri
1389  }
1390  
1391  
1392 -void MathFuncLimInset::draw(Painter & pain, int x, int y) const
1393 +void MathFuncLimInset::draw(MathPainterInfo & pain, int x, int y) const
1394  {
1395         drawStr(pain, font_, x, y, name_);
1396  }
1397 Index: math_funcliminset.h
1398 ===================================================================
1399 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_funcliminset.h,v
1400 retrieving revision 1.8
1401 diff -u -p -r1.8 math_funcliminset.h
1402 --- math_funcliminset.h 19 Mar 2002 16:55:58 -0000      1.8
1403 +++ math_funcliminset.h 25 Mar 2002 12:01:57 -0000
1404 @@ -20,7 +20,7 @@ public:
1405         ///
1406         void metrics(MathMetricsInfo const & st) const;
1407         ///
1408 -       void draw(Painter &, int x, int y) const;
1409 +       void draw(MathPainterInfo &, int x, int y) const;
1410         ///
1411         bool isScriptable() const;
1412  
1413 Index: math_gridinset.C
1414 ===================================================================
1415 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v
1416 retrieving revision 1.60
1417 diff -u -p -r1.60 math_gridinset.C
1418 --- math_gridinset.C    21 Mar 2002 17:42:55 -0000      1.60
1419 +++ math_gridinset.C    25 Mar 2002 12:01:57 -0000
1420 @@ -355,7 +355,7 @@ void MathGridInset::metrics(MathMetricsI
1421  }
1422  
1423  
1424 -void MathGridInset::draw(Painter & pain, int x, int y) const
1425 +void MathGridInset::draw(MathPainterInfo & pain, int x, int y) const
1426  {
1427         for (idx_type idx = 0; idx < nargs(); ++idx)
1428                 xcell(idx).draw(pain, x + cellXOffset(idx), y + cellYOffset(idx));
1429 @@ -364,14 +364,14 @@ void MathGridInset::draw(Painter & pain,
1430                 for (int i = 0; i < rowinfo_[row].lines_; ++i) {
1431                         int yy = y + rowinfo_[row].offset_ - rowinfo_[row].ascent_
1432                                 - i * hlinesep() - hlinesep()/2 - rowsep()/2;
1433 -                       pain.line(x + 1, yy, x + width_ - 1, yy);
1434 +                       pain.pain.line(x + 1, yy, x + width_ - 1, yy);
1435                 }
1436  
1437         for (col_type col = 0; col <= ncols(); ++col)
1438                 for (int i = 0; i < colinfo_[col].lines_; ++i) {
1439                         int xx = x + colinfo_[col].offset_
1440                                 - i * vlinesep() - vlinesep()/2 - colsep()/2;
1441 -                       pain.line(xx, y - ascent_ + 1, xx, y + descent_ - 1);
1442 +                       pain.pain.line(xx, y - ascent_ + 1, xx, y + descent_ - 1);
1443                 }
1444  }
1445  
1446 Index: math_gridinset.h
1447 ===================================================================
1448 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.h,v
1449 retrieving revision 1.38
1450 diff -u -p -r1.38 math_gridinset.h
1451 --- math_gridinset.h    21 Mar 2002 17:42:55 -0000      1.38
1452 +++ math_gridinset.h    25 Mar 2002 12:01:57 -0000
1453 @@ -72,7 +72,7 @@ public:
1454         ///
1455         void metrics(MathMetricsInfo const & st) const;
1456         ///
1457 -       void draw(Painter &, int x, int y) const;
1458 +       void draw(MathPainterInfo &, int x, int y) const;
1459         ///
1460         void metricsT(TextMetricsInfo const & st) const;
1461         ///
1462 Index: math_hullinset.C
1463 ===================================================================
1464 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v
1465 retrieving revision 1.21
1466 diff -u -p -r1.21 math_hullinset.C
1467 --- math_hullinset.C    21 Mar 2002 17:42:56 -0000      1.21
1468 +++ math_hullinset.C    25 Mar 2002 12:01:57 -0000
1469 @@ -186,7 +186,7 @@ void MathHullInset::metrics(MathMetricsI
1470  }
1471  
1472  
1473 -void MathHullInset::draw(Painter & pain, int x, int y) const
1474 +void MathHullInset::draw(MathPainterInfo & pain, int x, int y) const
1475  {
1476         MathGridInset::draw(pain, x, y);
1477  
1478 Index: math_hullinset.h
1479 ===================================================================
1480 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.h,v
1481 retrieving revision 1.10
1482 diff -u -p -r1.10 math_hullinset.h
1483 --- math_hullinset.h    21 Mar 2002 17:42:56 -0000      1.10
1484 +++ math_hullinset.h    25 Mar 2002 12:01:57 -0000
1485 @@ -29,7 +29,7 @@ public:
1486         ///
1487         void metrics(MathMetricsInfo const & st) const;
1488         ///
1489 -       void draw(Painter &, int x, int y) const;
1490 +       void draw(MathPainterInfo &, int x, int y) const;
1491         ///
1492         //void metricsT(TextMetricsInfo const & st) const;
1493         ///
1494 Index: math_inset.C
1495 ===================================================================
1496 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_inset.C,v
1497 retrieving revision 1.79
1498 diff -u -p -r1.79 math_inset.C
1499 --- math_inset.C        21 Mar 2002 17:42:56 -0000      1.79
1500 +++ math_inset.C        25 Mar 2002 12:01:57 -0000
1501 @@ -194,7 +194,7 @@ void MathInset::metrics(MathMetricsInfo 
1502  }
1503  
1504  
1505 -void MathInset::draw(Painter &, int, int) const
1506 +void MathInset::draw(MathPainterInfo &, int, int) const
1507  {
1508         lyxerr << "MathInset::draw() called directly!\n";
1509  }
1510 Index: math_inset.h
1511 ===================================================================
1512 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_inset.h,v
1513 retrieving revision 1.108
1514 diff -u -p -r1.108 math_inset.h
1515 --- math_inset.h        21 Mar 2002 17:42:56 -0000      1.108
1516 +++ math_inset.h        25 Mar 2002 12:01:57 -0000
1517 @@ -107,7 +107,7 @@ public:
1518         // updates the (xo,yo)-caches of all contained cells
1519         virtual void metrics(MathMetricsInfo const & st) const;
1520         /// draw the object
1521 -       virtual void draw(Painter &, int x, int y) const;
1522 +       virtual void draw(MathPainterInfo &, int x, int y) const;
1523         /// the ascent of the inset above the baseline
1524         /// compute the size of the object for text based drawing
1525         virtual void metricsT(TextMetricsInfo const & st) const;
1526 Index: math_kerninset.C
1527 ===================================================================
1528 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_kerninset.C,v
1529 retrieving revision 1.9
1530 diff -u -p -r1.9 math_kerninset.C
1531 --- math_kerninset.C    21 Mar 2002 17:42:56 -0000      1.9
1532 +++ math_kerninset.C    25 Mar 2002 12:01:57 -0000
1533 @@ -31,7 +31,7 @@ MathInset * MathKernInset::clone() const
1534  }
1535  
1536  
1537 -void MathKernInset::draw(Painter &, int, int) const
1538 +void MathKernInset::draw(MathPainterInfo &, int, int) const
1539  {}
1540  
1541  
1542 Index: math_kerninset.h
1543 ===================================================================
1544 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_kerninset.h,v
1545 retrieving revision 1.4
1546 diff -u -p -r1.4 math_kerninset.h
1547 --- math_kerninset.h    9 Nov 2001 08:35:56 -0000       1.4
1548 +++ math_kerninset.h    25 Mar 2002 12:01:57 -0000
1549 @@ -23,7 +23,7 @@ public:
1550         ///
1551         MathInset * clone() const;
1552         ///
1553 -       void draw(Painter &, int x, int y) const;
1554 +       void draw(MathPainterInfo &, int x, int y) const;
1555         ///
1556         void write(WriteStream & os) const;
1557         ///
1558 Index: math_lefteqninset.C
1559 ===================================================================
1560 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_lefteqninset.C,v
1561 retrieving revision 1.6
1562 diff -u -p -r1.6 math_lefteqninset.C
1563 --- math_lefteqninset.C 3 Jan 2002 12:02:54 -0000       1.6
1564 +++ math_lefteqninset.C 25 Mar 2002 12:01:57 -0000
1565 @@ -27,7 +27,7 @@ void MathLefteqnInset::metrics(MathMetri
1566  }
1567  
1568  
1569 -void MathLefteqnInset::draw(Painter & pain, int x, int y) const
1570 +void MathLefteqnInset::draw(MathPainterInfo & pain, int x, int y) const
1571  {
1572         xcell(0).draw(pain, x + 2, y);
1573         //mathed_draw_framebox(pain, x, y, this);
1574 Index: math_lefteqninset.h
1575 ===================================================================
1576 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_lefteqninset.h,v
1577 retrieving revision 1.4
1578 diff -u -p -r1.4 math_lefteqninset.h
1579 --- math_lefteqninset.h 9 Nov 2001 08:35:56 -0000       1.4
1580 +++ math_lefteqninset.h 25 Mar 2002 12:01:57 -0000
1581 @@ -17,7 +17,7 @@ public:
1582         ///
1583         MathInset * clone() const;
1584         ///
1585 -       void draw(Painter &, int x, int y) const;
1586 +       void draw(MathPainterInfo &, int x, int y) const;
1587         ///
1588         void write(WriteStream & os) const;
1589         ///
1590 Index: math_limitopinset.C
1591 ===================================================================
1592 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_limitopinset.C,v
1593 retrieving revision 1.5
1594 diff -u -p -r1.5 math_limitopinset.C
1595 --- math_limitopinset.C 21 Mar 2002 17:42:56 -0000      1.5
1596 +++ math_limitopinset.C 25 Mar 2002 12:01:58 -0000
1597 @@ -37,7 +37,7 @@ void MathLimitOpInset::metrics(MathMetri
1598  }
1599  
1600  
1601 -void MathLimitOpInset::draw(Painter &, int, int) const
1602 +void MathLimitOpInset::draw(MathPainterInfo &, int, int) const
1603  {
1604         lyxerr << "should not happen\n";
1605  }
1606 Index: math_limitopinset.h
1607 ===================================================================
1608 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_limitopinset.h,v
1609 retrieving revision 1.1
1610 diff -u -p -r1.1 math_limitopinset.h
1611 --- math_limitopinset.h 9 Nov 2001 14:23:44 -0000       1.1
1612 +++ math_limitopinset.h 25 Mar 2002 12:01:58 -0000
1613 @@ -16,7 +16,7 @@ public:
1614         ///
1615         void metrics(MathMetricsInfo const & st) const;
1616         ///
1617 -       void draw(Painter &, int x, int y) const;
1618 +       void draw(MathPainterInfo &, int x, int y) const;
1619         ///
1620         void write(WriteStream & os) const;
1621         ///
1622 Index: math_macro.C
1623 ===================================================================
1624 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macro.C,v
1625 retrieving revision 1.99
1626 diff -u -p -r1.99 math_macro.C
1627 --- math_macro.C        21 Mar 2002 17:42:56 -0000      1.99
1628 +++ math_macro.C        25 Mar 2002 12:01:58 -0000
1629 @@ -27,7 +27,6 @@
1630  #include "support/lstrings.h"
1631  #include "support/LAssert.h"
1632  #include "debug.h"
1633 -#include "Painter.h"
1634  #include "LaTeXFeatures.h"
1635  
1636  
1637 @@ -109,7 +108,7 @@ void MathMacro::metrics(MathMetricsInfo 
1638  }
1639  
1640  
1641 -void MathMacro::draw(Painter & pain, int x, int y) const
1642 +void MathMacro::draw(MathPainterInfo & pain, int x, int y) const
1643  {
1644         metrics(mi_);
1645  
1646 Index: math_macro.h
1647 ===================================================================
1648 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macro.h,v
1649 retrieving revision 1.70
1650 diff -u -p -r1.70 math_macro.h
1651 --- math_macro.h        21 Mar 2002 17:42:56 -0000      1.70
1652 +++ math_macro.h        25 Mar 2002 12:01:58 -0000
1653 @@ -42,7 +42,7 @@ public:
1654         ///
1655         MathMacro(MathMacro const &);
1656         ///
1657 -       void draw(Painter &, int x, int y) const;
1658 +       void draw(MathPainterInfo &, int x, int y) const;
1659         ///
1660         void metrics(MathMetricsInfo const & st) const;
1661         ///
1662 Index: math_macroarg.C
1663 ===================================================================
1664 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macroarg.C,v
1665 retrieving revision 1.36
1666 diff -u -p -r1.36 math_macroarg.C
1667 --- math_macroarg.C     21 Mar 2002 17:42:56 -0000      1.36
1668 +++ math_macroarg.C     25 Mar 2002 12:01:58 -0000
1669 @@ -4,7 +4,6 @@
1670  
1671  #include "math_macroarg.h"
1672  #include "math_macro.h"
1673 -#include "math_defs.h"
1674  #include "math_mathmlstream.h"
1675  #include "math_support.h"
1676  #include "debug.h"
1677 @@ -13,8 +12,8 @@
1678  using std::endl;
1679  
1680  
1681 -MathMacroArgument::MathMacroArgument(int n, MathTextCodes code)
1682 -       : MathNestInset(1), number_(n), expanded_(false), code_(code)
1683 +MathMacroArgument::MathMacroArgument(int n)
1684 +       : MathNestInset(1), number_(n), expanded_(false)
1685  {
1686         if (n < 1 || n > 9) {
1687                 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
1688 @@ -34,10 +33,7 @@ MathInset * MathMacroArgument::clone() c
1689  
1690  void MathMacroArgument::write(WriteStream & os) const
1691  {
1692 -       if (code_ == LM_TC_MIN)
1693 -               os << str_;
1694 -       else
1695 -               os << '\\' << math_font_name(code_) << '{' << str_ << '}';
1696 +       os << str_;
1697  }
1698  
1699  
1700 @@ -54,7 +50,7 @@ void MathMacroArgument::metrics(MathMetr
1701  }
1702  
1703  
1704 -void MathMacroArgument::draw(Painter & pain, int x, int y) const
1705 +void MathMacroArgument::draw(MathPainterInfo & pain, int x, int y) const
1706  {
1707         if (expanded_)
1708                 xcell(0).draw(pain, x, y);
1709 @@ -72,8 +68,5 @@ void MathMacroArgument::normalize(Normal
1710  void MathMacroArgument::substitute(MathMacro const & m)
1711  {
1712         cell(0) = m.cell(number_ - 1);
1713 -       if (code_ != LM_TC_MIN)
1714 -               for (MathArray::iterator it = cell(0).begin(); it != cell(0).end(); ++it)
1715 -                       it->nucleus()->handleFont(code_);
1716         expanded_ = true;
1717  }
1718 Index: math_macroarg.h
1719 ===================================================================
1720 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macroarg.h,v
1721 retrieving revision 1.25
1722 diff -u -p -r1.25 math_macroarg.h
1723 --- math_macroarg.h     19 Mar 2002 16:55:58 -0000      1.25
1724 +++ math_macroarg.h     25 Mar 2002 12:01:58 -0000
1725 @@ -14,7 +14,7 @@
1726  class MathMacroArgument : public MathNestInset {
1727  public:
1728         ///
1729 -       explicit MathMacroArgument(int, MathTextCodes = LM_TC_MIN);
1730 +       explicit MathMacroArgument(int);
1731         ///
1732         MathInset * clone() const;
1733         ///
1734 @@ -22,7 +22,7 @@ public:
1735         ///
1736         void metrics(MathMetricsInfo const & st) const;
1737         ///
1738 -       void draw(Painter &, int x, int y) const;
1739 +       void draw(MathPainterInfo &, int x, int y) const;
1740         ///
1741         void substitute(MathMacro const & macro);
1742  
1743 @@ -40,8 +40,6 @@ private:
1744         bool expanded_;
1745         ///
1746         mutable LyXFont font_;
1747 -       ///
1748 -       MathTextCodes code_;
1749  };
1750  
1751  #endif
1752 Index: math_macrotemplate.C
1753 ===================================================================
1754 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macrotemplate.C,v
1755 retrieving revision 1.43
1756 diff -u -p -r1.43 math_macrotemplate.C
1757 --- math_macrotemplate.C        16 Feb 2002 15:59:54 -0000      1.43
1758 +++ math_macrotemplate.C        25 Mar 2002 12:01:58 -0000
1759 @@ -59,10 +59,10 @@ void MathMacroTemplate::metrics(MathMetr
1760  }
1761  
1762  
1763 -void MathMacroTemplate::draw(Painter & pain, int x, int y) const
1764 +void MathMacroTemplate::draw(MathPainterInfo & pain, int x, int y) const
1765  {
1766         xcell(0).draw(pain, x + 2, y + 1);
1767 -       pain.rectangle(x, y - ascent(), width(), height(), LColor::blue);
1768 +       pain.pain.rectangle(x, y - ascent(), width(), height(), LColor::blue);
1769  }
1770  
1771  
1772 Index: math_macrotemplate.h
1773 ===================================================================
1774 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_macrotemplate.h,v
1775 retrieving revision 1.29
1776 diff -u -p -r1.29 math_macrotemplate.h
1777 --- math_macrotemplate.h        21 Mar 2002 17:42:56 -0000      1.29
1778 +++ math_macrotemplate.h        25 Mar 2002 12:01:58 -0000
1779 @@ -33,7 +33,7 @@ public:
1780         ///
1781         string const & name() const;
1782         ///
1783 -       void draw(Painter &, int x, int y) const;
1784 +       void draw(MathPainterInfo &, int x, int y) const;
1785         ///
1786         void metrics(MathMetricsInfo const & st) const;
1787         /// identifies macro templates
1788 Index: math_metricsinfo.C
1789 ===================================================================
1790 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_metricsinfo.C,v
1791 retrieving revision 1.1
1792 diff -u -p -r1.1 math_metricsinfo.C
1793 --- math_metricsinfo.C  19 Oct 2001 17:46:13 -0000      1.1
1794 +++ math_metricsinfo.C  25 Mar 2002 12:01:58 -0000
1795 @@ -0,0 +1,12 @@
1796 +
1797 +#include <config.h>
1798 +
1799 +#include "math_metricsinfo.h"
1800 +#include "math_support.h"
1801 +
1802 +
1803 +MathPainterInfo::MathPainterInfo(Painter & p)
1804 +       : pain(p), style(LM_ST_TEXT), code(LM_TC_MIN)
1805 +{
1806 +       //whichFont(font, LM_TC_MIN); 
1807 +}
1808 Index: math_metricsinfo.h
1809 ===================================================================
1810 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_metricsinfo.h,v
1811 retrieving revision 1.6
1812 diff -u -p -r1.6 math_metricsinfo.h
1813 --- math_metricsinfo.h  21 Mar 2002 06:57:13 -0000      1.6
1814 +++ math_metricsinfo.h  25 Mar 2002 12:01:58 -0000
1815 @@ -2,8 +2,10 @@
1816  #define MATH_METRICSINFO_H
1817  
1818  #include "lyxfont.h"
1819 +#include "math_defs.h"
1820  
1821  class BufferView;
1822 +class Painter;
1823  class MathNestInset;
1824  
1825  
1826 @@ -23,13 +25,13 @@ enum MathStyles {
1827  struct MathMetricsInfo {
1828         ///
1829         MathMetricsInfo()
1830 -               : view(0), font(), style(LM_ST_TEXT),
1831 +               : view(0), font(), style(LM_ST_TEXT), code(LM_TC_MIN),
1832                   inset(0), idx(0),
1833                   fullredraw(false)
1834         {}
1835         ///
1836         MathMetricsInfo(BufferView * v, LyXFont const & f, MathStyles s)
1837 -               : view(v), font(f), style(s),
1838 +               : view(v), font(f), style(s), code(LM_TC_MIN),
1839                   inset(0), idx(0),
1840                   fullredraw(false)
1841         {}
1842 @@ -40,6 +42,8 @@ struct MathMetricsInfo {
1843         LyXFont font;
1844         ///
1845         MathStyles style;
1846 +       ///
1847 +       MathTextCodes code;
1848         /// used to pass some info down
1849         MathNestInset const * inset;
1850         ///
1851 @@ -54,5 +58,24 @@ struct TextMetricsInfo {
1852         TextMetricsInfo()
1853                 {}
1854  };
1855 +
1856 +
1857 +
1858 +struct MathPainterInfo {
1859 +       ///
1860 +       MathPainterInfo(Painter & p);
1861 +       ///
1862 +       void draw(int x, int y, char c);
1863 +
1864 +       ///
1865 +       Painter & pain;
1866 +       ///
1867 +       LyXFont font;
1868 +       ///
1869 +       MathStyles style;
1870 +       ///
1871 +       MathTextCodes code;
1872 +};
1873 +
1874  
1875  #endif
1876 Index: math_notinset.C
1877 ===================================================================
1878 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_notinset.C,v
1879 retrieving revision 1.12
1880 diff -u -p -r1.12 math_notinset.C
1881 --- math_notinset.C     21 Mar 2002 17:42:56 -0000      1.12
1882 +++ math_notinset.C     25 Mar 2002 12:01:58 -0000
1883 @@ -40,7 +40,7 @@ void MathNotInset::metrics(MathMetricsIn
1884  }
1885  
1886  
1887 -void MathNotInset::draw(Painter & pain, int x, int y) const
1888 +void MathNotInset::draw(MathPainterInfo & pain, int x, int y) const
1889  {
1890         if (math_font_available(LM_TC_CMSY))
1891                 drawChar(pain, font_, x, y, 54);
1892 Index: math_notinset.h
1893 ===================================================================
1894 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_notinset.h,v
1895 retrieving revision 1.7
1896 diff -u -p -r1.7 math_notinset.h
1897 --- math_notinset.h     19 Mar 2002 16:55:58 -0000      1.7
1898 +++ math_notinset.h     25 Mar 2002 12:01:58 -0000
1899 @@ -19,7 +19,7 @@ public:
1900         ///
1901         void metrics(MathMetricsInfo const & mi) const;
1902         ///
1903 -       void draw(Painter &, int x, int y) const;
1904 +       void draw(MathPainterInfo &, int x, int y) const;
1905  private:
1906         ///
1907         mutable LyXFont font_;
1908 Index: math_parser.C
1909 ===================================================================
1910 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.C,v
1911 retrieving revision 1.189
1912 diff -u -p -r1.189 math_parser.C
1913 --- math_parser.C       21 Mar 2002 17:42:56 -0000      1.189
1914 +++ math_parser.C       25 Mar 2002 12:01:58 -0000
1915 @@ -101,9 +101,9 @@ bool stared(string const & s)
1916  }
1917  
1918  
1919 -void add(MathArray & ar, char c, MathTextCodes code)
1920 +void add(MathArray & ar, char c)
1921  {
1922 -       ar.push_back(MathAtom(new MathCharInset(c, code)));
1923 +       ar.push_back(MathAtom(new MathCharInset(c)));
1924  }
1925  
1926  
1927 @@ -252,7 +252,7 @@ public:
1928         ///
1929         bool parse_normal(MathAtom &);
1930         ///
1931 -       void parse_into(MathArray & array, unsigned flags, MathTextCodes = LM_TC_MIN);
1932 +       void parse_into(MathArray & array, unsigned flags);
1933         ///
1934         int lineno() const { return lineno_; }
1935         ///
1936 @@ -260,7 +260,7 @@ public:
1937  
1938  private:
1939         ///
1940 -       void parse_into1(MathArray & array, unsigned flags, MathTextCodes);
1941 +       void parse_into1(MathArray & array, unsigned flags);
1942         ///
1943         string getArg(char lf, char rf);
1944         ///
1945 @@ -888,9 +888,9 @@ bool Parser::parse_normal(MathAtom & mat
1946  }
1947  
1948  
1949 -void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
1950 +void Parser::parse_into(MathArray & array, unsigned flags)
1951  {
1952 -       parse_into1(array, flags, code);
1953 +       parse_into1(array, flags);
1954         // remove 'unnecessary' braces:
1955         if (array.size() == 1 && array.back()->asBraceInset()) {
1956                 lyxerr << "extra braces removed\n";
1957 @@ -899,7 +899,7 @@ void Parser::parse_into(MathArray & arra
1958  }
1959  
1960  
1961 -void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
1962 +void Parser::parse_into1(MathArray & array, unsigned flags)
1963  {
1964         bool panic  = false;
1965         int  limits = 0;
1966 @@ -959,14 +959,14 @@ void Parser::parse_into1(MathArray & arr
1967                 }
1968  
1969                 else if (t.cat() == catLetter)
1970 -                       add(array, t.character(), code);
1971 +                       add(array, t.character());
1972  
1973 -               else if (t.cat() == catSpace && code == LM_TC_TEXTRM)
1974 -                       add(array, t.character(), code);
1975 +               else if (t.cat() == catSpace) //&& code == LM_TC_TEXTRM
1976 +                       add(array, t.character());
1977  
1978                 else if (t.cat() == catParameter) {
1979                         Token const & n = getToken();
1980 -                       array.push_back(MathAtom(new MathMacroArgument(n.character()-'0', code)));
1981 +                       array.push_back(MathAtom(new MathMacroArgument(n.character()-'0')));
1982                 }
1983  
1984                 else if (t.cat() == catBegin) {
1985 @@ -994,13 +994,13 @@ void Parser::parse_into1(MathArray & arr
1986                         lyxerr << "found '}' unexpectedly, array: '" << array << "'\n";
1987                         //lyxerr << "found '}' unexpectedly\n";
1988                         lyx::Assert(0);
1989 -                       add(array, '}', LM_TC_TEX);
1990 +                       add(array, '}'); //, LM_TC_TEX);
1991                 }
1992  
1993                 else if (t.cat() == catAlign) {
1994                         lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
1995                         //lyxerr << "found tab unexpectedly\n";
1996 -                       add(array, '&', LM_TC_TEX);
1997 +                       add(array, '&'); //, LM_TC_TEX;
1998                 }
1999  
2000                 else if (t.cat() == catSuper || t.cat() == catSub) {
2001 @@ -1022,7 +1022,7 @@ void Parser::parse_into1(MathArray & arr
2002                         return;
2003  
2004                 else if (t.cat() == catOther)
2005 -                       add(array, t.character(), code);
2006 +                       add(array, t.character());
2007  
2008                 //
2009                 // control sequences
2010 @@ -1134,7 +1134,7 @@ void Parser::parse_into1(MathArray & arr
2011                 else if (t.cs() == "choose" || t.cs() == "over" || t.cs() == "atop") {
2012                         MathAtom p = createMathInset(t.cs());
2013                         array.swap(p->cell(0));
2014 -                       parse_into(p->cell(1), flags, code);
2015 +                       parse_into(p->cell(1), flags);
2016                         array.push_back(p);
2017                         return;
2018                 }
2019 @@ -1195,34 +1195,37 @@ void Parser::parse_into1(MathArray & arr
2020                         if (l) {
2021                                 if (l->token == LM_TK_FONT) {
2022                                         //lyxerr << "starting font\n";
2023 -                                       //CatCode catSpaceSave = theCatcode[' '];
2024 -                                       //if (l->id == LM_TC_TEXTRM) {
2025 -                                       //      // temporarily change catcode
2026 -                                       //      theCatcode[' '] = catLetter;
2027 -                                       //}
2028 -
2029 -                                       MathArray ar;
2030 -                                       parse_into(ar, FLAG_ITEM, static_cast<MathTextCodes>(l->id));
2031 -                                       array.push_back(ar);
2032 +                                       CatCode catSpaceSave = theCatcode[' '];
2033 +                                       if (l->id == LM_TC_TEXTRM) {
2034 +                                               // temporarily change catcode
2035 +                                               theCatcode[' '] = catLetter;
2036 +                                       }
2037 +
2038 +                                       MathAtom p = createMathInset(t.cs());
2039 +                                       parse_into(p->cell(0), FLAG_ITEM);
2040 +                                       array.push_back(p);
2041  
2042                                         // undo catcode changes
2043 -                                       ////theCatcode[' '] = catSpaceSave;
2044 -                                       //lyxerr << "ending font\n";
2045 +                                       theCatcode[' '] = catSpaceSave;
2046 +                                       lyxerr << "ending font\n";
2047                                 }
2048  
2049                                 else if (l->token == LM_TK_OLDFONT) {
2050 -                                       code = static_cast<MathTextCodes>(l->id);
2051 +                                       MathAtom p = createMathInset(t.cs());
2052 +                                       parse_into(p->cell(0), flags);
2053 +                                       array.push_back(p);
2054 +                                       return;
2055                                 }
2056  
2057                                 else if (l->token == LM_TK_BOX) {
2058                                         MathAtom p = createMathInset(t.cs());
2059 -                                       parse_into(p->cell(0), FLAG_ITEM | FLAG_BOX, LM_TC_BOX);
2060 +                                       parse_into(p->cell(0), FLAG_ITEM | FLAG_BOX);
2061                                         array.push_back(p);
2062                                 }
2063  
2064                                 else if (l->token == LM_TK_STY) {
2065                                         MathAtom p = createMathInset(t.cs());
2066 -                                       parse_into(p->cell(0), flags, code);
2067 +                                       parse_into(p->cell(0), flags);
2068                                         array.push_back(p);
2069                                         return;
2070                                 }
2071 Index: math_rootinset.C
2072 ===================================================================
2073 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_rootinset.C,v
2074 retrieving revision 1.20
2075 diff -u -p -r1.20 math_rootinset.C
2076 --- math_rootinset.C    21 Mar 2002 17:42:56 -0000      1.20
2077 +++ math_rootinset.C    25 Mar 2002 12:01:58 -0000
2078 @@ -43,7 +43,7 @@ void MathRootInset::metrics(MathMetricsI
2079  }
2080  
2081  
2082 -void MathRootInset::draw(Painter & pain, int x, int y) const
2083 +void MathRootInset::draw(MathPainterInfo & pain, int x, int y) const
2084  {
2085         int const w = xcell(0).width();
2086         // the "exponent"
2087 @@ -59,7 +59,7 @@ void MathRootInset::draw(Painter & pain,
2088         xp[2] = x + w;        yp[2] = y + d;
2089         xp[3] = x + w - 2;    yp[3] = y + (d - a)/2 + 2;
2090         xp[4] = x;            yp[4] = y + (d - a)/2 + 2;
2091 -       pain.lines(xp, yp, 5, LColor::math);
2092 +       pain.pain.lines(xp, yp, 5, LColor::math);
2093  }
2094  
2095  
2096 Index: math_rootinset.h
2097 ===================================================================
2098 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_rootinset.h,v
2099 retrieving revision 1.15
2100 diff -u -p -r1.15 math_rootinset.h
2101 --- math_rootinset.h    21 Mar 2002 17:42:56 -0000      1.15
2102 +++ math_rootinset.h    25 Mar 2002 12:01:58 -0000
2103 @@ -36,7 +36,7 @@ public:
2104         ///
2105         void metrics(MathMetricsInfo const & st) const;
2106         ///
2107 -       void draw(Painter &, int x, int y) const;
2108 +       void draw(MathPainterInfo &, int x, int y) const;
2109  
2110         ///
2111         void write(WriteStream & os) const;
2112 Index: math_scriptinset.C
2113 ===================================================================
2114 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_scriptinset.C,v
2115 retrieving revision 1.51
2116 diff -u -p -r1.51 math_scriptinset.C
2117 --- math_scriptinset.C  21 Mar 2002 17:42:56 -0000      1.51
2118 +++ math_scriptinset.C  25 Mar 2002 12:01:58 -0000
2119 @@ -198,7 +198,7 @@ void MathScriptInset::metrics(MathInset 
2120  }
2121  
2122  
2123 -void MathScriptInset::draw(Painter & pain, int x, int y) const
2124 +void MathScriptInset::draw(MathPainterInfo & pain, int x, int y) const
2125  {
2126         //lyxerr << "unexpected call to MathScriptInset::draw()\n";
2127         draw(0, pain, x, y);
2128 @@ -226,7 +226,7 @@ void MathScriptInset::metricsT(MathInset
2129  }
2130  
2131  
2132 -void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
2133 +void MathScriptInset::draw(MathInset const * nuc, MathPainterInfo & pain,
2134         int x, int y) const
2135  {
2136         if (nuc)
2137 Index: math_scriptinset.h
2138 ===================================================================
2139 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_scriptinset.h,v
2140 retrieving revision 1.34
2141 diff -u -p -r1.34 math_scriptinset.h
2142 --- math_scriptinset.h  21 Mar 2002 17:42:56 -0000      1.34
2143 +++ math_scriptinset.h  25 Mar 2002 12:01:58 -0000
2144 @@ -27,7 +27,7 @@ public:
2145         ///
2146         void metrics(MathMetricsInfo const & st) const;
2147         ///
2148 -       void draw(Painter &, int x, int y) const;
2149 +       void draw(MathPainterInfo &, int x, int y) const;
2150         ///
2151         void metricsT(TextMetricsInfo const & st) const;
2152         ///
2153 @@ -36,7 +36,7 @@ public:
2154         ///
2155         void metrics(MathInset const * nuc, MathMetricsInfo const & st) const;
2156         ///
2157 -       void draw(MathInset const * nuc, Painter &, int x, int y) const;
2158 +       void draw(MathInset const * nuc, MathPainterInfo &, int x, int y) const;
2159         ///
2160         void metricsT(MathInset const * nuc, TextMetricsInfo const & st) const;
2161         ///
2162 Index: math_sizeinset.C
2163 ===================================================================
2164 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_sizeinset.C,v
2165 retrieving revision 1.20
2166 diff -u -p -r1.20 math_sizeinset.C
2167 --- math_sizeinset.C    3 Jan 2002 12:02:54 -0000       1.20
2168 +++ math_sizeinset.C    25 Mar 2002 12:01:58 -0000
2169 @@ -22,7 +22,7 @@ MathInset * MathSizeInset::clone() const
2170  }
2171  
2172  
2173 -void MathSizeInset::draw(Painter & pain, int x, int y) const
2174 +void MathSizeInset::draw(MathPainterInfo & pain, int x, int y) const
2175  {
2176         xcell(0).draw(pain, x + 1, y);
2177         mathed_draw_framebox(pain, x, y, this);
2178 Index: math_sizeinset.h
2179 ===================================================================
2180 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_sizeinset.h,v
2181 retrieving revision 1.14
2182 diff -u -p -r1.14 math_sizeinset.h
2183 --- math_sizeinset.h    21 Mar 2002 17:42:56 -0000      1.14
2184 +++ math_sizeinset.h    25 Mar 2002 12:01:58 -0000
2185 @@ -24,7 +24,7 @@ public:
2186         ///
2187         void metrics(MathMetricsInfo const & st) const;
2188         ///
2189 -       void draw(Painter &, int x, int y) const;
2190 +       void draw(MathPainterInfo &, int x, int y) const;
2191         ///
2192         bool needsBraces() const { return false; }
2193  
2194 Index: math_spaceinset.C
2195 ===================================================================
2196 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_spaceinset.C,v
2197 retrieving revision 1.27
2198 diff -u -p -r1.27 math_spaceinset.C
2199 --- math_spaceinset.C   21 Mar 2002 17:42:56 -0000      1.27
2200 +++ math_spaceinset.C   25 Mar 2002 12:01:58 -0000
2201 @@ -34,7 +34,7 @@ void MathSpaceInset::metrics(MathMetrics
2202  }
2203  
2204  
2205 -void MathSpaceInset::draw(Painter & pain, int x, int y) const
2206 +void MathSpaceInset::draw(MathPainterInfo & pain, int x, int y) const
2207  {
2208  
2209  // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
2210 @@ -49,7 +49,7 @@ void MathSpaceInset::draw(Painter & pain
2211         xp[2] = x + width_ - 2;  yp[2] = y;
2212         xp[3] = x + width_ - 2;  yp[3] = y - 3;
2213  
2214 -       pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
2215 +       pain.pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
2216  }
2217  
2218  
2219 Index: math_spaceinset.h
2220 ===================================================================
2221 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_spaceinset.h,v
2222 retrieving revision 1.20
2223 diff -u -p -r1.20 math_spaceinset.h
2224 --- math_spaceinset.h   15 Nov 2001 14:14:37 -0000      1.20
2225 +++ math_spaceinset.h   25 Mar 2002 12:01:58 -0000
2226 @@ -25,7 +25,7 @@ public:
2227         ///
2228         void metrics(MathMetricsInfo const & st) const;
2229         ///
2230 -       void draw(Painter &, int x, int y) const;
2231 +       void draw(MathPainterInfo &, int x, int y) const;
2232  
2233         ///
2234         void normalize(NormalStream &) const;
2235 Index: math_specialcharinset.C
2236 ===================================================================
2237 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_specialcharinset.C,v
2238 retrieving revision 1.10
2239 diff -u -p -r1.10 math_specialcharinset.C
2240 --- math_specialcharinset.C     21 Mar 2002 17:42:56 -0000      1.10
2241 +++ math_specialcharinset.C     25 Mar 2002 12:01:58 -0000
2242 @@ -42,7 +42,7 @@ void MathSpecialCharInset::metrics(MathM
2243  }
2244  
2245  
2246 -void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
2247 +void MathSpecialCharInset::draw(MathPainterInfo & pain, int x, int y) const
2248  {
2249         drawChar(pain, font_, x, y, char_);
2250  }
2251 Index: math_specialcharinset.h
2252 ===================================================================
2253 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_specialcharinset.h,v
2254 retrieving revision 1.7
2255 diff -u -p -r1.7 math_specialcharinset.h
2256 --- math_specialcharinset.h     21 Mar 2002 17:42:56 -0000      1.7
2257 +++ math_specialcharinset.h     25 Mar 2002 12:01:58 -0000
2258 @@ -22,7 +22,7 @@ public:
2259         ///
2260         void metrics(MathMetricsInfo const & st) const;
2261         ///
2262 -       void draw(Painter &, int x, int y) const;
2263 +       void draw(MathPainterInfo &, int x, int y) const;
2264         ///
2265         void write(WriteStream & os) const;
2266         ///
2267 Index: math_sqrtinset.C
2268 ===================================================================
2269 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_sqrtinset.C,v
2270 retrieving revision 1.31
2271 diff -u -p -r1.31 math_sqrtinset.C
2272 --- math_sqrtinset.C    21 Mar 2002 17:42:56 -0000      1.31
2273 +++ math_sqrtinset.C    25 Mar 2002 12:01:58 -0000
2274 @@ -29,7 +29,7 @@ void MathSqrtInset::metrics(MathMetricsI
2275  }
2276  
2277  
2278 -void MathSqrtInset::draw(Painter & pain, int x, int y) const
2279 +void MathSqrtInset::draw(MathPainterInfo & pain, int x, int y) const
2280  {
2281         xcell(0).draw(pain, x + 10, y);
2282         int const a = ascent_;
2283 @@ -40,7 +40,7 @@ void MathSqrtInset::draw(Painter & pain,
2284         xp[1] = x + 8;      yp[1] = y - a + 1;
2285         xp[2] = x + 5;      yp[2] = y + d - 1;
2286         xp[3] = x;          yp[3] = y + (d - a)/2;
2287 -       pain.lines(xp, yp, 4, LColor::math);
2288 +       pain.pain.lines(xp, yp, 4, LColor::math);
2289  }
2290  
2291  
2292 Index: math_sqrtinset.h
2293 ===================================================================
2294 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_sqrtinset.h,v
2295 retrieving revision 1.18
2296 diff -u -p -r1.18 math_sqrtinset.h
2297 --- math_sqrtinset.h    21 Mar 2002 06:57:13 -0000      1.18
2298 +++ math_sqrtinset.h    25 Mar 2002 12:01:58 -0000
2299 @@ -18,7 +18,7 @@ public:
2300         ///
2301         MathInset * clone() const;
2302         ///
2303 -       void draw(Painter &, int x, int y) const;
2304 +       void draw(MathPainterInfo &, int x, int y) const;
2305         ///
2306         void metrics(MathMetricsInfo const & mi) const;
2307         ///
2308 Index: math_stackrelinset.C
2309 ===================================================================
2310 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_stackrelinset.C,v
2311 retrieving revision 1.11
2312 diff -u -p -r1.11 math_stackrelinset.C
2313 --- math_stackrelinset.C        21 Mar 2002 17:42:56 -0000      1.11
2314 +++ math_stackrelinset.C        25 Mar 2002 12:01:58 -0000
2315 @@ -32,7 +32,7 @@ void MathStackrelInset::metrics(MathMetr
2316  }
2317  
2318  
2319 -void MathStackrelInset::draw(Painter & pain, int x, int y) const
2320 +void MathStackrelInset::draw(MathPainterInfo & pain, int x, int y) const
2321  {
2322         int m  = x + width() / 2;
2323         int yo = y - xcell(1).ascent() - xcell(0).descent() - 1;
2324 Index: math_stackrelinset.h
2325 ===================================================================
2326 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_stackrelinset.h,v
2327 retrieving revision 1.5
2328 diff -u -p -r1.5 math_stackrelinset.h
2329 --- math_stackrelinset.h        21 Mar 2002 17:42:56 -0000      1.5
2330 +++ math_stackrelinset.h        25 Mar 2002 12:01:58 -0000
2331 @@ -20,7 +20,7 @@ public:
2332         ///
2333         void metrics(MathMetricsInfo const & st) const;
2334         ///
2335 -       void draw(Painter &, int x, int y) const;
2336 +       void draw(MathPainterInfo &, int x, int y) const;
2337  
2338         ///
2339         void write(WriteStream & os) const;
2340 Index: math_stringinset.C
2341 ===================================================================
2342 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_stringinset.C,v
2343 retrieving revision 1.14
2344 diff -u -p -r1.14 math_stringinset.C
2345 --- math_stringinset.C  21 Mar 2002 17:42:56 -0000      1.14
2346 +++ math_stringinset.C  25 Mar 2002 12:01:58 -0000
2347 @@ -8,21 +8,18 @@
2348  #include "math_mathmlstream.h"
2349  #include "math_streamstr.h"
2350  #include "LColor.h"
2351 -#include "Painter.h"
2352  #include "math_support.h"
2353  #include "math_parser.h"
2354  #include "LaTeXFeatures.h"
2355  #include "debug.h"
2356  
2357 -#include <cctype>
2358 -
2359  
2360  MathStringInset::MathStringInset()
2361 -       : str_(), code_(LM_TC_MIN)
2362 +       : str_()
2363  {}
2364  
2365 -MathStringInset::MathStringInset(string const & s, MathTextCodes t)
2366 -       : str_(s), code_(t)
2367 +MathStringInset::MathStringInset(string const & s)
2368 +       : str_(s)
2369  {}
2370  
2371  
2372 @@ -32,42 +29,16 @@ MathInset * MathStringInset::clone() con
2373  }
2374  
2375  
2376 -int MathStringInset::ascent() const
2377 -{
2378 -       return mathed_string_ascent(font_, str_);
2379 -}
2380 -
2381 -
2382 -int MathStringInset::descent() const
2383 -{
2384 -       return mathed_string_descent(font_, str_);
2385 -}
2386 -
2387 -
2388 -int MathStringInset::width() const
2389 -{
2390 -       return mathed_string_width(font_, str_);
2391 -}
2392 -
2393 -
2394 -void MathStringInset::validate(LaTeXFeatures & features) const
2395 -{
2396 -       //lyxerr << "stringinset amssymb" << endl;
2397 -       if (code_ == LM_TC_MSA || code_ == LM_TC_MSB)
2398 -               features.require("amssymb");
2399 -}
2400 -
2401 -
2402  void MathStringInset::metrics(MathMetricsInfo const & mi) const
2403  {
2404 -       whichFont(font_, code_, mi);
2405 +       mathed_string_dim(mi.font, str_, ascent_, descent_, width_);
2406  }
2407  
2408  
2409 -void MathStringInset::draw(Painter & pain, int x, int y) const
2410 +void MathStringInset::draw(MathPainterInfo & pain, int x, int y) const
2411  {
2412         //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
2413 -       drawStr(pain, font_, x, y, str_);
2414 +       drawStr(pain, pain.font, x, y, str_);
2415  }
2416  
2417  
2418 @@ -79,7 +50,7 @@ void MathStringInset::normalize(NormalSt
2419  
2420  void MathStringInset::maplize(MapleStream & os) const
2421  {
2422 -       if (code_ != LM_TC_VAR || str_.size() <= 1) {
2423 +       if (/*code_ != LM_TC_VAR || */ str_.size() <= 1) {
2424                 os << ' ' << str_ << ' ';
2425                 return;
2426         }
2427 @@ -93,7 +64,7 @@ void MathStringInset::maplize(MapleStrea
2428  
2429  void MathStringInset::octavize(OctaveStream & os) const
2430  {
2431 -       if (code_ != LM_TC_VAR || str_.size() <= 1) {
2432 +       if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
2433                 os << ' ' << str_ << ' ';
2434                 return;
2435         }
2436 @@ -107,6 +78,7 @@ void MathStringInset::octavize(OctaveStr
2437  
2438  void MathStringInset::mathmlize(MathMLStream & os) const
2439  {
2440 +/*
2441         if (code_ == LM_TC_VAR)
2442                 os << "<mi> " << str_ << " </mi>";
2443         else if (code_ == LM_TC_CONST)
2444 @@ -114,14 +86,12 @@ void MathStringInset::mathmlize(MathMLSt
2445         else if (code_ == LM_TC_RM || code_ == LM_TC_TEXTRM)
2446                 os << "<mtext> " << str_ <<  " </mtext>";
2447         else
2448 +*/
2449                 os << str_;
2450  }
2451  
2452  
2453  void MathStringInset::write(WriteStream & os) const
2454  {
2455 -       if (math_font_name(code_))
2456 -               os << '\\' << math_font_name(code_) << '{' << str_ << '}';
2457 -       else
2458 -               os << str_;
2459 +       os << str_;
2460  }
2461 Index: math_stringinset.h
2462 ===================================================================
2463 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_stringinset.h,v
2464 retrieving revision 1.11
2465 diff -u -p -r1.11 math_stringinset.h
2466 --- math_stringinset.h  21 Mar 2002 17:42:56 -0000      1.11
2467 +++ math_stringinset.h  25 Mar 2002 12:01:58 -0000
2468 @@ -2,7 +2,7 @@
2469  #ifndef MATH_STRINGINSET_H
2470  #define MATH_STRINGINSET_H
2471  
2472 -#include "math_inset.h"
2473 +#include "math_diminset.h"
2474  
2475  #ifdef __GNUG__
2476  #pragma interface
2477 @@ -12,30 +12,22 @@
2478      \author André Pönitz
2479   */
2480  
2481 -class MathStringInset : public MathInset {
2482 +class MathStringInset : public MathDimInset {
2483  public:
2484         ///
2485         MathStringInset();
2486         ///
2487 -       MathStringInset(string const & s, MathTextCodes t = LM_TC_TEXTRM);
2488 +       explicit MathStringInset(string const & s);
2489         ///
2490         MathInset * clone() const;
2491         ///
2492         void metrics(MathMetricsInfo const & st) const;
2493         ///
2494 -       void draw(Painter &, int x, int y) const;
2495 -       ///
2496 -       int ascent() const;
2497 -       ///
2498 -       int descent() const;
2499 -       ///
2500 -       int width() const;
2501 +       void draw(MathPainterInfo &, int x, int y) const;
2502         ///
2503         string str() const { return str_; }
2504         ///
2505         MathStringInset * asStringInset() { return this; }
2506 -       /// request "external features"
2507 -       void validate(LaTeXFeatures & features) const;
2508  
2509         ///
2510         void normalize(NormalStream &) const;
2511 @@ -51,9 +43,5 @@ public:
2512  public:
2513         /// the string
2514         string str_;
2515 -       /// the font to be used on screen
2516 -       MathTextCodes code_;
2517 -       ///
2518 -       mutable LyXFont font_;
2519  };
2520  #endif
2521 Index: math_support.C
2522 ===================================================================
2523 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_support.C,v
2524 retrieving revision 1.28
2525 diff -u -p -r1.28 math_support.C
2526 --- math_support.C      21 Mar 2002 17:42:56 -0000      1.28
2527 +++ math_support.C      25 Mar 2002 12:01:58 -0000
2528 @@ -611,11 +611,11 @@ int mathed_string_descent(LyXFont const 
2529  
2530  
2531  
2532 -void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
2533 +void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
2534         const string & name)
2535  {
2536         if (name == ".") {
2537 -               pain.line(x + w/2, y, x + w/2, y + h,
2538 +               pain.pain.line(x + w/2, y, x + w/2, y + h,
2539                           LColor::mathcursor, Painter::line_onoffdash);
2540                 return;
2541         }
2542 @@ -655,7 +655,7 @@ void mathed_draw_deco(Painter & pain, in
2543                         else
2544                                 mt.transform(xx, yy);
2545                         mt.transform(x2, y2);
2546 -                       pain.line(x + int(xx), y + int(yy), x + int(x2), y + int(y2),
2547 +                       pain.pain.line(x + int(xx), y + int(yy), x + int(x2), y + int(y2),
2548                                         LColor::math);
2549                 }       else {
2550                         int xp[32];
2551 @@ -673,31 +673,31 @@ void mathed_draw_deco(Painter & pain, in
2552                                 yp[j] = y + int(yy);
2553                                 //  lyxerr << "P[" << j " " << xx << " " << yy << " " << x << " " << y << "]";
2554                         }
2555 -                       pain.lines(xp, yp, n, LColor::math);
2556 +                       pain.pain.lines(xp, yp, n, LColor::math);
2557                 }
2558         }
2559  }
2560  
2561  
2562 -void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const * p)
2563 +void mathed_draw_framebox(MathPainterInfo & pain, int x, int y, MathInset const * p)
2564  {
2565         if (mathcursor && mathcursor->isInside(p))
2566 -               pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
2567 +               pain.pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
2568                         LColor::mathframe);
2569  }
2570  
2571  
2572  // In the future maybe we use a better fonts renderer
2573 -void drawStr(Painter & pain, LyXFont const & font,
2574 +void drawStr(MathPainterInfo & pain, LyXFont const & font,
2575         int x, int y, string const & str)
2576  {
2577 -       pain.text(x, y, str, font);
2578 +       pain.pain.text(x, y, str, font);
2579  }
2580  
2581  
2582 -void drawChar(Painter & pain, LyXFont const & font, int x, int y, char c)
2583 +void drawChar(MathPainterInfo & pain, LyXFont const & font, int x, int y, char c)
2584  {
2585 -       pain.text(x, y, c, font);
2586 +       pain.pain.text(x, y, c, font);
2587  }
2588  
2589  
2590 Index: math_support.h
2591 ===================================================================
2592 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_support.h,v
2593 retrieving revision 1.6
2594 diff -u -p -r1.6 math_support.h
2595 --- math_support.h      20 Mar 2002 07:30:32 -0000      1.6
2596 +++ math_support.h      25 Mar 2002 12:01:58 -0000
2597 @@ -6,7 +6,7 @@
2598  #include "math_defs.h"
2599  #include "LString.h"
2600  
2601 -class Painter;
2602 +class MathPainterInfo;
2603  class TextPainter;
2604  class latexkeys;
2605  class MathMetricsInfo;
2606 @@ -21,10 +21,10 @@ int mathed_char_width(LyXFont const &, u
2607  int mathed_char_ascent(LyXFont const &, unsigned char c);
2608  int mathed_char_descent(LyXFont const &, unsigned char c);
2609  
2610 -void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
2611 +void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
2612         string const & name);
2613  
2614 -void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const *);
2615 +void mathed_draw_framebox(MathPainterInfo & pain, int x, int y, MathInset const *);
2616  
2617  void mathed_string_dim(LyXFont const &,
2618         string const & s, int & asc, int & des, int & wid);
2619 @@ -33,8 +33,8 @@ int mathed_string_width(LyXFont const &,
2620  int mathed_string_ascent(LyXFont const &, string const & s);
2621  int mathed_string_descent(LyXFont const &, string const & s);
2622  
2623 -void drawStr(Painter & pain, LyXFont const &, int x, int y, string const & s);
2624 -void drawChar(Painter & pain, LyXFont const & font, int x, int y, char c);
2625 +void drawStr(MathPainterInfo & pain, LyXFont const &, int x, int y, string const & s);
2626 +void drawChar(MathPainterInfo & pain, LyXFont const & font, int x, int y, char c);
2627  
2628  void math_font_max_dim(LyXFont const &, int & asc, int & desc);
2629  
2630 Index: math_symbolinset.C
2631 ===================================================================
2632 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_symbolinset.C,v
2633 retrieving revision 1.34
2634 diff -u -p -r1.34 math_symbolinset.C
2635 --- math_symbolinset.C  21 Mar 2002 17:42:56 -0000      1.34
2636 +++ math_symbolinset.C  25 Mar 2002 12:01:58 -0000
2637 @@ -97,7 +97,7 @@ void MathSymbolInset::metrics(MathMetric
2638  }
2639  
2640  
2641 -void MathSymbolInset::draw(Painter & pain, int x, int y) const
2642 +void MathSymbolInset::draw(MathPainterInfo & pain, int x, int y) const
2643  {
2644         if (isRelOp())
2645                 x += 3;
2646 Index: math_symbolinset.h
2647 ===================================================================
2648 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_symbolinset.h,v
2649 retrieving revision 1.22
2650 diff -u -p -r1.22 math_symbolinset.h
2651 --- math_symbolinset.h  1 Feb 2002 10:21:29 -0000       1.22
2652 +++ math_symbolinset.h  25 Mar 2002 12:01:58 -0000
2653 @@ -22,7 +22,7 @@ public:
2654         ///
2655         void metrics(MathMetricsInfo const & st) const;
2656         ///
2657 -       void draw(Painter &, int x, int y) const;
2658 +       void draw(MathPainterInfo &, int x, int y) const;
2659         ///
2660         bool isRelOp() const;
2661         /// do we take scripts?
2662 Index: math_undersetinset.C
2663 ===================================================================
2664 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_undersetinset.C,v
2665 retrieving revision 1.3
2666 diff -u -p -r1.3 math_undersetinset.C
2667 --- math_undersetinset.C        21 Mar 2002 17:42:56 -0000      1.3
2668 +++ math_undersetinset.C        25 Mar 2002 12:01:58 -0000
2669 @@ -32,7 +32,7 @@ void MathUndersetInset::metrics(MathMetr
2670  }
2671  
2672  
2673 -void MathUndersetInset::draw(Painter & pain, int x, int y) const
2674 +void MathUndersetInset::draw(MathPainterInfo & pain, int x, int y) const
2675  {
2676         int m  = x + width() / 2;
2677         int yo = y + xcell(1).descent() + xcell(0).ascent() + 1;
2678 Index: math_undersetinset.h
2679 ===================================================================
2680 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_undersetinset.h,v
2681 retrieving revision 1.2
2682 diff -u -p -r1.2 math_undersetinset.h
2683 --- math_undersetinset.h        21 Mar 2002 17:42:56 -0000      1.2
2684 +++ math_undersetinset.h        25 Mar 2002 12:01:58 -0000
2685 @@ -20,7 +20,7 @@ public:
2686         ///
2687         void metrics(MathMetricsInfo const & st) const;
2688         ///
2689 -       void draw(Painter &, int x, int y) const;
2690 +       void draw(MathPainterInfo &, int x, int y) const;
2691  
2692         ///
2693         void write(WriteStream & os) const;
2694 Index: math_unknowninset.C
2695 ===================================================================
2696 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_unknowninset.C,v
2697 retrieving revision 1.5
2698 diff -u -p -r1.5 math_unknowninset.C
2699 --- math_unknowninset.C 21 Mar 2002 17:42:56 -0000      1.5
2700 +++ math_unknowninset.C 25 Mar 2002 12:01:58 -0000
2701 @@ -6,7 +6,6 @@
2702  
2703  #include "math_unknowninset.h"
2704  #include "font.h"
2705 -#include "Painter.h"
2706  #include "math_support.h"
2707  #include "math_mathmlstream.h"
2708  #include "math_streamstr.h"
2709 @@ -64,7 +63,7 @@ void MathUnknownInset::metrics(MathMetri
2710  }
2711  
2712  
2713 -void MathUnknownInset::draw(Painter & pain, int x, int y) const
2714 +void MathUnknownInset::draw(MathPainterInfo & pain, int x, int y) const
2715  {
2716         drawStr(pain, font_, x, y, name_);
2717  }
2718 Index: math_unknowninset.h
2719 ===================================================================
2720 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_unknowninset.h,v
2721 retrieving revision 1.3
2722 diff -u -p -r1.3 math_unknowninset.h
2723 --- math_unknowninset.h 19 Mar 2002 16:55:58 -0000      1.3
2724 +++ math_unknowninset.h 25 Mar 2002 12:01:58 -0000
2725 @@ -21,7 +21,7 @@ public:
2726         ///
2727         void metrics(MathMetricsInfo const & st) const;
2728         ///
2729 -       void draw(Painter &, int x, int y) const;
2730 +       void draw(MathPainterInfo &, int x, int y) const;
2731         ///
2732         string const & name() const;
2733         /// identifies UnknownInsets
2734 Index: math_xarrowinset.C
2735 ===================================================================
2736 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xarrowinset.C,v
2737 retrieving revision 1.2
2738 diff -u -p -r1.2 math_xarrowinset.C
2739 --- math_xarrowinset.C  21 Mar 2002 17:42:56 -0000      1.2
2740 +++ math_xarrowinset.C  25 Mar 2002 12:01:58 -0000
2741 @@ -33,7 +33,7 @@ void MathXArrowInset::metrics(MathMetric
2742  }
2743  
2744  
2745 -void MathXArrowInset::draw(Painter & pain, int x, int y) const
2746 +void MathXArrowInset::draw(MathPainterInfo & pain, int x, int y) const
2747  {
2748         xcell(0).draw(pain, x + 5, y - 10);
2749         mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
2750 Index: math_xarrowinset.h
2751 ===================================================================
2752 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xarrowinset.h,v
2753 retrieving revision 1.1
2754 diff -u -p -r1.1 math_xarrowinset.h
2755 --- math_xarrowinset.h  5 Feb 2002 13:27:34 -0000       1.1
2756 +++ math_xarrowinset.h  25 Mar 2002 12:01:58 -0000
2757 @@ -20,7 +20,7 @@ public:
2758         ///
2759         MathInset * clone() const;
2760         ///
2761 -       void draw(Painter &, int x, int y) const;
2762 +       void draw(MathPainterInfo &, int x, int y) const;
2763         ///
2764         void write(WriteStream & os) const;
2765         ///
2766 Index: math_xdata.C
2767 ===================================================================
2768 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xdata.C,v
2769 retrieving revision 1.19
2770 diff -u -p -r1.19 math_xdata.C
2771 --- math_xdata.C        21 Mar 2002 17:42:56 -0000      1.19
2772 +++ math_xdata.C        25 Mar 2002 12:01:58 -0000
2773 @@ -72,7 +72,7 @@ void MathXArray::metrics(MathMetricsInfo
2774  }
2775  
2776  
2777 -void MathXArray::draw(Painter & pain, int x, int y) const
2778 +void MathXArray::draw(MathPainterInfo & pain, int x, int y) const
2779  {
2780         //if (drawn_ && x == xo_ && y == yo_)
2781         //      return;
2782 @@ -85,17 +85,17 @@ void MathXArray::draw(Painter & pain, in
2783  
2784         if (y + descent_ <= 0)                   // don't draw above the workarea
2785                 return;
2786 -       if (y - ascent_ >= pain.paperHeight())   // don't draw below the workarea
2787 +       if (y - ascent_ >= pain.pain.paperHeight())   // don't draw below the workarea
2788                 return;
2789         if (x + width_ <= 0)                     // don't draw left of workarea
2790                 return;
2791 -       if (x >= pain.paperWidth())              // don't draw right of workarea
2792 +       if (x >= pain.pain.paperWidth())              // don't draw right of workarea
2793                 return;
2794  
2795         const_iterator it = begin(), et = end();
2796  
2797         if (it == et) {
2798 -               pain.rectangle(x, y - ascent_, width_, height(), LColor::mathline);
2799 +               pain.pain.rectangle(x, y - ascent_, width_, height(), LColor::mathline);
2800                 return;
2801         }
2802  
2803 Index: math_xdata.h
2804 ===================================================================
2805 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xdata.h,v
2806 retrieving revision 1.11
2807 diff -u -p -r1.11 math_xdata.h
2808 --- math_xdata.h        21 Mar 2002 17:42:56 -0000      1.11
2809 +++ math_xdata.h        25 Mar 2002 12:01:58 -0000
2810 @@ -12,7 +12,7 @@
2811  #pragma interface
2812  #endif
2813  
2814 -class Painter;
2815 +class MathPainterInfo;
2816  class TextPainter;
2817  
2818  
2819 @@ -32,7 +32,7 @@ public:
2820         /// rebuild cached metrics information
2821         void metrics(MathMetricsInfo const & st) const;
2822         /// redraw cell using cache metrics information
2823 -       void draw(Painter & pain, int x, int y) const;
2824 +       void draw(MathPainterInfo & pain, int x, int y) const;
2825         /// rebuild cached metrics information
2826         void metricsT(TextMetricsInfo const & st) const;
2827         /// redraw cell using cache metrics information
2828 Index: math_xyarrowinset.C
2829 ===================================================================
2830 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xyarrowinset.C,v
2831 retrieving revision 1.7
2832 diff -u -p -r1.7 math_xyarrowinset.C
2833 --- math_xyarrowinset.C 21 Mar 2002 17:42:56 -0000      1.7
2834 +++ math_xyarrowinset.C 25 Mar 2002 12:01:58 -0000
2835 @@ -85,7 +85,7 @@ void MathXYArrowInset::metrics(MathMetri
2836  }
2837  
2838  
2839 -void MathXYArrowInset::draw(Painter & pain, int x, int y) const
2840 +void MathXYArrowInset::draw(MathPainterInfo & pain, int x, int y) const
2841  {
2842         metrics(mi_);
2843  
2844 @@ -109,7 +109,7 @@ void MathXYArrowInset::draw(Painter & pa
2845                 //drawStr(pain, font_, x, y, "X");
2846                 MathXArray const & s = sourceCell();
2847                 MathXArray const & t = targetCell();
2848 -               pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
2849 +               pain.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
2850                 xcell(1).draw(pain, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
2851  
2852         }
2853 Index: math_xyarrowinset.h
2854 ===================================================================
2855 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xyarrowinset.h,v
2856 retrieving revision 1.5
2857 diff -u -p -r1.5 math_xyarrowinset.h
2858 --- math_xyarrowinset.h 21 Mar 2002 17:42:56 -0000      1.5
2859 +++ math_xyarrowinset.h 25 Mar 2002 12:01:58 -0000
2860 @@ -21,7 +21,7 @@ public:
2861         ///
2862         void metrics(MathMetricsInfo const & st) const;
2863         ///
2864 -       void draw(Painter & pain, int x, int y) const;
2865 +       void draw(MathPainterInfo & pain, int x, int y) const;
2866         ///
2867         MathXYArrowInset * asXYArrowInset() { return this; }
2868