#include "FuncStatus.h"
#include "gettext.h"
#include "Language.h"
-#include "LColor.h"
+#include "Color.h"
#include "LyXAction.h"
#include "Lexer.h"
-#include "LyXTextClass.h"
+#include "TextClass.h"
#include "MetricsInfo.h"
#include "ParagraphParameters.h"
#include "Paragraph.h"
-#include "frontends/Alert.h"
+#include "frontends/alert.h"
#include <sstream>
void InsetERT::init()
{
setButtonLabel();
-
- LyXFont font(LyXFont::ALL_SANE);
+ Font font(Font::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::latex);
+ font.setColor(Color::latex);
setLabelFont(font);
text_.current_font.setLanguage(latex_language);
text_.real_current_font.setLanguage(latex_language);
-
- setInsetName(from_ascii("ERT"));
}
}
-auto_ptr<InsetBase> InsetERT::doClone() const
+auto_ptr<Inset> InsetERT::doClone() const
{
- return auto_ptr<InsetBase>(new InsetERT(*this));
+ return auto_ptr<Inset>(new InsetERT(*this));
}
Language const *, string const & contents, CollapseStatus status)
: InsetCollapsable(bp, status)
{
- LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+ Font font(Font::ALL_INHERIT, latex_language);
paragraphs().begin()->insert(0, contents, font);
// the init has to be after the initialization of the paragraph
// inherits the language from the last position of the existing text.
// As a side effect this makes us also robust against bugs in LyX
// that might lead to font changes in ERT in .lyx files.
- LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+ Font font(Font::ALL_INHERIT, latex_language);
ParagraphList::iterator par = paragraphs().begin();
ParagraphList::iterator const end = paragraphs().end();
while (par != end) {
switch (cmd.action) {
case LFUN_QUOTE_INSERT: {
- // We need to bypass the fancy quotes in LyXText
+ // We need to bypass the fancy quotes in Text
FuncRequest f(LFUN_SELF_INSERT, "\"");
dispatch(cur, f);
break;
// FIXME: Change only the pasted paragraphs
BufferParams const & bp = cur.buffer().params();
- LyXLayout_ptr const layout =
- bp.getLyXTextClass().defaultLayout();
- LyXFont font = layout->font;
+ Layout_ptr const layout =
+ bp.getTextClass().defaultLayout();
+ Font font = layout->font;
// ERT contents has always latex_language
font.setLanguage(latex_language);
ParagraphList::iterator const end = paragraphs().end();
}
-bool InsetERT::insetAllowed(InsetBase::Code /* code */) const
+bool InsetERT::insetAllowed(Inset::Code /* code */) const
{
return false;
}
bool InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
{
- LyXFont tmpfont = mi.base.font;
+ Font tmpfont = mi.base.font;
getDrawFont(mi.base.font);
mi.base.font.realize(tmpfont);
InsetCollapsable::metrics(mi, dim);
void InsetERT::draw(PainterInfo & pi, int x, int y) const
{
- LyXFont tmpfont = pi.base.font;
+ Font tmpfont = pi.base.font;
getDrawFont(pi.base.font);
pi.base.font.realize(tmpfont);
InsetCollapsable::draw(pi, x, y);
}
-void InsetERT::getDrawFont(LyXFont & font) const
+void InsetERT::getDrawFont(Font & font) const
{
- font = LyXFont(LyXFont::ALL_INHERIT, latex_language);
- font.setFamily(LyXFont::TYPEWRITER_FAMILY);
- font.setColor(LColor::latex);
+ font = Font(Font::ALL_INHERIT, latex_language);
+ font.setFamily(Font::TYPEWRITER_FAMILY);
+ font.setColor(Color::latex);
}