10 ? fonts_as_insets.diff
11 ? math_symbolinset.h.new
12 ? math_symbolinset.C.new
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 = \
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());
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);
48 const_cast<InsetFormulaBase const *>(mathcursor->formula()) == this)
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);
55 par_->draw(pain, x, y);
56 @@ -546,7 +546,7 @@ void InsetFormula::handleExtern(const st
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";
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
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);
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";
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
100 - Painter & pain = bv->painter();
101 + MathPainterInfo pain = MathPainterInfo(bv->painter());
105 @@ -178,14 +178,14 @@ void InsetFormulaMacro::draw(BufferView
106 int const h = ascent(bv, font) + descent(bv, font) - 2;
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);
115 const_cast<InsetFormulaBase const *>(mathcursor->formula()) == this)
116 mathcursor->drawSelection(pain);
118 - pain.text(int(x + 2), y, prefix(), font);
119 + pain.pain.text(int(x + 2), y, prefix(), font);
120 x += width(bv, font);
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
134 -void MathAMSArrayInset::draw(Painter & pain, int x, int y) const
135 +void MathAMSArrayInset::draw(MathPainterInfo & pain, int x, int y) const
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:
148 void metrics(MathMetricsInfo const & st) const;
150 - void draw(Painter & pain, int x, int y) const;
151 + void draw(MathPainterInfo & pain, int x, int y) const;
153 MathAMSArrayInset * asAMSArrayInset() { return this; }
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
166 -void MathBigInset::draw(Painter & pain, int x, int y) const
167 +void MathBigInset::draw(MathPainterInfo & pain, int x, int y) const
169 mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
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:
180 MathInset * clone() const;
182 - void draw(Painter &, int x, int y) const;
183 + void draw(MathPainterInfo &, int x, int y) const;
185 void write(WriteStream & os) const;
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
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
207 -void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
208 +void MathBinaryOpInset::draw(MathPainterInfo & pain, int x, int y) const
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:
221 MathInset * clone() const;
223 - void draw(Painter &, int x, int y) const;
224 + void draw(MathPainterInfo &, int x, int y) const;
226 void write(WriteStream & os) const;
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
239 -void MathBinomInset::draw(Painter & pain, int x, int y) const
240 +void MathBinomInset::draw(MathPainterInfo & pain, int x, int y) const
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:
253 void metrics(MathMetricsInfo const & st) const;
255 - void draw(Painter &, int x, int y) const;
256 + void draw(MathPainterInfo &, int x, int y) 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()
271 -void MathBoxInset::draw(Painter & pain, int x, int y) const
272 +void MathBoxInset::draw(MathPainterInfo & pain, int x, int y) const
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:
285 void normalize(NormalStream &) const;
287 - void draw(Painter &, int x, int y) const;
288 + void draw(MathPainterInfo &, int x, int y) const;
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
303 -void MathBraceInset::draw(Painter & pain, int x, int y) const
304 +void MathBraceInset::draw(MathPainterInfo & pain, int x, int y) const
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:
317 MathBraceInset * asBraceInset() { return this; }
319 - void draw(Painter &, int x, int y) const;
320 + void draw(MathPainterInfo &, int x, int y) const;
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
332 #include "math_parser.h"
333 #include "math_mathmlstream.h"
334 #include "math_support.h"
335 -#include "Painter.h"
338 MathCasesInset::MathCasesInset(row_type n)
339 @@ -29,7 +28,7 @@ void MathCasesInset::metrics(MathMetrics
343 -void MathCasesInset::draw(Painter & pain, int x, int y) const
344 +void MathCasesInset::draw(MathPainterInfo & pain, int x, int y) const
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:
357 void metrics(MathMetricsInfo const & st) const;
359 - void draw(Painter & pain, int x, int y) const;
360 + void draw(MathPainterInfo & pain, int x, int y) const;
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
374 #include "math_charinset.h"
376 -#include "Painter.h"
377 #include "support/LOstream.h"
380 @@ -27,33 +25,29 @@ using std::strchr;
384 -bool isBinaryOp(char c, MathTextCodes type)
386 - return type < LM_TC_SYMB && strchr("+-<>=/*", c);
390 + bool isBinaryOp(char c, MathTextCodes type)
392 + return type < LM_TC_SYMB && strchr("+-<>=/*", c);
395 -MathCharInset::MathCharInset(char c)
396 - : char_(c), code_(nativeCode(c))
398 -//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
401 + MathTextCodes nativeCode(char c)
405 + //if (strchr("0123456789;:!|[]().,?+/-*<>=", c)
406 + return LM_TC_CONST;
409 -MathCharInset::MathCharInset(char c, MathTextCodes t)
410 - : char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t)
412 -//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
416 -MathTextCodes MathCharInset::nativeCode(char c)
420 - //if (strchr("0123456789;:!|[]().,?+/-*<>=", c)
421 - return LM_TC_CONST;
423 +MathCharInset::MathCharInset(char c)
429 MathInset * MathCharInset::clone() const
430 @@ -64,19 +58,18 @@ MathInset * MathCharInset::clone() const
432 void MathCharInset::metrics(MathMetricsInfo const & mi) const
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);
444 -void MathCharInset::draw(Painter & pain, int x, int y) const
445 +void MathCharInset::draw(MathPainterInfo & pain, int x, int y) const
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_);
457 @@ -95,31 +88,9 @@ void MathCharInset::drawT(TextPainter &
461 -void MathCharInset::writeHeader(ostream & os) const
463 - if (math_font_name(code_))
464 - os << '\\' << math_font_name(code_) << '{';
468 -void MathCharInset::writeTrailer(ostream & os) const
470 - if (math_font_name(code_))
475 -void MathCharInset::writeRaw(ostream & os) const
481 void MathCharInset::write(WriteStream & os) const
483 - writeHeader(os.os());
485 - writeTrailer(os.os());
490 @@ -135,23 +106,8 @@ bool MathCharInset::isRelOp() const
494 -void MathCharInset::handleFont(MathTextCodes t)
496 - code_ = (code_ == t) ? LM_TC_VAR : t;
500 -void MathCharInset::validate(LaTeXFeatures & features) const
502 - // Make sure amssymb is put in preamble if Blackboard Bold or
504 - if ((code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK))
505 - features.require("amssymb");
509 bool MathCharInset::match(MathInset * p) const
511 MathCharInset const * q = p->asCharInset();
512 - return q && char_ == q->char_ && code_ == q->code_;
513 + return q && char_ == q->char_;
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:
524 explicit MathCharInset(char c);
526 - MathCharInset(char c, MathTextCodes t);
528 MathInset * clone() const;
530 - static MathTextCodes nativeCode(char c);
532 void metrics(MathMetricsInfo const & st) const;
534 - void draw(Painter &, int x, int y) const;
535 + void draw(MathPainterInfo &, int x, int y) const;
537 void metricsT(TextMetricsInfo const & st) const;
539 @@ -33,26 +29,14 @@ public:
541 void write(WriteStream & os) const;
543 - void writeHeader(std::ostream &) const;
545 - void writeTrailer(std::ostream &) const;
547 - void writeRaw(std::ostream &) const;
549 void normalize(NormalStream &) const;
550 /// identifies Charinsets
551 MathCharInset const * asCharInset() const { return this; }
553 char getChar() const { return char_; }
555 - MathTextCodes code() const { return code_; }
557 bool isRelOp() const;
559 - void validate(LaTeXFeatures & features) const;
561 - void handleFont(MathTextCodes t);
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:
570 - /// the font to be used on screen
571 - MathTextCodes code_;
573 - mutable LyXFont font_;
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;
586 MathCursor::MathCursor(InsetFormulaBase * formula, bool left)
587 - : formula_(formula), lastcode_(LM_TC_MIN), selection_(false)
588 + : formula_(formula), selection_(false)
590 left ? first() : last();
592 @@ -299,11 +299,9 @@ bool MathCursor::left(bool sel)
596 - lastcode_ = LM_TC_MIN;
600 - lastcode_ = LM_TC_MIN;
602 if (hasPrevAtom() && openable(prevAtom(), sel)) {
603 if (prevAtom()->isHyperActive()) {
604 @@ -322,11 +320,9 @@ bool MathCursor::right(bool sel)
608 - lastcode_ = LM_TC_MIN;
612 - lastcode_ = LM_TC_MIN;
614 if (hasNextAtom() && openable(nextAtom(), sel)) {
615 if (nextAtom()->isHyperActive()) {
616 @@ -395,7 +391,6 @@ void MathCursor::home(bool sel)
620 - lastcode_ = LM_TC_MIN;
621 if (!par()->idxHome(idx(), pos()))
624 @@ -407,7 +402,6 @@ void MathCursor::end(bool sel)
628 - lastcode_ = LM_TC_MIN;
629 if (!par()->idxEnd(idx(), pos()))
632 @@ -423,7 +417,7 @@ void MathCursor::plainErase()
633 void MathCursor::markInsert()
635 //lyxerr << "inserting mark\n";
636 - array().insert(pos(), MathAtom(new MathCharInset(0, lastcode_)));
637 + array().insert(pos(), MathAtom(new MathCharInset(0)));
641 @@ -441,16 +435,10 @@ void MathCursor::plainInsert(MathAtom co
645 -void MathCursor::insert(char c, MathTextCodes t)
647 - //lyxerr << "inserting '" << c << "'\n";
648 - plainInsert(MathAtom(new MathCharInset(c, t)));
652 void MathCursor::insert(char c)
654 - insert(c, lastcode_);
655 + //lyxerr << "inserting '" << c << "'\n";
656 + plainInsert(MathAtom(new MathCharInset(c)));
660 @@ -741,7 +729,7 @@ void MathCursor::selGet(MathArray & ar)
664 -void MathCursor::drawSelection(Painter & pain) const
665 +void MathCursor::drawSelection(MathPainterInfo & pain) const
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);
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);
687 @@ -784,23 +772,6 @@ void MathCursor::drawSelection(Painter &
691 -void MathCursor::handleFont(MathTextCodes t)
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);
704 - lastcode_ = (lastcode_ == t) ? LM_TC_VAR : t;
708 void MathCursor::handleDelim(string const & l, string const & r)
710 handleNest(new MathDelimInset(l, r));
711 @@ -866,7 +837,7 @@ MathCursor::pos_type & MathCursor::pos()
713 bool MathCursor::inMacroMode() const
715 - return macroNamePos() != -1;
720 @@ -1369,11 +1340,6 @@ bool MathCursor::interpret(string const
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);
730 // prevent entering of recursive macros
731 if (formula()->lyxCode() == Inset::MATHMACRO_CODE
732 @@ -1423,7 +1389,7 @@ bool MathCursor::interpret(char c)
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')));
739 insert(MathAtom(new MathSpecialCharInset('#')));
740 interpret(c); // try again
741 @@ -1442,12 +1408,12 @@ bool MathCursor::interpret(char c)
745 - insert(c, LM_TC_TEX);
746 + insert(c); // LM_TC_TEX;
751 - insert(c, LM_TC_TEX);
752 + insert(c); // LM_TC_TEX;
756 @@ -1455,9 +1421,9 @@ bool MathCursor::interpret(char c)
760 - insert(c, LM_TC_TEX);
761 + insert(c); // LM_TC_TEX;
763 - insert(c, lastcode_);
764 + insert(c); // lastcode_;
768 @@ -1469,13 +1435,13 @@ bool MathCursor::interpret(char c)
769 // fall through in the other cases
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() == ' ')
779 - insert(c, LM_TC_TEXTRM);
780 + insert(c); // LM_TC_TEXTRM;
784 @@ -1491,13 +1457,13 @@ bool MathCursor::interpret(char c)
788 - insert(c, LM_TC_TEX);
789 + insert(c); // LM_TC_TEX;
794 if (c == '{' || c == '}', c)) {
795 - insert(c, LM_TC_TEX);
796 + insert(c); // LM_TC_TEX;
800 @@ -1513,10 +1479,10 @@ bool MathCursor::interpret(char c)
802 if (c == '$' || c == '%') {
803 insert(MathAtom(new MathSpecialCharInset(c)));
804 - lastcode_ = LM_TC_VAR;
809 if (isalpha(c) && lastcode_ == LM_TC_GREEK) {
810 insert(c, LM_TC_VAR);
812 @@ -1533,10 +1499,10 @@ bool MathCursor::interpret(char c)
813 //bv->owner()->message(_("TeX mode"));
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;
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
835 class InsetFormulaBase;
837 +class MathPainterInfo;
841 @@ -149,9 +149,7 @@ public:
843 void selGet(MathArray & ar);
845 - void drawSelection(Painter & pain) const;
847 - void handleFont(MathTextCodes t);
848 + void drawSelection(MathPainterInfo & pain) const;
850 void handleDelim(string const & l, string const & r);
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; }
859 void pullArg(bool goright);
861 bool isInside(MathInset const *) const;
863 - MathTextCodes nextCode() const;
868 @@ -266,8 +262,6 @@ private:
869 string macroName() const;
871 MathInset::difference_type macroNamePos() const;
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_;
884 /// do we currently select
886 + /// are we entering a macro name?
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
902 -void MathDecorationInset::draw(Painter & pain, int x, int y) const
903 +void MathDecorationInset::draw(MathPainterInfo & pain, int x, int y) const
905 xcell(0).draw(pain, x, y);
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:
916 MathInset * clone() const;
918 - void draw(Painter &, int x, int y) const;
919 + void draw(MathPainterInfo &, int x, int y) const;
921 void write(WriteStream & os) const;
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
934 -void MathDelimInset::draw(Painter & pain, int x, int y) const
935 +void MathDelimInset::draw(MathPainterInfo & pain, int x, int y) const
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:
948 void metrics(MathMetricsInfo const & st) const;
950 - void draw(Painter &, int x, int y) const;
951 + void draw(MathPainterInfo &, int x, int y) const;
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
966 -void MathDiffInset::draw(Painter &, int, int) const
967 +void MathDiffInset::draw(MathPainterInfo &, int, int) const
969 lyxerr << "should not happen\n";
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:
980 void metrics(MathMetricsInfo const & st) const;
982 - void draw(Painter &, int x, int y) const;
983 + void draw(MathPainterInfo &, int x, int y) const;
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
998 -void MathDotsInset::draw(Painter & pain, int x, int y) const
999 +void MathDotsInset::draw(MathPainterInfo & pain, int x, int y) const
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:
1012 MathInset * clone() const;
1014 - void draw(Painter &, int x, int y) const;
1015 + void draw(MathPainterInfo &, int x, int y) const;
1017 void write(WriteStream & os) const;
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
1030 -void MathExFuncInset::draw(Painter & pain, int x, int y) const
1031 +void MathExFuncInset::draw(MathPainterInfo & pain, int x, int y) const
1033 drawStr(pain, font_, x, y, name_);
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:
1044 void metrics(MathMetricsInfo const & st) const;
1046 - void draw(Painter &, int x, int y) const;
1047 + void draw(MathPainterInfo &, int x, int y) const;
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
1062 -void MathExIntInset::draw(Painter &, int, int) const
1063 +void MathExIntInset::draw(MathPainterInfo &, int, int) const
1065 lyxerr << "should not happen" << endl;
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:
1076 void metrics(MathMetricsInfo const & st) const;
1078 - void draw(Painter &, int x, int y) const;
1079 + void draw(MathPainterInfo &, int x, int y) const;
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)
1097 - MathCharInset const * p = (*it)->asCharInset();
1099 - for (; it != end; ++it) {
1100 - p = (*it)->asCharInset();
1101 - if (!p || p->code() != c)
1103 - s += p->getChar();
1105 + for (; it != end && (*it)->asCharInset(); ++it)
1106 + s += (*it)->getChar();
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_);
1119 @@ -196,8 +190,7 @@ bool extractString(MathInset * p, string
1120 bool extractNumber(MathArray const & ar, int & i)
1124 - charSequence(ar.begin(), ar.end(), s, c);
1125 + charSequence(ar.begin(), ar.end(), s);
1126 istringstream is(s.c_str());
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
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));
1147 return MathAtom(new MathSizeInset(l));
1149 + case LM_TK_OLDFONT:
1150 + return MathAtom(new MathFontInset(static_cast<MathTextCodes>(l->id)));
1152 return MathAtom(new MathUnknownInset(l->name));
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
1161 +#include <config.h>
1164 +#pragma implementation
1167 +#include "math_fontinset.h"
1168 +#include "support/LOstream.h"
1170 +#include "math_mathmlstream.h"
1171 +#include "math_support.h"
1172 +#include "LaTeXFeatures.h"
1173 +#include "textpainter.h"
1176 +MathFontInset::MathFontInset(MathTextCodes code)
1177 + : MathNestInset(1), code_(code)
1181 +MathInset * MathFontInset::clone() const
1183 + return new MathFontInset(*this);
1187 +void MathFontInset::metrics(MathMetricsInfo const & mi) const
1189 + MathMetricsInfo m = mi;
1190 + whichFont(m.font, code_, mi);
1192 + xcell(0).metrics(m);
1193 + width_ = xcell(0).width();
1194 + ascent_ = xcell(0).ascent();
1195 + descent_ = xcell(0).descent();
1199 +void MathFontInset::draw(MathPainterInfo & pain, int x, int y) const
1201 + lyxerr << "MathFontInset::draw\n";
1202 + xcell(0).draw(pain, x, y);
1206 +void MathFontInset::metricsT(TextMetricsInfo const & mi) const
1208 + xcell(0).metricsT(mi);
1209 + width_ = xcell(0).width();
1210 + ascent_ = xcell(0).ascent();
1211 + descent_ = xcell(0).descent();
1215 +void MathFontInset::drawT(TextPainter & pain, int x, int y) const
1217 + //lyxerr << "drawing font code: " << code_ << '\n';
1218 + xcell(0).drawT(pain, x, y);
1222 +void MathFontInset::write(WriteStream & os) const
1224 + os << math_font_name(code_) << '{' << cell(0) << '}';
1228 +void MathFontInset::normalize(NormalStream & os) const
1230 + os << "[font_ " << code_ << " " << cell(0) << "]";
1234 +void MathFontInset::handleFont(MathTextCodes t)
1236 + code_ = (code_ == t) ? LM_TC_VAR : t;
1240 +void MathFontInset::validate(LaTeXFeatures & features) const
1242 + // Make sure amssymb is put in preamble if Blackboard Bold or
1244 + if ((code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK))
1245 + features.require("amssymb");
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
1255 +#ifndef MATH_FONTINSET_H
1256 +#define MATH_FONTINSET_H
1258 +#include "math_nestinset.h"
1264 +/** The base character inset.
1265 + \author André Pönitz
1268 +class MathFontInset : public MathNestInset {
1271 + explicit MathFontInset(MathTextCodes t);
1273 + MathInset * clone() const;
1275 + void metrics(MathMetricsInfo const & st) const;
1277 + void draw(MathPainterInfo &, int x, int y) const;
1279 + void metricsT(TextMetricsInfo const & st) const;
1281 + void drawT(TextPainter &, int x, int y) const;
1283 + void write(WriteStream & os) const;
1285 + void normalize(NormalStream &) const;
1286 + /// identifies Fontinsets
1287 + MathFontInset const * asFontInset() const { return this; }
1289 + MathTextCodes code() const { return code_; }
1291 + void validate(LaTeXFeatures & features) const;
1293 + void handleFont(MathTextCodes t);
1296 + /// the font to be used on screen
1297 + MathTextCodes code_;
1299 + mutable LyXFont font_;
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
1313 -void MathFracInset::draw(Painter & pain, int x, int y) const
1314 +void MathFracInset::draw(MathPainterInfo & pain, int x, int y) const
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);
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);
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:
1334 void metrics(MathMetricsInfo const & mi) const;
1336 - void draw(Painter &, int x, int y) const;
1337 + void draw(MathPainterInfo &, int x, int y) const;
1339 void metricsT(TextMetricsInfo const & mi) const;
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
1350 #include "math_funcinset.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
1360 -void MathFuncInset::draw(Painter & pain, int x, int y) const
1361 +void MathFuncInset::draw(MathPainterInfo & pain, int x, int y) const
1363 drawStr(pain, font_, x, y, name_);
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:
1374 void metrics(MathMetricsInfo const & st) const;
1376 - void draw(Painter &, int x, int y) const;
1377 + void draw(MathPainterInfo &, int x, int y) const;
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
1392 -void MathFuncLimInset::draw(Painter & pain, int x, int y) const
1393 +void MathFuncLimInset::draw(MathPainterInfo & pain, int x, int y) const
1395 drawStr(pain, font_, x, y, name_);
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:
1406 void metrics(MathMetricsInfo const & st) const;
1408 - void draw(Painter &, int x, int y) const;
1409 + void draw(MathPainterInfo &, int x, int y) const;
1411 bool isScriptable() const;
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
1424 -void MathGridInset::draw(Painter & pain, int x, int y) const
1425 +void MathGridInset::draw(MathPainterInfo & pain, int x, int y) const
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);
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);
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:
1455 void metrics(MathMetricsInfo const & st) const;
1457 - void draw(Painter &, int x, int y) const;
1458 + void draw(MathPainterInfo &, int x, int y) const;
1460 void metricsT(TextMetricsInfo const & st) const;
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
1473 -void MathHullInset::draw(Painter & pain, int x, int y) const
1474 +void MathHullInset::draw(MathPainterInfo & pain, int x, int y) const
1476 MathGridInset::draw(pain, x, y);
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:
1487 void metrics(MathMetricsInfo const & st) const;
1489 - void draw(Painter &, int x, int y) const;
1490 + void draw(MathPainterInfo &, int x, int y) const;
1492 //void metricsT(TextMetricsInfo const & st) const;
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
1505 -void MathInset::draw(Painter &, int, int) const
1506 +void MathInset::draw(MathPainterInfo &, int, int) const
1508 lyxerr << "MathInset::draw() called directly!\n";
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;
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
1537 -void MathKernInset::draw(Painter &, int, int) const
1538 +void MathKernInset::draw(MathPainterInfo &, int, int) const
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:
1551 MathInset * clone() const;
1553 - void draw(Painter &, int x, int y) const;
1554 + void draw(MathPainterInfo &, int x, int y) const;
1556 void write(WriteStream & os) const;
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
1569 -void MathLefteqnInset::draw(Painter & pain, int x, int y) const
1570 +void MathLefteqnInset::draw(MathPainterInfo & pain, int x, int y) const
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:
1583 MathInset * clone() const;
1585 - void draw(Painter &, int x, int y) const;
1586 + void draw(MathPainterInfo &, int x, int y) const;
1588 void write(WriteStream & os) const;
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
1601 -void MathLimitOpInset::draw(Painter &, int, int) const
1602 +void MathLimitOpInset::draw(MathPainterInfo &, int, int) const
1604 lyxerr << "should not happen\n";
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:
1615 void metrics(MathMetricsInfo const & st) const;
1617 - void draw(Painter &, int x, int y) const;
1618 + void draw(MathPainterInfo &, int x, int y) const;
1620 void write(WriteStream & os) const;
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
1630 #include "support/lstrings.h"
1631 #include "support/LAssert.h"
1633 -#include "Painter.h"
1634 #include "LaTeXFeatures.h"
1637 @@ -109,7 +108,7 @@ void MathMacro::metrics(MathMetricsInfo
1641 -void MathMacro::draw(Painter & pain, int x, int y) const
1642 +void MathMacro::draw(MathPainterInfo & pain, int x, int y) const
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:
1655 MathMacro(MathMacro const &);
1657 - void draw(Painter &, int x, int y) const;
1658 + void draw(MathPainterInfo &, int x, int y) const;
1660 void metrics(MathMetricsInfo const & st) const;
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
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"
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)
1686 if (n < 1 || n > 9) {
1687 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
1688 @@ -34,10 +33,7 @@ MathInset * MathMacroArgument::clone() c
1690 void MathMacroArgument::write(WriteStream & os) const
1692 - if (code_ == LM_TC_MIN)
1695 - os << '\\' << math_font_name(code_) << '{' << str_ << '}';
1700 @@ -54,7 +50,7 @@ void MathMacroArgument::metrics(MathMetr
1704 -void MathMacroArgument::draw(Painter & pain, int x, int y) const
1705 +void MathMacroArgument::draw(MathPainterInfo & pain, int x, int y) const
1708 xcell(0).draw(pain, x, y);
1709 @@ -72,8 +68,5 @@ void MathMacroArgument::normalize(Normal
1710 void MathMacroArgument::substitute(MathMacro const & m)
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_);
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
1726 class MathMacroArgument : public MathNestInset {
1729 - explicit MathMacroArgument(int, MathTextCodes = LM_TC_MIN);
1730 + explicit MathMacroArgument(int);
1732 MathInset * clone() const;
1734 @@ -22,7 +22,7 @@ public:
1736 void metrics(MathMetricsInfo const & st) const;
1738 - void draw(Painter &, int x, int y) const;
1739 + void draw(MathPainterInfo &, int x, int y) const;
1741 void substitute(MathMacro const & macro);
1743 @@ -40,8 +40,6 @@ private:
1746 mutable LyXFont font_;
1748 - MathTextCodes code_;
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
1763 -void MathMacroTemplate::draw(Painter & pain, int x, int y) const
1764 +void MathMacroTemplate::draw(MathPainterInfo & pain, int x, int y) const
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);
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:
1781 string const & name() const;
1783 - void draw(Painter &, int x, int y) const;
1784 + void draw(MathPainterInfo &, int x, int y) const;
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
1797 +#include <config.h>
1799 +#include "math_metricsinfo.h"
1800 +#include "math_support.h"
1803 +MathPainterInfo::MathPainterInfo(Painter & p)
1804 + : pain(p), style(LM_ST_TEXT), code(LM_TC_MIN)
1806 + //whichFont(font, LM_TC_MIN);
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
1816 #define MATH_METRICSINFO_H
1818 #include "lyxfont.h"
1819 +#include "math_defs.h"
1823 class MathNestInset;
1826 @@ -23,13 +25,13 @@ enum MathStyles {
1827 struct MathMetricsInfo {
1830 - : view(0), font(), style(LM_ST_TEXT),
1831 + : view(0), font(), style(LM_ST_TEXT), code(LM_TC_MIN),
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),
1842 @@ -40,6 +42,8 @@ struct MathMetricsInfo {
1847 + MathTextCodes code;
1848 /// used to pass some info down
1849 MathNestInset const * inset;
1851 @@ -54,5 +58,24 @@ struct TextMetricsInfo {
1858 +struct MathPainterInfo {
1860 + MathPainterInfo(Painter & p);
1862 + void draw(int x, int y, char c);
1871 + MathTextCodes code;
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
1887 -void MathNotInset::draw(Painter & pain, int x, int y) const
1888 +void MathNotInset::draw(MathPainterInfo & pain, int x, int y) const
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:
1901 void metrics(MathMetricsInfo const & mi) const;
1903 - void draw(Painter &, int x, int y) const;
1904 + void draw(MathPainterInfo &, int x, int y) const;
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)
1919 -void add(MathArray & ar, char c, MathTextCodes code)
1920 +void add(MathArray & ar, char c)
1922 - ar.push_back(MathAtom(new MathCharInset(c, code)));
1923 + ar.push_back(MathAtom(new MathCharInset(c)));
1927 @@ -252,7 +252,7 @@ public:
1929 bool parse_normal(MathAtom &);
1931 - void parse_into(MathArray & array, unsigned flags, MathTextCodes = LM_TC_MIN);
1932 + void parse_into(MathArray & array, unsigned flags);
1934 int lineno() const { return lineno_; }
1936 @@ -260,7 +260,7 @@ public:
1940 - void parse_into1(MathArray & array, unsigned flags, MathTextCodes);
1941 + void parse_into1(MathArray & array, unsigned flags);
1943 string getArg(char lf, char rf);
1945 @@ -888,9 +888,9 @@ bool Parser::parse_normal(MathAtom & mat
1949 -void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code)
1950 +void Parser::parse_into(MathArray & array, unsigned flags)
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
1961 -void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
1962 +void Parser::parse_into1(MathArray & array, unsigned flags)
1966 @@ -959,14 +959,14 @@ void Parser::parse_into1(MathArray & arr
1969 else if (t.cat() == catLetter)
1970 - add(array, t.character(), code);
1971 + add(array, t.character());
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());
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')));
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";
1989 - add(array, '}', LM_TC_TEX);
1990 + add(array, '}'); //, LM_TC_TEX);
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;
2000 else if (t.cat() == catSuper || t.cat() == catSub) {
2001 @@ -1022,7 +1022,7 @@ void Parser::parse_into1(MathArray & arr
2004 else if (t.cat() == catOther)
2005 - add(array, t.character(), code);
2006 + add(array, t.character());
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);
2019 @@ -1195,34 +1195,37 @@ void Parser::parse_into1(MathArray & arr
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;
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;
2038 + MathAtom p = createMathInset(t.cs());
2039 + parse_into(p->cell(0), FLAG_ITEM);
2040 + array.push_back(p);
2042 // undo catcode changes
2043 - ////theCatcode[' '] = catSpaceSave;
2044 - //lyxerr << "ending font\n";
2045 + theCatcode[' '] = catSpaceSave;
2046 + lyxerr << "ending font\n";
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);
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);
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);
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
2082 -void MathRootInset::draw(Painter & pain, int x, int y) const
2083 +void MathRootInset::draw(MathPainterInfo & pain, int x, int y) const
2085 int const w = xcell(0).width();
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);
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:
2105 void metrics(MathMetricsInfo const & st) const;
2107 - void draw(Painter &, int x, int y) const;
2108 + void draw(MathPainterInfo &, int x, int y) const;
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
2123 -void MathScriptInset::draw(Painter & pain, int x, int y) const
2124 +void MathScriptInset::draw(MathPainterInfo & pain, int x, int y) const
2126 //lyxerr << "unexpected call to MathScriptInset::draw()\n";
2127 draw(0, pain, x, y);
2128 @@ -226,7 +226,7 @@ void MathScriptInset::metricsT(MathInset
2132 -void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
2133 +void MathScriptInset::draw(MathInset const * nuc, MathPainterInfo & pain,
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:
2146 void metrics(MathMetricsInfo const & st) const;
2148 - void draw(Painter &, int x, int y) const;
2149 + void draw(MathPainterInfo &, int x, int y) const;
2151 void metricsT(TextMetricsInfo const & st) const;
2153 @@ -36,7 +36,7 @@ public:
2155 void metrics(MathInset const * nuc, MathMetricsInfo const & st) const;
2157 - void draw(MathInset const * nuc, Painter &, int x, int y) const;
2158 + void draw(MathInset const * nuc, MathPainterInfo &, int x, int y) const;
2160 void metricsT(MathInset const * nuc, TextMetricsInfo const & st) const;
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
2173 -void MathSizeInset::draw(Painter & pain, int x, int y) const
2174 +void MathSizeInset::draw(MathPainterInfo & pain, int x, int y) const
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:
2187 void metrics(MathMetricsInfo const & st) const;
2189 - void draw(Painter &, int x, int y) const;
2190 + void draw(MathPainterInfo &, int x, int y) const;
2192 bool needsBraces() const { return false; }
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
2205 -void MathSpaceInset::draw(Painter & pain, int x, int y) const
2206 +void MathSpaceInset::draw(MathPainterInfo & pain, int x, int y) const
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;
2214 - pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
2215 + pain.pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
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:
2228 void metrics(MathMetricsInfo const & st) const;
2230 - void draw(Painter &, int x, int y) const;
2231 + void draw(MathPainterInfo &, int x, int y) const;
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
2246 -void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
2247 +void MathSpecialCharInset::draw(MathPainterInfo & pain, int x, int y) const
2249 drawChar(pain, font_, x, y, char_);
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:
2260 void metrics(MathMetricsInfo const & st) const;
2262 - void draw(Painter &, int x, int y) const;
2263 + void draw(MathPainterInfo &, int x, int y) const;
2265 void write(WriteStream & os) const;
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
2278 -void MathSqrtInset::draw(Painter & pain, int x, int y) const
2279 +void MathSqrtInset::draw(MathPainterInfo & pain, int x, int y) const
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);
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:
2301 MathInset * clone() const;
2303 - void draw(Painter &, int x, int y) const;
2304 + void draw(MathPainterInfo &, int x, int y) const;
2306 void metrics(MathMetricsInfo const & mi) const;
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
2319 -void MathStackrelInset::draw(Painter & pain, int x, int y) const
2320 +void MathStackrelInset::draw(MathPainterInfo & pain, int x, int y) const
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:
2333 void metrics(MathMetricsInfo const & st) const;
2335 - void draw(Painter &, int x, int y) const;
2336 + void draw(MathPainterInfo &, int x, int y) const;
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
2348 #include "math_mathmlstream.h"
2349 #include "math_streamstr.h"
2351 -#include "Painter.h"
2352 #include "math_support.h"
2353 #include "math_parser.h"
2354 #include "LaTeXFeatures.h"
2360 MathStringInset::MathStringInset()
2361 - : str_(), code_(LM_TC_MIN)
2365 -MathStringInset::MathStringInset(string const & s, MathTextCodes t)
2366 - : str_(s), code_(t)
2367 +MathStringInset::MathStringInset(string const & s)
2372 @@ -32,42 +29,16 @@ MathInset * MathStringInset::clone() con
2376 -int MathStringInset::ascent() const
2378 - return mathed_string_ascent(font_, str_);
2382 -int MathStringInset::descent() const
2384 - return mathed_string_descent(font_, str_);
2388 -int MathStringInset::width() const
2390 - return mathed_string_width(font_, str_);
2394 -void MathStringInset::validate(LaTeXFeatures & features) const
2396 - //lyxerr << "stringinset amssymb" << endl;
2397 - if (code_ == LM_TC_MSA || code_ == LM_TC_MSB)
2398 - features.require("amssymb");
2402 void MathStringInset::metrics(MathMetricsInfo const & mi) const
2404 - whichFont(font_, code_, mi);
2405 + mathed_string_dim(mi.font, str_, ascent_, descent_, width_);
2409 -void MathStringInset::draw(Painter & pain, int x, int y) const
2410 +void MathStringInset::draw(MathPainterInfo & pain, int x, int y) const
2412 //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
2413 - drawStr(pain, font_, x, y, str_);
2414 + drawStr(pain, pain.font, x, y, str_);
2418 @@ -79,7 +50,7 @@ void MathStringInset::normalize(NormalSt
2420 void MathStringInset::maplize(MapleStream & os) const
2422 - if (code_ != LM_TC_VAR || str_.size() <= 1) {
2423 + if (/*code_ != LM_TC_VAR || */ str_.size() <= 1) {
2424 os << ' ' << str_ << ' ';
2427 @@ -93,7 +64,7 @@ void MathStringInset::maplize(MapleStrea
2429 void MathStringInset::octavize(OctaveStream & os) const
2431 - if (code_ != LM_TC_VAR || str_.size() <= 1) {
2432 + if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) {
2433 os << ' ' << str_ << ' ';
2436 @@ -107,6 +78,7 @@ void MathStringInset::octavize(OctaveStr
2438 void MathStringInset::mathmlize(MathMLStream & os) const
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>";
2453 void MathStringInset::write(WriteStream & os) const
2455 - if (math_font_name(code_))
2456 - os << '\\' << math_font_name(code_) << '{' << str_ << '}';
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
2469 #ifndef MATH_STRINGINSET_H
2470 #define MATH_STRINGINSET_H
2472 -#include "math_inset.h"
2473 +#include "math_diminset.h"
2478 \author André Pönitz
2481 -class MathStringInset : public MathInset {
2482 +class MathStringInset : public MathDimInset {
2487 - MathStringInset(string const & s, MathTextCodes t = LM_TC_TEXTRM);
2488 + explicit MathStringInset(string const & s);
2490 MathInset * clone() const;
2492 void metrics(MathMetricsInfo const & st) const;
2494 - void draw(Painter &, int x, int y) const;
2496 - int ascent() const;
2498 - int descent() const;
2500 - int width() const;
2501 + void draw(MathPainterInfo &, int x, int y) const;
2503 string str() const { return str_; }
2505 MathStringInset * asStringInset() { return this; }
2506 - /// request "external features"
2507 - void validate(LaTeXFeatures & features) const;
2510 void normalize(NormalStream &) const;
2511 @@ -51,9 +43,5 @@ public:
2515 - /// the font to be used on screen
2516 - MathTextCodes code_;
2518 - mutable LyXFont font_;
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
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)
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);
2542 @@ -655,7 +655,7 @@ void mathed_draw_deco(Painter & pain, in
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),
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 << "]";
2555 - pain.lines(xp, yp, n, LColor::math);
2556 + pain.pain.lines(xp, yp, n, LColor::math);
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)
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(),
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)
2577 - pain.text(x, y, str, font);
2578 + pain.pain.text(x, y, str, font);
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)
2585 - pain.text(x, y, c, font);
2586 + pain.pain.text(x, y, c, font);
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
2598 #include "math_defs.h"
2599 #include "LString.h"
2602 +class MathPainterInfo;
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);
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);
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 *);
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);
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);
2628 void math_font_max_dim(LyXFont const &, int & asc, int & desc);
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
2641 -void MathSymbolInset::draw(Painter & pain, int x, int y) const
2642 +void MathSymbolInset::draw(MathPainterInfo & pain, int x, int y) const
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:
2655 void metrics(MathMetricsInfo const & st) const;
2657 - void draw(Painter &, int x, int y) const;
2658 + void draw(MathPainterInfo &, int x, int y) const;
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
2673 -void MathUndersetInset::draw(Painter & pain, int x, int y) const
2674 +void MathUndersetInset::draw(MathPainterInfo & pain, int x, int y) const
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:
2687 void metrics(MathMetricsInfo const & st) const;
2689 - void draw(Painter &, int x, int y) const;
2690 + void draw(MathPainterInfo &, int x, int y) const;
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
2703 #include "math_unknowninset.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
2713 -void MathUnknownInset::draw(Painter & pain, int x, int y) const
2714 +void MathUnknownInset::draw(MathPainterInfo & pain, int x, int y) const
2716 drawStr(pain, font_, x, y, name_);
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:
2727 void metrics(MathMetricsInfo const & st) const;
2729 - void draw(Painter &, int x, int y) const;
2730 + void draw(MathPainterInfo &, int x, int y) const;
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
2745 -void MathXArrowInset::draw(Painter & pain, int x, int y) const
2746 +void MathXArrowInset::draw(MathPainterInfo & pain, int x, int y) const
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:
2759 MathInset * clone() const;
2761 - void draw(Painter &, int x, int y) const;
2762 + void draw(MathPainterInfo &, int x, int y) const;
2764 void write(WriteStream & os) const;
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
2777 -void MathXArray::draw(Painter & pain, int x, int y) const
2778 +void MathXArray::draw(MathPainterInfo & pain, int x, int y) const
2780 //if (drawn_ && x == xo_ && y == yo_)
2782 @@ -85,17 +85,17 @@ void MathXArray::draw(Painter & pain, in
2784 if (y + descent_ <= 0) // don't draw above the workarea
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
2789 if (x + width_ <= 0) // don't draw left of workarea
2791 - if (x >= pain.paperWidth()) // don't draw right of workarea
2792 + if (x >= pain.pain.paperWidth()) // don't draw right of workarea
2795 const_iterator it = begin(), et = end();
2798 - pain.rectangle(x, y - ascent_, width_, height(), LColor::mathline);
2799 + pain.pain.rectangle(x, y - ascent_, width_, height(), LColor::mathline);
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
2815 +class MathPainterInfo;
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
2839 -void MathXYArrowInset::draw(Painter & pain, int x, int y) const
2840 +void MathXYArrowInset::draw(MathPainterInfo & pain, int x, int y) const
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);
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:
2862 void metrics(MathMetricsInfo const & st) const;
2864 - void draw(Painter & pain, int x, int y) const;
2865 + void draw(MathPainterInfo & pain, int x, int y) const;
2867 MathXYArrowInset * asXYArrowInset() { return this; }