return MathAtom(new MathSpaceInset(l->name));
if (inset == "dots")
return MathAtom(new MathDotsInset(l));
- if (inset == "mbox")
- return MathAtom(new MathBoxInset(l->name));
+// if (inset == "mbox")
+// return MathAtom(new MathBoxInset(l->name));
// if (inset == "parbox")
// return MathAtom(new MathParboxInset);
- if (inset == "fbox")
- return MathAtom(new MathFboxInset(l));
+// if (inset == "fbox")
+// return MathAtom(new MathFboxInset(l));
if (inset == "style")
return MathAtom(new MathSizeInset(l));
if (inset == "font")
if (s.size() == 3 && s[0] == '\\' && s[1] == '#'
&& s[2] >= '1' && s[2] <= '9')
return MathAtom(new MathMacroArgument(s[2] - '0'));
+ if (s == "mbox")
+ return MathAtom(new MathBoxInset("mbox"));
+ if (s == "fbox")
+ return MathAtom(new MathFboxInset());
if (s == "framebox")
return MathAtom(new MathFrameboxInset);
if (s == "makebox")
#include "math_parser.h"
#include "math_streamstr.h"
#include "LColor.h"
+
+#include "support/std_ostream.h"
#include "frontends/Painter.h"
using std::auto_ptr;
-MathFboxInset::MathFboxInset(latexkeys const * key)
- : MathNestInset(1), key_(key)
+MathFboxInset::MathFboxInset()
+ : MathNestInset(1)
{}
MathInset::mode_type MathFboxInset::currentMode() const
{
- if (key_->name == "fbox")
- return TEXT_MODE;
- return MATH_MODE;
+ return TEXT_MODE;
}
void MathFboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
{
- if (key_->name == "fbox") {
- FontSetChanger dummy(mi.base, "textnormal");
- cell(0).metrics(mi, dim);
- } else {
- cell(0).metrics(mi, dim);
- }
+ FontSetChanger dummy(mi.base, "textnormal");
+ cell(0).metrics(mi, dim);
metricsMarkers(dim, 5); // 5 pixels margin
dim_ = dim;
}
{
pi.pain.rectangle(x + 1, y - dim_.ascent() + 1,
dim_.width() - 2, dim_.height() - 2, LColor::foreground);
- if (key_->name == "fbox") {
- FontSetChanger dummy(pi.base, "textnormal");
- cell(0).draw(pi, x + 5, y);
- } else {
- cell(0).draw(pi, x + 5, y);
- }
+ FontSetChanger dummy(pi.base, "textnormal");
+ cell(0).draw(pi, x + 5, y);
setPosCache(pi, x, y);
}
void MathFboxInset::write(WriteStream & os) const
{
- os << '\\' << key_->name << '{' << cell(0) << '}';
+ os << "\\fbox{" << cell(0) << '}';
}
void MathFboxInset::normalize(NormalStream & os) const
{
- os << '[' << key_->name << ' ' << cell(0) << ']';
+ os << "[fbox " << cell(0) << ']';
+}
+
+
+void MathFboxInset::infoize(std::ostream & os) const
+{
+ os << "FBox: ";
}
+
class MathFboxInset : public MathNestInset {
public:
///
- MathFboxInset(latexkeys const * key);
+ MathFboxInset();
///
- virtual std::auto_ptr<InsetBase> clone() const;
+ std::auto_ptr<InsetBase> clone() const;
///
mode_type currentMode() const;
///
void write(WriteStream & os) const;
/// write normalized content
void normalize(NormalStream & ns) const;
-private:
///
- latexkeys const * key_;
+ void infoize(std::ostream & os) const;
};
#endif
return;
}
+#if 0
else if (l->inset == "parbox") {
// read optional positioning and width
string pos = parse_verbatim_option();
cell->back().nucleus()->asParboxInset()->setPosition(pos);
cell->back().nucleus()->asParboxInset()->setWidth(width);
}
+#endif
else {
MathAtom at = createMathInset(t.cs());
//}
for (MathInset::idx_type i = start; i < at->nargs(); ++i) {
parse(at.nucleus()->cell(i), FLAG_ITEM, m);
- parse1(grid, FLAG_SKIPSPACE, mode, numbered);
+ skipSpaces();
}
cell->push_back(at);
}