#include "QLPainter.h"
+#include "GuiApplication.h"
#include "GuiWorkArea.h"
#include "QLImage.h"
-#include "ColorCache.h"
#include "FontLoader.h"
-#include "Application.h"
+#include "GuiApplication.h"
+#include "qt_helpers.h"
#include "debug.h"
#include "language.h"
QPen pen = qp_.get()->pen();
- pen.setColor(lcolorcache.get(col));
+ pen.setColor(guiApp->colorCache().get(col));
switch (ls) {
case line_solid: pen.setStyle(Qt::SolidLine); break;
void QLPainter::fillRectangle(int x, int y, int w, int h, LColor_color col)
{
- qp_->fillRect(x, y, w, h, lcolorcache.get(col));
+ qp_->fillRect(x, y, w, h, guiApp->colorCache().get(col));
}
LyXFont smallfont(f);
smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
- QFont const & qfont = theApp->fontLoader().get(f);
- QFont const & qsmallfont = theApp->fontLoader().get(smallfont);
+ QFont const & qfont = guiApp->guiFontLoader().get(f);
+ QFont const & qsmallfont = guiApp->guiFontLoader().get(smallfont);
QFontMetrics const & qfontm = QFontMetrics(qfont);
QFontMetrics const & qsmallfontm = QFontMetrics(qsmallfont);
for (unsigned int i = 0; i < ls; ++i)
str[i] = QChar(encoding->ucs(s[i]));
#else
- //std::vector<boost::uint32_t> in(s, s + ls);
- //std::vector<unsigned short> ucs2 = ucs4_to_ucs2(in);
- std::vector<unsigned short> ucs2 = ucs4_to_ucs2(s, ls);
- ucs2.push_back(0);
- QString str = QString::fromUtf16(&ucs2[0]);
+ QString str = ucs4_to_qstring(s, ls);
#endif
#if 0
if (f.realShape() != LyXFont::SMALLCAPS_SHAPE) {
setQPainterPen(f.realColor());
- qp_->setFont(theApp->fontLoader().get(f));
+ qp_->setFont(guiApp->guiFontLoader().get(f));
// We need to draw the text as LTR as we use our own bidi code.
qp_->setLayoutDirection(Qt::LeftToRight);
qp_->drawText(x, y, str);