#include "LaTeXFeatures.h"
#include "Color.h"
#include "Lexer.h"
-#include "LyXText.h"
+#include "Text.h"
#include "MetricsInfo.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
void InsetCharStyle::init()
{
- setInlined();
setDrawFrame(false);
}
}
-auto_ptr<InsetBase> InsetCharStyle::doClone() const
+auto_ptr<Inset> InsetCharStyle::doClone() const
{
- return auto_ptr<InsetBase>(new InsetCharStyle(*this));
+ return auto_ptr<Inset>(new InsetCharStyle(*this));
}
params_.latextype.clear();
params_.latexname.clear();
params_.latexparam.clear();
- params_.font = LyXFont(LyXFont::ALL_INHERIT);
- params_.labelfont = LyXFont(LyXFont::ALL_INHERIT);
+ params_.font = Font(Font::ALL_INHERIT);
+ params_.labelfont = Font(Font::ALL_INHERIT);
params_.labelfont.setColor(Color::error);
params_.show_label = true;
}
{
params_.read(lex);
InsetCollapsable::read(buf, lex);
- setInlined();
}
bool InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
{
- LyXFont tmpfont = mi.base.font;
+ Font tmpfont = mi.base.font;
getDrawFont(mi.base.font);
- mi.base.font.reduce(LyXFont(LyXFont::ALL_SANE));
+ mi.base.font.reduce(Font(Font::ALL_SANE));
mi.base.font.realize(tmpfont);
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
InsetText::metrics(mi, dim);
mi.base.font = tmpfont;
if (params_.show_label) {
// consider width of the inset label
- LyXFont font(params_.labelfont);
- font.realize(LyXFont(LyXFont::ALL_SANE));
+ Font font(params_.labelfont);
+ font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
int w = 0;
{
setPosCache(pi, x, y);
- LyXFont tmpfont = pi.base.font;
+ Font tmpfont = pi.base.font;
getDrawFont(pi.base.font);
// I don't understand why the above .reduce and .realize aren't
//needed, or even wanted, here. It just works. -- MV 10.04.2005
// the name of the charstyle. Can be toggled.
if (params_.show_label) {
- LyXFont font(params_.labelfont);
- font.realize(LyXFont(LyXFont::ALL_SANE));
+ Font font(params_.labelfont);
+ font.realize(Font(Font::ALL_SANE));
font.decSize();
font.decSize();
int w = 0;
}
-void InsetCharStyle::getDrawFont(LyXFont & font) const
+void InsetCharStyle::getDrawFont(Font & font) const
{
font = params_.font;
}
void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- setInlined();
switch (cmd.action) {
-
- case LFUN_MOUSE_PRESS:
+
+ case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3)
params_.show_label = !params_.show_label;
else
- InsetText::doDispatch(cur, cmd);
+ InsetCollapsable::doDispatch(cur, cmd);
break;
case LFUN_INSET_TOGGLE:
int InsetCharStyle::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
if (!undefined()) {
// FIXME UNICODE
int InsetCharStyle::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
return InsetText::plaintext(buf, os, runparams);
}
int InsetCharStyle::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
ParagraphList::const_iterator beg = paragraphs().begin();
ParagraphList::const_iterator par = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
if (!undefined())
- // FIXME UNICODE
- sgml::openTag(os, params_.latexname,
- par->getID(buf, runparams) + params_.latexparam);
+ // FIXME UNICODE
+ sgml::openTag(os, params_.latexname,
+ par->getID(buf, runparams) + params_.latexparam);
for (; par != end; ++par) {
par->simpleDocBookOnePar(buf, os, runparams,