#include "frontends/FontMetrics.h"
-#include "LColor.h"
-#include "lyxfont.h"
+#include "Color.h"
+#include "Font.h"
using lyx::docstring;
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;
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)
+ Font const & font, bool mouseHover)
{
int width;
int ascent;
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();
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;
}
}
-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);
}
-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);