#include "MathStream.h"
#include "Buffer.h"
-#include "LCursor.h"
+#include "Cursor.h"
#include "debug.h"
#include "BufferView.h"
#include "LaTeXFeatures.h"
class MathMacroArgumentValue : public InsetMathDim {
public:
///
- MathMacroArgumentValue(MathArray const * value, docstring const & macroName)
+ MathMacroArgumentValue(MathData const * value, docstring const & macroName)
: value_(value), macroName_(macroName) {}
///
bool metrics(MetricsInfo & mi, Dimension & dim) const;
void draw(PainterInfo &, int x, int y) const;
private:
- std::auto_ptr<InsetBase> doClone() const;
- MathArray const * value_;
+ std::auto_ptr<Inset> doClone() const;
+ MathData const * value_;
docstring macroName_;
};
-auto_ptr<InsetBase> MathMacroArgumentValue::doClone() const
+auto_ptr<Inset> MathMacroArgumentValue::doClone() const
{
- return auto_ptr<InsetBase>(new MathMacroArgumentValue(*this));
+ return auto_ptr<Inset>(new MathMacroArgumentValue(*this));
}
{}
-auto_ptr<InsetBase> MathMacro::doClone() const
+auto_ptr<Inset> MathMacro::doClone() const
{
- return auto_ptr<InsetBase>(new MathMacro(*this));
+ return auto_ptr<Inset>(new MathMacro(*this));
}
MacroData const & macro = MacroTable::globalMacros().get(name());
if (macro.locked()) {
mathed_string_dim(mi.base.font, "Self reference: " + name(), dim);
- expanded_ = MathArray();
+ expanded_ = MathData();
} else if (editing(mi.base.bv)) {
// FIXME UNICODE
asArray(macro.def(), tmpl_);
- LyXFont font = mi.base.font;
+ Font font = mi.base.font;
augmentFont(font, from_ascii("lyxtex"));
tmpl_.metrics(mi, dim);
// FIXME UNICODE
// FIXME UNICODE
int ww = mathed_string_width(font, from_ascii("#1: "));
for (idx_type i = 0; i < nargs(); ++i) {
- MathArray const & c = cell(i);
+ MathData const & c = cell(i);
c.metrics(mi);
dim.wid = max(dim.wid, c.width() + ww);
dim.des += c.height() + 10;
} else {
// create MathMacroArgumentValue object pointing to the cells of the macro
MacroData const & macro = MacroTable::globalMacros().get(name());
- vector<MathArray> values(nargs());
+ vector<MathData> values(nargs());
for (size_t i = 0; i != nargs(); ++i)
values[i].insert(0, MathAtom(new MathMacroArgumentValue(&cells_[i], name())));
macro.expand(values, expanded_);
// FIXME UNICODE
drawStrRed(pi, x, y, "Self reference: " + name());
} else if (editing(pi.base.bv)) {
- LyXFont font = pi.base.font;
+ Font font = pi.base.font;
augmentFont(font, from_ascii("lyxtex"));
int h = y - dim_.ascent() + 2 + tmpl_.ascent();
pi.pain.text(x + 3, h, name(), font);
docstring t = from_ascii("#1: ");
mathed_string_dim(font, t, ldim);
for (idx_type i = 0; i < nargs(); ++i) {
- MathArray const & c = cell(i);
+ MathData const & c = cell(i);
h += max(c.ascent(), ldim.asc) + 5;
c.draw(pi, x + ldim.wid, h);
char_type str[] = { '#', '1', ':', '\0' };
}
-InsetBase * MathMacro::editXY(LCursor & cur, int x, int y)
+Inset * MathMacro::editXY(Cursor & cur, int x, int y)
{
// We may have 0 arguments, but InsetMathNest requires at least one.
if (nargs() > 0) {
}
-bool MathMacro::idxFirst(LCursor & cur) const
+bool MathMacro::idxFirst(Cursor & cur) const
{
cur.updateFlags(Update::Force);
return InsetMathNest::idxFirst(cur);
}
-bool MathMacro::idxLast(LCursor & cur) const
+bool MathMacro::idxLast(Cursor & cur) const
{
cur.updateFlags(Update::Force);
return InsetMathNest::idxLast(cur);
}
-bool MathMacro::notifyCursorLeaves(LCursor & cur)
+bool MathMacro::notifyCursorLeaves(Cursor & cur)
{
cur.updateFlags(Update::Force);
return InsetMathNest::notifyCursorLeaves(cur);