#include "InsetMathBrace.h"
#include "InsetMathColor.h"
#include "InsetMathComment.h"
-#include "MathArray.h"
#include "InsetMathDelim.h"
-#include "MathFactory.h"
#include "InsetMathHull.h"
-#include "MathStream.h"
-#include "MathMacroArgument.h"
//#include "InsetMathMBox.h"
-#include "MathParser.h"
+#include "InsetMathRef.h"
#include "InsetMathScript.h"
#include "InsetMathSpace.h"
#include "InsetMathSymbol.h"
-#include "MathSupport.h"
#include "InsetMathUnknown.h"
-#include "InsetMathRef.h"
+#include "MathData.h"
+#include "MathFactory.h"
+#include "MathMacroArgument.h"
+#include "MathParser.h"
+#include "MathStream.h"
+#include "MathSupport.h"
-#include "BufferView.h"
-#include "CutAndPaste.h"
-#include "FuncStatus.h"
-#include "LColor.h"
#include "bufferview_funcs.h"
+#include "BufferView.h"
+#include "Color.h"
#include "CoordCache.h"
#include "Cursor.h"
+#include "CutAndPaste.h"
#include "debug.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
+#include "FuncStatus.h"
#include "gettext.h"
-#include "LyXText.h"
+#include "Text.h"
#include "OutputParams.h"
#include "Undo.h"
#include "frontends/Selection.h"
#include "FuncRequest.h"
-#include "LyXServer.h"
-#include "LyXServerSocket.h"
#include <sstream>
{
// FIXME: This is a hack. Ideally, the coord cache should not store
// absolute positions, but relative ones. This would mean to call
-// setXY() not in MathArray::draw(), but in the parent insets' draw()
+// setXY() not in MathData::draw(), but in the parent insets' draw()
// with the correctly adjusted x,y values. But this means that we'd have
// to touch all (math)inset's draw() methods. Right now, we'll store
// absolute value, and make them here relative, only to make them
// absolute again when actually drawing the cursor. What a mess.
BOOST_ASSERT(ptr_cmp(&sl.inset(), this));
- MathArray const & ar = sl.cell();
+ MathData const & ar = sl.cell();
CoordCache const & coord_cache = bv.coordCache();
if (!coord_cache.getArrays().has(&ar)) {
// this can (semi-)legally happen if we just created this cell
return;
}
Point const pt2 = coord_cache.getInsets().xy(this);
- //lyxerr << "retrieving position cache for MathArray "
+ //lyxerr << "retrieving position cache for MathData "
// << pt.x_ << ' ' << pt.y_ << std::endl;
x = pt.x_ - pt2.x_ + ar.pos2x(sl.pos());
y = pt.y_ - pt2.y_;
#if 0
if (lock_)
pi.pain.fillRectangle(x, y - ascent(), width(), height(),
- LColor::mathlockbg);
+ Color::mathlockbg);
#endif
setPosCache(pi, x, y);
}
//lyxerr << "InsetMathNest::drawing selection: "
// << " s1: " << s1 << " s2: " << s2 << endl;
if (s1.idx() == s2.idx()) {
- MathArray const & c = cell(s1.idx());
+ MathData const & c = cell(s1.idx());
int x1 = c.xo(bv) + c.pos2x(s1.pos());
int y1 = c.yo(bv) - c.ascent();
int x2 = c.xo(bv) + c.pos2x(s2.pos());
int y2 = c.yo(bv) + c.descent();
- pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
+ pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
//lyxerr << "InsetMathNest::drawing selection 3: "
// << " x1: " << x1 << " x2: " << x2
// << " y1: " << y1 << " y2: " << y2 << endl;
} else {
for (idx_type i = 0; i < nargs(); ++i) {
if (idxBetween(i, s1.idx(), s2.idx())) {
- MathArray const & c = cell(i);
+ MathData const & c = cell(i);
int x1 = c.xo(bv);
int y1 = c.yo(bv) - c.ascent();
int x2 = c.xo(bv) + c.width();
int y2 = c.yo(bv) + c.descent();
- pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
+ pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, Color::selection);
}
}
}
}
-bool InsetMathNest::contains(MathArray const & ar) const
+bool InsetMathNest::contains(MathData const & ar) const
{
for (idx_type i = 0; i < nargs(); ++i)
if (cell(i).contains(ar))
}
-MathArray InsetMathNest::glue() const
+MathData InsetMathNest::glue() const
{
- MathArray ar;
+ MathData ar;
for (size_t i = 0; i < nargs(); ++i)
ar.append(cell(i));
return ar;
#warning look here
#endif
#if 0
- MathArray & ar = cur.cell();
+ MathData & ar = cur.cell();
// remove base-only "scripts"
for (pos_type i = 0; i + 1 < ar.size(); ++i) {
InsetMathScript * p = operator[](i).nucleus()->asScriptInset();
if (p && p->nargs() == 1) {
- MathArray ar = p->nuc();
+ MathData ar = p->nuc();
erase(i);
insert(i, ar);
cur.adjust(i, ar.size() - 1);
void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg)
{
recordUndo(cur, Undo::ATOMIC);
- LyXFont font;
+ Font font;
bool b;
bv_funcs::string2font(to_utf8(arg), font, b);
- if (font.color() != LColor::inherit) {
+ if (font.color() != Color::inherit) {
MathAtom at = MathAtom(new InsetMathColor(true, font.color()));
cur.handleNest(at, 0);
}
case LFUN_MATH_MODE: {
#if 1
// ignore math-mode on when already in math mode
- if (currentMode() == InsetBase::MATH_MODE && cmd.argument() == "on")
+ if (currentMode() == Inset::MATH_MODE && cmd.argument() == "on")
break;
cur.macroModeClose();
docstring const save_selection = grabAndEraseSelection(cur);
cur.pushLeft(*cur.nextInset());
cur.niceInsert(save_selection);
#else
- if (currentMode() == InsetBase::TEXT_MODE) {
+ if (currentMode() == Inset::TEXT_MODE) {
cur.niceInsert(MathAtom(new InsetMathHull("simple")));
cur.message(_("create new math text environment ($...$)"));
} else {
rdelim)));
}
// Don't call cur.undispatched() if we did nothing, this would
- // lead to infinite recursion via LyXText::dispatch().
+ // lead to infinite recursion via Text::dispatch().
break;
}
docstring const & name = cmd.argument();
string data;
if (name == "ref") {
- RefInset tmp(name);
+ InsetMathRef tmp(name);
data = tmp.createDialogStr(to_utf8(name));
}
cur.bv().showInsetDialog(to_utf8(name), data, 0);
}
case LFUN_INSET_INSERT: {
- MathArray ar;
+ MathData ar;
if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
recordUndo(cur);
cur.insert(ar);
}
-InsetBase * InsetMathNest::editXY(Cursor & cur, int x, int y)
+Inset * InsetMathNest::editXY(Cursor & cur, int x, int y)
{
int idx_min = 0;
int dist_min = 1000000;
idx_min = i;
}
}
- MathArray & ar = cell(idx_min);
+ MathData & ar = cell(idx_min);
cur.push(*this);
cur.idx() = idx_min;
cur.pos() = ar.x2pos(x - ar.xo(cur.bv()));
// cur.result().update(): don't overwrite previously set flags.
cur.updateFlags(Update::Decoration | Update::FitCursor | cur.result().update());
} else if (cmd.button() == mouse_button::button2) {
- MathArray ar;
+ MathData ar;
if (cap::selection()) {
- // See comment in LyXText::dispatch why we do this
+ // See comment in Text::dispatch why we do this
cap::copySelectionToStack();
cmd = FuncRequest(LFUN_PASTE, "0");
doDispatch(cur, cmd);