]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlatexaccent.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetlatexaccent.C
index c069c32706820086b0b324db6aac1154b90f43bf..bcbd6ed46cb23660b41a6d4f85ba1c1c60db0063 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include "insetlatexaccent.h"
 
 #include "debug.h"
-#include "lyxrc.h"
-#include "support/lstrings.h"
-#include "BufferView.h"
-#include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
 #include "language.h"
+#include "LColor.h"
 #include "lyxlex.h"
+#include "lyxrc.h"
 #include "metricsinfo.h"
 
-using namespace lyx::support;
+#include "frontends/font_metrics.h"
+#include "frontends/Painter.h"
+
+#include "support/lstrings.h"
+
+using lyx::support::contains;
+using lyx::support::trim;
 
-using std::ostream;
 using std::endl;
+using std::string;
 using std::auto_ptr;
+using std::ostream;
 
 
 /* LatexAccent. Proper handling of accented characters */
@@ -484,13 +488,15 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                case TIE:     // tie
                {
                        pi.pain.arc(int(x2 + hg35), int(y + hg / 2.0),
-                                int(2 * hg), int(hg), 0, 360 * 32);
+                                   int(2 * hg), int(hg), 0, 360 * 32,
+                                   LColor::foreground);
                        break;
                }
                case BREVE:     // breve
                {
                        pi.pain.arc(int(x2 - (hg / 2.0)), y,
-                                int(hg), int(hg), 0, -360*32);
+                                   int(hg), int(hg), 0, -360*32,
+                                   LColor::foreground);
                        break;
                }
                case CARON:    // caron
@@ -500,7 +506,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        xp[0] = int(x2 - hg35); yp[0] = int(y + hg35);
                        xp[1] = int(x2);        yp[1] = int(y + hg);
                        xp[2] = int(x2 + hg35); yp[2] = int(y + hg35);
-                       pi.pain.lines(xp, yp, 3);
+                       pi.pain.lines(xp, yp, 3, LColor::foreground);
                        break;
                }
                case SPECIAL_CARON:    // special caron
@@ -519,7 +525,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        xp[2] = int(x + dim_.wid + (hg35 / 2.0));
                        yp[2] = y + int(hg);
 
-                       pi.pain.lines(xp, yp, 3);
+                       pi.pain.lines(xp, yp, 3, LColor::foreground);
                        break;
                }
                case HUNGARIAN_UMLAUT:    // hung. umlaut
@@ -566,7 +572,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        xp[3] = int(x2 + hg / 4.0);
                        yp[3] = y + int(hg);
 
-                       pi.pain.lines(xp, yp, 4);
+                       pi.pain.lines(xp, yp, 4, LColor::foreground);
                        break;
                }
                case lSLASH:
@@ -580,7 +586,7 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                        xp[1] = int(x + float(dim_.wid) * 0.75);
                        yp[1] = y + int(hg);
 
-                       pi.pain.lines(xp, yp, 2);
+                       pi.pain.lines(xp, yp, 2, LColor::foreground);
                        break;
                }
                case DOT_LESS_I: // dotless-i
@@ -592,22 +598,24 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
                }
        } else {
                pi.pain.fillRectangle(x + 1,
-                                  baseline - dim_.asc + 1, dim_.wid - 2,
-                                  dim_.asc + dim_.des - 2, backgroundColor());
+                                     baseline - dim_.asc + 1, dim_.wid - 2,
+                                     dim_.asc + dim_.des - 2,
+                                     backgroundColor());
                pi.pain.rectangle(x + 1, baseline - dim_.asc + 1,
-                              dim_.wid - 2, dim_.asc + dim_.des - 2);
+                                 dim_.wid - 2, dim_.asc + dim_.des - 2,
+                                 LColor::foreground);
                pi.pain.text(x + 2, baseline, contents, font);
        }
 }
 
 
-void InsetLatexAccent::write(Buffer const *, ostream & os) const
+void InsetLatexAccent::write(Buffer const &, ostream & os) const
 {
        os << "\\i " << contents << "\n";
 }
 
 
-void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
+void InsetLatexAccent::read(Buffer const &, LyXLex & lex)
 {
        lex.eatLine();
        contents = lex.getString();
@@ -615,7 +623,7 @@ void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetLatexAccent::latex(Buffer const *, ostream & os,
+int InsetLatexAccent::latex(Buffer const &, ostream & os,
                            LatexRunParams const &) const
 {
        os << contents;
@@ -623,21 +631,21 @@ int InsetLatexAccent::latex(Buffer const *, ostream & os,
 }
 
 
-int InsetLatexAccent::ascii(Buffer const *, ostream & os, int) const
+int InsetLatexAccent::ascii(Buffer const &, ostream & os, int) const
 {
        os << contents;
        return 0;
 }
 
 
-int InsetLatexAccent::linuxdoc(Buffer const *, ostream & os) const
+int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os) const
 {
        os << contents;
        return 0;
 }
 
 
-int InsetLatexAccent::docbook(Buffer const *, ostream & os, bool) const
+int InsetLatexAccent::docbook(Buffer const &, ostream & os, bool) const
 {
        os << contents;
        return 0;
@@ -656,9 +664,9 @@ auto_ptr<InsetBase> InsetLatexAccent::clone() const
 }
 
 
-Inset::Code InsetLatexAccent::lyxCode() const
+InsetOld::Code InsetLatexAccent::lyxCode() const
 {
-       return Inset::ACCENT_CODE;
+       return InsetOld::ACCENT_CODE;
 }