]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Painter.cpp
* src/frontends/qt4/QListings.cpp:
[lyx.git] / src / frontends / Painter.cpp
index 772eada114e7f94838cea32ff4cf1a78eaad0eb9..cba834ad50582a27f67782f72fa4e0e66b53a186 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "frontends/FontMetrics.h"
 
-#include "LColor.h"
-#include "LyXFont.h"
+#include "Color.h"
+#include "Font.h"
 
 using lyx::docstring;
 
@@ -29,27 +29,27 @@ namespace frontend {
 void Painter::button(int x, int y, int w, int h, bool mouseHover)
 {
        if (mouseHover)
-               fillRectangle(x, y, w, h, LColor::buttonhoverbg);
+               fillRectangle(x, y, w, h, Color::buttonhoverbg);
        else
-               fillRectangle(x, y, w, h, LColor::buttonbg);
+               fillRectangle(x, y, w, h, Color::buttonbg);
        buttonFrame(x, y, w, h);
 }
 
 
 void Painter::buttonFrame(int x, int y, int w, int h)
 {
-       line(x, y, x, y + h - 1, LColor::buttonframe);
-       line(x - 1 + w, y, x - 1 + w, y + h - 1, LColor::buttonframe);
-       line(x, y - 1, x - 1 + w, y - 1, LColor::buttonframe);
-       line(x, y + h - 1, x - 1 + w, y + h - 1, LColor::buttonframe);
+       line(x, y, x, y + h - 1, Color::buttonframe);
+       line(x - 1 + w, y, x - 1 + w, y + h - 1, Color::buttonframe);
+       line(x, y - 1, x - 1 + w, y - 1, Color::buttonframe);
+       line(x, y + h - 1, x - 1 + w, y + h - 1, Color::buttonframe);
 }
 
 
 void Painter::rectText(int x, int y,
        docstring const & str,
-       LyXFont const & font,
-       LColor_color back,
-       LColor_color frame)
+       Font const & font,
+       Color_color back,
+       Color_color frame)
 {
        int width;
        int ascent;
@@ -58,19 +58,19 @@ void Painter::rectText(int x, int y,
        FontMetrics const & fm = theFontMetrics(font);
        fm.rectText(str, width, ascent, descent);
 
-       if (back != LColor::none)
+       if (back != Color::none)
                fillRectangle(x + 1, y - ascent + 1, width - 1,
                              ascent + descent - 1, back);
 
-       if (frame != LColor::none)
+       if (frame != Color::none)
                rectangle(x, y - ascent, width, ascent + descent, frame);
 
        text(x + 3, y, str, font);
 }
 
 
-void Painter::buttonText(int x, int y, docstring const & str, 
-       LyXFont const & font, bool mouseHover)
+void Painter::buttonText(int x, int y, docstring const & str,
+       Font const & font, bool mouseHover)
 {
        int width;
        int ascent;
@@ -85,9 +85,9 @@ void Painter::buttonText(int x, int y, docstring const & str,
 
 
 int Painter::preeditText(int x, int y, char_type c,
-       LyXFont const & font, preedit_style style)
+       Font const & font, preedit_style style)
 {
-       LyXFont temp_font = font;
+       Font temp_font = font;
        FontMetrics const & fm = theFontMetrics(font);
        int ascent = fm.maxAscent();
        int descent = fm.maxDescent();
@@ -97,17 +97,17 @@ int Painter::preeditText(int x, int y, char_type c,
        switch (style) {
                case preedit_default:
                        // default unselecting mode.
-                       fillRectangle(x, y - height + 1, width, height, LColor::background);
+                       fillRectangle(x, y - height + 1, width, height, Color::background);
                        dashedUnderline(font, x, y - descent + 1, width);
                        break;
                case preedit_selecting:
                        // We are in selecting mode: white text on black background.
-                       fillRectangle(x, y - height + 1, width, height, LColor::black);
-                       temp_font.setColor(LColor::white);
+                       fillRectangle(x, y - height + 1, width, height, Color::black);
+                       temp_font.setColor(Color::white);
                        break;
                case preedit_cursor:
                        // The character comes with a cursor.
-                       fillRectangle(x, y - height + 1, width, height, LColor::background);
+                       fillRectangle(x, y - height + 1, width, height, Color::background);
                        underline(font, x, y - descent + 1, width);
                        break;
        }
@@ -117,7 +117,7 @@ int Painter::preeditText(int x, int y, char_type c,
 }
 
 
-void Painter::underline(LyXFont const & f, int x, int y, int width)
+void Painter::underline(Font const & f, int x, int y, int width)
 {
        FontMetrics const & fm = theFontMetrics(f);
 
@@ -131,7 +131,7 @@ void Painter::underline(LyXFont const & f, int x, int y, int width)
 }
 
 
-void Painter::dashedUnderline(LyXFont const & f, int x, int y, int width)
+void Painter::dashedUnderline(Font const & f, int x, int y, int width)
 {
        FontMetrics const & fm = theFontMetrics(f);