From 2805c297349d82c62f3b0d9c2dcc45611e748f53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sat, 16 Sep 2006 18:11:38 +0000 Subject: [PATCH] rename Math*Inset into InsetMath* git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15023 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/CutAndPaste.C | 14 +- src/cursor.C | 33 ++-- src/cursor.h | 4 +- src/cursor_slice.C | 12 +- src/cursor_slice.h | 4 +- src/dociterator.C | 4 +- src/factory.C | 2 +- src/frontends/WorkArea.h | 16 -- src/frontends/key_state.h | 13 +- src/insets/insetbase.h | 4 +- src/lyx_cb.C | 2 +- src/mathed/command_inset.C | 2 +- src/mathed/command_inset.h | 2 +- src/mathed/formulamacro.C | 6 +- src/mathed/formulamacro.h | 2 +- src/mathed/math_amsarrayinset.C | 44 +++--- src/mathed/math_amsarrayinset.h | 10 +- src/mathed/math_arrayinset.C | 46 +++--- src/mathed/math_arrayinset.h | 14 +- src/mathed/math_atom.C | 4 +- src/mathed/math_atom.h | 18 +-- src/mathed/math_biginset.C | 24 +-- src/mathed/math_biginset.h | 4 +- src/mathed/math_binominset.C | 18 +-- src/mathed/math_binominset.h | 4 +- src/mathed/math_boldsymbolinset.C | 24 +-- src/mathed/math_boldsymbolinset.h | 4 +- src/mathed/math_boxedinset.C | 20 +-- src/mathed/math_boxedinset.h | 4 +- src/mathed/math_boxinset.C | 18 +-- src/mathed/math_boxinset.h | 4 +- src/mathed/math_braceinset.C | 30 ++-- src/mathed/math_braceinset.h | 8 +- src/mathed/math_casesinset.C | 44 +++--- src/mathed/math_casesinset.h | 4 +- src/mathed/math_charinset.C | 26 ++-- src/mathed/math_charinset.h | 6 +- src/mathed/math_colorinset.C | 26 ++-- src/mathed/math_colorinset.h | 6 +- src/mathed/math_commentinset.C | 32 ++-- src/mathed/math_commentinset.h | 6 +- src/mathed/math_decorationinset.C | 32 ++-- src/mathed/math_decorationinset.h | 4 +- src/mathed/math_deliminset.C | 36 ++--- src/mathed/math_deliminset.h | 10 +- src/mathed/math_dfracinset.C | 20 +-- src/mathed/math_dfracinset.h | 4 +- src/mathed/math_diffinset.C | 26 ++-- src/mathed/math_diffinset.h | 4 +- src/mathed/math_diminset.C | 12 +- src/mathed/math_diminset.h | 4 +- src/mathed/math_dotsinset.C | 12 +- src/mathed/math_dotsinset.h | 4 +- src/mathed/math_envinset.C | 18 +-- src/mathed/math_envinset.h | 4 +- src/mathed/math_exfuncinset.C | 28 ++-- src/mathed/math_exfuncinset.h | 6 +- src/mathed/math_exintinset.C | 30 ++-- src/mathed/math_exintinset.h | 4 +- src/mathed/math_extern.C | 66 ++++---- src/mathed/math_factory.C | 96 ++++++------ src/mathed/math_factory.h | 4 +- src/mathed/math_fboxinset.C | 20 +-- src/mathed/math_fboxinset.h | 4 +- src/mathed/math_fontinset.C | 26 ++-- src/mathed/math_fontinset.h | 8 +- src/mathed/math_fontoldinset.C | 22 +-- src/mathed/math_fontoldinset.h | 4 +- src/mathed/math_fracbase.C | 12 +- src/mathed/math_fracbase.h | 4 +- src/mathed/math_fracinset.C | 38 ++--- src/mathed/math_fracinset.h | 8 +- src/mathed/math_frameboxinset.C | 18 +-- src/mathed/math_frameboxinset.h | 4 +- src/mathed/math_gridinset.C | 162 ++++++++++---------- src/mathed/math_gridinset.h | 16 +- src/mathed/math_hullinset.C | 247 +++++++++++++++--------------- src/mathed/math_hullinset.h | 16 +- src/mathed/math_inset.C | 32 ++-- src/mathed/math_inset.h | 100 ++++++------ src/mathed/math_kerninset.C | 20 +-- src/mathed/math_kerninset.h | 8 +- src/mathed/math_lefteqninset.C | 16 +- src/mathed/math_lefteqninset.h | 4 +- src/mathed/math_liminset.C | 24 +-- src/mathed/math_liminset.h | 4 +- src/mathed/math_macro.C | 16 +- src/mathed/math_macro.h | 2 +- src/mathed/math_macroarg.h | 2 +- src/mathed/math_macrotable.C | 4 +- src/mathed/math_macrotemplate.C | 6 +- src/mathed/math_macrotemplate.h | 2 +- src/mathed/math_makeboxinset.C | 20 +-- src/mathed/math_makeboxinset.h | 6 +- src/mathed/math_mathmlstream.h | 2 +- src/mathed/math_matrixinset.C | 28 ++-- src/mathed/math_matrixinset.h | 8 +- src/mathed/math_mboxinset.C | 22 +-- src/mathed/math_mboxinset.h | 4 +- src/mathed/math_nestinset.C | 174 ++++++++++----------- src/mathed/math_nestinset.h | 8 +- src/mathed/math_numberinset.C | 22 +-- src/mathed/math_numberinset.h | 6 +- src/mathed/math_oversetinset.C | 20 +-- src/mathed/math_oversetinset.h | 2 +- src/mathed/math_parinset.C | 18 +-- src/mathed/math_parinset.h | 6 +- src/mathed/math_parser.C | 226 +++++++++++++-------------- src/mathed/math_parser.h | 4 +- src/mathed/math_phantominset.C | 18 +-- src/mathed/math_phantominset.h | 4 +- src/mathed/math_rootinset.C | 26 ++-- src/mathed/math_rootinset.h | 4 +- src/mathed/math_scriptinset.C | 110 ++++++------- src/mathed/math_scriptinset.h | 12 +- src/mathed/math_sizeinset.C | 18 +-- src/mathed/math_sizeinset.h | 4 +- src/mathed/math_spaceinset.C | 32 ++-- src/mathed/math_spaceinset.h | 10 +- src/mathed/math_splitinset.C | 30 ++-- src/mathed/math_splitinset.h | 4 +- src/mathed/math_sqrtinset.C | 28 ++-- src/mathed/math_sqrtinset.h | 6 +- src/mathed/math_stackrelinset.C | 14 +- src/mathed/math_stackrelinset.h | 4 +- src/mathed/math_stringinset.C | 22 +-- src/mathed/math_stringinset.h | 8 +- src/mathed/math_substackinset.C | 42 ++--- src/mathed/math_substackinset.h | 6 +- src/mathed/math_support.C | 2 +- src/mathed/math_support.h | 4 +- src/mathed/math_symbolinset.C | 40 ++--- src/mathed/math_symbolinset.h | 10 +- src/mathed/math_tabularinset.C | 38 ++--- src/mathed/math_tabularinset.h | 12 +- src/mathed/math_tfracinset.C | 20 +-- src/mathed/math_tfracinset.h | 4 +- src/mathed/math_undersetinset.C | 22 +-- src/mathed/math_undersetinset.h | 2 +- src/mathed/math_unknowninset.C | 28 ++-- src/mathed/math_unknowninset.h | 8 +- src/mathed/math_xarrowinset.C | 20 +-- src/mathed/math_xarrowinset.h | 4 +- src/mathed/math_xyarrowinset.C | 30 ++-- src/mathed/math_xyarrowinset.h | 12 +- src/mathed/math_xymatrixinset.C | 32 ++-- src/mathed/math_xymatrixinset.h | 6 +- src/mathed/ref_inset.C | 2 +- src/text2.C | 4 +- src/text3.C | 6 +- 150 files changed, 1553 insertions(+), 1572 deletions(-) diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index eeb7e8f0e6..f0aba7cdbd 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -635,7 +635,7 @@ void pasteParagraphList(LCursor & cur, ParagraphList const & parlist, text->setCursor(cur, ppp.first, ppp.second); } - // mathed is handled in MathNestInset/MathGridInset + // mathed is handled in InsetMathNest/InsetMathGrid BOOST_ASSERT(!cur.inMathed()); } @@ -694,7 +694,7 @@ void eraseSelection(LCursor & cur) //lyxerr << "LCursor::eraseSelection begin: " << cur << endl; CursorSlice const & i1 = cur.selBegin(); CursorSlice const & i2 = cur.selEnd(); - if (i1.inset().asMathInset()) { + if (i1.inset().asInsetMath()) { cur.top() = i1; if (i1.idx() == i2.idx()) { i1.cell().erase(i1.pos(), i2.pos()); @@ -703,7 +703,7 @@ void eraseSelection(LCursor & cur) if (cur.pos() > cur.lastpos()) cur.pos() = cur.lastpos(); } else { - MathInset * p = i1.asMathInset(); + InsetMath * p = i1.asInsetMath(); InsetBase::row_type r1, r2; InsetBase::col_type c1, c2; region(i1, i2, r1, r2, c1, c2); @@ -758,7 +758,7 @@ string grabSelection(LCursor const & cur) CursorSlice i2 = cur.selEnd(); if (i1.idx() == i2.idx()) { - if (i1.inset().asMathInset()) { + if (i1.inset().asInsetMath()) { MathArray::const_iterator it = i1.cell().begin(); return asString(MathArray(it + i1.pos(), it + i2.pos())); } else { @@ -771,15 +771,15 @@ string grabSelection(LCursor const & cur) region(i1, i2, r1, r2, c1, c2); string data; - if (i1.inset().asMathInset()) { + if (i1.inset().asInsetMath()) { for (InsetBase::row_type row = r1; row <= r2; ++row) { if (row > r1) data += "\\\\"; for (InsetBase::col_type col = c1; col <= c2; ++col) { if (col > c1) data += '&'; - data += asString(i1.asMathInset()-> - cell(i1.asMathInset()->index(row, col))); + data += asString(i1.asInsetMath()-> + cell(i1.asInsetMath()->index(row, col))); } } } else { diff --git a/src/cursor.C b/src/cursor.C index 9e52a22d24..3a9ed20790 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -95,7 +95,7 @@ namespace { DocIterator it = c; it.top().pos() = 0; DocIterator et = c; - et.top().pos() = et.top().asMathInset()->cell(et.top().idx()).size(); + et.top().pos() = et.top().asInsetMath()->cell(et.top().idx()).size(); for (size_t i = 0; ; ++i) { int xo; int yo; @@ -566,7 +566,7 @@ std::ostream & operator<<(std::ostream & os, LCursor const & cur) // // The part below is the non-integrated rest of the original math // cursor. This should be either generalized for texted or moved -// back to mathed (in most cases to MathNestInset). +// back to mathed (in most cases to InsetMathNest). // /////////////////////////////////////////////////////////////////// @@ -670,7 +670,7 @@ void LCursor::insert(char_type c) BOOST_ASSERT(!empty()); if (inMathed()) { lyx::cap::selClearOrDel(*this); - insert(new MathCharInset(c)); + insert(new InsetMathChar(c)); } else { text()->insertChar(*this, c); } @@ -752,7 +752,7 @@ bool LCursor::backspace() } if (inMacroMode()) { - MathUnknownInset * p = activeMacro(); + InsetMathUnknown * p = activeMacro(); if (p->name().size() > 1) { p->setName(p->name().substr(0, p->name().size() - 1)); return true; @@ -842,7 +842,7 @@ bool LCursor::macroModeClose() { if (!inMacroMode()) return false; - MathUnknownInset * p = activeMacro(); + InsetMathUnknown * p = activeMacro(); p->finalize(); string const s = p->name(); --pos(); @@ -860,10 +860,10 @@ bool LCursor::macroModeClose() if (macro && macro->getInsetName() == name) lyxerr << "can't enter recursive macro" << endl; - MathNestInset * const in = inset().asMathInset()->asNestInset(); + InsetMathNest * const in = inset().asInsetMath()->asNestInset(); if (in && in->interpret(*this, s)) return true; - plainInsert(createMathInset(name)); + plainInsert(createInsetMath(name)); return true; } @@ -912,12 +912,12 @@ bool LCursor::inMacroMode() const { if (pos() == 0) return false; - MathUnknownInset const * p = prevAtom()->asUnknownInset(); + InsetMathUnknown const * p = prevAtom()->asUnknownInset(); return p && !p->final(); } -MathUnknownInset * LCursor::activeMacro() +InsetMathUnknown * LCursor::activeMacro() { return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : 0; } @@ -967,7 +967,7 @@ void LCursor::normalize() << pos() << ' ' << lastpos() << " in idx: " << idx() << " in atom: '"; WriteStream wi(lyxerr, false, true); - inset().asMathInset()->write(wi); + inset().asInsetMath()->write(wi); lyxerr << endl; pos() = lastpos(); } @@ -985,7 +985,8 @@ bool LCursor::goUpDown(bool up) int yo = 0; getPos(xo, yo); - // check if we had something else in mind, if not, this is the future goal + // check if we had something else in mind, if not, this is the future + // target if (x_target() == -1) x_target() = xo; else @@ -995,10 +996,10 @@ bool LCursor::goUpDown(bool up) if (!selection()) { // try left if (pos() != 0) { - MathScriptInset const * p = prevAtom()->asScriptInset(); + InsetMathScript const * p = prevAtom()->asScriptInset(); if (p && p->has(up)) { --pos(); - push(*const_cast(p)); + push(*const_cast(p)); idx() = p->idxOfScript(up); pos() = lastpos(); return true; @@ -1007,9 +1008,9 @@ bool LCursor::goUpDown(bool up) // try right if (pos() != lastpos()) { - MathScriptInset const * p = nextAtom()->asScriptInset(); + InsetMathScript const * p = nextAtom()->asScriptInset(); if (p && p->has(up)) { - push(*const_cast(p)); + push(*const_cast(p)); idx() = p->idxOfScript(up); pos() = 0; return true; @@ -1088,7 +1089,7 @@ void LCursor::handleFont(string const & font) } else { // cursor in between. split cell MathArray::iterator bt = cell().begin(); - MathAtom at = createMathInset(font); + MathAtom at = createInsetMath(font); at.nucleus()->cell(0) = MathArray(bt, bt + pos()); cell().erase(bt, bt + pos()); popLeft(); diff --git a/src/cursor.h b/src/cursor.h index ed6a35c686..e934700244 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -26,7 +26,7 @@ class Point; class LyXFont; // these should go -class MathUnknownInset; +class InsetMathUnknown; class Encoding; @@ -261,7 +261,7 @@ public: /// are we currently typing the name of a macro? bool inMacroMode() const; /// get access to the macro we are currently typing - MathUnknownInset * activeMacro(); + InsetMathUnknown * activeMacro(); /// replace selected stuff with at, placing the former // selection in given cell of atom diff --git a/src/cursor_slice.C b/src/cursor_slice.C index eda679a2e9..7425bf5f84 100644 --- a/src/cursor_slice.C +++ b/src/cursor_slice.C @@ -40,7 +40,7 @@ CursorSlice::CursorSlice(InsetBase & p) MathArray & CursorSlice::cell() const { - return inset_->asMathInset()->cell(idx_); + return inset_->asInsetMath()->cell(idx_); } @@ -59,21 +59,21 @@ Paragraph const & CursorSlice::paragraph() const CursorSlice::pos_type CursorSlice::lastpos() const { BOOST_ASSERT(inset_); - return inset_->asMathInset() ? cell().size() : paragraph().size(); + return inset_->asInsetMath() ? cell().size() : paragraph().size(); } CursorSlice::row_type CursorSlice::row() const { - BOOST_ASSERT(asMathInset()); - return asMathInset()->row(idx_); + BOOST_ASSERT(asInsetMath()); + return asInsetMath()->row(idx_); } CursorSlice::col_type CursorSlice::col() const { - BOOST_ASSERT(asMathInset()); - return asMathInset()->col(idx_); + BOOST_ASSERT(asInsetMath()); + return asInsetMath()->col(idx_); } diff --git a/src/cursor_slice.h b/src/cursor_slice.h index 3ba4dfb058..f08fe045af 100644 --- a/src/cursor_slice.h +++ b/src/cursor_slice.h @@ -109,8 +109,8 @@ public: /// /// mathed specific stuff /// - /// returns the owning inset if it is a MathInset, else 0 - MathInset * asMathInset() const { return inset_->asMathInset(); } + /// returns the owning inset if it is a InsetMath, else 0 + InsetMath * asInsetMath() const { return inset_->asInsetMath(); } /// returns cell corresponding to this position MathArray & cell() const; diff --git a/src/dociterator.C b/src/dociterator.C index 25b9a282e6..257cf4eabe 100644 --- a/src/dociterator.C +++ b/src/dociterator.C @@ -298,9 +298,9 @@ void DocIterator::forwardPos(bool ignorecollapsed) } // jump over collapsables if they are collapsed - // FIXME: the check for asMathInset() shouldn't be necessary + // FIXME: the check for asInsetMath() shouldn't be necessary // but math insets do not return a sensible editable() state yet. - if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset() + if (ignorecollapsed && nextInset() && (!nextInset()->asInsetMath() && nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) { ++top().pos(); return; diff --git a/src/factory.C b/src/factory.C index 0f3285cec8..4279534000 100644 --- a/src/factory.C +++ b/src/factory.C @@ -402,7 +402,7 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf) } else if (tmptok == "FormulaMacro") { inset.reset(new MathMacroTemplate); } else if (tmptok == "Formula") { - inset.reset(new MathHullInset); + inset.reset(new InsetMathHull); } else if (tmptok == "Graphics") { inset.reset(new InsetGraphics); } else if (tmptok == "Note") { diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index d7b7fe0f6a..7c399a1875 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -11,22 +11,6 @@ * Full author contact details are available in file CREDITS. */ -// X11 use a define called CursorShape, and we really want to use -// that name our selves. Therefore we do something similar to what is done -// in kde/fixx11h.h: -namespace X { -#ifdef CursorShape -#ifndef FIXX11H_CursorShape -#define FIXX11H_CursorShape -int const XCursorShape = CursorShape; -#undef CursorShape -int const CursorShape = CursorShape; -#endif -#undef CursorShape -#endif -} // namespace X - - #ifndef BASE_WORKAREA_H #define BASE_WORKAREA_H diff --git a/src/frontends/key_state.h b/src/frontends/key_state.h index 0f9cd19e93..ce77e170c3 100644 --- a/src/frontends/key_state.h +++ b/src/frontends/key_state.h @@ -16,12 +16,13 @@ /// modifier key states namespace key_modifier { - enum state { - none = 0, //< no modifiers held - ctrl = 1, //< control button held - alt = 2, //< alt/meta key held - shift = 4 //< shift key held - }; + +enum state { + none = 0, //< no modifiers held + ctrl = 1, //< control button held + alt = 2, //< alt/meta key held + shift = 4 //< shift key held +}; inline state operator|(state const & s1, state const & s2) diff --git a/src/insets/insetbase.h b/src/insets/insetbase.h index 23c9010741..62ec6a5025 100644 --- a/src/insets/insetbase.h +++ b/src/insets/insetbase.h @@ -23,12 +23,12 @@ class BufferView; class CursorSlice; class FuncRequest; class FuncStatus; +class InsetMath; class InsetText; class LaTeXFeatures; class LCursor; class LyXLex; class LyXText; -class MathInset; class MetricsInfo; class Dimension; class PainterInfo; @@ -65,7 +65,7 @@ public: std::auto_ptr clone() const; /// identification as math inset - virtual MathInset * asMathInset() { return 0; } + virtual InsetMath * asInsetMath() { return 0; } /// true for 'math' math inset, but not for e.g. mbox virtual bool inMathed() const { return false; } diff --git a/src/lyx_cb.C b/src/lyx_cb.C index e1af6fd8fd..4d108c860b 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -362,7 +362,7 @@ void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph) return; // clear the selection - LyXText & const text = bv->buffer()->text(); + LyXText const & text = bv->buffer()->text(); if (&text == bv->getLyXText()) bv->cursor().clearSelection(); if (asParagraph) diff --git a/src/mathed/command_inset.C b/src/mathed/command_inset.C index fcfa79d16a..e303aec832 100644 --- a/src/mathed/command_inset.C +++ b/src/mathed/command_inset.C @@ -24,7 +24,7 @@ using std::ostringstream; CommandInset::CommandInset(string const & name) - : MathNestInset(2), name_(name), set_label_(false) + : InsetMathNest(2), name_(name), set_label_(false) { lock_ = true; } diff --git a/src/mathed/command_inset.h b/src/mathed/command_inset.h index 8872cfec91..1cc5d2dac4 100644 --- a/src/mathed/command_inset.h +++ b/src/mathed/command_inset.h @@ -19,7 +19,7 @@ /// Inset for things like \name[options]{contents} -class CommandInset : public MathNestInset { +class CommandInset : public InsetMathNest { public: /// explicit CommandInset(std::string const & name); diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index d183f2a25c..3cd2f08346 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -41,20 +41,20 @@ using std::endl; InsetFormulaMacro::InsetFormulaMacro() - : MathNestInset(2), name_("unknownA") + : InsetMathNest(2), name_("unknownA") {} InsetFormulaMacro::InsetFormulaMacro (string const & name, int nargs, string const & type) - : MathNestInset(2), name_(name) + : InsetMathNest(2), name_(name) { MathMacroTable::create(MathAtom(new MathMacroTemplate(name, nargs, type))); } InsetFormulaMacro::InsetFormulaMacro(string const & s) - : MathNestInset(2), name_("unknownB") + : InsetMathNest(2), name_("unknownB") { std::istringstream is(s); read(is); diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index a6831ce1ae..03968620c9 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -23,7 +23,7 @@ class LyXLex; // MathMacroTable if it needs to know more. /// Main LyX Inset for defining math macros -class InsetFormulaMacro : public MathNestInset { +class InsetFormulaMacro : public InsetMathNest { public: /// InsetFormulaMacro(); diff --git a/src/mathed/math_amsarrayinset.C b/src/mathed/math_amsarrayinset.C index 4bcc0ab343..26bca0c610 100644 --- a/src/mathed/math_amsarrayinset.C +++ b/src/mathed/math_amsarrayinset.C @@ -32,23 +32,23 @@ using std::auto_ptr; using lyx::support::bformat; -MathAMSArrayInset::MathAMSArrayInset(string const & name, int m, int n) - : MathGridInset(m, n), name_(name) +InsetMathAMSArray::InsetMathAMSArray(string const & name, int m, int n) + : InsetMathGrid(m, n), name_(name) {} -MathAMSArrayInset::MathAMSArrayInset(string const & name) - : MathGridInset(1, 1), name_(name) +InsetMathAMSArray::InsetMathAMSArray(string const & name) + : InsetMathGrid(1, 1), name_(name) {} -auto_ptr MathAMSArrayInset::doClone() const +auto_ptr InsetMathAMSArray::doClone() const { - return auto_ptr(new MathAMSArrayInset(*this)); + return auto_ptr(new InsetMathAMSArray(*this)); } -char const * MathAMSArrayInset::name_left() const +char const * InsetMathAMSArray::name_left() const { if (name_ == "bmatrix") return "["; @@ -64,7 +64,7 @@ char const * MathAMSArrayInset::name_left() const } -char const * MathAMSArrayInset::name_right() const +char const * InsetMathAMSArray::name_right() const { if (name_ == "bmatrix") return "]"; @@ -80,27 +80,27 @@ char const * MathAMSArrayInset::name_right() const } -void MathAMSArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathAMSArray::metrics(MetricsInfo & mi, Dimension & dim) const { ArrayChanger dummy(mi.base); - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); dim.wid += 14; dim_ = dim; } -void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathAMSArray::draw(PainterInfo & pi, int x, int y) const { int const yy = y - dim_.ascent(); // Drawing the deco after an ArrayChanger does not work mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left()); mathed_draw_deco(pi, x + dim_.width() - 8, yy, 5, dim_.height(), name_right()); ArrayChanger dummy(pi.base); - MathGridInset::drawWithMargin(pi, x, y, 6, 8); + InsetMathGrid::drawWithMargin(pi, x, y, 6, 8); } -bool MathAMSArrayInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathAMSArray::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action) { @@ -113,23 +113,23 @@ bool MathAMSArrayInset::getStatus(LCursor & cur, FuncRequest const & cmd, flag.enabled(false); return true; } - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } default: - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } } -void MathAMSArrayInset::write(WriteStream & os) const +void InsetMathAMSArray::write(WriteStream & os) const { os << "\\begin{" << name_ << '}'; - MathGridInset::write(os); + InsetMathGrid::write(os); os << "\\end{" << name_ << '}'; } -void MathAMSArrayInset::infoize(std::ostream & os) const +void InsetMathAMSArray::infoize(std::ostream & os) const { string name = name_; name[0] = lyx::support::uppercase(name[0]); @@ -137,16 +137,16 @@ void MathAMSArrayInset::infoize(std::ostream & os) const } -void MathAMSArrayInset::normalize(NormalStream & os) const +void InsetMathAMSArray::normalize(NormalStream & os) const { os << '[' << name_ << ' '; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathAMSArrayInset::validate(LaTeXFeatures & features) const +void InsetMathAMSArray::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathGridInset::validate(features); + InsetMathGrid::validate(features); } diff --git a/src/mathed/math_amsarrayinset.h b/src/mathed/math_amsarrayinset.h index 8ff70cbdc8..4ca858753b 100644 --- a/src/mathed/math_amsarrayinset.h +++ b/src/mathed/math_amsarrayinset.h @@ -16,20 +16,20 @@ /// Inset for things like [pbvV]matrix, psmatrix etc -class MathAMSArrayInset : public MathGridInset { +class InsetMathAMSArray : public InsetMathGrid { public: /// - MathAMSArrayInset(std::string const & name, int m, int n); + InsetMathAMSArray(std::string const & name, int m, int n); /// - MathAMSArrayInset(std::string const & name); + InsetMathAMSArray(std::string const & name); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo & pain, int x, int y) const; /// - MathAMSArrayInset * asAMSArrayInset() { return this; } + InsetMathAMSArray * asAMSArrayInset() { return this; } /// - MathAMSArrayInset const * asAMSArrayInset() const { return this; } + InsetMathAMSArray const * asAMSArrayInset() const { return this; } /// bool getStatus(LCursor & cur, FuncRequest const & cmd, diff --git a/src/mathed/math_arrayinset.C b/src/mathed/math_arrayinset.C index be837bad25..fdf44d961b 100644 --- a/src/mathed/math_arrayinset.C +++ b/src/mathed/math_arrayinset.C @@ -31,25 +31,25 @@ using std::istream_iterator; using std::vector; -MathArrayInset::MathArrayInset(string const & name, int m, int n) - : MathGridInset(m, n), name_(name) +InsetMathArray::InsetMathArray(string const & name, int m, int n) + : InsetMathGrid(m, n), name_(name) {} -MathArrayInset::MathArrayInset(string const & name, int m, int n, +InsetMathArray::InsetMathArray(string const & name, int m, int n, char valign, string const & halign) - : MathGridInset(m, n, valign, halign), name_(name) + : InsetMathGrid(m, n, valign, halign), name_(name) {} -MathArrayInset::MathArrayInset(string const & name, char valign, +InsetMathArray::InsetMathArray(string const & name, char valign, string const & halign) - : MathGridInset(valign, halign), name_(name) + : InsetMathGrid(valign, halign), name_(name) {} -MathArrayInset::MathArrayInset(string const & name, string const & str) - : MathGridInset(1, 1), name_(name) +InsetMathArray::InsetMathArray(string const & name, string const & str) + : InsetMathGrid(1, 1), name_(name) { vector< vector > dat; istringstream is(str); @@ -72,30 +72,30 @@ MathArrayInset::MathArrayInset(string const & name, string const & str) } -auto_ptr MathArrayInset::doClone() const +auto_ptr InsetMathArray::doClone() const { - return auto_ptr(new MathArrayInset(*this)); + return auto_ptr(new InsetMathArray(*this)); } -void MathArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathArray::metrics(MetricsInfo & mi, Dimension & dim) const { ArrayChanger dummy(mi.base); - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); dim.wid += 6; dim_ = dim; } -void MathArrayInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathArray::draw(PainterInfo & pi, int x, int y) const { setPosCache(pi, x, y); ArrayChanger dummy(pi.base); - MathGridInset::drawWithMargin(pi, x, y, 4, 2); + InsetMathGrid::drawWithMargin(pi, x, y, 4, 2); } -void MathArrayInset::write(WriteStream & os) const +void InsetMathArray::write(WriteStream & os) const { if (os.fragile()) os << "\\protect"; @@ -105,7 +105,7 @@ void MathArrayInset::write(WriteStream & os) const os << '[' << char(v_align_) << ']'; os << '{' << halign() << "}\n"; - MathGridInset::write(os); + InsetMathGrid::write(os); if (os.fragile()) os << "\\protect"; @@ -115,7 +115,7 @@ void MathArrayInset::write(WriteStream & os) const } -void MathArrayInset::infoize(std::ostream & os) const +void InsetMathArray::infoize(std::ostream & os) const { string name = name_; name[0] = lyx::support::uppercase(name[0]); @@ -123,25 +123,25 @@ void MathArrayInset::infoize(std::ostream & os) const } -void MathArrayInset::normalize(NormalStream & os) const +void InsetMathArray::normalize(NormalStream & os) const { os << '[' << name_ << ' '; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathArrayInset::maple(MapleStream & os) const +void InsetMathArray::maple(MapleStream & os) const { os << "array("; - MathGridInset::maple(os); + InsetMathGrid::maple(os); os << ')'; } -void MathArrayInset::validate(LaTeXFeatures & features) const +void InsetMathArray::validate(LaTeXFeatures & features) const { if (name_ == "subarray") features.require("amsmath"); - MathGridInset::validate(features); + InsetMathGrid::validate(features); } diff --git a/src/mathed/math_arrayinset.h b/src/mathed/math_arrayinset.h index f3f9b7d5ee..e688a084f2 100644 --- a/src/mathed/math_arrayinset.h +++ b/src/mathed/math_arrayinset.h @@ -16,25 +16,25 @@ /// Inset for things like \begin{array}...\end{array} -class MathArrayInset : public MathGridInset { +class InsetMathArray : public InsetMathGrid { public: /// - MathArrayInset(std::string const &, int m, int n); + InsetMathArray(std::string const &, int m, int n); /// - MathArrayInset(std::string const &, int m, int n, + InsetMathArray(std::string const &, int m, int n, char valign, std::string const & halign); /// - MathArrayInset(std::string const &, char valign, std::string const & halign); + InsetMathArray(std::string const &, char valign, std::string const & halign); /// convenience constructor from whitespace/newline separated data - MathArrayInset(std::string const &, std::string const & str); + InsetMathArray(std::string const &, std::string const & str); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo & pi, int x, int y) const; /// - MathArrayInset * asArrayInset() { return this; } + InsetMathArray * asArrayInset() { return this; } /// - MathArrayInset const * asArrayInset() const { return this; } + InsetMathArray const * asArrayInset() const { return this; } /// void write(WriteStream & os) const; diff --git a/src/mathed/math_atom.C b/src/mathed/math_atom.C index 4b8259f1ff..bdf81d25ae 100644 --- a/src/mathed/math_atom.C +++ b/src/mathed/math_atom.C @@ -22,7 +22,7 @@ MathAtom::MathAtom() MathAtom::MathAtom(InsetBase * p) - : nucleus_(static_cast(p)) + : nucleus_(static_cast(p)) {} @@ -30,7 +30,7 @@ MathAtom::MathAtom(MathAtom const & at) : nucleus_(0) { if (at.nucleus_) - nucleus_ = static_cast(at.nucleus_->clone().release()); + nucleus_ = static_cast(at.nucleus_->clone().release()); } diff --git a/src/mathed/math_atom.h b/src/mathed/math_atom.h index e4e2ce99a4..3457a2181c 100644 --- a/src/mathed/math_atom.h +++ b/src/mathed/math_atom.h @@ -14,7 +14,7 @@ /** -Wrapper for MathInset * with copy-semantics +Wrapper for InsetMath * with copy-semantics -- @@ -29,11 +29,11 @@ Jules -- Ok: Implementing it thusly is not feasible since cursor movement gets -hackish. We use MathAtom only as a wrapper around MathInset * with value +hackish. We use MathAtom only as a wrapper around InsetMath * with value semantics. -The MathAtom owns the MathInset * and is responsible for proper cloning and -destruction. Every MathInset * should be put into a MathAtom after its +The MathAtom owns the InsetMath * and is responsible for proper cloning and +destruction. Every InsetMath * should be put into a MathAtom after its creation as soon as possible. Andre' @@ -41,7 +41,7 @@ Andre' */ class InsetBase; -class MathInset; +class InsetMath; class MathAtom { public: @@ -57,17 +57,17 @@ public: /// assignment invokes nucleus_->clone() MathAtom & operator=(MathAtom const &); /// access to the inset (checked with gprof) - MathInset * nucleus() { return nucleus_; } - MathInset const * nucleus() const { return nucleus_; } + InsetMath * nucleus() { return nucleus_; } + InsetMath const * nucleus() const { return nucleus_; } /// access to the inset - MathInset const * operator->() const { return nucleus_; } + InsetMath const * operator->() const { return nucleus_; } /// width cache. Not nice... //mutable int width_; private: /// - MathInset * nucleus_; + InsetMath * nucleus_; }; #endif diff --git a/src/mathed/math_biginset.C b/src/mathed/math_biginset.C index 9b1aaf5cb6..40f9be317e 100644 --- a/src/mathed/math_biginset.C +++ b/src/mathed/math_biginset.C @@ -22,24 +22,24 @@ using std::string; using std::auto_ptr; -MathBigInset::MathBigInset(string const & name, string const & delim) +InsetMathBig::InsetMathBig(string const & name, string const & delim) : name_(name), delim_(delim) {} -string MathBigInset::name() const +string InsetMathBig::name() const { return name_; } -auto_ptr MathBigInset::doClone() const +auto_ptr InsetMathBig::doClone() const { - return auto_ptr(new MathBigInset(*this)); + return auto_ptr(new InsetMathBig(*this)); } -MathBigInset::size_type MathBigInset::size() const +InsetMathBig::size_type InsetMathBig::size() const { // order: big Big bigg Bigg biggg Biggg // 0 1 2 3 4 5 @@ -49,7 +49,7 @@ MathBigInset::size_type MathBigInset::size() const } -double MathBigInset::increase() const +double InsetMathBig::increase() const { // The formula used in amsmath.sty is // 1.2 * (1.0 + size() * 0.5) - 1.0. @@ -59,7 +59,7 @@ double MathBigInset::increase() const } -void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const { double const h = mathed_char_ascent(mi.base.font, 'I'); double const f = increase(); @@ -70,7 +70,7 @@ void MathBigInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBigInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBig::draw(PainterInfo & pi, int x, int y) const { // mathed_draw_deco does not use the leading backslash, so remove it. // Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco @@ -84,7 +84,7 @@ void MathBigInset::draw(PainterInfo & pi, int x, int y) const } -void MathBigInset::write(WriteStream & os) const +void InsetMathBig::write(WriteStream & os) const { os << '\\' << name_ << ' ' << delim_; if (delim_[0] == '\\') @@ -92,19 +92,19 @@ void MathBigInset::write(WriteStream & os) const } -void MathBigInset::normalize(NormalStream & os) const +void InsetMathBig::normalize(NormalStream & os) const { os << '[' << name_ << ' ' << delim_ << ']'; } -void MathBigInset::infoize2(std::ostream & os) const +void InsetMathBig::infoize2(std::ostream & os) const { os << name_; } -bool MathBigInset::isBigInsetDelim(string const & delim) +bool InsetMathBig::isBigInsetDelim(string const & delim) { // mathed_draw_deco must handle these static char const * const delimiters[] = { diff --git a/src/mathed/math_biginset.h b/src/mathed/math_biginset.h index 5d85fa2fa1..c778d7a097 100644 --- a/src/mathed/math_biginset.h +++ b/src/mathed/math_biginset.h @@ -17,10 +17,10 @@ #include /// Inset for \\bigl & Co. -class MathBigInset : public MathDimInset { +class InsetMathBig : public InsetMathDim { public: /// - MathBigInset(std::string const & name, std::string const & delim); + InsetMathBig(std::string const & name, std::string const & delim); /// std::string name() const; /// diff --git a/src/mathed/math_binominset.C b/src/mathed/math_binominset.C index c2718bb049..80eafb3fd8 100644 --- a/src/mathed/math_binominset.C +++ b/src/mathed/math_binominset.C @@ -20,18 +20,18 @@ using std::max; using std::auto_ptr; -MathBinomInset::MathBinomInset(bool choose) +InsetMathBinom::InsetMathBinom(bool choose) : choose_(choose) {} -auto_ptr MathBinomInset::doClone() const +auto_ptr InsetMathBinom::doClone() const { - return auto_ptr(new MathBinomInset(*this)); + return auto_ptr(new InsetMathBinom(*this)); } -int MathBinomInset::dw() const +int InsetMathBinom::dw() const { int w = dim_.height() / 5; if (w > 15) @@ -42,7 +42,7 @@ int MathBinomInset::dw() const } -void MathBinomInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const { ScriptChanger dummy(mi.base); cell(0).metrics(mi); @@ -55,7 +55,7 @@ void MathBinomInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBinomInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBinom::draw(PainterInfo & pi, int x, int y) const { int m = x + dim_.width() / 2; ScriptChanger dummy(pi.base); @@ -68,13 +68,13 @@ void MathBinomInset::draw(PainterInfo & pi, int x, int y) const } -bool MathBinomInset::extraBraces() const +bool InsetMathBinom::extraBraces() const { return choose_; } -void MathBinomInset::write(WriteStream & os) const +void InsetMathBinom::write(WriteStream & os) const { if (choose_) os << '{' << cell(0) << " \\choose " << cell(1) << '}'; @@ -83,7 +83,7 @@ void MathBinomInset::write(WriteStream & os) const } -void MathBinomInset::normalize(NormalStream & os) const +void InsetMathBinom::normalize(NormalStream & os) const { os << "[binom " << cell(0) << ' ' << cell(1) << ']'; } diff --git a/src/mathed/math_binominset.h b/src/mathed/math_binominset.h index 28a2bbadf8..659b23d4d7 100644 --- a/src/mathed/math_binominset.h +++ b/src/mathed/math_binominset.h @@ -16,10 +16,10 @@ /// Binom like objects -class MathBinomInset : public MathFracbaseInset { +class InsetMathBinom : public InsetMathFracBase { public: /// - explicit MathBinomInset(bool choose = false); + explicit InsetMathBinom(bool choose = false); /// void write(WriteStream & os) const; /// diff --git a/src/mathed/math_boldsymbolinset.C b/src/mathed/math_boldsymbolinset.C index fc847197e4..cbb284e6b7 100644 --- a/src/mathed/math_boldsymbolinset.C +++ b/src/mathed/math_boldsymbolinset.C @@ -19,18 +19,18 @@ using std::auto_ptr; -MathBoldsymbolInset::MathBoldsymbolInset() - : MathNestInset(1) +InsetMathBoldSymbol::InsetMathBoldSymbol() + : InsetMathNest(1) {} -auto_ptr MathBoldsymbolInset::doClone() const +auto_ptr InsetMathBoldSymbol::doClone() const { - return auto_ptr(new MathBoldsymbolInset(*this)); + return auto_ptr(new InsetMathBoldSymbol(*this)); } -void MathBoldsymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const { //FontSetChanger dummy(mi.base, "mathbf"); cell(0).metrics(mi, dim); @@ -40,7 +40,7 @@ void MathBoldsymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBoldsymbolInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const { //FontSetChanger dummy(pi.base, "mathbf"); cell(0).draw(pi, x + 1, y); @@ -49,32 +49,32 @@ void MathBoldsymbolInset::draw(PainterInfo & pi, int x, int y) const } -void MathBoldsymbolInset::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const +void InsetMathBoldSymbol::metricsT(TextMetricsInfo const & mi, Dimension & /*dim*/) const { cell(0).metricsT(mi, dim_); } -void MathBoldsymbolInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const { cell(0).drawT(pain, x, y); } -void MathBoldsymbolInset::validate(LaTeXFeatures & features) const +void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const { - MathNestInset::validate(features); + InsetMathNest::validate(features); features.require("amssymb"); } -void MathBoldsymbolInset::write(WriteStream & os) const +void InsetMathBoldSymbol::write(WriteStream & os) const { os << "\\boldsymbol{" << cell(0) << "}"; } -void MathBoldsymbolInset::infoize(std::ostream & os) const +void InsetMathBoldSymbol::infoize(std::ostream & os) const { os << "Boldsymbol "; } diff --git a/src/mathed/math_boldsymbolinset.h b/src/mathed/math_boldsymbolinset.h index cb5a6eb046..76153ed318 100644 --- a/src/mathed/math_boldsymbolinset.h +++ b/src/mathed/math_boldsymbolinset.h @@ -16,10 +16,10 @@ /// Inset for AMSTeX's \boldsymbol -class MathBoldsymbolInset : public MathNestInset { +class InsetMathBoldSymbol : public InsetMathNest { public: /// - MathBoldsymbolInset(); + InsetMathBoldSymbol(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_boxedinset.C b/src/mathed/math_boxedinset.C index d16e4b169c..de36c489d9 100644 --- a/src/mathed/math_boxedinset.C +++ b/src/mathed/math_boxedinset.C @@ -24,18 +24,18 @@ using std::auto_ptr; -MathBoxedInset::MathBoxedInset() - : MathNestInset(1) +InsetMathBoxed::InsetMathBoxed() + : InsetMathNest(1) {} -auto_ptr MathBoxedInset::doClone() const +auto_ptr InsetMathBoxed::doClone() const { - return auto_ptr(new MathBoxedInset(*this)); + return auto_ptr(new InsetMathBoxed(*this)); } -void MathBoxedInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space @@ -43,7 +43,7 @@ void MathBoxedInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBoxedInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const { pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, dim_.width() - 2, dim_.height() - 2, LColor::foreground); @@ -52,25 +52,25 @@ void MathBoxedInset::draw(PainterInfo & pi, int x, int y) const } -void MathBoxedInset::write(WriteStream & os) const +void InsetMathBoxed::write(WriteStream & os) const { os << "\\boxed{" << cell(0) << '}'; } -void MathBoxedInset::normalize(NormalStream & os) const +void InsetMathBoxed::normalize(NormalStream & os) const { os << "[boxed " << cell(0) << ']'; } -void MathBoxedInset::infoize(std::ostream & os) const +void InsetMathBoxed::infoize(std::ostream & os) const { os << "Boxed: "; } -void MathBoxedInset::validate(LaTeXFeatures & features) const +void InsetMathBoxed::validate(LaTeXFeatures & features) const { features.require("amsmath"); } diff --git a/src/mathed/math_boxedinset.h b/src/mathed/math_boxedinset.h index c87ade2aab..06924e762f 100644 --- a/src/mathed/math_boxedinset.h +++ b/src/mathed/math_boxedinset.h @@ -16,10 +16,10 @@ /// Non-AMS-style frame -class MathBoxedInset : public MathNestInset { +class InsetMathBoxed : public InsetMathNest { public: /// - MathBoxedInset(); + InsetMathBoxed(); /// void validate(LaTeXFeatures & features) const; /// diff --git a/src/mathed/math_boxinset.C b/src/mathed/math_boxinset.C index a5af582e8c..7fd3ac7a80 100644 --- a/src/mathed/math_boxinset.C +++ b/src/mathed/math_boxinset.C @@ -20,24 +20,24 @@ using std::string; using std::auto_ptr; -MathBoxInset::MathBoxInset(string const & name) - : MathNestInset(1), name_(name) +InsetMathBox::InsetMathBox(string const & name) + : InsetMathNest(1), name_(name) {} -auto_ptr MathBoxInset::doClone() const +auto_ptr InsetMathBox::doClone() const { - return auto_ptr(new MathBoxInset(*this)); + return auto_ptr(new InsetMathBox(*this)); } -void MathBoxInset::write(WriteStream & os) const +void InsetMathBox::write(WriteStream & os) const { os << '\\' << name_ << '{' << cell(0) << '}'; } -void MathBoxInset::normalize(NormalStream & os) const +void InsetMathBox::normalize(NormalStream & os) const { os << '[' << name_ << ' '; //text_->write(buffer(), os); @@ -45,7 +45,7 @@ void MathBoxInset::normalize(NormalStream & os) const } -void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); cell(0).metrics(mi, dim); @@ -54,7 +54,7 @@ void MathBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBoxInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBox::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, "textnormal"); cell(0).draw(pi, x, y); @@ -62,7 +62,7 @@ void MathBoxInset::draw(PainterInfo & pi, int x, int y) const } -void MathBoxInset::infoize(std::ostream & os) const +void InsetMathBox::infoize(std::ostream & os) const { os << "Box: " << name_; } diff --git a/src/mathed/math_boxinset.h b/src/mathed/math_boxinset.h index df9bcd6cff..96629de670 100644 --- a/src/mathed/math_boxinset.h +++ b/src/mathed/math_boxinset.h @@ -21,10 +21,10 @@ class LyXFont; /// Support for \\mbox -class MathBoxInset : public MathNestInset { +class InsetMathBox : public InsetMathNest { public: /// - explicit MathBoxInset(std::string const & name); + explicit InsetMathBox(std::string const & name); /// mode_type currentMode() const { return TEXT_MODE; } /// diff --git a/src/mathed/math_braceinset.C b/src/mathed/math_braceinset.C index 7e8a702349..b8b20acc2a 100644 --- a/src/mathed/math_braceinset.C +++ b/src/mathed/math_braceinset.C @@ -22,25 +22,25 @@ using std::max; using std::auto_ptr; -MathBraceInset::MathBraceInset() - : MathNestInset(1) +InsetMathBrace::InsetMathBrace() + : InsetMathNest(1) {} -MathBraceInset::MathBraceInset(MathArray const & ar) - : MathNestInset(1) +InsetMathBrace::InsetMathBrace(MathArray const & ar) + : InsetMathNest(1) { cell(0) = ar; } -auto_ptr MathBraceInset::doClone() const +auto_ptr InsetMathBrace::doClone() const { - return auto_ptr(new MathBraceInset(*this)); + return auto_ptr(new InsetMathBrace(*this)); } -void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi); Dimension t; @@ -53,7 +53,7 @@ void MathBraceInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathBraceInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const { LyXFont font = pi.base.font; font.setColor(LColor::latex); @@ -66,43 +66,43 @@ void MathBraceInset::draw(PainterInfo & pi, int x, int y) const } -void MathBraceInset::write(WriteStream & os) const +void InsetMathBrace::write(WriteStream & os) const { os << '{' << cell(0) << '}'; } -void MathBraceInset::normalize(NormalStream & os) const +void InsetMathBrace::normalize(NormalStream & os) const { os << "[block " << cell(0) << ']'; } -void MathBraceInset::maple(MapleStream & os) const +void InsetMathBrace::maple(MapleStream & os) const { os << cell(0); } -void MathBraceInset::octave(OctaveStream & os) const +void InsetMathBrace::octave(OctaveStream & os) const { os << cell(0); } -void MathBraceInset::mathmlize(MathMLStream & os) const +void InsetMathBrace::mathmlize(MathMLStream & os) const { os << MTag("mrow") << cell(0) << ETag("mrow"); } -void MathBraceInset::mathematica(MathematicaStream & os) const +void InsetMathBrace::mathematica(MathematicaStream & os) const { os << cell(0); } -void MathBraceInset::infoize(std::ostream & os) const +void InsetMathBrace::infoize(std::ostream & os) const { os << "Nested Block: "; } diff --git a/src/mathed/math_braceinset.h b/src/mathed/math_braceinset.h index c6c0af1747..1eb3939999 100644 --- a/src/mathed/math_braceinset.h +++ b/src/mathed/math_braceinset.h @@ -16,14 +16,14 @@ /// Extra nesting -class MathBraceInset : public MathNestInset { +class InsetMathBrace : public InsetMathNest { public: /// - MathBraceInset(); + InsetMathBrace(); /// - MathBraceInset(MathArray const & ar); + InsetMathBrace(MathArray const & ar); /// - MathBraceInset const * asBraceInset() const { return this; } + InsetMathBrace const * asBraceInset() const { return this; } /// we write extra braces in any case... bool extraBraces() const { return true; } /// diff --git a/src/mathed/math_casesinset.C b/src/mathed/math_casesinset.C index 60ad0d57b2..0e1695075d 100644 --- a/src/mathed/math_casesinset.C +++ b/src/mathed/math_casesinset.C @@ -37,36 +37,36 @@ using std::string; using std::auto_ptr; -MathCasesInset::MathCasesInset(row_type n) - : MathGridInset(2, n, 'c', "ll") +InsetMathCases::InsetMathCases(row_type n) + : InsetMathGrid(2, n, 'c', "ll") {} -auto_ptr MathCasesInset::doClone() const +auto_ptr InsetMathCases::doClone() const { - return auto_ptr(new MathCasesInset(*this)); + return auto_ptr(new InsetMathCases(*this)); } -void MathCasesInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathCases::metrics(MetricsInfo & mi, Dimension & dim) const { - MathGridInset::metrics(mi); + InsetMathGrid::metrics(mi); dim_.wid += 8; dim = dim_; } -void MathCasesInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathCases::draw(PainterInfo & pi, int x, int y) const { mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 6, dim_.height(), "{"); - MathGridInset::drawWithMargin(pi, x, y, 8, 0); + InsetMathGrid::drawWithMargin(pi, x, y, 8, 0); setPosCache(pi, x, y); } -void MathCasesInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathCases::doDispatch(LCursor & cur, FuncRequest & cmd) { - //lyxerr << "*** MathCasesInset: request: " << cmd << endl; + //lyxerr << "*** InsetMathCases: request: " << cmd << endl; switch (cmd.action) { case LFUN_TABULAR_FEATURE: { recordUndo(cur); @@ -77,12 +77,12 @@ void MathCasesInset::doDispatch(LCursor & cur, FuncRequest & cmd) } } default: - MathGridInset::doDispatch(cur, cmd); + InsetMathGrid::doDispatch(cur, cmd); } } -bool MathCasesInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathCases::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action) { @@ -97,47 +97,47 @@ bool MathCasesInset::getStatus(LCursor & cur, FuncRequest const & cmd, } } default: - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } } -void MathCasesInset::write(WriteStream & os) const +void InsetMathCases::write(WriteStream & os) const { if (os.fragile()) os << "\\protect"; os << "\\begin{cases}\n"; - MathGridInset::write(os); + InsetMathGrid::write(os); if (os.fragile()) os << "\\protect"; os << "\\end{cases}"; } -void MathCasesInset::normalize(NormalStream & os) const +void InsetMathCases::normalize(NormalStream & os) const { os << "[cases "; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathCasesInset::maple(MapleStream & os) const +void InsetMathCases::maple(MapleStream & os) const { os << "cases("; - MathGridInset::maple(os); + InsetMathGrid::maple(os); os << ')'; } -void MathCasesInset::infoize(std::ostream & os) const +void InsetMathCases::infoize(std::ostream & os) const { os << "Cases "; } -void MathCasesInset::validate(LaTeXFeatures & features) const +void InsetMathCases::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathGridInset::validate(features); + InsetMathGrid::validate(features); } diff --git a/src/mathed/math_casesinset.h b/src/mathed/math_casesinset.h index f28776c51b..d868fba09b 100644 --- a/src/mathed/math_casesinset.h +++ b/src/mathed/math_casesinset.h @@ -17,10 +17,10 @@ class LaTeXFeatures; -class MathCasesInset : public MathGridInset { +class InsetMathCases : public InsetMathGrid { public: /// - explicit MathCasesInset(row_type rows = 1u); + explicit InsetMathCases(row_type rows = 1u); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index 290815d88b..309bf4a63c 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -40,19 +40,19 @@ namespace { } -MathCharInset::MathCharInset(char c) +InsetMathChar::InsetMathChar(char c) : char_(c) {} -auto_ptr MathCharInset::doClone() const +auto_ptr InsetMathChar::doClone() const { - return auto_ptr(new MathCharInset(*this)); + return auto_ptr(new InsetMathChar(*this)); } -void MathCharInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathChar::metrics(MetricsInfo & mi, Dimension & dim) const { #if 1 if (char_ == '=' && has_math_fonts) { @@ -77,13 +77,13 @@ void MathCharInset::metrics(MetricsInfo & mi, Dimension & dim) const mathed_char_dim(font_, char_, dim_); if (isBinaryOp(char_, code_)) width_ += 2 * font_metrics::width(' ', font_); - lyxerr << "MathCharInset::metrics: " << dim << endl; + lyxerr << "InsetMathChar::metrics: " << dim << endl; #endif width_ = dim.wid; } -void MathCharInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathChar::draw(PainterInfo & pi, int x, int y) const { //lyxerr << "drawing '" << char_ << "' font: " << pi.base.fontname << endl; int const em = mathed_char_width(pi.base.font, 'M'); @@ -110,7 +110,7 @@ void MathCharInset::draw(PainterInfo & pi, int x, int y) const } -void MathCharInset::metricsT(TextMetricsInfo const &, Dimension & dim) const +void InsetMathChar::metricsT(TextMetricsInfo const &, Dimension & dim) const { dim.wid = 1; dim.asc = 1; @@ -118,32 +118,32 @@ void MathCharInset::metricsT(TextMetricsInfo const &, Dimension & dim) const } -void MathCharInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathChar::drawT(TextPainter & pain, int x, int y) const { //lyxerr << "drawing text '" << char_ << "' code: " << code_ << endl; pain.draw(x, y, char_); } -void MathCharInset::write(WriteStream & os) const +void InsetMathChar::write(WriteStream & os) const { os << char_; } -void MathCharInset::normalize(NormalStream & os) const +void InsetMathChar::normalize(NormalStream & os) const { os << "[char " << char_ << " mathalpha]"; } -void MathCharInset::octave(OctaveStream & os) const +void InsetMathChar::octave(OctaveStream & os) const { os << char_; } -void MathCharInset::mathmlize(MathMLStream & ms) const +void InsetMathChar::mathmlize(MathMLStream & ms) const { switch (char_) { case '<': ms << "<"; break; @@ -154,7 +154,7 @@ void MathCharInset::mathmlize(MathMLStream & ms) const } -bool MathCharInset::isRelOp() const +bool InsetMathChar::isRelOp() const { return char_ == '=' || char_ == '<' || char_ == '>'; } diff --git a/src/mathed/math_charinset.h b/src/mathed/math_charinset.h index a40f577d47..cf8ca1fc62 100644 --- a/src/mathed/math_charinset.h +++ b/src/mathed/math_charinset.h @@ -16,10 +16,10 @@ /// The base character inset. -class MathCharInset : public MathInset { +class InsetMathChar : public InsetMath { public: /// - explicit MathCharInset(char c); + explicit InsetMathChar(char c); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// @@ -40,7 +40,7 @@ public: /// void mathmlize(MathMLStream & ms) const; /// identifies Charinsets - MathCharInset const * asCharInset() const { return this; } + InsetMathChar const * asCharInset() const { return this; } /// char getChar() const { return char_; } /// diff --git a/src/mathed/math_colorinset.C b/src/mathed/math_colorinset.C index e630ebc95d..d05f44ad98 100644 --- a/src/mathed/math_colorinset.C +++ b/src/mathed/math_colorinset.C @@ -35,24 +35,24 @@ bool normalcolor(string const & color) } // namespace anon -MathColorInset::MathColorInset(bool oldstyle, LColor_color const & color) - : MathNestInset(1), oldstyle_(oldstyle), +InsetMathColor::InsetMathColor(bool oldstyle, LColor_color const & color) + : InsetMathNest(1), oldstyle_(oldstyle), color_(lcolor.getLaTeXName(color)) {} -MathColorInset::MathColorInset(bool oldstyle, string const & color) - : MathNestInset(1), oldstyle_(oldstyle), color_(color) +InsetMathColor::InsetMathColor(bool oldstyle, string const & color) + : InsetMathNest(1), oldstyle_(oldstyle), color_(color) {} -auto_ptr MathColorInset::doClone() const +auto_ptr InsetMathColor::doClone() const { - return auto_ptr(new MathColorInset(*this)); + return auto_ptr(new InsetMathColor(*this)); } -void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathColor::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers(dim); @@ -60,7 +60,7 @@ void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathColorInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathColor::draw(PainterInfo & pi, int x, int y) const { LColor_color origcol = pi.base.font.color(); pi.base.font.setColor(lcolor.getFromLaTeXName(color_)); @@ -71,15 +71,15 @@ void MathColorInset::draw(PainterInfo & pi, int x, int y) const } -void MathColorInset::validate(LaTeXFeatures & features) const +void InsetMathColor::validate(LaTeXFeatures & features) const { - MathNestInset::validate(features); + InsetMathNest::validate(features); if (!normalcolor(color_)) features.require("color"); } -void MathColorInset::write(WriteStream & os) const +void InsetMathColor::write(WriteStream & os) const { if (normalcolor(color_)) // reset to default color inside another color inset @@ -91,13 +91,13 @@ void MathColorInset::write(WriteStream & os) const } -void MathColorInset::normalize(NormalStream & os) const +void InsetMathColor::normalize(NormalStream & os) const { os << "[color " << color_ << ' ' << cell(0) << ']'; } -void MathColorInset::infoize(std::ostream & os) const +void InsetMathColor::infoize(std::ostream & os) const { os << "Color: " << color_; } diff --git a/src/mathed/math_colorinset.h b/src/mathed/math_colorinset.h index 6eec693f4f..539345faa9 100644 --- a/src/mathed/math_colorinset.h +++ b/src/mathed/math_colorinset.h @@ -18,13 +18,13 @@ /// Change colours. -class MathColorInset : public MathNestInset { +class InsetMathColor : public InsetMathNest { public: /// Create a color inset from LyX color number - explicit MathColorInset(bool oldstyle, + explicit InsetMathColor(bool oldstyle, LColor_color const & color = LColor::none); /// Create a color inset from LaTeX color name - explicit MathColorInset(bool oldstyle, std::string const & color); + explicit InsetMathColor(bool oldstyle, std::string const & color); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// we write extra braces in any case... diff --git a/src/mathed/math_commentinset.C b/src/mathed/math_commentinset.C index 790871ccbe..11c09080bb 100644 --- a/src/mathed/math_commentinset.C +++ b/src/mathed/math_commentinset.C @@ -20,25 +20,25 @@ using std::string; using std::auto_ptr; -MathCommentInset::MathCommentInset() - : MathNestInset(1) +InsetMathComment::InsetMathComment() + : InsetMathNest(1) {} -MathCommentInset::MathCommentInset(string const & str) - : MathNestInset(1) +InsetMathComment::InsetMathComment(string const & str) + : InsetMathNest(1) { asArray(str, cell(0)); } -auto_ptr MathCommentInset::doClone() const +auto_ptr InsetMathComment::doClone() const { - return auto_ptr(new MathCommentInset(*this)); + return auto_ptr(new InsetMathComment(*this)); } -void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers(dim); @@ -46,52 +46,52 @@ void MathCommentInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathCommentInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathComment::draw(PainterInfo & pi, int x, int y) const { cell(0).draw(pi, x + 1, y); drawMarkers(pi, x, y); } -void MathCommentInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathComment::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { cell(0).metricsT(mi, dim); } -void MathCommentInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathComment::drawT(TextPainter & pain, int x, int y) const { cell(0).drawT(pain, x, y); } -void MathCommentInset::write(WriteStream & os) const +void InsetMathComment::write(WriteStream & os) const { os << '%' << cell(0) << "\n"; } -void MathCommentInset::maple(MapleStream & os) const +void InsetMathComment::maple(MapleStream & os) const { os << '#' << cell(0) << "\n"; } -void MathCommentInset::mathematica(MathematicaStream &) const +void InsetMathComment::mathematica(MathematicaStream &) const {} -void MathCommentInset::octave(OctaveStream &) const +void InsetMathComment::octave(OctaveStream &) const {} -void MathCommentInset::mathmlize(MathMLStream & os) const +void InsetMathComment::mathmlize(MathMLStream & os) const { os << MTag("comment") << cell(0) << cell(1) << ETag("comment"); } -void MathCommentInset::infoize(std::ostream & os) const +void InsetMathComment::infoize(std::ostream & os) const { os << "Comment"; } diff --git a/src/mathed/math_commentinset.h b/src/mathed/math_commentinset.h index 509ae0c661..40653b0826 100644 --- a/src/mathed/math_commentinset.h +++ b/src/mathed/math_commentinset.h @@ -18,12 +18,12 @@ class latexkeys; /// Inset for end-of-line comments -class MathCommentInset : public MathNestInset { +class InsetMathComment : public InsetMathNest { public: /// - MathCommentInset(); + InsetMathComment(); /// - explicit MathCommentInset(std::string const &); + explicit InsetMathComment(std::string const &); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_decorationinset.C b/src/mathed/math_decorationinset.C index eddbbf7ce1..2c836e2a86 100644 --- a/src/mathed/math_decorationinset.C +++ b/src/mathed/math_decorationinset.C @@ -24,26 +24,26 @@ #include "support/std_ostream.h" -MathDecorationInset::MathDecorationInset(latexkeys const * key) - : MathNestInset(1), key_(key) +InsetMathDecoration::InsetMathDecoration(latexkeys const * key) + : InsetMathNest(1), key_(key) { // lyxerr << " creating deco " << key->name << std::endl; } -std::auto_ptr MathDecorationInset::doClone() const +std::auto_ptr InsetMathDecoration::doClone() const { - return std::auto_ptr(new MathDecorationInset(*this)); + return std::auto_ptr(new InsetMathDecoration(*this)); } -bool MathDecorationInset::upper() const +bool InsetMathDecoration::upper() const { return key_->name.substr(0, 5) != "under"; } -bool MathDecorationInset::isScriptable() const +bool InsetMathDecoration::isScriptable() const { return key_->name == "overbrace" || @@ -57,7 +57,7 @@ bool MathDecorationInset::isScriptable() const } -bool MathDecorationInset::protect() const +bool InsetMathDecoration::protect() const { return key_->name == "overbrace" || @@ -71,7 +71,7 @@ bool MathDecorationInset::protect() const } -bool MathDecorationInset::wide() const +bool InsetMathDecoration::wide() const { return key_->name == "overline" || @@ -89,7 +89,7 @@ bool MathDecorationInset::wide() const } -bool MathDecorationInset::ams() const +bool InsetMathDecoration::ams() const { return key_->name == "overleftrightarrow" || @@ -99,7 +99,7 @@ bool MathDecorationInset::ams() const } -void MathDecorationInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathDecoration::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); @@ -119,7 +119,7 @@ void MathDecorationInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathDecoration::draw(PainterInfo & pi, int x, int y) const { cell(0).draw(pi, x + 1, y); if (wide()) @@ -132,7 +132,7 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const } -void MathDecorationInset::write(WriteStream & os) const +void InsetMathDecoration::write(WriteStream & os) const { if (os.fragile() && protect()) os << "\\protect"; @@ -140,21 +140,21 @@ void MathDecorationInset::write(WriteStream & os) const } -void MathDecorationInset::normalize(NormalStream & os) const +void InsetMathDecoration::normalize(NormalStream & os) const { os << "[deco " << key_->name << ' ' << cell(0) << ']'; } -void MathDecorationInset::infoize(std::ostream & os) const +void InsetMathDecoration::infoize(std::ostream & os) const { os << "Deco: " << key_->name; } -void MathDecorationInset::validate(LaTeXFeatures & features) const +void InsetMathDecoration::validate(LaTeXFeatures & features) const { if (ams()) features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_decorationinset.h b/src/mathed/math_decorationinset.h index 2878523e2e..4dbdb60f4b 100644 --- a/src/mathed/math_decorationinset.h +++ b/src/mathed/math_decorationinset.h @@ -19,10 +19,10 @@ class latexkeys; /// Decorations and accents over (below) a math object -class MathDecorationInset : public MathNestInset { +class InsetMathDecoration : public InsetMathNest { public: /// - explicit MathDecorationInset(latexkeys const * key); + explicit InsetMathDecoration(latexkeys const * key); /// void draw(PainterInfo &, int x, int y) const; /// diff --git a/src/mathed/math_deliminset.C b/src/mathed/math_deliminset.C index 1e179f8bed..460e3350f2 100644 --- a/src/mathed/math_deliminset.C +++ b/src/mathed/math_deliminset.C @@ -51,40 +51,40 @@ string convertDelimToLatexName(string const & name) -MathDelimInset::MathDelimInset(string const & l, string const & r) - : MathNestInset(1), left_(l), right_(r) +InsetMathDelim::InsetMathDelim(string const & l, string const & r) + : InsetMathNest(1), left_(l), right_(r) {} -MathDelimInset::MathDelimInset +InsetMathDelim::InsetMathDelim (string const & l, string const & r, MathArray const & ar) - : MathNestInset(1), left_(l), right_(r) + : InsetMathNest(1), left_(l), right_(r) { cell(0) = ar; } -auto_ptr MathDelimInset::doClone() const +auto_ptr InsetMathDelim::doClone() const { - return auto_ptr(new MathDelimInset(*this)); + return auto_ptr(new InsetMathDelim(*this)); } -void MathDelimInset::write(WriteStream & os) const +void InsetMathDelim::write(WriteStream & os) const { os << "\\left" << convertDelimToLatexName(left_) << cell(0) << "\\right" << convertDelimToLatexName(right_); } -void MathDelimInset::normalize(NormalStream & os) const +void InsetMathDelim::normalize(NormalStream & os) const { os << "[delim " << convertDelimToLatexName(left_) << ' ' << convertDelimToLatexName(right_) << ' ' << cell(0) << ']'; } -void MathDelimInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathDelim::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi); Dimension t; @@ -104,7 +104,7 @@ void MathDelimInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathDelimInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathDelim::draw(PainterInfo & pi, int x, int y) const { int const b = y - dim_.asc; cell(0).draw(pi, x + dw_ + 4, y); @@ -115,25 +115,25 @@ void MathDelimInset::draw(PainterInfo & pi, int x, int y) const } -bool MathDelimInset::isParenthesis() const +bool InsetMathDelim::isParenthesis() const { return left_ == "(" && right_ == ")"; } -bool MathDelimInset::isBrackets() const +bool InsetMathDelim::isBrackets() const { return left_ == "[" && right_ == "]"; } -bool MathDelimInset::isAbs() const +bool InsetMathDelim::isAbs() const { return left_ == "|" && right_ == "|"; } -void MathDelimInset::maple(MapleStream & os) const +void InsetMathDelim::maple(MapleStream & os) const { if (isAbs()) { if (cell(0).size() == 1 && cell(0).front()->asMatrixInset()) @@ -145,7 +145,7 @@ void MathDelimInset::maple(MapleStream & os) const os << left_ << cell(0) << right_; } -void MathDelimInset::maxima(MaximaStream & os) const +void InsetMathDelim::maxima(MaximaStream & os) const { if (isAbs()) { if (cell(0).size() == 1 && cell(0).front()->asMatrixInset()) @@ -158,7 +158,7 @@ void MathDelimInset::maxima(MaximaStream & os) const } -void MathDelimInset::mathematica(MathematicaStream & os) const +void InsetMathDelim::mathematica(MathematicaStream & os) const { if (isAbs()) { if (cell(0).size() == 1 && cell(0).front()->asMatrixInset()) @@ -171,14 +171,14 @@ void MathDelimInset::mathematica(MathematicaStream & os) const } -void MathDelimInset::mathmlize(MathMLStream & os) const +void InsetMathDelim::mathmlize(MathMLStream & os) const { os << "" << cell(0) << ""; } -void MathDelimInset::octave(OctaveStream & os) const +void InsetMathDelim::octave(OctaveStream & os) const { if (isAbs()) os << "det(" << cell(0) << ')'; diff --git a/src/mathed/math_deliminset.h b/src/mathed/math_deliminset.h index 41b1f7044a..baefcd347d 100644 --- a/src/mathed/math_deliminset.h +++ b/src/mathed/math_deliminset.h @@ -19,16 +19,16 @@ /// A delimiter -class MathDelimInset : public MathNestInset { +class InsetMathDelim : public InsetMathNest { public: /// - MathDelimInset(std::string const & left, std::string const & right); + InsetMathDelim(std::string const & left, std::string const & right); /// - MathDelimInset(std::string const & left, std::string const & right, MathArray const &); + InsetMathDelim(std::string const & left, std::string const & right, MathArray const &); /// - MathDelimInset * asDelimInset() { return this; } + InsetMathDelim * asDelimInset() { return this; } /// - MathDelimInset const * asDelimInset() const { return this; } + InsetMathDelim const * asDelimInset() const { return this; } /// is it (...)? bool isParenthesis() const; /// is it [...]? diff --git a/src/mathed/math_dfracinset.C b/src/mathed/math_dfracinset.C index 164b3c705b..d73d470c49 100644 --- a/src/mathed/math_dfracinset.C +++ b/src/mathed/math_dfracinset.C @@ -23,18 +23,18 @@ using std::max; using std::auto_ptr; -MathDfracInset::MathDfracInset() - : MathFracInset() +InsetMathDFrac::InsetMathDFrac() + : InsetMathFrac() {} -auto_ptr MathDfracInset::doClone() const +auto_ptr InsetMathDFrac::doClone() const { - return auto_ptr(new MathDfracInset(*this)); + return auto_ptr(new InsetMathDFrac(*this)); } -void MathDfracInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathDFrac::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi); cell(1).metrics(mi); @@ -45,7 +45,7 @@ void MathDfracInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathDfracInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathDFrac::draw(PainterInfo & pi, int x, int y) const { int m = x + dim_.wid / 2; cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); @@ -55,20 +55,20 @@ void MathDfracInset::draw(PainterInfo & pi, int x, int y) const } -string MathDfracInset::name() const +string InsetMathDFrac::name() const { return "dfrac"; } -void MathDfracInset::mathmlize(MathMLStream & os) const +void InsetMathDFrac::mathmlize(MathMLStream & os) const { os << MTag("mdfrac") << cell(0) << cell(1) << ETag("mdfrac"); } -void MathDfracInset::validate(LaTeXFeatures & features) const +void InsetMathDFrac::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_dfracinset.h b/src/mathed/math_dfracinset.h index 1a24b1b5e6..e294f25c7e 100644 --- a/src/mathed/math_dfracinset.h +++ b/src/mathed/math_dfracinset.h @@ -16,10 +16,10 @@ /// \dfrac support -class MathDfracInset : public MathFracInset { +class InsetMathDFrac : public InsetMathFrac { public: /// - MathDfracInset(); + InsetMathDFrac(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_diffinset.C b/src/mathed/math_diffinset.C index a8f4f35ede..3882df30e9 100644 --- a/src/mathed/math_diffinset.C +++ b/src/mathed/math_diffinset.C @@ -19,24 +19,24 @@ using std::auto_ptr; using std::endl; -MathDiffInset::MathDiffInset() - : MathNestInset(1) +InsetMathDiff::InsetMathDiff() + : InsetMathNest(1) {} -auto_ptr MathDiffInset::doClone() const +auto_ptr InsetMathDiff::doClone() const { - return auto_ptr(new MathDiffInset(*this)); + return auto_ptr(new InsetMathDiff(*this)); } -void MathDiffInset::addDer(MathArray const & der) +void InsetMathDiff::addDer(MathArray const & der) { cells_.push_back(der); } -void MathDiffInset::normalize(NormalStream & os) const +void InsetMathDiff::normalize(NormalStream & os) const { os << "[diff"; for (idx_type idx = 0; idx < nargs(); ++idx) @@ -45,19 +45,19 @@ void MathDiffInset::normalize(NormalStream & os) const } -void MathDiffInset::metrics(MetricsInfo &, Dimension &) const +void InsetMathDiff::metrics(MetricsInfo &, Dimension &) const { lyxerr << "should not happen" << endl; } -void MathDiffInset::draw(PainterInfo &, int, int) const +void InsetMathDiff::draw(PainterInfo &, int, int) const { lyxerr << "should not happen" << endl; } -void MathDiffInset::maple(MapleStream & os) const +void InsetMathDiff::maple(MapleStream & os) const { os << "diff("; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -69,7 +69,7 @@ void MathDiffInset::maple(MapleStream & os) const } -void MathDiffInset::maxima(MaximaStream & os) const +void InsetMathDiff::maxima(MaximaStream & os) const { os << "diff("; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -83,7 +83,7 @@ void MathDiffInset::maxima(MaximaStream & os) const } -void MathDiffInset::mathematica(MathematicaStream & os) const +void InsetMathDiff::mathematica(MathematicaStream & os) const { os << "D["; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -95,7 +95,7 @@ void MathDiffInset::mathematica(MathematicaStream & os) const } -void MathDiffInset::mathmlize(MathMLStream & os) const +void InsetMathDiff::mathmlize(MathMLStream & os) const { os << "diff("; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -107,7 +107,7 @@ void MathDiffInset::mathmlize(MathMLStream & os) const } -void MathDiffInset::write(WriteStream &) const +void InsetMathDiff::write(WriteStream &) const { lyxerr << "should not happen" << endl; } diff --git a/src/mathed/math_diffinset.h b/src/mathed/math_diffinset.h index 7e5a190ce0..034e1ef90f 100644 --- a/src/mathed/math_diffinset.h +++ b/src/mathed/math_diffinset.h @@ -18,10 +18,10 @@ #include "math_nestinset.h" -class MathDiffInset : public MathNestInset { +class InsetMathDiff : public InsetMathNest { public: /// - MathDiffInset(); + InsetMathDiff(); /// void addDer(MathArray const & der); /// diff --git a/src/mathed/math_diminset.C b/src/mathed/math_diminset.C index 939e4b89a8..2908fbc3dd 100644 --- a/src/mathed/math_diminset.C +++ b/src/mathed/math_diminset.C @@ -15,30 +15,30 @@ #include "debug.h" -MathDimInset::MathDimInset() +InsetMathDim::InsetMathDim() {} -int MathDimInset::ascent() const +int InsetMathDim::ascent() const { return dim_.asc; } -int MathDimInset::descent() const +int InsetMathDim::descent() const { return dim_.des; } -int MathDimInset::width() const +int InsetMathDim::width() const { return dim_.wid; } -void MathDimInset::setPosCache(PainterInfo const &, int x, int y) const +void InsetMathDim::setPosCache(PainterInfo const &, int x, int y) const { - //lyxerr << "MathDimInset: cache to " << x << " " << y << std::endl; + //lyxerr << "InsetMathDim: cache to " << x << " " << y << std::endl; theCoords.insets().add(this, x, y); } diff --git a/src/mathed/math_diminset.h b/src/mathed/math_diminset.h index 3294e8f12e..990516d03d 100644 --- a/src/mathed/math_diminset.h +++ b/src/mathed/math_diminset.h @@ -19,10 +19,10 @@ class PainterInfo; /// things that need the dimension cache -class MathDimInset : public MathInset { +class InsetMathDim : public InsetMath { public: /// - MathDimInset(); + InsetMathDim(); /// Dimension dimensions() const { return dim_; } diff --git a/src/mathed/math_dotsinset.C b/src/mathed/math_dotsinset.C index 1c7b4ff3a9..9411f11096 100644 --- a/src/mathed/math_dotsinset.C +++ b/src/mathed/math_dotsinset.C @@ -21,18 +21,18 @@ using std::string; using std::auto_ptr; -MathDotsInset::MathDotsInset(latexkeys const * key) +InsetMathDots::InsetMathDots(latexkeys const * key) : key_(key) {} -auto_ptr MathDotsInset::doClone() const +auto_ptr InsetMathDots::doClone() const { - return auto_ptr(new MathDotsInset(*this)); + return auto_ptr(new InsetMathDots(*this)); } -void MathDotsInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const { mathed_char_dim(mi.base.font, 'M', dim); dh_ = 0; @@ -51,7 +51,7 @@ void MathDotsInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathDotsInset::draw(PainterInfo & pain, int x, int y) const +void InsetMathDots::draw(PainterInfo & pain, int x, int y) const { mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(), key_->name); @@ -65,7 +65,7 @@ void MathDotsInset::draw(PainterInfo & pain, int x, int y) const } -string MathDotsInset::name() const +string InsetMathDots::name() const { return key_->name; } diff --git a/src/mathed/math_dotsinset.h b/src/mathed/math_dotsinset.h index 90cd39ade8..f923f5d467 100644 --- a/src/mathed/math_dotsinset.h +++ b/src/mathed/math_dotsinset.h @@ -18,10 +18,10 @@ class latexkeys; /// The different kinds of ellipsis -class MathDotsInset : public MathDimInset { +class InsetMathDots : public InsetMathDim { public: /// - explicit MathDotsInset(latexkeys const * l); + explicit InsetMathDots(latexkeys const * l); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_envinset.C b/src/mathed/math_envinset.C index 14942be2b1..98e69b864a 100644 --- a/src/mathed/math_envinset.C +++ b/src/mathed/math_envinset.C @@ -21,18 +21,18 @@ using std::string; using std::auto_ptr; -MathEnvInset::MathEnvInset(string const & name) - : MathNestInset(1), name_(name) +InsetMathEnv::InsetMathEnv(string const & name) + : InsetMathNest(1), name_(name) {} -auto_ptr MathEnvInset::doClone() const +auto_ptr InsetMathEnv::doClone() const { - return auto_ptr(new MathEnvInset(*this)); + return auto_ptr(new InsetMathEnv(*this)); } -void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers(dim); @@ -40,26 +40,26 @@ void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathEnvInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const { cell(0).draw(pi, x + 1, y); drawMarkers(pi, x, y); } -void MathEnvInset::write(WriteStream & os) const +void InsetMathEnv::write(WriteStream & os) const { os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}'; } -void MathEnvInset::normalize(NormalStream & os) const +void InsetMathEnv::normalize(NormalStream & os) const { os << "[env " << name_ << ' ' << cell(0) << ']'; } -void MathEnvInset::infoize(std::ostream & os) const +void InsetMathEnv::infoize(std::ostream & os) const { os << "Env: " << name_; } diff --git a/src/mathed/math_envinset.h b/src/mathed/math_envinset.h index ab32bda5e6..4bf3298acf 100644 --- a/src/mathed/math_envinset.h +++ b/src/mathed/math_envinset.h @@ -18,10 +18,10 @@ /// Environtments á la \begin{something}...\end{something} -class MathEnvInset : public MathNestInset { +class InsetMathEnv : public InsetMathNest { public: /// - MathEnvInset(std::string const & name_); + InsetMathEnv(std::string const & name_); /// void draw(PainterInfo &, int x, int y) const; /// diff --git a/src/mathed/math_exfuncinset.C b/src/mathed/math_exfuncinset.C index c3b9a82989..348d82d1f1 100644 --- a/src/mathed/math_exfuncinset.C +++ b/src/mathed/math_exfuncinset.C @@ -21,43 +21,43 @@ using std::string; using std::auto_ptr; -MathExFuncInset::MathExFuncInset(string const & name) - : MathNestInset(1), name_(name) +InsetMathExFunc::InsetMathExFunc(string const & name) + : InsetMathNest(1), name_(name) {} -MathExFuncInset::MathExFuncInset(string const & name, MathArray const & ar) - : MathNestInset(1), name_(name) +InsetMathExFunc::InsetMathExFunc(string const & name, MathArray const & ar) + : InsetMathNest(1), name_(name) { cell(0) = ar; } -auto_ptr MathExFuncInset::doClone() const +auto_ptr InsetMathExFunc::doClone() const { - return auto_ptr(new MathExFuncInset(*this)); + return auto_ptr(new InsetMathExFunc(*this)); } -void MathExFuncInset::metrics(MetricsInfo & mi, Dimension & /*dim*/) const +void InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & /*dim*/) const { mathed_string_dim(mi.base.font, name_, dim_); } -void MathExFuncInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathExFunc::draw(PainterInfo & pi, int x, int y) const { drawStrBlack(pi, x, y, name_); } -string MathExFuncInset::name() const +string InsetMathExFunc::name() const { return name_; } -void MathExFuncInset::maple(MapleStream & os) const +void InsetMathExFunc::maple(MapleStream & os) const { if (name_ == "det") os << "linalg[det](" << cell(0) << ')'; @@ -66,7 +66,7 @@ void MathExFuncInset::maple(MapleStream & os) const } -void MathExFuncInset::maxima(MaximaStream & os) const +void InsetMathExFunc::maxima(MaximaStream & os) const { if (name_ == "det") os << "determinant(" << cell(0) << ')'; @@ -107,19 +107,19 @@ string asMathematicaName(string const & name) } -void MathExFuncInset::mathematica(MathematicaStream & os) const +void InsetMathExFunc::mathematica(MathematicaStream & os) const { os << asMathematicaName(name_) << '[' << cell(0) << ']'; } -void MathExFuncInset::mathmlize(MathMLStream & os) const +void InsetMathExFunc::mathmlize(MathMLStream & os) const { os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str()); } -void MathExFuncInset::octave(OctaveStream & os) const +void InsetMathExFunc::octave(OctaveStream & os) const { os << name_ << '(' << cell(0) << ')'; } diff --git a/src/mathed/math_exfuncinset.h b/src/mathed/math_exfuncinset.h index d999d9af0d..c0caf64951 100644 --- a/src/mathed/math_exfuncinset.h +++ b/src/mathed/math_exfuncinset.h @@ -21,12 +21,12 @@ // f(x) in one block (as opposed to 'f','(','x',')' or 'f','x') // for interfacing external programs -class MathExFuncInset : public MathNestInset { +class InsetMathExFunc : public InsetMathNest { public: /// - explicit MathExFuncInset(std::string const & name); + explicit InsetMathExFunc(std::string const & name); /// - MathExFuncInset(std::string const & name, MathArray const & ar); + InsetMathExFunc(std::string const & name, MathArray const & ar); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_exintinset.C b/src/mathed/math_exintinset.C index bd4afb918a..a0900bbfbe 100644 --- a/src/mathed/math_exintinset.C +++ b/src/mathed/math_exintinset.C @@ -25,8 +25,8 @@ using std::auto_ptr; using std::endl; -MathExIntInset::MathExIntInset(string const & name) - : MathNestInset(4), symbol_(name) +InsetMathExInt::InsetMathExInt(string const & name) + : InsetMathNest(4), symbol_(name) {} // 0 - core @@ -35,19 +35,19 @@ MathExIntInset::MathExIntInset(string const & name) // 3 - upper -auto_ptr MathExIntInset::doClone() const +auto_ptr InsetMathExInt::doClone() const { - return auto_ptr(new MathExIntInset(*this)); + return auto_ptr(new InsetMathExInt(*this)); } -void MathExIntInset::symbol(string const & symbol) +void InsetMathExInt::symbol(string const & symbol) { symbol_ = symbol; } -bool MathExIntInset::hasScripts() const +bool InsetMathExInt::hasScripts() const { // take empty upper bound as "no scripts" return !cell(3).empty(); @@ -55,26 +55,26 @@ bool MathExIntInset::hasScripts() const -void MathExIntInset::normalize(NormalStream & os) const +void InsetMathExInt::normalize(NormalStream & os) const { os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ' ' << cell(3) << ']'; } -void MathExIntInset::metrics(MetricsInfo &, Dimension &) const +void InsetMathExInt::metrics(MetricsInfo &, Dimension &) const { lyxerr << "should not happen" << endl; } -void MathExIntInset::draw(PainterInfo &, int, int) const +void InsetMathExInt::draw(PainterInfo &, int, int) const { lyxerr << "should not happen" << endl; } -void MathExIntInset::maple(MapleStream & os) const +void InsetMathExInt::maple(MapleStream & os) const { os << symbol_ << '('; if (cell(0).size()) @@ -88,7 +88,7 @@ void MathExIntInset::maple(MapleStream & os) const } -void MathExIntInset::maxima(MaximaStream & os) const +void InsetMathExInt::maxima(MaximaStream & os) const { if ( symbol_ == "int" ) os << "integrate("; @@ -105,7 +105,7 @@ void MathExIntInset::maxima(MaximaStream & os) const os << cell(1) << ')'; } -void MathExIntInset::mathematica(MathematicaStream & os) const +void InsetMathExInt::mathematica(MathematicaStream & os) const { if ( symbol_ == "int" ) os << "Integrate["; @@ -125,9 +125,9 @@ void MathExIntInset::mathematica(MathematicaStream & os) const } -void MathExIntInset::mathmlize(MathMLStream & os) const +void InsetMathExInt::mathmlize(MathMLStream & os) const { - boost::scoped_ptr sym(new MathSymbolInset(symbol_)); + boost::scoped_ptr sym(new InsetMathSymbol(symbol_)); //if (hasScripts()) // mathmlize(sym, os); //else @@ -138,7 +138,7 @@ void MathExIntInset::mathmlize(MathMLStream & os) const } -void MathExIntInset::write(WriteStream &) const +void InsetMathExInt::write(WriteStream &) const { lyxerr << "should not happen" << endl; } diff --git a/src/mathed/math_exintinset.h b/src/mathed/math_exintinset.h index 8047fe21c8..ea589e9983 100644 --- a/src/mathed/math_exintinset.h +++ b/src/mathed/math_exintinset.h @@ -22,10 +22,10 @@ // cell(0) is stuff before the 'd', cell(1) the stuff after -class MathExIntInset : public MathNestInset { +class InsetMathExInt : public InsetMathNest { public: /// - explicit MathExIntInset(std::string const & name_); + explicit InsetMathExInt(std::string const & name_); /// void symbol(std::string const &); /// diff --git a/src/mathed/math_extern.C b/src/mathed/math_extern.C index b6e087eb48..6849fd952c 100644 --- a/src/mathed/math_extern.C +++ b/src/mathed/math_extern.C @@ -175,7 +175,7 @@ void extractStrings(MathArray & ar) if (!ar[i]->asCharInset()) continue; string s = charSequence(ar.begin() + i, ar.end()); - ar[i] = MathAtom(new MathStringInset(s)); + ar[i] = MathAtom(new InsetMathString(s)); ar.erase(i + 1, i + s.size()); } //lyxerr << "\nStrings to: " << ar << endl; @@ -194,13 +194,13 @@ void extractMatrices(MathArray & ar) continue; if (!arr.front()->asGridInset()) continue; - ar[i] = MathAtom(new MathMatrixInset(*(arr.front()->asGridInset()))); + ar[i] = MathAtom(new InsetMathMatrix(*(arr.front()->asGridInset()))); } // second pass for AMS "pmatrix" etc for (size_t i = 0; i < ar.size(); ++i) if (ar[i]->asAMSArrayInset()) - ar[i] = MathAtom(new MathMatrixInset(*(ar[i]->asGridInset()))); + ar[i] = MathAtom(new InsetMathMatrix(*(ar[i]->asGridInset()))); //lyxerr << "\nMatrices to: " << ar << endl; } @@ -335,7 +335,7 @@ void splitScripts(MathArray & ar) { //lyxerr << "\nScripts from: " << ar << endl; for (size_t i = 0; i < ar.size(); ++i) { - MathScriptInset const * script = ar[i]->asScriptInset(); + InsetMathScript const * script = ar[i]->asScriptInset(); // is this a script inset and do we also have a superscript? if (!script || !script->hasUp()) @@ -347,15 +347,15 @@ void splitScripts(MathArray & ar) if (script->nuc().size() == 1) { // leave alone sums and integrals - MathSymbolInset const * sym = + InsetMathSymbol const * sym = script->nuc().front()->asSymbolInset(); if (sym && (sym->name() == "sum" || sym->name() == "int")) continue; } // create extra script inset and move superscript over - MathScriptInset * p = ar[i].nucleus()->asScriptInset(); - auto_ptr q(new MathScriptInset(true)); + InsetMathScript * p = ar[i].nucleus()->asScriptInset(); + auto_ptr q(new InsetMathScript(true)); swap(q->up(), p->up()); p->removeScript(true); @@ -390,12 +390,12 @@ void extractExps(MathArray & ar) continue; // we need an exponent but no subscript - MathScriptInset const * sup = ar[i + 1]->asScriptInset(); + InsetMathScript const * sup = ar[i + 1]->asScriptInset(); if (!sup || sup->hasDown()) continue; // create a proper exp-inset as replacement - ar[i] = MathAtom(new MathExFuncInset("exp", sup->cell(1))); + ar[i] = MathAtom(new InsetMathExFunc("exp", sup->cell(1))); ar.erase(i + 1); } //lyxerr << "\nExps to: " << ar << endl; @@ -409,12 +409,12 @@ void extractDets(MathArray & ar) { //lyxerr << "\ndet from: " << ar << endl; for (MathArray::iterator it = ar.begin(); it != ar.end(); ++it) { - MathDelimInset const * del = (*it)->asDelimInset(); + InsetMathDelim const * del = (*it)->asDelimInset(); if (!del) continue; if (!del->isAbs()) continue; - *it = MathAtom(new MathExFuncInset("det", del->cell(0))); + *it = MathAtom(new InsetMathExFunc("det", del->cell(0))); } //lyxerr << "\ndet to: " << ar << endl; } @@ -455,7 +455,7 @@ void extractNumbers(MathArray & ar) string s = digitSequence(ar.begin() + i, ar.end()); - ar[i] = MathAtom(new MathNumberInset(s)); + ar[i] = MathAtom(new InsetMathNumber(s)); ar.erase(i + 1, i + s.size()); } //lyxerr << "\nNumbers to: " << ar << endl; @@ -481,7 +481,7 @@ bool testCloseParen(MathAtom const & at) MathAtom replaceParenDelims(const MathArray & ar) { - return MathAtom(new MathDelimInset("(", ")", ar)); + return MathAtom(new InsetMathDelim("(", ")", ar)); } @@ -499,11 +499,11 @@ bool testCloseBracket(MathAtom const & at) MathAtom replaceBracketDelims(const MathArray & ar) { - return MathAtom(new MathDelimInset("[", "]", ar)); + return MathAtom(new InsetMathDelim("[", "]", ar)); } -// replace '('...')' and '['...']' sequences by a real MathDelimInset +// replace '('...')' and '['...']' sequences by a real InsetMathDelim void extractDelims(MathArray & ar) { //lyxerr << "\nDelims from: " << ar << endl; @@ -519,7 +519,7 @@ void extractDelims(MathArray & ar) // -// replace 'f' '(...)' and 'f' '^n' '(...)' sequences by a real MathExFuncInset +// replace 'f' '(...)' and 'f' '^n' '(...)' sequences by a real InsetMathExFunc // assume 'extractDelims' ran before void extractFunctions(MathArray & ar) { @@ -545,7 +545,7 @@ void extractFunctions(MathArray & ar) continue; // guess so, if this is followed by // a DelimInset with a single item in the cell - MathDelimInset const * del = (*jt)->asDelimInset(); + InsetMathDelim const * del = (*jt)->asDelimInset(); if (!del || del->cell(0).size() != 1) continue; // fall trough into main branch @@ -557,7 +557,7 @@ void extractFunctions(MathArray & ar) extractScript(exp, jt, ar.end(), true); // create a proper inset as replacement - auto_ptr p(new MathExFuncInset(name)); + auto_ptr p(new InsetMathExFunc(name)); // jt points to the "argument". Get hold of this. MathArray::iterator st = extractArgument(p->cell(0), jt, ar.end(), true); @@ -608,7 +608,7 @@ bool testIntDiff(MathAtom const & at) } -// replace '\int' ['_^'] x 'd''x'(...)' sequences by a real MathExIntInset +// replace '\int' ['_^'] x 'd''x'(...)' sequences by a real InsetMathExInt // assume 'extractDelims' ran before void extractIntegrals(MathArray & ar) { @@ -633,7 +633,7 @@ void extractIntegrals(MathArray & ar) continue; // core ist part from behind the scripts to the 'd' - auto_ptr p(new MathExIntInset("int")); + auto_ptr p(new InsetMathExInt("int")); // handle scripts if available if (!testIntSymbol(*it)) { @@ -699,7 +699,7 @@ bool testSum(MathAtom const & at) } -// replace '\sum' ['_^'] f(x) sequences by a real MathExIntInset +// replace '\sum' ['_^'] f(x) sequences by a real InsetMathExInt // assume 'extractDelims' ran before void extractSums(MathArray & ar) { @@ -716,10 +716,10 @@ void extractSums(MathArray & ar) continue; // create a proper inset as replacement - auto_ptr p(new MathExIntInset("sum")); + auto_ptr p(new InsetMathExInt("sum")); // collect lower bound and summation index - MathScriptInset const * sub = ar[i]->asScriptInset(); + InsetMathScript const * sub = ar[i]->asScriptInset(); if (sub && sub->hasDown()) { // try to figure out the summation index from the subscript MathArray const & ar = sub->down(); @@ -762,7 +762,7 @@ bool testDiffItem(MathAtom const & at) return true; // we may have d^n .../d and splitScripts() has not yet seen it - MathScriptInset const * sup = at->asScriptInset(); + InsetMathScript const * sup = at->asScriptInset(); if (sup && !sup->hasDown() && sup->hasUp() && sup->nuc().size() == 1) { MathAtom const & ma = sup->nuc().front(); return testString(ma, "d") || testSymbol(ma, "partial"); @@ -796,14 +796,14 @@ void extractDiff(MathArray & ar) if (!testDiffFrac(*it)) continue; - MathFracInset const * f = (*it)->asFracInset(); + InsetMathFrac const * f = (*it)->asFracInset(); if (!f) { lyxerr << "should not happen" << endl; continue; } // create a proper diff inset - auto_ptr diff(new MathDiffInset); + auto_ptr diff(new InsetMathDiff); // collect function, let jt point behind last used item MathArray::iterator jt = it + 1; @@ -836,7 +836,7 @@ void extractDiff(MathArray & ar) // point before this MathArray::iterator st = et - 1; - MathScriptInset const * script = (*st)->asScriptInset(); + InsetMathScript const * script = (*st)->asScriptInset(); if (script && script->hasUp()) { // things like d.../dx^n int mult = 1; @@ -872,7 +872,7 @@ bool testRightArrow(MathAtom const & at) -// replace '\lim_{x->x0} f(x)' sequences by a real MathLimInset +// replace '\lim_{x->x0} f(x)' sequences by a real InsetMathLim // assume 'extractDelims' ran before void extractLims(MathArray & ar) { @@ -881,7 +881,7 @@ void extractLims(MathArray & ar) MathArray::iterator it = ar.begin() + i; // must be a script inset with a subscript (without superscript) - MathScriptInset const * sub = (*it)->asScriptInset(); + InsetMathScript const * sub = (*it)->asScriptInset(); if (!sub || !sub->hasDown() || sub->hasUp() || sub->nuc().size() != 1) continue; @@ -907,7 +907,7 @@ void extractLims(MathArray & ar) ar.erase(it + 1, tt); // create a proper inset as replacement - *it = MathAtom(new MathLimInset(f, x, x0)); + *it = MathAtom(new InsetMathLim(f, x, x0)); } //lyxerr << "\nLimits to: " << ar << endl; } @@ -1280,13 +1280,13 @@ namespace { out = out.substr(6); // parse output as matrix or single number - MathAtom at(new MathArrayInset("array", out)); - MathArrayInset const * mat = at->asArrayInset(); + MathAtom at(new InsetMathArray("array", out)); + InsetMathArray const * mat = at->asArrayInset(); MathArray res; if (mat->ncols() == 1 && mat->nrows() == 1) res.append(mat->cell(0)); else { - res.push_back(MathAtom(new MathDelimInset("(", ")"))); + res.push_back(MathAtom(new InsetMathDelim("(", ")"))); res.back().nucleus()->cell(0).push_back(at); } return res; diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 97da7b6b15..d8ea93e818 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -241,7 +241,7 @@ latexkeys const * in_word_set(string const & str) } -MathAtom createMathInset(string const & s) +MathAtom createInsetMath(string const & s) { //lyxerr << "creating inset with name: '" << s << '\'' << endl; latexkeys const * l = in_word_set(s); @@ -251,36 +251,36 @@ MathAtom createMathInset(string const & s) if (inset == "ref") return MathAtom(new RefInset(l->name)); if (inset == "overset") - return MathAtom(new MathOversetInset); + return MathAtom(new InsetMathOverset); if (inset == "underset") - return MathAtom(new MathUndersetInset); + return MathAtom(new InsetMathUnderset); if (inset == "decoration") - return MathAtom(new MathDecorationInset(l)); + return MathAtom(new InsetMathDecoration(l)); if (inset == "space") - return MathAtom(new MathSpaceInset(l->name)); + return MathAtom(new InsetMathSpace(l->name)); if (inset == "dots") - return MathAtom(new MathDotsInset(l)); + return MathAtom(new InsetMathDots(l)); if (inset == "mbox") - // return MathAtom(new MathMBoxInset); - // MathMBoxInset is proposed to replace MathBoxInset, + // return MathAtom(new InsetMathMBox); + // InsetMathMBox is proposed to replace InsetMathBox, // but is not ready yet (it needs a BufferView for // construction) - return MathAtom(new MathBoxInset(l->name)); + return MathAtom(new InsetMathBox(l->name)); // if (inset == "fbox") -// return MathAtom(new MathFboxInset(l)); +// return MathAtom(new InsetMathFBox(l)); if (inset == "style") - return MathAtom(new MathSizeInset(l)); + return MathAtom(new InsetMathSize(l)); if (inset == "font") - return MathAtom(new MathFontInset(l)); + return MathAtom(new InsetMathFont(l)); if (inset == "oldfont") - return MathAtom(new MathFontOldInset(l)); + return MathAtom(new InsetMathFontOld(l)); if (inset == "matrix") - return MathAtom(new MathAMSArrayInset(s)); + return MathAtom(new InsetMathAMSArray(s)); if (inset == "big") - // we can't create a MathBigInset, since the argument + // we can't create a InsetMathBig, since the argument // is missing. - return MathAtom(new MathUnknownInset(s)); - return MathAtom(new MathSymbolInset(l)); + return MathAtom(new InsetMathUnknown(s)); + return MathAtom(new InsetMathSymbol(l)); } if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9') @@ -289,65 +289,65 @@ MathAtom createMathInset(string const & s) && s[2] >= '1' && s[2] <= '9') return MathAtom(new MathMacroArgument(s[2] - '0')); if (s == "boxed") - return MathAtom(new MathBoxedInset()); + return MathAtom(new InsetMathBoxed()); if (s == "fbox") - return MathAtom(new MathFboxInset()); + return MathAtom(new InsetMathFBox()); if (s == "framebox") - return MathAtom(new MathFrameboxInset); + return MathAtom(new InsetMathFrameBox); if (s == "makebox") - return MathAtom(new MathMakeboxInset); + return MathAtom(new InsetMathMakebox); if (s == "kern") - return MathAtom(new MathKernInset); + return MathAtom(new InsetMathKern); if (s == "xymatrix") - return MathAtom(new MathXYMatrixInset); + return MathAtom(new InsetMathXYMatrix); if (s == "xrightarrow" || s == "xleftarrow") - return MathAtom(new MathXArrowInset(s)); + return MathAtom(new InsetMathXArrow(s)); if (s == "split" || s == "gathered" || s == "aligned" || s == "alignedat") - return MathAtom(new MathSplitInset(s)); + return MathAtom(new InsetMathSplit(s)); if (s == "cases") - return MathAtom(new MathCasesInset); + return MathAtom(new InsetMathCases); if (s == "substack") - return MathAtom(new MathSubstackInset); + return MathAtom(new InsetMathSubstack); if (s == "subarray" || s == "array") - return MathAtom(new MathArrayInset(s, 1, 1)); + return MathAtom(new InsetMathArray(s, 1, 1)); if (s == "sqrt") - return MathAtom(new MathSqrtInset); + return MathAtom(new InsetMathSqrt); if (s == "root") - return MathAtom(new MathRootInset); + return MathAtom(new InsetMathRoot); if (s == "tabular") - return MathAtom(new MathTabularInset(s, 1, 1)); + return MathAtom(new InsetMathTabular(s, 1, 1)); if (s == "stackrel") - return MathAtom(new MathStackrelInset); + return MathAtom(new InsetMathStackrel); if (s == "binom" || s == "choose") - return MathAtom(new MathBinomInset(s == "choose")); + return MathAtom(new InsetMathBinom(s == "choose")); if (s == "frac") - return MathAtom(new MathFracInset); + return MathAtom(new InsetMathFrac); if (s == "over") - return MathAtom(new MathFracInset(MathFracInset::OVER)); + return MathAtom(new InsetMathFrac(InsetMathFrac::OVER)); if (s == "nicefrac") - return MathAtom(new MathFracInset(MathFracInset::NICEFRAC)); + return MathAtom(new InsetMathFrac(InsetMathFrac::NICEFRAC)); //if (s == "infer") // return MathAtom(new MathInferInset); if (s == "atop") - return MathAtom(new MathFracInset(MathFracInset::ATOP)); + return MathAtom(new InsetMathFrac(InsetMathFrac::ATOP)); if (s == "lefteqn") - return MathAtom(new MathLefteqnInset); + return MathAtom(new InsetMathLefteqn); if (s == "boldsymbol") - return MathAtom(new MathBoldsymbolInset); + return MathAtom(new InsetMathBoldSymbol); if (s == "color" || s == "normalcolor") - return MathAtom(new MathColorInset(true)); + return MathAtom(new InsetMathColor(true)); if (s == "textcolor") - return MathAtom(new MathColorInset(false)); + return MathAtom(new InsetMathColor(false)); if (s == "dfrac") - return MathAtom(new MathDfracInset); + return MathAtom(new InsetMathDFrac); if (s == "tfrac") - return MathAtom(new MathTfracInset); + return MathAtom(new InsetMathTFrac); if (s == "hphantom") - return MathAtom(new MathPhantomInset(MathPhantomInset::hphantom)); + return MathAtom(new InsetMathPhantom(InsetMathPhantom::hphantom)); if (s == "phantom") - return MathAtom(new MathPhantomInset(MathPhantomInset::phantom)); + return MathAtom(new InsetMathPhantom(InsetMathPhantom::phantom)); if (s == "vphantom") - return MathAtom(new MathPhantomInset(MathPhantomInset::vphantom)); + return MathAtom(new InsetMathPhantom(InsetMathPhantom::vphantom)); if (MacroTable::globalMacros().has(s)) return MathAtom(new MathMacro(s, @@ -357,11 +357,11 @@ MathAtom createMathInset(string const & s) // MacroTable::localMacros().get(s).numargs())); //lyxerr << "creating unknown inset '" << s << "'" << endl; - return MathAtom(new MathUnknownInset(s)); + return MathAtom(new InsetMathUnknown(s)); } -bool createMathInset_fromDialogStr(string const & str, MathArray & ar) +bool createInsetMath_fromDialogStr(string const & str, MathArray & ar) { // An example str: // "ref LatexCommand \\ref{sec:Title}\n\\end_inset\n\n"; diff --git a/src/mathed/math_factory.h b/src/mathed/math_factory.h index e5aac336b0..20fd5c9ad9 100644 --- a/src/mathed/math_factory.h +++ b/src/mathed/math_factory.h @@ -18,12 +18,12 @@ class MathAtom; class MathArray; -MathAtom createMathInset(std::string const &); +MathAtom createInsetMath(std::string const &); /** Fills ar with the contents of str. * str is created by the frontend dialog's and returned to the LyX core. * The function returns true if successful. */ -bool createMathInset_fromDialogStr(std::string const &, MathArray &); +bool createInsetMath_fromDialogStr(std::string const &, MathArray &); #endif diff --git a/src/mathed/math_fboxinset.C b/src/mathed/math_fboxinset.C index 6fbbb38c8b..d6c16e14f7 100644 --- a/src/mathed/math_fboxinset.C +++ b/src/mathed/math_fboxinset.C @@ -23,24 +23,24 @@ using std::auto_ptr; -MathFboxInset::MathFboxInset() - : MathNestInset(1) +InsetMathFBox::InsetMathFBox() + : InsetMathNest(1) {} -auto_ptr MathFboxInset::doClone() const +auto_ptr InsetMathFBox::doClone() const { - return auto_ptr(new MathFboxInset(*this)); + return auto_ptr(new InsetMathFBox(*this)); } -MathInset::mode_type MathFboxInset::currentMode() const +InsetMath::mode_type InsetMathFBox::currentMode() const { return TEXT_MODE; } -void MathFboxInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); cell(0).metrics(mi, dim); @@ -49,7 +49,7 @@ void MathFboxInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathFboxInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const { pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, dim_.width() - 2, dim_.height() - 2, LColor::foreground); @@ -59,19 +59,19 @@ void MathFboxInset::draw(PainterInfo & pi, int x, int y) const } -void MathFboxInset::write(WriteStream & os) const +void InsetMathFBox::write(WriteStream & os) const { os << "\\fbox{" << cell(0) << '}'; } -void MathFboxInset::normalize(NormalStream & os) const +void InsetMathFBox::normalize(NormalStream & os) const { os << "[fbox " << cell(0) << ']'; } -void MathFboxInset::infoize(std::ostream & os) const +void InsetMathFBox::infoize(std::ostream & os) const { os << "FBox: "; } diff --git a/src/mathed/math_fboxinset.h b/src/mathed/math_fboxinset.h index 405a7c5b27..2865ae3162 100644 --- a/src/mathed/math_fboxinset.h +++ b/src/mathed/math_fboxinset.h @@ -16,10 +16,10 @@ /// Non-AMS-style frame -class MathFboxInset : public MathNestInset { +class InsetMathFBox : public InsetMathNest { public: /// - MathFboxInset(); + InsetMathFBox(); /// mode_type currentMode() const; /// diff --git a/src/mathed/math_fontinset.C b/src/mathed/math_fontinset.C index ae35161d5e..f7980368df 100644 --- a/src/mathed/math_fontinset.C +++ b/src/mathed/math_fontinset.C @@ -21,18 +21,18 @@ using std::string; using std::auto_ptr; -MathFontInset::MathFontInset(latexkeys const * key) - : MathNestInset(1), key_(key) +InsetMathFont::InsetMathFont(latexkeys const * key) + : InsetMathNest(1), key_(key) {} -auto_ptr MathFontInset::doClone() const +auto_ptr InsetMathFont::doClone() const { - return auto_ptr(new MathFontInset(*this)); + return auto_ptr(new InsetMathFont(*this)); } -MathInset::mode_type MathFontInset::currentMode() const +InsetMath::mode_type InsetMathFont::currentMode() const { if (key_->extra == "mathmode") return MATH_MODE; @@ -42,7 +42,7 @@ MathInset::mode_type MathFontInset::currentMode() const } -void MathFontInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathFont::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, key_->name.c_str()); cell(0).metrics(mi, dim); @@ -51,7 +51,7 @@ void MathFontInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathFontInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathFont::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, key_->name.c_str()); cell(0).draw(pi, x + 1, y); @@ -60,27 +60,27 @@ void MathFontInset::draw(PainterInfo & pi, int x, int y) const } -void MathFontInset::metricsT(TextMetricsInfo const & mi, Dimension &) const +void InsetMathFont::metricsT(TextMetricsInfo const & mi, Dimension &) const { cell(0).metricsT(mi, dim_); } -void MathFontInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathFont::drawT(TextPainter & pain, int x, int y) const { cell(0).drawT(pain, x, y); } -string MathFontInset::name() const +string InsetMathFont::name() const { return key_->name; } -void MathFontInset::validate(LaTeXFeatures & features) const +void InsetMathFont::validate(LaTeXFeatures & features) const { - MathNestInset::validate(features); + InsetMathNest::validate(features); // Make sure amssymb is put in preamble if Blackboard Bold or // Fraktur used: if (key_->name == "mathfrak" || key_->name == "mathbb") @@ -92,7 +92,7 @@ void MathFontInset::validate(LaTeXFeatures & features) const } -void MathFontInset::infoize(std::ostream & os) const +void InsetMathFont::infoize(std::ostream & os) const { os << "Font: " << key_->name; } diff --git a/src/mathed/math_fontinset.h b/src/mathed/math_fontinset.h index efe6ce2033..6e6b567dc6 100644 --- a/src/mathed/math_fontinset.h +++ b/src/mathed/math_fontinset.h @@ -18,14 +18,14 @@ class latexkeys; /// Inset for font changes -class MathFontInset : public MathNestInset { +class InsetMathFont : public InsetMathNest { public: /// - explicit MathFontInset(latexkeys const * key); + explicit InsetMathFont(latexkeys const * key); /// - MathFontInset * asFontInset() { return this; } + InsetMathFont * asFontInset() { return this; } /// - MathFontInset const * asFontInset() const { return this; } + InsetMathFont const * asFontInset() const { return this; } /// are we in math mode, text mode, or unsure? mode_type currentMode() const; /// diff --git a/src/mathed/math_fontoldinset.C b/src/mathed/math_fontoldinset.C index e339c27ac3..54c183fc46 100644 --- a/src/mathed/math_fontoldinset.C +++ b/src/mathed/math_fontoldinset.C @@ -20,20 +20,20 @@ using std::auto_ptr; -MathFontOldInset::MathFontOldInset(latexkeys const * key) - : MathNestInset(1), key_(key) +InsetMathFontOld::InsetMathFontOld(latexkeys const * key) + : InsetMathNest(1), key_(key) { //lock(true); } -auto_ptr MathFontOldInset::doClone() const +auto_ptr InsetMathFontOld::doClone() const { - return auto_ptr(new MathFontOldInset(*this)); + return auto_ptr(new InsetMathFontOld(*this)); } -void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathFontOld::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, key_->name.c_str()); cell(0).metrics(mi, dim); @@ -42,7 +42,7 @@ void MathFontOldInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathFontOld::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, key_->name.c_str()); cell(0).draw(pi, x + 1, y); @@ -50,31 +50,31 @@ void MathFontOldInset::draw(PainterInfo & pi, int x, int y) const } -void MathFontOldInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathFontOld::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { cell(0).metricsT(mi, dim); } -void MathFontOldInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathFontOld::drawT(TextPainter & pain, int x, int y) const { cell(0).drawT(pain, x, y); } -void MathFontOldInset::write(WriteStream & os) const +void InsetMathFontOld::write(WriteStream & os) const { os << "{\\" << key_->name << ' ' << cell(0) << '}'; } -void MathFontOldInset::normalize(NormalStream & os) const +void InsetMathFontOld::normalize(NormalStream & os) const { os << "[font " << key_->name << ' ' << cell(0) << ']'; } -void MathFontOldInset::infoize(std::ostream & os) const +void InsetMathFontOld::infoize(std::ostream & os) const { os << "Font: " << key_->name; } diff --git a/src/mathed/math_fontoldinset.h b/src/mathed/math_fontoldinset.h index 0db0702c1e..b29c3190f6 100644 --- a/src/mathed/math_fontoldinset.h +++ b/src/mathed/math_fontoldinset.h @@ -18,10 +18,10 @@ class latexkeys; /// Old-style font changes -class MathFontOldInset : public MathNestInset { +class InsetMathFontOld : public InsetMathNest { public: /// - explicit MathFontOldInset(latexkeys const * key); + explicit InsetMathFontOld(latexkeys const * key); /// we are in text mode. mode_type currentMode() const { return TEXT_MODE; } /// we write extra braces in any case... diff --git a/src/mathed/math_fracbase.C b/src/mathed/math_fracbase.C index f55f7fe8d4..555657cc37 100644 --- a/src/mathed/math_fracbase.C +++ b/src/mathed/math_fracbase.C @@ -15,26 +15,26 @@ #include "cursor.h" -MathFracbaseInset::MathFracbaseInset() - : MathNestInset(2) +InsetMathFracBase::InsetMathFracBase() + : InsetMathNest(2) {} -bool MathFracbaseInset::idxRight(LCursor &) const +bool InsetMathFracBase::idxRight(LCursor &) const { return false; } -bool MathFracbaseInset::idxLeft(LCursor &) const +bool InsetMathFracBase::idxLeft(LCursor &) const { return false; } -bool MathFracbaseInset::idxUpDown(LCursor & cur, bool up) const +bool InsetMathFracBase::idxUpDown(LCursor & cur, bool up) const { - MathInset::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0 + InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0 if (cur.idx() == target) return false; cur.idx() = target; diff --git a/src/mathed/math_fracbase.h b/src/mathed/math_fracbase.h index 5339db8271..8a200b5a97 100644 --- a/src/mathed/math_fracbase.h +++ b/src/mathed/math_fracbase.h @@ -15,10 +15,10 @@ #include "math_nestinset.h" -class MathFracbaseInset : public MathNestInset { +class InsetMathFracBase : public InsetMathNest { public: /// - MathFracbaseInset(); + InsetMathFracBase(); /// bool idxUpDown(LCursor &, bool up) const; /// diff --git a/src/mathed/math_fracinset.C b/src/mathed/math_fracinset.C index e709d190d7..e13e114a87 100644 --- a/src/mathed/math_fracinset.C +++ b/src/mathed/math_fracinset.C @@ -25,30 +25,30 @@ using std::max; using std::auto_ptr; -MathFracInset::MathFracInset(Kind kind) +InsetMathFrac::InsetMathFrac(Kind kind) : kind_(kind) {} -auto_ptr MathFracInset::doClone() const +auto_ptr InsetMathFrac::doClone() const { - return auto_ptr(new MathFracInset(*this)); + return auto_ptr(new InsetMathFrac(*this)); } -MathFracInset * MathFracInset::asFracInset() +InsetMathFrac * InsetMathFrac::asFracInset() { return kind_ == ATOP ? 0 : this; } -MathFracInset const * MathFracInset::asFracInset() const +InsetMathFrac const * InsetMathFrac::asFracInset() const { return kind_ == ATOP ? 0 : this; } -void MathFracInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const { FracChanger dummy(mi.base); cell(0).metrics(mi); @@ -67,7 +67,7 @@ void MathFracInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathFracInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const { setPosCache(pi, x, y); int m = x + dim_.wid / 2; @@ -94,7 +94,7 @@ void MathFracInset::draw(PainterInfo & pi, int x, int y) const } -void MathFracInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathFrac::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { cell(0).metricsT(mi, dim); cell(1).metricsT(mi, dim); @@ -105,7 +105,7 @@ void MathFracInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const } -void MathFracInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathFrac::drawT(TextPainter & pain, int x, int y) const { int m = x + dim_.width() / 2; cell(0).drawT(pain, m - cell(0).width() / 2, y - cell(0).descent() - 1); @@ -116,7 +116,7 @@ void MathFracInset::drawT(TextPainter & pain, int x, int y) const } -void MathFracInset::write(WriteStream & os) const +void InsetMathFrac::write(WriteStream & os) const { switch (kind_) { case ATOP: @@ -128,13 +128,13 @@ void MathFracInset::write(WriteStream & os) const break; case FRAC: case NICEFRAC: - MathNestInset::write(os); + InsetMathNest::write(os); break; } } -string MathFracInset::name() const +string InsetMathFrac::name() const { switch (kind_) { case FRAC: @@ -151,40 +151,40 @@ string MathFracInset::name() const } -bool MathFracInset::extraBraces() const +bool InsetMathFrac::extraBraces() const { return kind_ == ATOP || kind_ == OVER; } -void MathFracInset::maple(MapleStream & os) const +void InsetMathFrac::maple(MapleStream & os) const { os << '(' << cell(0) << ")/(" << cell(1) << ')'; } -void MathFracInset::mathematica(MathematicaStream & os) const +void InsetMathFrac::mathematica(MathematicaStream & os) const { os << '(' << cell(0) << ")/(" << cell(1) << ')'; } -void MathFracInset::octave(OctaveStream & os) const +void InsetMathFrac::octave(OctaveStream & os) const { os << '(' << cell(0) << ")/(" << cell(1) << ')'; } -void MathFracInset::mathmlize(MathMLStream & os) const +void InsetMathFrac::mathmlize(MathMLStream & os) const { os << MTag("mfrac") << cell(0) << cell(1) << ETag("mfrac"); } -void MathFracInset::validate(LaTeXFeatures & features) const +void InsetMathFrac::validate(LaTeXFeatures & features) const { if (kind_ == NICEFRAC) features.require("nicefrac"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_fracinset.h b/src/mathed/math_fracinset.h index 53abf28184..c46d726aca 100644 --- a/src/mathed/math_fracinset.h +++ b/src/mathed/math_fracinset.h @@ -17,7 +17,7 @@ /// Fraction like objects (frac, binom) -class MathFracInset : public MathFracbaseInset { +class InsetMathFrac : public InsetMathFracBase { public: /// enum Kind { @@ -28,7 +28,7 @@ public: }; /// - explicit MathFracInset(Kind kind = FRAC); + explicit InsetMathFrac(Kind kind = FRAC); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// @@ -38,9 +38,9 @@ public: /// void drawT(TextPainter &, int x, int y) const; /// identifies FracInsets - MathFracInset * asFracInset(); + InsetMathFrac * asFracInset(); /// identifies FracInsets - MathFracInset const * asFracInset() const; + InsetMathFrac const * asFracInset() const; /// std::string name() const; /// diff --git a/src/mathed/math_frameboxinset.C b/src/mathed/math_frameboxinset.C index bb6badd6bb..4414ba8170 100644 --- a/src/mathed/math_frameboxinset.C +++ b/src/mathed/math_frameboxinset.C @@ -20,22 +20,22 @@ using std::auto_ptr; -MathFrameboxInset::MathFrameboxInset() - : MathNestInset(3) +InsetMathFrameBox::InsetMathFrameBox() + : InsetMathNest(3) {} -auto_ptr MathFrameboxInset::doClone() const +auto_ptr InsetMathFrameBox::doClone() const { - return auto_ptr(new MathFrameboxInset(*this)); + return auto_ptr(new InsetMathFrameBox(*this)); } -void MathFrameboxInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathFrameBox::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); w_ = mathed_char_width(mi.base.font, '['); - MathNestInset::metrics(mi); + InsetMathNest::metrics(mi); dim = cell(0).dim(); dim += cell(1).dim(); dim += cell(2).dim(); @@ -44,7 +44,7 @@ void MathFrameboxInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathFrameboxInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, "textnormal"); pi.pain.rectangle(x + 1, y - dim_.ascent() + 1, @@ -70,7 +70,7 @@ void MathFrameboxInset::draw(PainterInfo & pi, int x, int y) const } -void MathFrameboxInset::write(WriteStream & os) const +void InsetMathFrameBox::write(WriteStream & os) const { os << "\\framebox"; os << '[' << cell(0) << ']'; @@ -80,7 +80,7 @@ void MathFrameboxInset::write(WriteStream & os) const } -void MathFrameboxInset::normalize(NormalStream & os) const +void InsetMathFrameBox::normalize(NormalStream & os) const { os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']'; } diff --git a/src/mathed/math_frameboxinset.h b/src/mathed/math_frameboxinset.h index 7c7ea77b00..513ee60a0d 100644 --- a/src/mathed/math_frameboxinset.h +++ b/src/mathed/math_frameboxinset.h @@ -16,10 +16,10 @@ /// Extra nesting -class MathFrameboxInset : public MathNestInset { +class InsetMathFrameBox : public InsetMathNest { public: /// - MathFrameboxInset(); + InsetMathFrameBox(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index c4dbf502de..08a9517ee1 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -50,7 +50,7 @@ using std::vector; class GridInsetMailer : public MailInset { public: - GridInsetMailer(MathGridInset & inset) : inset_(inset) {} + GridInsetMailer(InsetMathGrid & inset) : inset_(inset) {} /// virtual string const & name() const { @@ -70,11 +70,11 @@ public: protected: InsetBase & inset() const { return inset_; } - MathGridInset & inset_; + InsetMathGrid & inset_; }; -void mathed_parse_normal(MathGridInset &, string const & argument); +void mathed_parse_normal(InsetMathGrid &, string const & argument); namespace { @@ -102,7 +102,7 @@ int extractInt(istream & is) ////////////////////////////////////////////////////////////// -MathGridInset::CellInfo::CellInfo() +InsetMathGrid::CellInfo::CellInfo() : dummy_(false) {} @@ -112,13 +112,13 @@ MathGridInset::CellInfo::CellInfo() ////////////////////////////////////////////////////////////// -MathGridInset::RowInfo::RowInfo() +InsetMathGrid::RowInfo::RowInfo() : lines_(0), skip_(0) {} -int MathGridInset::RowInfo::skipPixels() const +int InsetMathGrid::RowInfo::skipPixels() const { return crskip_.inBP(); } @@ -128,7 +128,7 @@ int MathGridInset::RowInfo::skipPixels() const ////////////////////////////////////////////////////////////// -MathGridInset::ColInfo::ColInfo() +InsetMathGrid::ColInfo::ColInfo() : align_('c'), lines_(0) {} @@ -136,8 +136,8 @@ MathGridInset::ColInfo::ColInfo() ////////////////////////////////////////////////////////////// -MathGridInset::MathGridInset(char v, string const & h) - : MathNestInset(guessColumns(h)), +InsetMathGrid::InsetMathGrid(char v, string const & h) + : InsetMathNest(guessColumns(h)), rowinfo_(2), colinfo_(guessColumns(h) + 1), cellinfo_(1 * guessColumns(h)) @@ -149,8 +149,8 @@ MathGridInset::MathGridInset(char v, string const & h) } -MathGridInset::MathGridInset() - : MathNestInset(1), +InsetMathGrid::InsetMathGrid() + : InsetMathNest(1), rowinfo_(1 + 1), colinfo_(1 + 1), cellinfo_(1), @@ -160,8 +160,8 @@ MathGridInset::MathGridInset() } -MathGridInset::MathGridInset(col_type m, row_type n) - : MathNestInset(m * n), +InsetMathGrid::InsetMathGrid(col_type m, row_type n) + : InsetMathNest(m * n), rowinfo_(n + 1), colinfo_(m + 1), cellinfo_(m * n), @@ -171,8 +171,8 @@ MathGridInset::MathGridInset(col_type m, row_type n) } -MathGridInset::MathGridInset(col_type m, row_type n, char v, string const & h) - : MathNestInset(m * n), +InsetMathGrid::InsetMathGrid(col_type m, row_type n, char v, string const & h) + : InsetMathNest(m * n), rowinfo_(n + 1), colinfo_(m + 1), cellinfo_(m * n), @@ -184,26 +184,26 @@ MathGridInset::MathGridInset(col_type m, row_type n, char v, string const & h) } -MathGridInset::~MathGridInset() +InsetMathGrid::~InsetMathGrid() { GridInsetMailer mailer(*this); mailer.hideDialog(); } -auto_ptr MathGridInset::doClone() const +auto_ptr InsetMathGrid::doClone() const { - return auto_ptr(new MathGridInset(*this)); + return auto_ptr(new InsetMathGrid(*this)); } -MathInset::idx_type MathGridInset::index(row_type row, col_type col) const +InsetMath::idx_type InsetMathGrid::index(row_type row, col_type col) const { return col + ncols() * row; } -void MathGridInset::setDefaults() +void InsetMathGrid::setDefaults() { if (ncols() <= 0) lyxerr << "positive number of columns expected" << endl; @@ -216,7 +216,7 @@ void MathGridInset::setDefaults() } -void MathGridInset::halign(string const & hh) +void InsetMathGrid::halign(string const & hh) { col_type col = 0; for (string::const_iterator it = hh.begin(); it != hh.end(); ++it) { @@ -245,7 +245,7 @@ void MathGridInset::halign(string const & hh) } -MathGridInset::col_type MathGridInset::guessColumns(string const & hh) const +InsetMathGrid::col_type InsetMathGrid::guessColumns(string const & hh) const { col_type col = 0; for (string::const_iterator it = hh.begin(); it != hh.end(); ++it) @@ -259,19 +259,19 @@ MathGridInset::col_type MathGridInset::guessColumns(string const & hh) const } -void MathGridInset::halign(char h, col_type col) +void InsetMathGrid::halign(char h, col_type col) { colinfo_[col].align_ = h; } -char MathGridInset::halign(col_type col) const +char InsetMathGrid::halign(col_type col) const { return colinfo_[col].align_; } -string MathGridInset::halign() const +string InsetMathGrid::halign() const { string res; for (col_type col = 0; col < ncols(); ++col) { @@ -282,58 +282,58 @@ string MathGridInset::halign() const } -void MathGridInset::valign(char c) +void InsetMathGrid::valign(char c) { v_align_ = c; } -char MathGridInset::valign() const +char InsetMathGrid::valign() const { return v_align_; } -MathGridInset::col_type MathGridInset::ncols() const +InsetMathGrid::col_type InsetMathGrid::ncols() const { return colinfo_.size() - 1; } -MathGridInset::row_type MathGridInset::nrows() const +InsetMathGrid::row_type InsetMathGrid::nrows() const { return rowinfo_.size() - 1; } -MathGridInset::col_type MathGridInset::col(idx_type idx) const +InsetMathGrid::col_type InsetMathGrid::col(idx_type idx) const { return idx % ncols(); } -MathGridInset::row_type MathGridInset::row(idx_type idx) const +InsetMathGrid::row_type InsetMathGrid::row(idx_type idx) const { return idx / ncols(); } -void MathGridInset::vcrskip(LyXLength const & crskip, row_type row) +void InsetMathGrid::vcrskip(LyXLength const & crskip, row_type row) { rowinfo_[row].crskip_ = crskip; } -LyXLength MathGridInset::vcrskip(row_type row) const +LyXLength InsetMathGrid::vcrskip(row_type row) const { return rowinfo_[row].crskip_; } -void MathGridInset::metrics(MetricsInfo & mi) const +void InsetMathGrid::metrics(MetricsInfo & mi) const { // let the cells adjust themselves - MathNestInset::metrics(mi); + InsetMathNest::metrics(mi); // compute absolute sizes of vertical structure for (row_type row = 0; row < nrows(); ++row) { @@ -470,19 +470,19 @@ void MathGridInset::metrics(MetricsInfo & mi) const } -void MathGridInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathGrid::metrics(MetricsInfo & mi, Dimension & dim) const { metrics(mi); dim = dim_; } -void MathGridInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathGrid::draw(PainterInfo & pi, int x, int y) const { drawWithMargin(pi, x, y, 0, 0); } -void MathGridInset::drawWithMargin(PainterInfo & pi, int x, int y, +void InsetMathGrid::drawWithMargin(PainterInfo & pi, int x, int y, int lmargin, int rmargin) const { for (idx_type idx = 0; idx < nargs(); ++idx) @@ -510,10 +510,10 @@ void MathGridInset::drawWithMargin(PainterInfo & pi, int x, int y, } -void MathGridInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathGrid::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { // let the cells adjust themselves - //MathNestInset::metrics(mi); + //InsetMathNest::metrics(mi); for (idx_type i = 0; i < nargs(); ++i) cell(i).metricsT(mi, dim); @@ -599,14 +599,14 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const } -void MathGridInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathGrid::drawT(TextPainter & pain, int x, int y) const { for (idx_type idx = 0; idx < nargs(); ++idx) cell(idx).drawT(pain, x + cellXOffset(idx), y + cellYOffset(idx)); } -string MathGridInset::eolString(row_type row, bool emptyline, bool fragile) const +string InsetMathGrid::eolString(row_type row, bool emptyline, bool fragile) const { string eol; @@ -629,7 +629,7 @@ string MathGridInset::eolString(row_type row, bool emptyline, bool fragile) cons } -string MathGridInset::eocString(col_type col, col_type lastcol) const +string InsetMathGrid::eocString(col_type col, col_type lastcol) const { if (col + 1 == lastcol) return string(); @@ -637,7 +637,7 @@ string MathGridInset::eocString(col_type col, col_type lastcol) const } -void MathGridInset::addRow(row_type row) +void InsetMathGrid::addRow(row_type row) { rowinfo_.insert(rowinfo_.begin() + row + 1, RowInfo()); cells_.insert @@ -647,7 +647,7 @@ void MathGridInset::addRow(row_type row) } -void MathGridInset::appendRow() +void InsetMathGrid::appendRow() { rowinfo_.push_back(RowInfo()); //cells_.insert(cells_.end(), ncols(), MathArray()); @@ -658,7 +658,7 @@ void MathGridInset::appendRow() } -void MathGridInset::delRow(row_type row) +void InsetMathGrid::delRow(row_type row) { if (nrows() == 1) return; @@ -673,7 +673,7 @@ void MathGridInset::delRow(row_type row) } -void MathGridInset::copyRow(row_type row) +void InsetMathGrid::copyRow(row_type row) { addRow(row); for (col_type col = 0; col < ncols(); ++col) @@ -681,7 +681,7 @@ void MathGridInset::copyRow(row_type row) } -void MathGridInset::swapRow(row_type row) +void InsetMathGrid::swapRow(row_type row) { if (nrows() == 1) return; @@ -692,7 +692,7 @@ void MathGridInset::swapRow(row_type row) } -void MathGridInset::addCol(col_type newcol) +void InsetMathGrid::addCol(col_type newcol) { const col_type nc = ncols(); const row_type nr = nrows(); @@ -716,7 +716,7 @@ void MathGridInset::addCol(col_type newcol) } -void MathGridInset::delCol(col_type col) +void InsetMathGrid::delCol(col_type col) { if (ncols() == 1) return; @@ -735,7 +735,7 @@ void MathGridInset::delCol(col_type col) } -void MathGridInset::copyCol(col_type col) +void InsetMathGrid::copyCol(col_type col) { addCol(col); for (row_type row = 0; row < nrows(); ++row) @@ -743,7 +743,7 @@ void MathGridInset::copyCol(col_type col) } -void MathGridInset::swapCol(col_type col) +void InsetMathGrid::swapCol(col_type col) { if (ncols() == 1) return; @@ -754,7 +754,7 @@ void MathGridInset::swapCol(col_type col) } -int MathGridInset::cellXOffset(idx_type idx) const +int InsetMathGrid::cellXOffset(idx_type idx) const { col_type c = col(idx); int x = colinfo_[c].offset_; @@ -767,13 +767,13 @@ int MathGridInset::cellXOffset(idx_type idx) const } -int MathGridInset::cellYOffset(idx_type idx) const +int InsetMathGrid::cellYOffset(idx_type idx) const { return rowinfo_[row(idx)].offset_; } -bool MathGridInset::idxUpDown(LCursor & cur, bool up) const +bool InsetMathGrid::idxUpDown(LCursor & cur, bool up) const { if (up) { if (cur.row() == 0) @@ -789,7 +789,7 @@ bool MathGridInset::idxUpDown(LCursor & cur, bool up) const } -bool MathGridInset::idxLeft(LCursor & cur) const +bool InsetMathGrid::idxLeft(LCursor & cur) const { // leave matrix if on the left hand edge if (cur.col() == 0) @@ -800,7 +800,7 @@ bool MathGridInset::idxLeft(LCursor & cur) const } -bool MathGridInset::idxRight(LCursor & cur) const +bool InsetMathGrid::idxRight(LCursor & cur) const { // leave matrix if on the right hand edge if (cur.col() + 1 == ncols()) @@ -811,7 +811,7 @@ bool MathGridInset::idxRight(LCursor & cur) const } -bool MathGridInset::idxFirst(LCursor & cur) const +bool InsetMathGrid::idxFirst(LCursor & cur) const { switch (v_align_) { case 't': @@ -828,7 +828,7 @@ bool MathGridInset::idxFirst(LCursor & cur) const } -bool MathGridInset::idxLast(LCursor & cur) const +bool InsetMathGrid::idxLast(LCursor & cur) const { switch (v_align_) { case 't': @@ -845,7 +845,7 @@ bool MathGridInset::idxLast(LCursor & cur) const } -bool MathGridInset::idxDelete(idx_type & idx) +bool InsetMathGrid::idxDelete(idx_type & idx) { // nothing to do if we have just one row if (nrows() == 1) @@ -880,7 +880,7 @@ bool MathGridInset::idxDelete(idx_type & idx) // reimplement old behaviour when pressing Delete in the last position // of a cell -void MathGridInset::idxGlue(idx_type idx) +void InsetMathGrid::idxGlue(idx_type idx) { col_type c = col(idx); if (c + 1 == ncols()) { @@ -898,19 +898,19 @@ void MathGridInset::idxGlue(idx_type idx) } -MathGridInset::RowInfo const & MathGridInset::rowinfo(row_type row) const +InsetMathGrid::RowInfo const & InsetMathGrid::rowinfo(row_type row) const { return rowinfo_[row]; } -MathGridInset::RowInfo & MathGridInset::rowinfo(row_type row) +InsetMathGrid::RowInfo & InsetMathGrid::rowinfo(row_type row) { return rowinfo_[row]; } -bool MathGridInset::idxBetween(idx_type idx, idx_type from, idx_type to) const +bool InsetMathGrid::idxBetween(idx_type idx, idx_type from, idx_type to) const { row_type const ri = row(idx); row_type const r1 = min(row(from), row(to)); @@ -923,7 +923,7 @@ bool MathGridInset::idxBetween(idx_type idx, idx_type from, idx_type to) const -void MathGridInset::normalize(NormalStream & os) const +void InsetMathGrid::normalize(NormalStream & os) const { os << "[grid "; for (row_type row = 0; row < nrows(); ++row) { @@ -936,7 +936,7 @@ void MathGridInset::normalize(NormalStream & os) const } -void MathGridInset::mathmlize(MathMLStream & os) const +void InsetMathGrid::mathmlize(MathMLStream & os) const { os << MTag("mtable"); for (row_type row = 0; row < nrows(); ++row) { @@ -949,7 +949,7 @@ void MathGridInset::mathmlize(MathMLStream & os) const } -void MathGridInset::write(WriteStream & os) const +void InsetMathGrid::write(WriteStream & os) const { string eol; for (row_type row = 0; row < nrows(); ++row) { @@ -983,37 +983,37 @@ void MathGridInset::write(WriteStream & os) const } -int MathGridInset::colsep() const +int InsetMathGrid::colsep() const { return 6; } -int MathGridInset::rowsep() const +int InsetMathGrid::rowsep() const { return 6; } -int MathGridInset::hlinesep() const +int InsetMathGrid::hlinesep() const { return 3; } -int MathGridInset::vlinesep() const +int InsetMathGrid::vlinesep() const { return 3; } -int MathGridInset::border() const +int InsetMathGrid::border() const { return 1; } -void MathGridInset::splitCell(LCursor & cur) +void InsetMathGrid::splitCell(LCursor & cur) { if (cur.idx() == cur.lastidx()) return; @@ -1026,9 +1026,9 @@ void MathGridInset::splitCell(LCursor & cur) } -void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathGrid::doDispatch(LCursor & cur, FuncRequest & cmd) { - //lyxerr << "*** MathGridInset: request: " << cmd << endl; + //lyxerr << "*** InsetMathGrid: request: " << cmd << endl; switch (cmd.action) { case LFUN_MOUSE_RELEASE: @@ -1036,7 +1036,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) // GridInsetMailer(*this).showDialog(); // return DispatchResult(true, true); //} - MathNestInset::doDispatch(cur, cmd); + InsetMathNest::doDispatch(cur, cmd); break; case LFUN_INSET_DIALOG_UPDATE: @@ -1209,7 +1209,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) istringstream is(lyx::to_utf8(cmd.argument())); int n = 0; is >> n; - MathGridInset grid(1, 1); + InsetMathGrid grid(1, 1); mathed_parse_normal(grid, lyx::cap::getSelection(cur.buffer(), n)); if (grid.nargs() == 1) { // single cell/part of cell @@ -1230,7 +1230,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) } // append the left over horizontal cells to the last column idx_type i = index(r + cur.row(), ncols() - 1); - for (MathInset::col_type c = numcols; c < grid.ncols(); ++c) + for (InsetMath::col_type c = numcols; c < grid.ncols(); ++c) cell(i).append(grid.cell(grid.index(r, c))); } // append the left over vertical cells to the last _cell_ @@ -1289,12 +1289,12 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) break; default: - MathNestInset::doDispatch(cur, cmd); + InsetMathNest::doDispatch(cur, cmd); } } -bool MathGridInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathGrid::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & status) const { switch (cmd.action) { @@ -1385,6 +1385,6 @@ bool MathGridInset::getStatus(LCursor & cur, FuncRequest const & cmd, return true; default: - return MathNestInset::getStatus(cur, cmd, status); + return InsetMathNest::getStatus(cur, cmd, status); } } diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index 317bb92b21..38d0b02a9f 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -19,7 +19,7 @@ /** Gridded math inset base class. * This is the base to all grid-like editable math objects */ -class MathGridInset : public MathNestInset { +class InsetMathGrid : public InsetMathNest { public: /// additional per-cell information @@ -82,15 +82,15 @@ public: public: /// sets nrows and ncols to 1 - MathGridInset(); + InsetMathGrid(); /// constructor from columns description, creates one row - MathGridInset(char valign, std::string const & halign); + InsetMathGrid(char valign, std::string const & halign); /// Note: columns first! - MathGridInset(col_type m, row_type n); + InsetMathGrid(col_type m, row_type n); /// - MathGridInset(col_type m, row_type n, char valign, std::string const & halign); + InsetMathGrid(col_type m, row_type n, char valign, std::string const & halign); /// Ensures that the dialog is closed. - ~MathGridInset(); + ~InsetMathGrid(); /// void metrics(MetricsInfo & mi) const; /// @@ -131,9 +131,9 @@ public: /// CellInfo & cellinfo(idx_type idx) { return cellinfo_[idx]; } /// identifies GridInset - MathGridInset * asGridInset() { return this; } + InsetMathGrid * asGridInset() { return this; } /// identifies GridInset - MathGridInset const * asGridInset() const { return this; } + InsetMathGrid const * asGridInset() const { return this; } /// col_type ncols() const; /// diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 9d6380d0fa..b119f582e4 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -10,15 +10,23 @@ #include +#include "math_arrayinset.h" #include "math_charinset.h" #include "math_colorinset.h" #include "math_data.h" +#include "math_deliminset.h" #include "math_extern.h" #include "math_factory.h" #include "math_hullinset.h" #include "math_mathmlstream.h" +#include "math_parser.h" +#include "math_spaceinset.h" #include "math_streamstr.h" #include "math_support.h" +#include "ref_inset.h" + +#include "bufferview_funcs.h" +#include "lyxtext.h" #include "buffer.h" #include "bufferparams.h" @@ -48,6 +56,7 @@ #include "graphics/PreviewImage.h" #include "graphics/PreviewLoader.h" +#include "support/lyxlib.h" #include "support/lstrings.h" #include @@ -150,21 +159,21 @@ std::string hullName(HullType type) } -MathHullInset::MathHullInset() - : MathGridInset(1, 1), type_(hullNone), nonum_(1), label_(1), +InsetMathHull::InsetMathHull() + : InsetMathGrid(1, 1), type_(hullNone), nonum_(1), label_(1), preview_(new RenderPreview(this)) { - //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << endl; + //lyxerr << "sizeof InsetMath: " << sizeof(InsetMath) << endl; //lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl; - //lyxerr << "sizeof MathCharInset: " << sizeof(MathCharInset) << endl; + //lyxerr << "sizeof InsetMathChar: " << sizeof(InsetMathChar) << endl; //lyxerr << "sizeof LyXFont: " << sizeof(LyXFont) << endl; initMath(); setDefaults(); } -MathHullInset::MathHullInset(HullType type) - : MathGridInset(getCols(type), 1), type_(type), nonum_(1), label_(1), +InsetMathHull::InsetMathHull(HullType type) + : InsetMathGrid(getCols(type), 1), type_(type), nonum_(1), label_(1), preview_(new RenderPreview(this)) { initMath(); @@ -172,28 +181,28 @@ MathHullInset::MathHullInset(HullType type) } -MathHullInset::MathHullInset(MathHullInset const & other) - : MathGridInset(other), +InsetMathHull::InsetMathHull(InsetMathHull const & other) + : InsetMathGrid(other), type_(other.type_), nonum_(other.nonum_), label_(other.label_), preview_(new RenderPreview(this)) {} -MathHullInset::~MathHullInset() +InsetMathHull::~InsetMathHull() {} -auto_ptr MathHullInset::doClone() const +auto_ptr InsetMathHull::doClone() const { - return auto_ptr(new MathHullInset(*this)); + return auto_ptr(new InsetMathHull(*this)); } -MathHullInset & MathHullInset::operator=(MathHullInset const & other) +InsetMathHull & InsetMathHull::operator=(InsetMathHull const & other) { if (this == &other) return *this; - *static_cast(this) = MathGridInset(other); + *static_cast(this) = InsetMathGrid(other); type_ = other.type_; nonum_ = other.nonum_; label_ = other.label_; @@ -203,17 +212,17 @@ MathHullInset & MathHullInset::operator=(MathHullInset const & other) } -InsetBase * MathHullInset::editXY(LCursor & cur, int x, int y) +InsetBase * InsetMathHull::editXY(LCursor & cur, int x, int y) { if (use_preview_) { edit(cur, true); return this; } - return MathNestInset::editXY(cur, x, y); + return InsetMathNest::editXY(cur, x, y); } -MathInset::mode_type MathHullInset::currentMode() const +InsetMath::mode_type InsetMathHull::currentMode() const { if (type_ == hullNone) return UNDECIDED_MODE; @@ -222,7 +231,7 @@ MathInset::mode_type MathHullInset::currentMode() const } -bool MathHullInset::idxFirst(LCursor & cur) const +bool InsetMathHull::idxFirst(LCursor & cur) const { cur.idx() = 0; cur.pos() = 0; @@ -230,7 +239,7 @@ bool MathHullInset::idxFirst(LCursor & cur) const } -bool MathHullInset::idxLast(LCursor & cur) const +bool InsetMathHull::idxLast(LCursor & cur) const { cur.idx() = nargs() - 1; cur.pos() = cur.lastpos(); @@ -238,7 +247,7 @@ bool MathHullInset::idxLast(LCursor & cur) const } -char MathHullInset::defaultColAlign(col_type col) +char InsetMathHull::defaultColAlign(col_type col) { if (type_ == hullEqnArray) return "rcl"[col]; @@ -248,7 +257,7 @@ char MathHullInset::defaultColAlign(col_type col) } -int MathHullInset::defaultColSpace(col_type col) +int InsetMathHull::defaultColSpace(col_type col) { if (type_ == hullAlign || type_ == hullAlignAt) return 0; @@ -260,13 +269,13 @@ int MathHullInset::defaultColSpace(col_type col) } -char const * MathHullInset::standardFont() const +char const * InsetMathHull::standardFont() const { return type_ == hullNone ? "lyxnochange" : "mathnormal"; } -bool MathHullInset::previewState(BufferView * bv) const +bool InsetMathHull::previewState(BufferView * bv) const { if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON) { lyx::graphics::PreviewImage const * pimage = @@ -277,7 +286,7 @@ bool MathHullInset::previewState(BufferView * bv) const } -void MathHullInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const { if (previewState(mi.base.bv)) { preview_->metrics(mi, dim); @@ -293,7 +302,7 @@ void MathHullInset::metrics(MetricsInfo & mi, Dimension & dim) const StyleChanger dummy2(mi.base, display() ? LM_ST_DISPLAY : LM_ST_TEXT); // let the cells adjust themselves - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); if (display()) { dim.asc += displayMargin(); @@ -321,7 +330,7 @@ void MathHullInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathHullInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathHull::draw(PainterInfo & pi, int x, int y) const { use_preview_ = previewState(pi.base.bv); @@ -334,7 +343,7 @@ void MathHullInset::draw(PainterInfo & pi, int x, int y) const FontSetChanger dummy1(pi.base, standardFont()); StyleChanger dummy2(pi.base, display() ? LM_ST_DISPLAY : LM_ST_TEXT); - MathGridInset::draw(pi, x + 1, y); + InsetMathGrid::draw(pi, x + 1, y); if (numberedType()) { int const xx = x + colinfo_.back().offset_ + colinfo_.back().width_ + 20; @@ -350,10 +359,10 @@ void MathHullInset::draw(PainterInfo & pi, int x, int y) const } -void MathHullInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathHull::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { if (display()) { - MathGridInset::metricsT(mi, dim); + InsetMathGrid::metricsT(mi, dim); } else { ostringstream os; WriteStream wi(os, false, true); @@ -365,10 +374,10 @@ void MathHullInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const } -void MathHullInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathHull::drawT(TextPainter & pain, int x, int y) const { if (display()) { - MathGridInset::drawT(pain, x, y); + InsetMathGrid::drawT(pain, x, y); } else { ostringstream os; WriteStream wi(os, false, true); @@ -380,7 +389,7 @@ void MathHullInset::drawT(TextPainter & pain, int x, int y) const namespace { -string const latex_string(MathHullInset const & inset) +string const latex_string(InsetMathHull const & inset) { ostringstream ls; WriteStream wi(ls, false, false); @@ -391,7 +400,7 @@ string const latex_string(MathHullInset const & inset) } // namespace anon -void MathHullInset::addPreview(lyx::graphics::PreviewLoader & ploader) const +void InsetMathHull::addPreview(lyx::graphics::PreviewLoader & ploader) const { if (RenderPreview::status() == LyXRC::PREVIEW_ON) { string const snippet = latex_string(*this); @@ -400,7 +409,7 @@ void MathHullInset::addPreview(lyx::graphics::PreviewLoader & ploader) const } -bool MathHullInset::notifyCursorLeaves(LCursor & cur) +bool InsetMathHull::notifyCursorLeaves(LCursor & cur) { if (RenderPreview::status() == LyXRC::PREVIEW_ON) { Buffer const & buffer = cur.buffer(); @@ -412,33 +421,33 @@ bool MathHullInset::notifyCursorLeaves(LCursor & cur) } -string MathHullInset::label(row_type row) const +string InsetMathHull::label(row_type row) const { BOOST_ASSERT(row < nrows()); return label_[row]; } -void MathHullInset::label(row_type row, string const & label) +void InsetMathHull::label(row_type row, string const & label) { //lyxerr << "setting label '" << label << "' for row " << row << endl; label_[row] = label; } -void MathHullInset::numbered(row_type row, bool num) +void InsetMathHull::numbered(row_type row, bool num) { nonum_[row] = !num; } -bool MathHullInset::numbered(row_type row) const +bool InsetMathHull::numbered(row_type row) const { return !nonum_[row]; } -bool MathHullInset::ams() const +bool InsetMathHull::ams() const { return type_ == hullAlign || @@ -451,13 +460,13 @@ bool MathHullInset::ams() const } -bool MathHullInset::display() const +bool InsetMathHull::display() const { return type_ != hullSimple && type_ != hullNone; } -void MathHullInset::getLabelList(Buffer const &, vector & labels) const +void InsetMathHull::getLabelList(Buffer const &, vector & labels) const { for (row_type row = 0; row < nrows(); ++row) if (!label_[row].empty() && nonum_[row] != 1) @@ -465,7 +474,7 @@ void MathHullInset::getLabelList(Buffer const &, vector & labels) const } -bool MathHullInset::numberedType() const +bool InsetMathHull::numberedType() const { if (type_ == hullNone) return false; @@ -480,7 +489,7 @@ bool MathHullInset::numberedType() const } -void MathHullInset::validate(LaTeXFeatures & features) const +void InsetMathHull::validate(LaTeXFeatures & features) const { if (ams()) features.require("amsmath"); @@ -494,11 +503,11 @@ void MathHullInset::validate(LaTeXFeatures & features) const features.require("boldsymbol"); //features.binom = true; - MathGridInset::validate(features); + InsetMathGrid::validate(features); } -void MathHullInset::header_write(WriteStream & os) const +void InsetMathHull::header_write(WriteStream & os) const { bool n = numberedType(); @@ -536,7 +545,7 @@ hullFlAlign } -void MathHullInset::footer_write(WriteStream & os) const +void InsetMathHull::footer_write(WriteStream & os) const { bool n = numberedType(); @@ -566,7 +575,7 @@ hullFlAlign } -bool MathHullInset::rowChangeOK() const +bool InsetMathHull::rowChangeOK() const { return type_ == hullEqnArray || type_ == hullAlign || @@ -576,7 +585,7 @@ bool MathHullInset::rowChangeOK() const } -bool MathHullInset::colChangeOK() const +bool InsetMathHull::colChangeOK() const { return type_ == hullAlign || type_ == hullFlAlign ||type_ == hullAlignAt || @@ -584,17 +593,17 @@ bool MathHullInset::colChangeOK() const } -void MathHullInset::addRow(row_type row) +void InsetMathHull::addRow(row_type row) { if (!rowChangeOK()) return; nonum_.insert(nonum_.begin() + row + 1, !numberedType()); label_.insert(label_.begin() + row + 1, string()); - MathGridInset::addRow(row); + InsetMathGrid::addRow(row); } -void MathHullInset::swapRow(row_type row) +void InsetMathHull::swapRow(row_type row) { if (nrows() <= 1) return; @@ -602,15 +611,15 @@ void MathHullInset::swapRow(row_type row) --row; swap(nonum_[row], nonum_[row + 1]); swap(label_[row], label_[row + 1]); - MathGridInset::swapRow(row); + InsetMathGrid::swapRow(row); } -void MathHullInset::delRow(row_type row) +void InsetMathHull::delRow(row_type row) { if (nrows() <= 1 || !rowChangeOK()) return; - MathGridInset::delRow(row); + InsetMathGrid::delRow(row); // The last dummy row has no number info nor a label. // Test nrows() + 1 because we have already erased the row. if (row == nrows() + 1) @@ -620,23 +629,23 @@ void MathHullInset::delRow(row_type row) } -void MathHullInset::addCol(col_type col) +void InsetMathHull::addCol(col_type col) { if (!colChangeOK()) return; - MathGridInset::addCol(col); + InsetMathGrid::addCol(col); } -void MathHullInset::delCol(col_type col) +void InsetMathHull::delCol(col_type col) { if (ncols() <= 1 || !colChangeOK()) return; - MathGridInset::delCol(col); + InsetMathGrid::delCol(col); } -string MathHullInset::nicelabel(row_type row) const +string InsetMathHull::nicelabel(row_type row) const { if (nonum_[row]) return string(); @@ -646,21 +655,21 @@ string MathHullInset::nicelabel(row_type row) const } -void MathHullInset::glueall() +void InsetMathHull::glueall() { MathArray ar; for (idx_type i = 0; i < nargs(); ++i) ar.append(cell(i)); - *this = MathHullInset(hullSimple); + *this = InsetMathHull(hullSimple); cell(0) = ar; setDefaults(); } -void MathHullInset::splitTo2Cols() +void InsetMathHull::splitTo2Cols() { BOOST_ASSERT(ncols() == 1); - MathGridInset::addCol(1); + InsetMathGrid::addCol(1); for (row_type row = 0; row < nrows(); ++row) { idx_type const i = 2 * row; pos_type pos = firstRelOp(cell(i)); @@ -670,12 +679,12 @@ void MathHullInset::splitTo2Cols() } -void MathHullInset::splitTo3Cols() +void InsetMathHull::splitTo3Cols() { BOOST_ASSERT(ncols() < 3); if (ncols() < 2) splitTo2Cols(); - MathGridInset::addCol(1); + InsetMathGrid::addCol(1); for (row_type row = 0; row < nrows(); ++row) { idx_type const i = 3 * row + 1; if (cell(i).size()) { @@ -686,7 +695,7 @@ void MathHullInset::splitTo3Cols() } -void MathHullInset::changeCols(col_type cols) +void InsetMathHull::changeCols(col_type cols) { if (ncols() == cols) return; @@ -697,7 +706,7 @@ void MathHullInset::changeCols(col_type cols) else { splitTo3Cols(); while (ncols() < cols) - MathGridInset::addCol(ncols() - 1); + InsetMathGrid::addCol(ncols() - 1); } return; } @@ -711,25 +720,25 @@ void MathHullInset::changeCols(col_type cols) } // delete columns while (ncols() > cols) { - MathGridInset::delCol(ncols() - 1); + InsetMathGrid::delCol(ncols() - 1); } } -HullType MathHullInset::getType() const +HullType InsetMathHull::getType() const { return type_; } -void MathHullInset::setType(HullType type) +void InsetMathHull::setType(HullType type) { type_ = type; setDefaults(); } -void MathHullInset::mutate(HullType newtype) +void InsetMathHull::mutate(HullType newtype) { //lyxerr << "mutating from '" << type_ << "' to '" << newtype << "'" << endl; @@ -873,7 +882,7 @@ void MathHullInset::mutate(HullType newtype) } -string MathHullInset::eolString(row_type row, bool emptyline, bool fragile) const +string InsetMathHull::eolString(row_type row, bool emptyline, bool fragile) const { string res; if (numberedType()) { @@ -882,46 +891,46 @@ string MathHullInset::eolString(row_type row, bool emptyline, bool fragile) cons if (nonum_[row] && (type_ != hullMultline)) res += "\\nonumber "; } - return res + MathGridInset::eolString(row, emptyline, fragile); + return res + InsetMathGrid::eolString(row, emptyline, fragile); } -void MathHullInset::write(WriteStream & os) const +void InsetMathHull::write(WriteStream & os) const { header_write(os); - MathGridInset::write(os); + InsetMathGrid::write(os); footer_write(os); } -void MathHullInset::normalize(NormalStream & os) const +void InsetMathHull::normalize(NormalStream & os) const { os << "[formula " << type_ << ' '; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << "] "; } -void MathHullInset::mathmlize(MathMLStream & os) const +void InsetMathHull::mathmlize(MathMLStream & os) const { - MathGridInset::mathmlize(os); + InsetMathGrid::mathmlize(os); } -void MathHullInset::infoize(ostream & os) const +void InsetMathHull::infoize(ostream & os) const { os << "Type: " << type_; } -void MathHullInset::check() const +void InsetMathHull::check() const { BOOST_ASSERT(nonum_.size() == nrows()); BOOST_ASSERT(label_.size() == nrows()); } -void MathHullInset::doExtern(LCursor & cur, FuncRequest & func) +void InsetMathHull::doExtern(LCursor & cur, FuncRequest & func) { string lang; string extra; @@ -942,7 +951,7 @@ void MathHullInset::doExtern(LCursor & cur, FuncRequest & func) #endif MathArray eq; - eq.push_back(MathAtom(new MathCharInset('='))); + eq.push_back(MathAtom(new InsetMathChar('='))); // go to first item in line cur.idx() -= cur.idx() % ncols(); @@ -1000,7 +1009,7 @@ void MathHullInset::doExtern(LCursor & cur, FuncRequest & func) } -void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathHull::doDispatch(LCursor & cur, FuncRequest & cmd) { //lyxerr << "action: " << cmd.action << endl; switch (cmd.action) { @@ -1010,7 +1019,7 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_FINISHED_UP: case LFUN_FINISHED_DOWN: //lyxerr << "action: " << cmd.action << endl; - MathGridInset::doDispatch(cur, cmd); + InsetMathGrid::doDispatch(cur, cmd); notifyCursorLeaves(cur); cur.undispatched(); break; @@ -1029,7 +1038,7 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) cur.idx() = 0; cur.pos() = cur.lastpos(); } - MathGridInset::doDispatch(cur, cmd); + InsetMathGrid::doDispatch(cur, cmd); break; case LFUN_MATH_NUMBER: @@ -1100,7 +1109,7 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) break; } MathArray ar; - if (createMathInset_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) { + if (createInsetMath_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) { recordUndo(cur); cur.insert(ar); } else @@ -1139,13 +1148,13 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) } default: - MathGridInset::doDispatch(cur, cmd); + InsetMathGrid::doDispatch(cur, cmd); break; } } -bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathHull::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & status) const { switch (cmd.action) { @@ -1168,7 +1177,7 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd, status.enabled(type_ != hullSimple); return true; case LFUN_INSET_INSERT: { - // Don't test createMathInset_fromDialogStr(), since + // Don't test createInsetMath_fromDialogStr(), since // getStatus is not called with a valid reference and the // dialog would not be applyable. string const name = cmd.getArg(0); @@ -1223,37 +1232,23 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd, status.enabled(false); return true; } - return MathGridInset::getStatus(cur, cmd, status); + return InsetMathGrid::getStatus(cur, cmd, status); } default: - return MathGridInset::getStatus(cur, cmd, status); + return InsetMathGrid::getStatus(cur, cmd, status); } // This cannot really happen, but inserted to shut-up gcc - return MathGridInset::getStatus(cur, cmd, status); + return InsetMathGrid::getStatus(cur, cmd, status); } ///////////////////////////////////////////////////////////////////// -#include "math_arrayinset.h" -#include "math_deliminset.h" -#include "math_factory.h" -#include "math_parser.h" -#include "math_spaceinset.h" -#include "ref_inset.h" - -#include "bufferview_funcs.h" -#include "lyxtext.h" - -#include "frontends/LyXView.h" -#include "frontends/Dialogs.h" - -#include "support/lyxlib.h" // simply scrap this function if you want -void MathHullInset::mutateToText() +void InsetMathHull::mutateToText() { #if 0 // translate to latex @@ -1274,48 +1269,48 @@ void MathHullInset::mutateToText() } -void MathHullInset::handleFont(LCursor & cur, string const & arg, +void InsetMathHull::handleFont(LCursor & cur, string const & arg, string const & font) { // this whole function is a hack and won't work for incremental font // changes... recordUndo(cur); - if (cur.inset().asMathInset()->name() == font) + if (cur.inset().asInsetMath()->name() == font) cur.handleFont(font); else { - cur.handleNest(createMathInset(font)); + cur.handleNest(createInsetMath(font)); cur.insert(arg); } } -void MathHullInset::handleFont2(LCursor & cur, string const & arg) +void InsetMathHull::handleFont2(LCursor & cur, string const & arg) { recordUndo(cur); LyXFont font; bool b; bv_funcs::string2font(arg, font, b); if (font.color() != LColor::inherit) { - MathAtom at = MathAtom(new MathColorInset(true, font.color())); + MathAtom at = MathAtom(new InsetMathColor(true, font.color())); cur.handleNest(at, 0); } } -void MathHullInset::edit(LCursor & cur, bool left) +void InsetMathHull::edit(LCursor & cur, bool left) { cur.push(*this); left ? idxFirst(cur) : idxLast(cur); } -docstring const MathHullInset::editMessage() const +docstring const InsetMathHull::editMessage() const { return _("Math editor mode"); } -void MathHullInset::revealCodes(LCursor & cur) const +void InsetMathHull::revealCodes(LCursor & cur) const { if (!cur.inMathed()) return; @@ -1351,7 +1346,7 @@ void MathHullInset::revealCodes(LCursor & cur) const } -InsetBase::Code MathHullInset::lyxCode() const +InsetBase::Code InsetMathHull::lyxCode() const { return MATH_CODE; } @@ -1361,13 +1356,13 @@ InsetBase::Code MathHullInset::lyxCode() const #if 0 -bool MathHullInset::searchForward(BufferView * bv, string const & str, +bool InsetMathHull::searchForward(BufferView * bv, string const & str, bool, bool) { #ifdef WITH_WARNINGS #warning completely broken #endif - static MathHullInset * lastformula = 0; + static InsetMathHull * lastformula = 0; static CursorBase current = DocIterator(ibegin(nucleus())); static MathArray ar; static string laststr; @@ -1386,7 +1381,7 @@ bool MathHullInset::searchForward(BufferView * bv, string const & str, for (DocIterator it = current; it != iend(nucleus()); increment(it)) { CursorSlice & top = it.back(); - MathArray const & a = top.asMathInset()->cell(top.idx_); + MathArray const & a = top.asInsetMath()->cell(top.idx_); if (a.matchpart(ar, top.pos_)) { bv->cursor().setSelection(it, ar.size()); current = it; @@ -1403,7 +1398,7 @@ bool MathHullInset::searchForward(BufferView * bv, string const & str, #endif -void MathHullInset::write(Buffer const &, std::ostream & os) const +void InsetMathHull::write(Buffer const &, std::ostream & os) const { WriteStream wi(os, false, false); os << "Formula "; @@ -1411,7 +1406,7 @@ void MathHullInset::write(Buffer const &, std::ostream & os) const } -void MathHullInset::read(Buffer const &, LyXLex & lex) +void InsetMathHull::read(Buffer const &, LyXLex & lex) { MathAtom at; mathed_parse_normal(at, lex); @@ -1419,7 +1414,7 @@ void MathHullInset::read(Buffer const &, LyXLex & lex) } -int MathHullInset::plaintext(Buffer const &, ostream & os, +int InsetMathHull::plaintext(Buffer const &, ostream & os, OutputParams const &) const { if (0 && display()) { @@ -1440,7 +1435,7 @@ int MathHullInset::plaintext(Buffer const &, ostream & os, } -int MathHullInset::docbook(Buffer const & buf, ostream & os, +int InsetMathHull::docbook(Buffer const & buf, ostream & os, OutputParams const & runparams) const { MathMLStream ms(os); @@ -1463,11 +1458,11 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os, // \ensuremath{} or \begin{display}\end{display} // so we strip LyX' math environment WriteStream wi(ls, false, false); - MathGridInset::write(wi); + InsetMathGrid::write(wi); ms << subst(subst(ls.str(), "&", "&"), "<", "<"); ms << ETag("alt"); ms << MTag("math"); - MathGridInset::mathmlize(ms); + InsetMathGrid::mathmlize(ms); ms << ETag("math"); } else { ms << MTag("alt role=\"tex\""); @@ -1492,7 +1487,7 @@ int MathHullInset::docbook(Buffer const & buf, ostream & os, } -int MathHullInset::textString(Buffer const & buf, ostream & os, +int InsetMathHull::textString(Buffer const & buf, ostream & os, OutputParams const & op) const { return plaintext(buf, os, op); diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index 5f0edb5c61..99e4fd4fb6 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -19,16 +19,16 @@ class RenderPreview; /// This provides an interface between "LyX insets" and "LyX math insets" -class MathHullInset : public MathGridInset { +class InsetMathHull : public InsetMathGrid { public: /// - MathHullInset(); + InsetMathHull(); /// - explicit MathHullInset(HullType type); + explicit InsetMathHull(HullType type); /// - ~MathHullInset(); + ~InsetMathHull(); /// - MathHullInset & operator=(MathHullInset const &); + InsetMathHull & operator=(InsetMathHull const &); /// mode_type currentMode() const; /// @@ -57,9 +57,9 @@ public: /// void validate(LaTeXFeatures & features) const; /// identifies HullInset - MathHullInset const * asHullInset() const { return this; } + InsetMathHull const * asHullInset() const { return this; } /// identifies HullInset - MathHullInset * asHullInset() { return this; } + InsetMathHull * asHullInset() { return this; } /// add a row void addRow(row_type row); @@ -120,7 +120,7 @@ public: static int displayMargin() { return 12; } protected: - MathHullInset(MathHullInset const &); + InsetMathHull(InsetMathHull const &); virtual void doDispatch(LCursor & cur, FuncRequest & cmd); diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 2f04f7a9b7..fc5d35a653 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -25,7 +25,7 @@ using std::ostream; using std::endl; -MathArray & MathInset::cell(idx_type) +MathArray & InsetMath::cell(idx_type) { static MathArray dummyCell; lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl; @@ -33,7 +33,7 @@ MathArray & MathInset::cell(idx_type) } -MathArray const & MathInset::cell(idx_type) const +MathArray const & InsetMath::cell(idx_type) const { static MathArray dummyCell; lyxerr << BOOST_CURRENT_FUNCTION << ": I don't have any cell" << endl; @@ -41,7 +41,7 @@ MathArray const & MathInset::cell(idx_type) const } -void MathInset::dump() const +void InsetMath::dump() const { lyxerr << "---------------------------------------------" << endl; WriteStream wi(lyxerr, false, true); @@ -50,24 +50,24 @@ void MathInset::dump() const } -void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const +void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const { #ifdef WITH_WARNINGS - lyxerr << "MathInset::metricsT(Text) called directly!" << endl; + lyxerr << "InsetMath::metricsT(Text) called directly!" << endl; #endif } -void MathInset::drawT(TextPainter &, int, int) const +void InsetMath::drawT(TextPainter &, int, int) const { #ifdef WITH_WARNINGS - lyxerr << "MathInset::drawT(Text) called directly!" << endl; + lyxerr << "InsetMath::drawT(Text) called directly!" << endl; #endif } -void MathInset::write(WriteStream & os) const +void InsetMath::write(WriteStream & os) const { string const s = name(); os << '\\' << s.c_str(); @@ -78,54 +78,54 @@ void MathInset::write(WriteStream & os) const } -void MathInset::normalize(NormalStream & os) const +void InsetMath::normalize(NormalStream & os) const { os << '[' << name().c_str() << "] "; } -void MathInset::octave(OctaveStream & os) const +void InsetMath::octave(OctaveStream & os) const { NormalStream ns(os.os()); normalize(ns); } -void MathInset::maple(MapleStream & os) const +void InsetMath::maple(MapleStream & os) const { NormalStream ns(os.os()); normalize(ns); } -void MathInset::maxima(MaximaStream & os) const +void InsetMath::maxima(MaximaStream & os) const { MapleStream ns(os.os()); maple(ns); } -void MathInset::mathematica(MathematicaStream & os) const +void InsetMath::mathematica(MathematicaStream & os) const { NormalStream ns(os.os()); normalize(ns); } -void MathInset::mathmlize(MathMLStream & os) const +void InsetMath::mathmlize(MathMLStream & os) const { NormalStream ns(os.os()); normalize(ns); } -HullType MathInset::getType() const +HullType InsetMath::getType() const { return hullNone; } -string MathInset::name() const +string InsetMath::name() const { return "unknown"; } diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index c3bf7330a6..09972c2e58 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -44,30 +44,30 @@ the math objects. Math insets do not know there parents, a cursor position or things like that. The are dumb object that are contained in other math insets -(MathNestInsets, in fact) thus forming a tree. The root of this tree is -always a MathHullInset, which provides an interface to the Outer World by +(InsetMathNests, in fact) thus forming a tree. The root of this tree is +always a InsetMathHull, which provides an interface to the Outer World by inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset. */ class OutputParams; -class MathArrayInset; -class MathAMSArrayInset; -class MathBraceInset; -class MathCharInset; -class MathDelimInset; -class MathFracInset; -class MathFontInset; -class MathGridInset; -class MathHullInset; -class MathMatrixInset; -class MathNestInset; -class MathParboxInset; -class MathScriptInset; -class MathStringInset; -class MathSpaceInset; -class MathSymbolInset; -class MathUnknownInset; +class InsetMathArray; +class InsetMathAMSArray; +class InsetMathBrace; +class InsetMathChar; +class InsetMathDelim; +class InsetMathFrac; +class InsetMathFont; +class InsetMathGrid; +class InsetMathHull; +class InsetMathMatrix; +class InsetMathNest; +class InsetMathParbox; +class InsetMathScript; +class InsetMathString; +class InsetMathSpace; +class InsetMathSymbol; +class InsetMathUnknown; class RefInset; @@ -90,10 +90,10 @@ class TextMetricsInfo; class ReplaceData; -class MathInset : public InsetBase { +class InsetMath : public InsetBase { public: /// identification as math inset - MathInset * asMathInset() { return this; } + InsetMath * asInsetMath() { return this; } /// this is overridden in math text insets (i.e. mbox) bool inMathed() const { return true; } @@ -109,39 +109,39 @@ public: virtual MathArray const & cell(idx_type) const; /// identifies certain types of insets - virtual MathAMSArrayInset * asAMSArrayInset() { return 0; } - virtual MathAMSArrayInset const * asAMSArrayInset() const { return 0; } - virtual MathArrayInset * asArrayInset() { return 0; } - virtual MathArrayInset const * asArrayInset() const { return 0; } - virtual MathBraceInset const * asBraceInset() const { return 0; } - virtual MathCharInset const * asCharInset() const { return 0; } - virtual MathDelimInset * asDelimInset() { return 0; } - virtual MathDelimInset const * asDelimInset() const { return 0; } - virtual MathFracInset * asFracInset() { return 0; } - virtual MathFracInset const * asFracInset() const { return 0; } - virtual MathFontInset * asFontInset() { return 0; } - virtual MathFontInset const * asFontInset() const { return 0; } - virtual MathGridInset * asGridInset() { return 0; } - virtual MathGridInset const * asGridInset() const { return 0; } - virtual MathHullInset * asHullInset() { return 0; } - virtual MathHullInset const * asHullInset() const { return 0; } + virtual InsetMathAMSArray * asAMSArrayInset() { return 0; } + virtual InsetMathAMSArray const * asAMSArrayInset() const { return 0; } + virtual InsetMathArray * asArrayInset() { return 0; } + virtual InsetMathArray const * asArrayInset() const { return 0; } + virtual InsetMathBrace const * asBraceInset() const { return 0; } + virtual InsetMathChar const * asCharInset() const { return 0; } + virtual InsetMathDelim * asDelimInset() { return 0; } + virtual InsetMathDelim const * asDelimInset() const { return 0; } + virtual InsetMathFrac * asFracInset() { return 0; } + virtual InsetMathFrac const * asFracInset() const { return 0; } + virtual InsetMathFont * asFontInset() { return 0; } + virtual InsetMathFont const * asFontInset() const { return 0; } + virtual InsetMathGrid * asGridInset() { return 0; } + virtual InsetMathGrid const * asGridInset() const { return 0; } + virtual InsetMathHull * asHullInset() { return 0; } + virtual InsetMathHull const * asHullInset() const { return 0; } virtual MathMacro * asMacro() { return 0; } virtual MathMacro const * asMacro() const { return 0; } virtual MathMacroTemplate * asMacroTemplate() { return 0; } virtual MathMacroTemplate const * asMacroTemplate() const { return 0; } - virtual MathMatrixInset const * asMatrixInset() const { return 0; } - virtual MathNestInset * asNestInset() { return 0; } - virtual MathNestInset const * asNestInset() const { return 0; } - virtual MathParboxInset * asParboxInset() { return 0; } - virtual MathScriptInset * asScriptInset() { return 0; } - virtual MathScriptInset const * asScriptInset() const { return 0; } - virtual MathSpaceInset * asSpaceInset() { return 0; } - virtual MathSpaceInset const * asSpaceInset() const { return 0; } - virtual MathStringInset * asStringInset() { return 0; } - virtual MathStringInset const * asStringInset() const { return 0; } - virtual MathSymbolInset const * asSymbolInset() const { return 0; } - virtual MathUnknownInset * asUnknownInset() { return 0; } - virtual MathUnknownInset const * asUnknownInset() const { return 0; } + virtual InsetMathMatrix const * asMatrixInset() const { return 0; } + virtual InsetMathNest * asNestInset() { return 0; } + virtual InsetMathNest const * asNestInset() const { return 0; } + virtual InsetMathParbox * asParboxInset() { return 0; } + virtual InsetMathScript * asScriptInset() { return 0; } + virtual InsetMathScript const * asScriptInset() const { return 0; } + virtual InsetMathSpace * asSpaceInset() { return 0; } + virtual InsetMathSpace const * asSpaceInset() const { return 0; } + virtual InsetMathString * asStringInset() { return 0; } + virtual InsetMathString const * asStringInset() const { return 0; } + virtual InsetMathSymbol const * asSymbolInset() const { return 0; } + virtual InsetMathUnknown * asUnknownInset() { return 0; } + virtual InsetMathUnknown const * asUnknownInset() const { return 0; } virtual RefInset * asRefInset() { return 0; } /// identifies things that can get scripts diff --git a/src/mathed/math_kerninset.C b/src/mathed/math_kerninset.C index d5e5339977..3dfd470699 100644 --- a/src/mathed/math_kerninset.C +++ b/src/mathed/math_kerninset.C @@ -20,27 +20,27 @@ using std::string; using std::auto_ptr; -MathKernInset::MathKernInset() +InsetMathKern::InsetMathKern() {} -MathKernInset::MathKernInset(LyXLength const & w) +InsetMathKern::InsetMathKern(LyXLength const & w) : wid_(w) {} -MathKernInset::MathKernInset(string const & s) +InsetMathKern::InsetMathKern(string const & s) : wid_(s) {} -auto_ptr MathKernInset::doClone() const +auto_ptr InsetMathKern::doClone() const { - return auto_ptr(new MathKernInset(*this)); + return auto_ptr(new InsetMathKern(*this)); } -void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const { wid_pix_ = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M')); dim.wid = wid_pix_; @@ -49,23 +49,23 @@ void MathKernInset::metrics(MetricsInfo & mi, Dimension & dim) const } -int MathKernInset::width() const +int InsetMathKern::width() const { return wid_pix_; } -void MathKernInset::draw(PainterInfo &, int, int) const +void InsetMathKern::draw(PainterInfo &, int, int) const {} -void MathKernInset::write(WriteStream & os) const +void InsetMathKern::write(WriteStream & os) const { os << "\\kern" << wid_.asLatexString() << ' '; } -void MathKernInset::normalize(NormalStream & os) const +void InsetMathKern::normalize(NormalStream & os) const { os << "[kern " << wid_.asLatexString() << ']'; } diff --git a/src/mathed/math_kerninset.h b/src/mathed/math_kerninset.h index a8c4c9c0bd..94aebac529 100644 --- a/src/mathed/math_kerninset.h +++ b/src/mathed/math_kerninset.h @@ -19,14 +19,14 @@ /// The \kern primitive /// Some hack for visual effects -class MathKernInset : public MathInset { +class InsetMathKern : public InsetMath { public: /// - MathKernInset(); + InsetMathKern(); /// - explicit MathKernInset(LyXLength const & wid); + explicit InsetMathKern(LyXLength const & wid); /// - explicit MathKernInset(std::string const & wid); + explicit InsetMathKern(std::string const & wid); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_lefteqninset.C b/src/mathed/math_lefteqninset.C index 46771075a9..cdd8970ac7 100644 --- a/src/mathed/math_lefteqninset.C +++ b/src/mathed/math_lefteqninset.C @@ -19,18 +19,18 @@ using std::string; using std::auto_ptr; -MathLefteqnInset::MathLefteqnInset() - : MathNestInset(1) +InsetMathLefteqn::InsetMathLefteqn() + : InsetMathNest(1) {} -auto_ptr MathLefteqnInset::doClone() const +auto_ptr InsetMathLefteqn::doClone() const { - return auto_ptr(new MathLefteqnInset(*this)); + return auto_ptr(new InsetMathLefteqn(*this)); } -void MathLefteqnInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathLefteqn::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); dim.asc += 2; @@ -41,20 +41,20 @@ void MathLefteqnInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathLefteqnInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathLefteqn::draw(PainterInfo & pi, int x, int y) const { cell(0).draw(pi, x + 2, y); drawMarkers(pi, x, y); } -string MathLefteqnInset::name() const +string InsetMathLefteqn::name() const { return "lefteqn"; } -void MathLefteqnInset::infoize(std::ostream & os) const +void InsetMathLefteqn::infoize(std::ostream & os) const { os << "Lefteqn "; } diff --git a/src/mathed/math_lefteqninset.h b/src/mathed/math_lefteqninset.h index d5fe40ee6b..3ab4017239 100644 --- a/src/mathed/math_lefteqninset.h +++ b/src/mathed/math_lefteqninset.h @@ -17,10 +17,10 @@ /// Support for LaTeX's \\lefteqn command -class MathLefteqnInset : public MathNestInset { +class InsetMathLefteqn : public InsetMathNest { public: /// - MathLefteqnInset(); + InsetMathLefteqn(); /// std::string name() const; /// diff --git a/src/mathed/math_liminset.C b/src/mathed/math_liminset.C index 0139db1b4c..c1355e2598 100644 --- a/src/mathed/math_liminset.C +++ b/src/mathed/math_liminset.C @@ -19,9 +19,9 @@ using std::auto_ptr; using std::endl; -MathLimInset::MathLimInset +InsetMathLim::InsetMathLim (MathArray const & f, MathArray const & x, MathArray const & x0) - : MathNestInset(3) + : InsetMathNest(3) { cell(0) = f; cell(1) = x; @@ -29,55 +29,55 @@ MathLimInset::MathLimInset } -auto_ptr MathLimInset::doClone() const +auto_ptr InsetMathLim::doClone() const { - return auto_ptr(new MathLimInset(*this)); + return auto_ptr(new InsetMathLim(*this)); } -void MathLimInset::normalize(NormalStream & os) const +void InsetMathLim::normalize(NormalStream & os) const { os << "[lim " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']'; } -void MathLimInset::metrics(MetricsInfo &, Dimension &) const +void InsetMathLim::metrics(MetricsInfo &, Dimension &) const { lyxerr << "should not happen" << endl; } -void MathLimInset::draw(PainterInfo &, int, int) const +void InsetMathLim::draw(PainterInfo &, int, int) const { lyxerr << "should not happen" << endl; } -void MathLimInset::maple(MapleStream & os) const +void InsetMathLim::maple(MapleStream & os) const { os << "limit(" << cell(0) << ',' << cell(1) << '=' << cell(2) << ')'; } -void MathLimInset::maxima(MaximaStream & os) const +void InsetMathLim::maxima(MaximaStream & os) const { os << "limit(" << cell(0) << ',' << cell(1) << ',' << cell(2) << ')'; } -void MathLimInset::mathematica(MathematicaStream & os) const +void InsetMathLim::mathematica(MathematicaStream & os) const { os << "Limit[" << cell(0) << ',' << cell(1) << "-> " << cell(2) << ']'; } -void MathLimInset::mathmlize(MathMLStream & os) const +void InsetMathLim::mathmlize(MathMLStream & os) const { os << "lim(" << cell(0) << ',' << cell(1) << ',' << cell(2) << ')'; } -void MathLimInset::write(WriteStream &) const +void InsetMathLim::write(WriteStream &) const { lyxerr << "should not happen" << endl; } diff --git a/src/mathed/math_liminset.h b/src/mathed/math_liminset.h index 39fc87de80..7e4eb44e38 100644 --- a/src/mathed/math_liminset.h +++ b/src/mathed/math_liminset.h @@ -18,10 +18,10 @@ #include "math_nestinset.h" -class MathLimInset : public MathNestInset { +class InsetMathLim : public InsetMathNest { public: /// - MathLimInset(MathArray const & f, MathArray const & x, MathArray const & x0); + InsetMathLim(MathArray const & f, MathArray const & x, MathArray const & x0); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index a424d252e2..19ec6a3ebe 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -32,7 +32,7 @@ using std::endl; MathMacro::MathMacro(string const & name, int numargs) - : MathNestInset(numargs), name_(name) + : InsetMathNest(numargs), name_(name) {} @@ -51,9 +51,9 @@ string MathMacro::name() const void MathMacro::cursorPos(CursorSlice const & sl, bool boundary, int & x, int & y) const { - // We may have 0 arguments, but MathNestInset requires at least one. + // We may have 0 arguments, but InsetMathNest requires at least one. if (nargs() > 0) - MathNestInset::cursorPos(sl, boundary, x, y); + InsetMathNest::cursorPos(sl, boundary, x, y); } @@ -116,9 +116,9 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const void MathMacro::drawSelection(PainterInfo & pi, int x, int y) const { - // We may have 0 arguments, but MathNestInset requires at least one. + // We may have 0 arguments, but InsetMathNest requires at least one. if (nargs() > 0) - MathNestInset::drawSelection(pi, x, y); + InsetMathNest::drawSelection(pi, x, y); } @@ -131,17 +131,17 @@ void MathMacro::validate(LaTeXFeatures & features) const InsetBase * MathMacro::editXY(LCursor & cur, int x, int y) { - // We may have 0 arguments, but MathNestInset requires at least one. + // We may have 0 arguments, but InsetMathNest requires at least one. if (nargs() > 0) { // Prevent crash due to cold coordcache // FIXME: This is only a workaround, the call of - // MathNestInset::editXY is correct. The correct fix would + // InsetMathNest::editXY is correct. The correct fix would // ensure that the coordcache of the arguments is valid. if (!editing(&cur.bv())) { edit(cur, true); return this; } - return MathNestInset::editXY(cur, x, y); + return InsetMathNest::editXY(cur, x, y); } return this; } diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index 6afbab1b3f..102a9a0904 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -20,7 +20,7 @@ /// This class contains the data for a macro. -class MathMacro : public MathNestInset { +class MathMacro : public InsetMathNest { public: /// A macro can be built from an existing template MathMacro(std::string const & name, int numargs); diff --git a/src/mathed/math_macroarg.h b/src/mathed/math_macroarg.h index 0db549d7ab..56c57f7c5a 100644 --- a/src/mathed/math_macroarg.h +++ b/src/mathed/math_macroarg.h @@ -17,7 +17,7 @@ /// A macro argument. -class MathMacroArgument : public MathDimInset { +class MathMacroArgument : public InsetMathDim { public: /// explicit MathMacroArgument(std::size_t); diff --git a/src/mathed/math_macrotable.C b/src/mathed/math_macrotable.C index f7bb45efcb..74bc46bd88 100644 --- a/src/mathed/math_macrotable.C +++ b/src/mathed/math_macrotable.C @@ -44,7 +44,7 @@ MacroData::MacroData(string const & def, int numargs, string const & disp) void MacroData::expand(vector const & args, MathArray & to) const { - MathSqrtInset inset; // Hack. Any inset with a cell would do. + InsetMathSqrt inset; // Hack. Any inset with a cell would do. asArray(disp_.empty() ? def_ : disp_, inset.cell(0)); //lyxerr << "MathData::expand: args: " << args << endl; //lyxerr << "MathData::expand: ar: " << inset.cell(0) << endl; @@ -54,7 +54,7 @@ void MacroData::expand(vector const & args, MathArray & to) const if (it.nextInset()->lyxCode() != InsetBase::MATHMACROARG_CODE) continue; //it.cell().erase(it.pos()); - //it.cell().insert(it.pos(), it.nextInset()->asMathInset() + //it.cell().insert(it.pos(), it.nextInset()->asInsetMath() size_t n = static_cast(it.nextInset())->number(); if (n <= args.size()) { it.cell().erase(it.pos()); diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 3607a35d1b..717d0bc65d 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -36,7 +36,7 @@ using std::endl; MathMacroTemplate::MathMacroTemplate() - : MathNestInset(2), numargs_(0), name_(), type_("newcommand") + : InsetMathNest(2), numargs_(0), name_(), type_("newcommand") { initMath(); } @@ -44,7 +44,7 @@ MathMacroTemplate::MathMacroTemplate() MathMacroTemplate::MathMacroTemplate(string const & nm, int numargs, string const & type, MathArray const & ar1, MathArray const & ar2) - : MathNestInset(2), numargs_(numargs), name_(nm), type_(type) + : InsetMathNest(2), numargs_(numargs), name_(nm), type_(type) { initMath(); @@ -57,7 +57,7 @@ MathMacroTemplate::MathMacroTemplate(string const & nm, int numargs, MathMacroTemplate::MathMacroTemplate(std::istream & is) - : MathNestInset(2), numargs_(0), name_() + : InsetMathNest(2), numargs_(0), name_() { initMath(); diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index 6b471088d9..d2c2a4ed22 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -20,7 +20,7 @@ #include "support/types.h" /// This class contains the macro definition. -class MathMacroTemplate : public MathNestInset { +class MathMacroTemplate : public InsetMathNest { public: /// MathMacroTemplate(); diff --git a/src/mathed/math_makeboxinset.C b/src/mathed/math_makeboxinset.C index a3d6d4b480..c83715f7f3 100644 --- a/src/mathed/math_makeboxinset.C +++ b/src/mathed/math_makeboxinset.C @@ -20,22 +20,22 @@ using std::auto_ptr; -MathMakeboxInset::MathMakeboxInset() - : MathNestInset(3) +InsetMathMakebox::InsetMathMakebox() + : InsetMathNest(3) {} -auto_ptr MathMakeboxInset::doClone() const +auto_ptr InsetMathMakebox::doClone() const { - return auto_ptr(new MathMakeboxInset(*this)); + return auto_ptr(new InsetMathMakebox(*this)); } -void MathMakeboxInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); w_ = mathed_char_width(mi.base.font, '['); - MathNestInset::metrics(mi); + InsetMathNest::metrics(mi); dim = cell(0).dim(); dim += cell(1).dim(); dim += cell(2).dim(); @@ -45,7 +45,7 @@ void MathMakeboxInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, "textnormal"); drawMarkers(pi, x, y); @@ -69,7 +69,7 @@ void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const } -void MathMakeboxInset::write(WriteStream & os) const +void InsetMathMakebox::write(WriteStream & os) const { os << "\\makebox"; os << '[' << cell(0) << ']'; @@ -79,13 +79,13 @@ void MathMakeboxInset::write(WriteStream & os) const } -void MathMakeboxInset::normalize(NormalStream & os) const +void InsetMathMakebox::normalize(NormalStream & os) const { os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']'; } -void MathMakeboxInset::infoize(std::ostream & os) const +void InsetMathMakebox::infoize(std::ostream & os) const { os << "Makebox (width: " << cell(0) << " pos: " << cell(1) << ")"; diff --git a/src/mathed/math_makeboxinset.h b/src/mathed/math_makeboxinset.h index 5ddf3618e3..cf7b4bbe4d 100644 --- a/src/mathed/math_makeboxinset.h +++ b/src/mathed/math_makeboxinset.h @@ -15,12 +15,12 @@ #include "math_nestinset.h" /// Extra nesting: \\makebox. -// consolidate with MathFrameboxInset? +// consolidate with InsetMathFrameBox? -class MathMakeboxInset : public MathNestInset { +class InsetMathMakebox : public InsetMathNest { public: /// - MathMakeboxInset(); + InsetMathMakebox(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_mathmlstream.h b/src/mathed/math_mathmlstream.h index 65df407fba..8369e047cf 100644 --- a/src/mathed/math_mathmlstream.h +++ b/src/mathed/math_mathmlstream.h @@ -22,7 +22,7 @@ #include class MathArray; -class MathInset; +class InsetMath; class MathAtom; // diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index 961c0ed51e..2fa7f10d08 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -17,30 +17,30 @@ using std::auto_ptr; -MathMatrixInset::MathMatrixInset(MathGridInset const & p) - : MathGridInset(p) +InsetMathMatrix::InsetMathMatrix(InsetMathGrid const & p) + : InsetMathGrid(p) {} -auto_ptr MathMatrixInset::doClone() const +auto_ptr InsetMathMatrix::doClone() const { - return auto_ptr(new MathMatrixInset(*this)); + return auto_ptr(new InsetMathMatrix(*this)); } -void MathMatrixInset::write(WriteStream & os) const +void InsetMathMatrix::write(WriteStream & os) const { - MathGridInset::write(os); + InsetMathGrid::write(os); } -void MathMatrixInset::normalize(NormalStream & os) const +void InsetMathMatrix::normalize(NormalStream & os) const { - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); } -void MathMatrixInset::maple(MapleStream & os) const +void InsetMathMatrix::maple(MapleStream & os) const { os << "matrix(" << int(nrows()) << ',' << int(ncols()) << ",["; for (idx_type idx = 0; idx < nargs(); ++idx) { @@ -52,7 +52,7 @@ void MathMatrixInset::maple(MapleStream & os) const } -void MathMatrixInset::maxima(MaximaStream & os) const +void InsetMathMatrix::maxima(MaximaStream & os) const { os << "matrix("; for (row_type row = 0; row < nrows(); ++row) { @@ -70,7 +70,7 @@ void MathMatrixInset::maxima(MaximaStream & os) const } -void MathMatrixInset::mathematica(MathematicaStream & os) const +void InsetMathMatrix::mathematica(MathematicaStream & os) const { os << '{'; for (row_type row = 0; row < nrows(); ++row) { @@ -88,13 +88,13 @@ void MathMatrixInset::mathematica(MathematicaStream & os) const } -void MathMatrixInset::mathmlize(MathMLStream & os) const +void InsetMathMatrix::mathmlize(MathMLStream & os) const { - MathGridInset::mathmlize(os); + InsetMathGrid::mathmlize(os); } -void MathMatrixInset::octave(OctaveStream & os) const +void InsetMathMatrix::octave(OctaveStream & os) const { os << '['; for (row_type row = 0; row < nrows(); ++row) { diff --git a/src/mathed/math_matrixinset.h b/src/mathed/math_matrixinset.h index 2935c64413..95de7a48d3 100644 --- a/src/mathed/math_matrixinset.h +++ b/src/mathed/math_matrixinset.h @@ -17,14 +17,14 @@ // "shortcut" for DelimInset("(",ArrayInset,")") -class MathMatrixInset : public MathGridInset { +class InsetMathMatrix : public InsetMathGrid { public: /// - explicit MathMatrixInset(MathGridInset const &); + explicit InsetMathMatrix(InsetMathGrid const &); /// - explicit MathMatrixInset(std::string const & str); + explicit InsetMathMatrix(std::string const & str); /// identifies MatrixInsets - MathMatrixInset const * asMatrixInset() const { return this; } + InsetMathMatrix const * asMatrixInset() const { return this; } /// void write(WriteStream & os) const; diff --git a/src/mathed/math_mboxinset.C b/src/mathed/math_mboxinset.C index fd2f1e25b4..7b7c16ee84 100644 --- a/src/mathed/math_mboxinset.C +++ b/src/mathed/math_mboxinset.C @@ -29,7 +29,7 @@ using std::auto_ptr; using std::endl; -MathMBoxInset::MathMBoxInset(BufferView & bv) +InsetMathMBox::InsetMathMBox(BufferView & bv) : text_(&bv), bv_(&bv) { text_.paragraphs().clear(); @@ -40,13 +40,13 @@ MathMBoxInset::MathMBoxInset(BufferView & bv) } -auto_ptr MathMBoxInset::doClone() const +auto_ptr InsetMathMBox::doClone() const { - return auto_ptr(new MathMBoxInset(*this)); + return auto_ptr(new InsetMathMBox(*this)); } -void MathMBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathMBox::metrics(MetricsInfo & mi, Dimension & dim) const { text_.metrics(mi, dim); metricsMarkers2(dim); @@ -54,14 +54,14 @@ void MathMBoxInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathMBoxInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathMBox::draw(PainterInfo & pi, int x, int y) const { text_.draw(pi, x + 1, y); drawMarkers(pi, x, y); } -void MathMBoxInset::write(WriteStream & ws) const +void InsetMathMBox::write(WriteStream & ws) const { if (ws.latex()) { ws << "\\mbox{\n"; @@ -79,7 +79,7 @@ void MathMBoxInset::write(WriteStream & ws) const } -int MathMBoxInset::latex(Buffer const & buf, std::ostream & os, +int InsetMathMBox::latex(Buffer const & buf, std::ostream & os, OutputParams const & runparams) const { os << "\\mbox{\n"; @@ -90,19 +90,19 @@ int MathMBoxInset::latex(Buffer const & buf, std::ostream & os, } -void MathMBoxInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathMBox::doDispatch(LCursor & cur, FuncRequest & cmd) { text_.dispatch(cur, cmd); } -LyXText * MathMBoxInset::getText(int) const +LyXText * InsetMathMBox::getText(int) const { return &text_; } -void MathMBoxInset::cursorPos +void InsetMathMBox::cursorPos (CursorSlice const & sl, bool boundary, int & x, int & y) const { x = text_.cursorX(sl, boundary); @@ -110,7 +110,7 @@ void MathMBoxInset::cursorPos } -void MathMBoxInset::drawSelection(PainterInfo & pi, int x, int y) const +void InsetMathMBox::drawSelection(PainterInfo & pi, int x, int y) const { text_.drawSelection(pi, x, y); } diff --git a/src/mathed/math_mboxinset.h b/src/mathed/math_mboxinset.h index 59f13be506..4e6b34f4c5 100644 --- a/src/mathed/math_mboxinset.h +++ b/src/mathed/math_mboxinset.h @@ -18,10 +18,10 @@ // almost a substitute for the real text inset... -class MathMBoxInset : public MathDimInset { +class InsetMathMBox : public InsetMathDim { public: /// - explicit MathMBoxInset(BufferView & bv); + explicit InsetMathMBox(BufferView & bv); /// this stores metrics information in cache_ void metrics(MetricsInfo & mi, Dimension & dim) const; /// draw according to cached metrics diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index b45b3e27bd..5b6de1a04b 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -72,30 +72,30 @@ using std::string; using std::istringstream; -MathNestInset::MathNestInset(idx_type nargs) +InsetMathNest::InsetMathNest(idx_type nargs) : cells_(nargs), lock_(false) {} -MathInset::idx_type MathNestInset::nargs() const +InsetMath::idx_type InsetMathNest::nargs() const { return cells_.size(); } -MathArray & MathNestInset::cell(idx_type i) +MathArray & InsetMathNest::cell(idx_type i) { return cells_[i]; } -MathArray const & MathNestInset::cell(idx_type i) const +MathArray const & InsetMathNest::cell(idx_type i) const { return cells_[i]; } -void MathNestInset::cursorPos(CursorSlice const & sl, bool /*boundary*/, +void InsetMathNest::cursorPos(CursorSlice const & sl, bool /*boundary*/, int & x, int & y) const { // FIXME: This is a hack. Ideally, the coord cache should not store @@ -137,7 +137,7 @@ void MathNestInset::cursorPos(CursorSlice const & sl, bool /*boundary*/, } -void MathNestInset::metrics(MetricsInfo const & mi) const +void InsetMathNest::metrics(MetricsInfo const & mi) const { MetricsInfo m = mi; for (idx_type i = 0, n = nargs(); i != n; ++i) @@ -145,7 +145,7 @@ void MathNestInset::metrics(MetricsInfo const & mi) const } -bool MathNestInset::idxNext(LCursor & cur) const +bool InsetMathNest::idxNext(LCursor & cur) const { BOOST_ASSERT(ptr_cmp(&cur.inset(), this)); if (cur.idx() == cur.lastidx()) @@ -156,13 +156,13 @@ bool MathNestInset::idxNext(LCursor & cur) const } -bool MathNestInset::idxRight(LCursor & cur) const +bool InsetMathNest::idxRight(LCursor & cur) const { return idxNext(cur); } -bool MathNestInset::idxPrev(LCursor & cur) const +bool InsetMathNest::idxPrev(LCursor & cur) const { BOOST_ASSERT(ptr_cmp(&cur.inset(), this)); if (cur.idx() == 0) @@ -173,13 +173,13 @@ bool MathNestInset::idxPrev(LCursor & cur) const } -bool MathNestInset::idxLeft(LCursor & cur) const +bool InsetMathNest::idxLeft(LCursor & cur) const { return idxPrev(cur); } -bool MathNestInset::idxFirst(LCursor & cur) const +bool InsetMathNest::idxFirst(LCursor & cur) const { BOOST_ASSERT(ptr_cmp(&cur.inset(), this)); if (nargs() == 0) @@ -190,7 +190,7 @@ bool MathNestInset::idxFirst(LCursor & cur) const } -bool MathNestInset::idxLast(LCursor & cur) const +bool InsetMathNest::idxLast(LCursor & cur) const { BOOST_ASSERT(ptr_cmp(&cur.inset(), this)); if (nargs() == 0) @@ -201,7 +201,7 @@ bool MathNestInset::idxLast(LCursor & cur) const } -void MathNestInset::dump() const +void InsetMathNest::dump() const { WriteStream os(lyxerr); os << "---------------------------------------------\n"; @@ -213,7 +213,7 @@ void MathNestInset::dump() const } -void MathNestInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathNest::draw(PainterInfo & pi, int x, int y) const { #if 0 if (lock_) @@ -224,7 +224,7 @@ void MathNestInset::draw(PainterInfo & pi, int x, int y) const } -void MathNestInset::drawSelection(PainterInfo & pi, int x, int y) const +void InsetMathNest::drawSelection(PainterInfo & pi, int x, int y) const { // this should use the x/y values given, not the cached values LCursor & cur = pi.base.bv->cursor(); @@ -241,7 +241,7 @@ void MathNestInset::drawSelection(PainterInfo & pi, int x, int y) const CursorSlice s1 = cur.selBegin(); CursorSlice s2 = cur.selEnd(); - //lyxerr << "MathNestInset::drawing selection: " + //lyxerr << "InsetMathNest::drawing selection: " // << " s1: " << s1 << " s2: " << s2 << endl; if (s1.idx() == s2.idx()) { MathArray const & c = cell(s1.idx()); @@ -250,7 +250,7 @@ void MathNestInset::drawSelection(PainterInfo & pi, int x, int y) const int x2 = c.xo() + c.pos2x(s2.pos()); int y2 = c.yo() + c.descent(); pi.pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection); - //lyxerr << "MathNestInset::drawing selection 3: " + //lyxerr << "InsetMathNest::drawing selection 3: " // << " x1: " << x1 << " x2: " << x2 // << " y1: " << y1 << " y2: " << y2 << endl; } else { @@ -268,21 +268,21 @@ void MathNestInset::drawSelection(PainterInfo & pi, int x, int y) const } -void MathNestInset::validate(LaTeXFeatures & features) const +void InsetMathNest::validate(LaTeXFeatures & features) const { for (idx_type i = 0; i < nargs(); ++i) cell(i).validate(features); } -void MathNestInset::replace(ReplaceData & rep) +void InsetMathNest::replace(ReplaceData & rep) { for (idx_type i = 0; i < nargs(); ++i) cell(i).replace(rep); } -bool MathNestInset::contains(MathArray const & ar) const +bool InsetMathNest::contains(MathArray const & ar) const { for (idx_type i = 0; i < nargs(); ++i) if (cell(i).contains(ar)) @@ -291,25 +291,25 @@ bool MathNestInset::contains(MathArray const & ar) const } -bool MathNestInset::lock() const +bool InsetMathNest::lock() const { return lock_; } -void MathNestInset::lock(bool l) +void InsetMathNest::lock(bool l) { lock_ = l; } -bool MathNestInset::isActive() const +bool InsetMathNest::isActive() const { return nargs() > 0; } -MathArray MathNestInset::glue() const +MathArray InsetMathNest::glue() const { MathArray ar; for (size_t i = 0; i < nargs(); ++i) @@ -318,7 +318,7 @@ MathArray MathNestInset::glue() const } -void MathNestInset::write(WriteStream & os) const +void InsetMathNest::write(WriteStream & os) const { os << '\\' << name().c_str(); for (size_t i = 0; i < nargs(); ++i) @@ -332,7 +332,7 @@ void MathNestInset::write(WriteStream & os) const } -void MathNestInset::normalize(NormalStream & os) const +void InsetMathNest::normalize(NormalStream & os) const { os << '[' << name().c_str(); for (size_t i = 0; i < nargs(); ++i) @@ -341,7 +341,7 @@ void MathNestInset::normalize(NormalStream & os) const } -int MathNestInset::latex(Buffer const &, std::ostream & os, +int InsetMathNest::latex(Buffer const &, std::ostream & os, OutputParams const & runparams) const { WriteStream wi(os, runparams.moving_arg, true); @@ -350,7 +350,7 @@ int MathNestInset::latex(Buffer const &, std::ostream & os, } -bool MathNestInset::notifyCursorLeaves(LCursor & /*cur*/) +bool InsetMathNest::notifyCursorLeaves(LCursor & /*cur*/) { #ifdef WITH_WARNINGS #warning look here @@ -359,7 +359,7 @@ bool MathNestInset::notifyCursorLeaves(LCursor & /*cur*/) MathArray & ar = cur.cell(); // remove base-only "scripts" for (pos_type i = 0; i + 1 < ar.size(); ++i) { - MathScriptInset * p = operator[](i).nucleus()->asScriptInset(); + InsetMathScript * p = operator[](i).nucleus()->asScriptInset(); if (p && p->nargs() == 1) { MathArray ar = p->nuc(); erase(i); @@ -370,8 +370,8 @@ bool MathNestInset::notifyCursorLeaves(LCursor & /*cur*/) // glue adjacent font insets of the same kind for (pos_type i = 0; i + 1 < size(); ++i) { - MathFontInset * p = operator[](i).nucleus()->asFontInset(); - MathFontInset const * q = operator[](i + 1)->asFontInset(); + InsetMathFont * p = operator[](i).nucleus()->asFontInset(); + InsetMathFont const * q = operator[](i + 1)->asFontInset(); if (p && q && p->name() == q->name()) { p->cell(0).append(q->cell(0)); erase(i + 1); @@ -383,38 +383,38 @@ bool MathNestInset::notifyCursorLeaves(LCursor & /*cur*/) } -void MathNestInset::handleFont +void InsetMathNest::handleFont (LCursor & cur, string const & arg, string const & font) { // this whole function is a hack and won't work for incremental font // changes... recordUndo(cur, Undo::ATOMIC); - if (cur.inset().asMathInset()->name() == font) + if (cur.inset().asInsetMath()->name() == font) cur.handleFont(font); else { - cur.handleNest(createMathInset(font)); + cur.handleNest(createInsetMath(font)); cur.insert(arg); } } -void MathNestInset::handleFont2(LCursor & cur, string const & arg) +void InsetMathNest::handleFont2(LCursor & cur, string const & arg) { recordUndo(cur, Undo::ATOMIC); LyXFont font; bool b; bv_funcs::string2font(arg, font, b); if (font.color() != LColor::inherit) { - MathAtom at = MathAtom(new MathColorInset(true, font.color())); + MathAtom at = MathAtom(new InsetMathColor(true, font.color())); cur.handleNest(at, 0); } } -void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathNest::doDispatch(LCursor & cur, FuncRequest & cmd) { - //lyxerr << "MathNestInset: request: " << cmd << std::endl; + //lyxerr << "InsetMathNest: request: " << cmd << std::endl; //CursorSlice sl = cur.current(); switch (cmd.action) { @@ -676,8 +676,8 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) // Otherwise we'll get an invalid cursor if we undo after // the macro was finished and the macro is a known command, // e.g. sqrt. LCursor::macroModeClose replaces in this case - // the MathUnknownInset with name "frac" by an empty - // MathFracInset -> a pos value > 0 is invalid. + // the InsetMathUnknown with name "frac" by an empty + // InsetMathFrac -> a pos value > 0 is invalid. // A side effect is that an undo before the macro is finished // undoes the complete macro, not only the last character. if (!cur.inMacroMode()) @@ -811,14 +811,14 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) cur.macroModeClose(); string const save_selection = grabAndEraseSelection(cur); selClearOrDel(cur); - //cur.plainInsert(MathAtom(new MathMBoxInset(cur.bv()))); - cur.plainInsert(MathAtom(new MathBoxInset("mbox"))); + //cur.plainInsert(MathAtom(new InsetMathMBox(cur.bv()))); + cur.plainInsert(MathAtom(new InsetMathBox("mbox"))); cur.posLeft(); cur.pushLeft(*cur.nextInset()); cur.niceInsert(save_selection); #else if (currentMode() == InsetBase::TEXT_MODE) { - cur.niceInsert(MathAtom(new MathHullInset("simple"))); + cur.niceInsert(MathAtom(new InsetMathHull("simple"))); cur.message(_("create new math text environment ($...$)")); } else { handleFont(cur, lyx::to_utf8(cmd.argument()), "textrm"); @@ -849,7 +849,7 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) n = 1; v_align += 'c'; cur.niceInsert( - MathAtom(new MathArrayInset("array", m, n, v_align[0], h_align))); + MathAtom(new InsetMathArray("array", m, n, v_align[0], h_align))); break; } @@ -862,7 +862,7 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) if (rs.empty()) rs = ')'; recordUndo(cur, Undo::ATOMIC); - cur.handleNest(MathAtom(new MathDelimInset(ls, rs))); + cur.handleNest(MathAtom(new InsetMathDelim(ls, rs))); break; } @@ -873,10 +873,10 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) string const rdelim = cmd.getArg(3); latexkeys const * l = in_word_set(lname); bool const have_l = l && l->inset == "big" && - MathBigInset::isBigInsetDelim(ldelim); + InsetMathBig::isBigInsetDelim(ldelim); l = in_word_set(rname); bool const have_r = l && l->inset == "big" && - MathBigInset::isBigInsetDelim(rdelim); + InsetMathBig::isBigInsetDelim(rdelim); // We mimic LFUN_MATH_DELIM in case we have an empty left // or right delimiter. if (have_l || have_r) { @@ -884,11 +884,11 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) string const selection = grabAndEraseSelection(cur); selClearOrDel(cur); if (have_l) - cur.insert(MathAtom(new MathBigInset(lname, + cur.insert(MathAtom(new InsetMathBig(lname, ldelim))); cur.niceInsert(selection); if (have_r) - cur.insert(MathAtom(new MathBigInset(rname, + cur.insert(MathAtom(new InsetMathBig(rname, rdelim))); } // Don't call cur.undispatched() if we did nothing, this would @@ -899,7 +899,7 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_SPACE_INSERT: case LFUN_MATH_SPACE: recordUndo(cur, Undo::ATOMIC); - cur.insert(MathAtom(new MathSpaceInset(","))); + cur.insert(MathAtom(new InsetMathSpace(","))); break; case LFUN_ERT_INSERT: @@ -944,13 +944,13 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) } default: - MathDimInset::doDispatch(cur, cmd); + InsetMathDim::doDispatch(cur, cmd); break; } } -bool MathNestInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathNest::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { // the font related toggles @@ -1041,17 +1041,17 @@ bool MathNestInset::getStatus(LCursor & cur, FuncRequest const & cmd, } -void MathNestInset::edit(LCursor & cur, bool left) +void InsetMathNest::edit(LCursor & cur, bool left) { cur.push(*this); cur.idx() = left ? 0 : cur.lastidx(); cur.pos() = left ? 0 : cur.lastpos(); cur.resetAnchor(); - //lyxerr << "MathNestInset::edit, cur:\n" << cur << endl; + //lyxerr << "InsetMathNest::edit, cur:\n" << cur << endl; } -InsetBase * MathNestInset::editXY(LCursor & cur, int x, int y) +InsetBase * InsetMathNest::editXY(LCursor & cur, int x, int y) { int idx_min = 0; int dist_min = 1000000; @@ -1077,7 +1077,7 @@ InsetBase * MathNestInset::editXY(LCursor & cur, int x, int y) } -void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd) +void InsetMathNest::lfunMousePress(LCursor & cur, FuncRequest & cmd) { //lyxerr << "## lfunMousePress: buttons: " << cmd.button() << endl; BufferView & bv = cur.bv(); @@ -1097,7 +1097,7 @@ void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd) } -void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd) +void InsetMathNest::lfunMouseMotion(LCursor & cur, FuncRequest & cmd) { // only select with button 1 if (cmd.button() == mouse_button::button1) { @@ -1115,7 +1115,7 @@ void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd) } -void MathNestInset::lfunMouseRelease(LCursor & cur, FuncRequest & cmd) +void InsetMathNest::lfunMouseRelease(LCursor & cur, FuncRequest & cmd) { //lyxerr << "## lfunMouseRelease: buttons: " << cmd.button() << endl; @@ -1134,7 +1134,7 @@ void MathNestInset::lfunMouseRelease(LCursor & cur, FuncRequest & cmd) } -bool MathNestInset::interpret(LCursor & cur, char c) +bool InsetMathNest::interpret(LCursor & cur, char c) { //lyxerr << "interpret 2: '" << c << "'" << endl; string save_selection; @@ -1166,22 +1166,22 @@ bool MathNestInset::interpret(LCursor & cur, char c) // remove the '\\' if (c == '\\') { cur.backspace(); - if (currentMode() == MathInset::TEXT_MODE) - cur.niceInsert(createMathInset("textbackslash")); + if (currentMode() == InsetMath::TEXT_MODE) + cur.niceInsert(createInsetMath("textbackslash")); else - cur.niceInsert(createMathInset("backslash")); + cur.niceInsert(createInsetMath("backslash")); } else if (c == '{') { cur.backspace(); - cur.niceInsert(MathAtom(new MathBraceInset)); + cur.niceInsert(MathAtom(new InsetMathBrace)); } else if (c == '%') { cur.backspace(); - cur.niceInsert(MathAtom(new MathCommentInset)); + cur.niceInsert(MathAtom(new InsetMathComment)); } else if (c == '#') { BOOST_ASSERT(cur.activeMacro()); cur.activeMacro()->setName(name + c); } else { cur.backspace(); - cur.niceInsert(createMathInset(string(1, c))); + cur.niceInsert(createInsetMath(string(1, c))); } return true; } @@ -1202,16 +1202,16 @@ bool MathNestInset::interpret(LCursor & cur, char c) delim = string(1, c); break; } - if (MathBigInset::isBigInsetDelim(delim)) { - // name + delim ared a valid MathBigInset. + if (InsetMathBig::isBigInsetDelim(delim)) { + // name + delim ared a valid InsetMathBig. // We can't use cur.macroModeClose() because // it does not handle delim. - MathUnknownInset * p = cur.activeMacro(); + InsetMathUnknown * p = cur.activeMacro(); p->finalize(); --cur.pos(); cur.cell().erase(cur.pos()); cur.plainInsert(MathAtom( - new MathBigInset(name.substr(1), delim))); + new InsetMathBig(name.substr(1), delim))); return true; } } @@ -1219,7 +1219,7 @@ bool MathNestInset::interpret(LCursor & cur, char c) // leave macro mode and try again if necessary cur.macroModeClose(); if (c == '{') - cur.niceInsert(MathAtom(new MathBraceInset)); + cur.niceInsert(MathAtom(new InsetMathBrace)); else if (c != ' ') interpret(cur, c); return true; @@ -1246,18 +1246,18 @@ bool MathNestInset::interpret(LCursor & cur, char c) if (c == '\\') { //lyxerr << "starting with macro" << endl; - cur.insert(MathAtom(new MathUnknownInset("\\", false))); + cur.insert(MathAtom(new InsetMathUnknown("\\", false))); return true; } if (c == '\n') { - if (currentMode() == MathInset::TEXT_MODE) + if (currentMode() == InsetMath::TEXT_MODE) cur.insert(c); return true; } if (c == ' ') { - if (currentMode() == MathInset::TEXT_MODE) { + if (currentMode() == InsetMath::TEXT_MODE) { // insert spaces in text mode, // but suppress direct insertion of two spaces in a row // the still allows typing 'a' and deleting the 'a', but @@ -1277,7 +1277,7 @@ bool MathNestInset::interpret(LCursor & cur, char c) } // These shouldn't work in text mode: - if (currentMode() != MathInset::TEXT_MODE) { + if (currentMode() != InsetMath::TEXT_MODE) { if (c == '_') { script(cur, false, save_selection); return true; @@ -1287,14 +1287,14 @@ bool MathNestInset::interpret(LCursor & cur, char c) return true; } if (c == '~') { - cur.niceInsert(createMathInset("sim")); + cur.niceInsert(createInsetMath("sim")); return true; } } if (c == '{' || c == '}' || c == '&' || c == '$' || c == '#' || c == '%' || c == '_' || c == '^') { - cur.niceInsert(createMathInset(string(1, c))); + cur.niceInsert(createInsetMath(string(1, c))); return true; } @@ -1310,20 +1310,20 @@ bool MathNestInset::interpret(LCursor & cur, char c) } -bool MathNestInset::interpret(LCursor & cur, string const & str) +bool InsetMathNest::interpret(LCursor & cur, string const & str) { - // Create a MathBigInset from cur.cell()[cur.pos() - 1] and t if + // Create a InsetMathBig from cur.cell()[cur.pos() - 1] and t if // possible if (!cur.empty() && cur.pos() > 0 && cur.cell()[cur.pos() - 1]->asUnknownInset()) { - if (MathBigInset::isBigInsetDelim(str)) { + if (InsetMathBig::isBigInsetDelim(str)) { string prev = asString(cur.cell()[cur.pos() - 1]); if (prev[0] == '\\') { prev = prev.substr(1); latexkeys const * l = in_word_set(prev); if (l && l->inset == "big") { cur.cell()[cur.pos() - 1] = - MathAtom(new MathBigInset(prev, str)); + MathAtom(new InsetMathBig(prev, str)); return true; } } @@ -1333,14 +1333,14 @@ bool MathNestInset::interpret(LCursor & cur, string const & str) } -bool MathNestInset::script(LCursor & cur, bool up, string const & +bool InsetMathNest::script(LCursor & cur, bool up, string const & save_selection) { // Hack to get \^ and \_ working //lyxerr << "handling script: up: " << up << endl; if (cur.inMacroMode() && cur.macroName() == "\\") { if (up) - cur.niceInsert(createMathInset("mathcircumflex")); + cur.niceInsert(createInsetMath("mathcircumflex")); else interpret(cur, '_'); return true; @@ -1349,14 +1349,14 @@ bool MathNestInset::script(LCursor & cur, bool up, string const & cur.macroModeClose(); if (asScriptInset() && cur.idx() == 0) { // we are in a nucleus of a script inset, move to _our_ script - MathScriptInset * inset = asScriptInset(); + InsetMathScript * inset = asScriptInset(); //lyxerr << " going to cell " << inset->idxOfScript(up) << endl; inset->ensure(up); cur.idx() = inset->idxOfScript(up); cur.pos() = 0; } else if (cur.pos() != 0 && cur.prevAtom()->asScriptInset()) { --cur.pos(); - MathScriptInset * inset = cur.nextAtom().nucleus()->asScriptInset(); + InsetMathScript * inset = cur.nextAtom().nucleus()->asScriptInset(); cur.push(*inset); inset->ensure(up); cur.idx() = inset->idxOfScript(up); @@ -1366,13 +1366,13 @@ bool MathNestInset::script(LCursor & cur, bool up, string const & // one if in the very first position of the array if (cur.pos() == 0) { //lyxerr << "new scriptinset" << endl; - cur.insert(new MathScriptInset(up)); + cur.insert(new InsetMathScript(up)); } else { //lyxerr << "converting prev atom " << endl; - cur.prevAtom() = MathAtom(new MathScriptInset(cur.prevAtom(), up)); + cur.prevAtom() = MathAtom(new InsetMathScript(cur.prevAtom(), up)); } --cur.pos(); - MathScriptInset * inset = cur.nextAtom().nucleus()->asScriptInset(); + InsetMathScript * inset = cur.nextAtom().nucleus()->asScriptInset(); // special handling of {}-bases // is this always correct? if (inset->nuc().size() == 1 diff --git a/src/mathed/math_nestinset.h b/src/mathed/math_nestinset.h index 70344cc46e..f86e9fd030 100644 --- a/src/mathed/math_nestinset.h +++ b/src/mathed/math_nestinset.h @@ -20,10 +20,10 @@ single symbol. */ -class MathNestInset : public MathDimInset { +class InsetMathNest : public InsetMathDim { public: /// nestinsets have a fixed size to start with - explicit MathNestInset(idx_type ncells); + explicit InsetMathNest(idx_type ncells); /// the size is usually some sort of convex hull of the cells /// hides inset::metrics() intentionally! @@ -33,9 +33,9 @@ public: /// draw selection background void drawSelection(PainterInfo & pi, int x, int y) const; /// identifies NestInsets - MathNestInset * asNestInset() { return this; } + InsetMathNest * asNestInset() { return this; } /// identifies NestInsets - MathNestInset const * asNestInset() const { return this; } + InsetMathNest const * asNestInset() const { return this; } /// get cursor position void cursorPos(CursorSlice const & sl, bool boundary, int & x, int & y) const; /// diff --git a/src/mathed/math_numberinset.C b/src/mathed/math_numberinset.C index 16f64c4e9c..13ef842476 100644 --- a/src/mathed/math_numberinset.C +++ b/src/mathed/math_numberinset.C @@ -21,61 +21,61 @@ using std::string; using std::auto_ptr; -MathNumberInset::MathNumberInset(string const & s) +InsetMathNumber::InsetMathNumber(string const & s) : str_(s) {} -auto_ptr MathNumberInset::doClone() const +auto_ptr InsetMathNumber::doClone() const { - return auto_ptr(new MathNumberInset(*this)); + return auto_ptr(new InsetMathNumber(*this)); } -void MathNumberInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const { mathed_string_dim(mi.base.font, str_, dim); } -void MathNumberInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathNumber::draw(PainterInfo & pi, int x, int y) const { docstring const dstr(str_.begin(), str_.end()); pi.draw(x, y, dstr); } -void MathNumberInset::normalize(NormalStream & os) const +void InsetMathNumber::normalize(NormalStream & os) const { os << "[number " << str_ << ']'; } -void MathNumberInset::maple(MapleStream & os) const +void InsetMathNumber::maple(MapleStream & os) const { os << str_; } -void MathNumberInset::mathematica(MathematicaStream & os) const +void InsetMathNumber::mathematica(MathematicaStream & os) const { os << str_; } -void MathNumberInset::octave(OctaveStream & os) const +void InsetMathNumber::octave(OctaveStream & os) const { os << str_; } -void MathNumberInset::mathmlize(MathMLStream & os) const +void InsetMathNumber::mathmlize(MathMLStream & os) const { os << " " << str_ << " "; } -void MathNumberInset::write(WriteStream & os) const +void InsetMathNumber::write(WriteStream & os) const { os << str_; } diff --git a/src/mathed/math_numberinset.h b/src/mathed/math_numberinset.h index 326bd45dfe..de78449e60 100644 --- a/src/mathed/math_numberinset.h +++ b/src/mathed/math_numberinset.h @@ -18,10 +18,10 @@ /** Some inset that "is" a number * mainly for math-extern */ -class MathNumberInset : public MathInset { +class InsetMathNumber : public InsetMath { public: /// - explicit MathNumberInset(std::string const & s); + explicit InsetMathNumber(std::string const & s); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// @@ -29,7 +29,7 @@ public: /// std::string str() const { return str_; } /// - MathNumberInset * asNumberInset() { return this; } + InsetMathNumber * asNumberInset() { return this; } /// void normalize(NormalStream &) const; diff --git a/src/mathed/math_oversetinset.C b/src/mathed/math_oversetinset.C index ed4670407b..696edde3f0 100644 --- a/src/mathed/math_oversetinset.C +++ b/src/mathed/math_oversetinset.C @@ -21,13 +21,13 @@ using std::max; using std::auto_ptr; -auto_ptr MathOversetInset::doClone() const +auto_ptr InsetMathOverset::doClone() const { - return auto_ptr(new MathOversetInset(*this)); + return auto_ptr(new InsetMathOverset(*this)); } -void MathOversetInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathOverset::metrics(MetricsInfo & mi, Dimension & dim) const { cell(1).metrics(mi); FracChanger dummy(mi.base); @@ -40,7 +40,7 @@ void MathOversetInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathOversetInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathOverset::draw(PainterInfo & pi, int x, int y) const { int m = x + width() / 2; int yo = y - cell(1).ascent() + cell(0).descent() - 1; @@ -51,7 +51,7 @@ void MathOversetInset::draw(PainterInfo & pi, int x, int y) const } -bool MathOversetInset::idxFirst(LCursor & cur) const +bool InsetMathOverset::idxFirst(LCursor & cur) const { cur.idx() = 1; cur.pos() = 0; @@ -59,7 +59,7 @@ bool MathOversetInset::idxFirst(LCursor & cur) const } -bool MathOversetInset::idxLast(LCursor & cur) const +bool InsetMathOverset::idxLast(LCursor & cur) const { cur.idx() = 1; cur.pos() = cur.lastpos(); @@ -67,20 +67,20 @@ bool MathOversetInset::idxLast(LCursor & cur) const } -void MathOversetInset::write(WriteStream & os) const +void InsetMathOverset::write(WriteStream & os) const { os << "\\overset{" << cell(0) << "}{" << cell(1) << '}'; } -void MathOversetInset::normalize(NormalStream & os) const +void InsetMathOverset::normalize(NormalStream & os) const { os << "[overset " << cell(0) << ' ' << cell(1) << ']'; } -void MathOversetInset::validate(LaTeXFeatures & features) const +void InsetMathOverset::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_oversetinset.h b/src/mathed/math_oversetinset.h index f73ac6149b..3e3e39c2ed 100644 --- a/src/mathed/math_oversetinset.h +++ b/src/mathed/math_oversetinset.h @@ -16,7 +16,7 @@ #include "math_fracbase.h" /// Inset for overset -class MathOversetInset : public MathFracbaseInset { +class InsetMathOverset : public InsetMathFracBase { public: /// void metrics(MetricsInfo & mi, Dimension & dim) const; diff --git a/src/mathed/math_parinset.C b/src/mathed/math_parinset.C index 3f2baae0dd..4064b99cba 100644 --- a/src/mathed/math_parinset.C +++ b/src/mathed/math_parinset.C @@ -19,41 +19,41 @@ using std::auto_ptr; -MathParInset::MathParInset(MathArray const & ar) +InsetMathPar::InsetMathPar(MathArray const & ar) { cells_[0] = ar; } -void MathParInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathPar::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy1(mi.base, "textnormal"); - MathGridInset::metrics(mi); + InsetMathGrid::metrics(mi); dim = dim_; } -void MathParInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathPar::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy1(pi.base, "textnormal"); - MathGridInset::draw(pi, x, y); + InsetMathGrid::draw(pi, x, y); } -void MathParInset::write(WriteStream & os) const +void InsetMathPar::write(WriteStream & os) const { for (idx_type i = 0; i < nargs(); ++i) os << cell(i) << "\n"; } -void MathParInset::infoize(std::ostream & os) const +void InsetMathPar::infoize(std::ostream & os) const { os << "Type: Paragraph "; } -auto_ptr MathParInset::doClone() const +auto_ptr InsetMathPar::doClone() const { - return auto_ptr(new MathParInset(*this)); + return auto_ptr(new InsetMathPar(*this)); } diff --git a/src/mathed/math_parinset.h b/src/mathed/math_parinset.h index 0c32eb6354..eb03ffe42a 100644 --- a/src/mathed/math_parinset.h +++ b/src/mathed/math_parinset.h @@ -15,12 +15,12 @@ #include "math_hullinset.h" -class MathParInset : public MathHullInset { +class InsetMathPar : public InsetMathHull { public: /// - MathParInset() {} + InsetMathPar() {} /// - MathParInset(MathArray const & ar); + InsetMathPar(MathArray const & ar); /// mode_type currentMode() const { return TEXT_MODE; } /// diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 6cf2817de3..8b1da5111a 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -85,13 +85,13 @@ using std::vector; namespace { -MathInset::mode_type asMode(MathInset::mode_type oldmode, string const & str) +InsetMath::mode_type asMode(InsetMath::mode_type oldmode, string const & str) { //lyxerr << "handling mode: '" << str << "'" << endl; if (str == "mathmode") - return MathInset::MATH_MODE; + return InsetMath::MATH_MODE; if (str == "textmode" || str == "forcetext") - return MathInset::TEXT_MODE; + return InsetMath::TEXT_MODE; return oldmode; } @@ -108,7 +108,7 @@ bool stared(string const & s) * \returns wether the row could be added. Adding a row can fail for * environments like "equation" that have a fixed number of rows. */ -bool addRow(MathGridInset & grid, MathGridInset::row_type & cellrow, +bool addRow(InsetMathGrid & grid, InsetMathGrid::row_type & cellrow, string const & vskip) { ++cellrow; @@ -140,7 +140,7 @@ bool addRow(MathGridInset & grid, MathGridInset::row_type & cellrow, * \returns wether the column could be added. Adding a column can fail for * environments like "eqnarray" that have a fixed number of columns. */ -bool addCol(MathGridInset & grid, MathGridInset::col_type & cellcol) +bool addCol(InsetMathGrid & grid, InsetMathGrid::col_type & cellcol) { ++cellcol; if (cellcol == grid.ncols()) { @@ -175,10 +175,10 @@ bool addCol(MathGridInset & grid, MathGridInset::col_type & cellcol) * will result in a grid with 3 rows (+ the dummy row that is always present), * because the last '\\' opens a new row. */ -void delEmptyLastRow(MathGridInset & grid) +void delEmptyLastRow(InsetMathGrid & grid) { - MathGridInset::row_type const row = grid.nrows() - 1; - for (MathGridInset::col_type col = 0; col < grid.ncols(); ++col) { + InsetMathGrid::row_type const row = grid.nrows() - 1; + for (InsetMathGrid::col_type col = 0; col < grid.ncols(); ++col) { if (!grid.cell(grid.index(row, col)).empty()) return; } @@ -284,7 +284,7 @@ ostream & operator<<(ostream & os, Token const & t) class Parser { public: /// - typedef MathInset::mode_type mode_type; + typedef InsetMath::mode_type mode_type; /// Parser(LyXLex & lex); @@ -296,7 +296,7 @@ public: /// void parse(MathArray & array, unsigned flags, mode_type mode); /// - void parse1(MathGridInset & grid, unsigned flags, mode_type mode, + void parse1(InsetMathGrid & grid, unsigned flags, mode_type mode, bool numbered); /// MathArray parse(unsigned flags, mode_type mode); @@ -575,10 +575,10 @@ bool Parser::parse(MathAtom & at) { skipSpaces(); MathArray ar; - parse(ar, false, MathInset::UNDECIDED_MODE); + parse(ar, false, InsetMath::UNDECIDED_MODE); if (ar.size() != 1 || ar.front()->getType() == hullNone) { lyxerr << "unusual contents found: " << ar << endl; - at = MathAtom(new MathParInset(ar)); + at = MathAtom(new InsetMathPar(ar)); //if (at->nargs() > 0) // at.nucleus()->cell(0) = ar; //else @@ -637,7 +637,7 @@ MathArray Parser::parse(unsigned flags, mode_type mode) void Parser::parse(MathArray & array, unsigned flags, mode_type mode) { - MathGridInset grid(1, 1); + InsetMathGrid grid(1, 1); parse1(grid, flags, mode, false); array = grid.cell(0); } @@ -650,12 +650,12 @@ void Parser::parse2(MathAtom & at, const unsigned flags, const mode_type mode, } -void Parser::parse1(MathGridInset & grid, unsigned flags, +void Parser::parse1(InsetMathGrid & grid, unsigned flags, const mode_type mode, const bool numbered) { int limits = 0; - MathGridInset::row_type cellrow = 0; - MathGridInset::col_type cellcol = 0; + InsetMathGrid::row_type cellrow = 0; + InsetMathGrid::col_type cellcol = 0; MathArray * cell = &grid.cell(grid.index(cellrow, cellcol)); if (grid.asHullInset()) @@ -721,19 +721,19 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, // cat codes // if (t.cat() == catMath) { - if (mode != MathInset::MATH_MODE) { + if (mode != InsetMath::MATH_MODE) { // we are inside some text mode thingy, so opening new math is allowed Token const & n = getToken(); if (n.cat() == catMath) { // TeX's $$...$$ syntax for displayed math - cell->push_back(MathAtom(new MathHullInset(hullEquation))); - parse2(cell->back(), FLAG_SIMPLE, MathInset::MATH_MODE, false); + cell->push_back(MathAtom(new InsetMathHull(hullEquation))); + parse2(cell->back(), FLAG_SIMPLE, InsetMath::MATH_MODE, false); getToken(); // skip the second '$' token } else { // simple $...$ stuff putback(); - cell->push_back(MathAtom(new MathHullInset(hullSimple))); - parse2(cell->back(), FLAG_SIMPLE, MathInset::MATH_MODE, false); + cell->push_back(MathAtom(new InsetMathHull(hullSimple))); + parse2(cell->back(), FLAG_SIMPLE, InsetMath::MATH_MODE, false); } } @@ -749,16 +749,16 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else if (t.cat() == catLetter) - cell->push_back(MathAtom(new MathCharInset(t.character()))); + cell->push_back(MathAtom(new InsetMathChar(t.character()))); - else if (t.cat() == catSpace && mode != MathInset::MATH_MODE) { + else if (t.cat() == catSpace && mode != InsetMath::MATH_MODE) { if (cell->empty() || cell->back()->getChar() != ' ') - cell->push_back(MathAtom(new MathCharInset(t.character()))); + cell->push_back(MathAtom(new InsetMathChar(t.character()))); } - else if (t.cat() == catNewline && mode != MathInset::MATH_MODE) { + else if (t.cat() == catNewline && mode != InsetMath::MATH_MODE) { if (cell->empty() || cell->back()->getChar() != ' ') - cell->push_back(MathAtom(new MathCharInset(' '))); + cell->push_back(MathAtom(new InsetMathChar(' '))); } else if (t.cat() == catParameter) { @@ -767,7 +767,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else if (t.cat() == catActive) - cell->push_back(MathAtom(new MathCharInset(t.character()))); + cell->push_back(MathAtom(new InsetMathChar(t.character()))); else if (t.cat() == catBegin) { MathArray ar; @@ -777,7 +777,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (ar.size() == 1 && ar[0]->extraBraces()) cell->append(ar); else - cell->push_back(MathAtom(new MathBraceInset(ar))); + cell->push_back(MathAtom(new InsetMathBrace(ar))); } else if (t.cat() == catEnd) { @@ -802,15 +802,15 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, // we need no new script inset if the last thing was a scriptinset, // which has that script already not the same script already if (!cell->size()) - cell->push_back(MathAtom(new MathScriptInset(up))); + cell->push_back(MathAtom(new InsetMathScript(up))); else if (cell->back()->asScriptInset() && !cell->back()->asScriptInset()->has(up)) cell->back().nucleus()->asScriptInset()->ensure(up); else if (cell->back()->asScriptInset()) - cell->push_back(MathAtom(new MathScriptInset(up))); + cell->push_back(MathAtom(new InsetMathScript(up))); else - cell->back() = MathAtom(new MathScriptInset(cell->back(), up)); - MathScriptInset * p = cell->back().nucleus()->asScriptInset(); + cell->back() = MathAtom(new InsetMathScript(cell->back(), up)); + InsetMathScript * p = cell->back().nucleus()->asScriptInset(); // special handling of {}-bases // is this always correct? if (p->nuc().size() == 1 @@ -829,7 +829,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else if (t.cat() == catOther) - cell->push_back(MathAtom(new MathCharInset(t.character()))); + cell->push_back(MathAtom(new InsetMathChar(t.character()))); else if (t.cat() == catComment) { string s; @@ -839,7 +839,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, break; s += t.asString(); } - cell->push_back(MathAtom(new MathCommentInset(s))); + cell->push_back(MathAtom(new InsetMathComment(s))); skipSpaces(); } @@ -893,11 +893,11 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } MathArray ar1; - parse(ar1, FLAG_ITEM, MathInset::UNDECIDED_MODE); + parse(ar1, FLAG_ITEM, InsetMath::UNDECIDED_MODE); // we cannot handle recursive stuff at all //MathArray test; - //test.push_back(createMathInset(name)); + //test.push_back(createInsetMath(name)); //if (ar1.contains(test)) { // error("we cannot handle recursive macros at all."); // return; @@ -907,20 +907,20 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, skipSpaces(); MathArray ar2; if (nextToken().cat() == catBegin) - parse(ar2, FLAG_ITEM, MathInset::MATH_MODE); + parse(ar2, FLAG_ITEM, InsetMath::MATH_MODE); cell->push_back(MathAtom(new MathMacroTemplate(name, nargs, type, ar1, ar2))); } else if (t.cs() == "(") { - cell->push_back(MathAtom(new MathHullInset(hullSimple))); - parse2(cell->back(), FLAG_SIMPLE2, MathInset::MATH_MODE, false); + cell->push_back(MathAtom(new InsetMathHull(hullSimple))); + parse2(cell->back(), FLAG_SIMPLE2, InsetMath::MATH_MODE, false); } else if (t.cs() == "[") { - cell->push_back(MathAtom(new MathHullInset(hullEquation))); - parse2(cell->back(), FLAG_EQUATION, MathInset::MATH_MODE, false); + cell->push_back(MathAtom(new InsetMathHull(hullEquation))); + parse2(cell->back(), FLAG_EQUATION, InsetMath::MATH_MODE, false); } else if (t.cs() == "protect") @@ -943,7 +943,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, environments_.pop_back(); // Delete empty last row in matrix // like insets. - // If you abuse MathGridInset for + // If you abuse InsetMathGrid for // non-matrix like structures you // probably need to refine this test. // Right now we only have to test for @@ -1037,17 +1037,17 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, MathArray ar; parse(ar, FLAG_OPTION, mode); if (ar.size()) { - cell->push_back(MathAtom(new MathRootInset)); + cell->push_back(MathAtom(new InsetMathRoot)); cell->back().nucleus()->cell(0) = ar; parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode); } else { - cell->push_back(MathAtom(new MathSqrtInset)); + cell->push_back(MathAtom(new InsetMathSqrt)); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } } else if (t.cs() == "xrightarrow" || t.cs() == "xleftarrow") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse(cell->back().nucleus()->cell(1), FLAG_OPTION, mode); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } @@ -1062,16 +1062,16 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, else if (t.cs() == "left") { skipSpaces(); Token const & tl = getToken(); - // \| and \Vert are equivalent, and MathDelimInset + // \| and \Vert are equivalent, and InsetMathDelim // can't handle \| - // FIXME: fix this in MathDelimInset itself! + // FIXME: fix this in InsetMathDelim itself! string const l = tl.cs() == "|" ? "Vert" : tl.asString(); MathArray ar; parse(ar, FLAG_RIGHT, mode); skipSpaces(); Token const & tr = getToken(); string const r = tr.cs() == "|" ? "Vert" : tr.asString(); - cell->push_back(MathAtom(new MathDelimInset(l, r, ar))); + cell->push_back(MathAtom(new InsetMathDelim(l, r, ar))); } else if (t.cs() == "right") { @@ -1089,90 +1089,90 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (name == "array" || name == "subarray") { string const valign = parse_verbatim_option() + 'c'; string const halign = parse_verbatim_item(); - cell->push_back(MathAtom(new MathArrayInset(name, valign[0], halign))); + cell->push_back(MathAtom(new InsetMathArray(name, valign[0], halign))); parse2(cell->back(), FLAG_END, mode, false); } else if (name == "tabular") { string const valign = parse_verbatim_option() + 'c'; string const halign = parse_verbatim_item(); - cell->push_back(MathAtom(new MathTabularInset(name, valign[0], halign))); - parse2(cell->back(), FLAG_END, MathInset::TEXT_MODE, false); + cell->push_back(MathAtom(new InsetMathTabular(name, valign[0], halign))); + parse2(cell->back(), FLAG_END, InsetMath::TEXT_MODE, false); } else if (name == "split" || name == "cases" || name == "gathered" || name == "aligned") { - cell->push_back(createMathInset(name)); + cell->push_back(createInsetMath(name)); parse2(cell->back(), FLAG_END, mode, false); } else if (name == "alignedat") { // ignore this for a while getArg('{', '}'); - cell->push_back(createMathInset(name)); + cell->push_back(createInsetMath(name)); parse2(cell->back(), FLAG_END, mode, false); } else if (name == "math") { - cell->push_back(MathAtom(new MathHullInset(hullSimple))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, true); + cell->push_back(MathAtom(new InsetMathHull(hullSimple))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, true); } else if (name == "equation" || name == "equation*" || name == "displaymath") { - cell->push_back(MathAtom(new MathHullInset(hullEquation))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, (name == "equation")); + cell->push_back(MathAtom(new InsetMathHull(hullEquation))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, (name == "equation")); } else if (name == "eqnarray" || name == "eqnarray*") { - cell->push_back(MathAtom(new MathHullInset(hullEqnArray))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullEqnArray))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "align" || name == "align*") { - cell->push_back(MathAtom(new MathHullInset(hullAlign))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullAlign))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "flalign" || name == "flalign*") { - cell->push_back(MathAtom(new MathHullInset(hullFlAlign))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullFlAlign))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "alignat" || name == "alignat*") { // ignore this for a while getArg('{', '}'); - cell->push_back(MathAtom(new MathHullInset(hullAlignAt))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullAlignAt))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "xalignat" || name == "xalignat*") { // ignore this for a while getArg('{', '}'); - cell->push_back(MathAtom(new MathHullInset(hullXAlignAt))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullXAlignAt))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "xxalignat") { // ignore this for a while getArg('{', '}'); - cell->push_back(MathAtom(new MathHullInset(hullXXAlignAt))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullXXAlignAt))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "multline" || name == "multline*") { - cell->push_back(MathAtom(new MathHullInset(hullMultline))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullMultline))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (name == "gather" || name == "gather*") { - cell->push_back(MathAtom(new MathHullInset(hullGather))); - parse2(cell->back(), FLAG_END, MathInset::MATH_MODE, !stared(name)); + cell->push_back(MathAtom(new InsetMathHull(hullGather))); + parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name)); } else if (latexkeys const * l = in_word_set(name)) { if (l->inset == "matrix") { - cell->push_back(createMathInset(name)); + cell->push_back(createInsetMath(name)); parse2(cell->back(), FLAG_END, mode, false); } } @@ -1181,7 +1181,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, dump(); lyxerr << "found unknown math environment '" << name << "'" << endl; // create generic environment inset - cell->push_back(MathAtom(new MathEnvInset(name))); + cell->push_back(MathAtom(new InsetMathEnv(name))); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } } @@ -1201,7 +1201,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (isValidLength(s)) break; } - cell->push_back(MathAtom(new MathKernInset(s))); + cell->push_back(MathAtom(new InsetMathKern(s))); } else if (t.cs() == "label") { @@ -1212,13 +1212,13 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (grid.asHullInset()) { grid.asHullInset()->label(cellrow, label); } else { - cell->push_back(createMathInset(t.cs())); - cell->push_back(MathAtom(new MathBraceInset(ar))); + cell->push_back(createInsetMath(t.cs())); + cell->push_back(MathAtom(new InsetMathBrace(ar))); } } else if (t.cs() == "choose" || t.cs() == "over" || t.cs() == "atop") { - MathAtom at = createMathInset(t.cs()); + MathAtom at = createInsetMath(t.cs()); at.nucleus()->cell(0) = *cell; cell->clear(); parse(at.nucleus()->cell(1), flags, mode); @@ -1228,60 +1228,60 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, else if (t.cs() == "color") { string const color = parse_verbatim_item(); - cell->push_back(MathAtom(new MathColorInset(true, color))); + cell->push_back(MathAtom(new InsetMathColor(true, color))); parse(cell->back().nucleus()->cell(0), flags, mode); return; } else if (t.cs() == "textcolor") { string const color = parse_verbatim_item(); - cell->push_back(MathAtom(new MathColorInset(false, color))); - parse(cell->back().nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE); + cell->push_back(MathAtom(new InsetMathColor(false, color))); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, InsetMath::TEXT_MODE); } else if (t.cs() == "normalcolor") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse(cell->back().nucleus()->cell(0), flags, mode); return; } else if (t.cs() == "substack") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse2(cell->back(), FLAG_ITEM, mode, false); } else if (t.cs() == "xymatrix") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse2(cell->back(), FLAG_ITEM, mode, false); } else if (t.cs() == "framebox" || t.cs() == "makebox") { - cell->push_back(createMathInset(t.cs())); - parse(cell->back().nucleus()->cell(0), FLAG_OPTION, MathInset::TEXT_MODE); - parse(cell->back().nucleus()->cell(1), FLAG_OPTION, MathInset::TEXT_MODE); - parse(cell->back().nucleus()->cell(2), FLAG_ITEM, MathInset::TEXT_MODE); + cell->push_back(createInsetMath(t.cs())); + parse(cell->back().nucleus()->cell(0), FLAG_OPTION, InsetMath::TEXT_MODE); + parse(cell->back().nucleus()->cell(1), FLAG_OPTION, InsetMath::TEXT_MODE); + parse(cell->back().nucleus()->cell(2), FLAG_ITEM, InsetMath::TEXT_MODE); } else if (t.cs() == "tag") { if (nextToken().character() == '*') { getToken(); - cell->push_back(createMathInset(t.cs() + '*')); + cell->push_back(createInsetMath(t.cs() + '*')); } else - cell->push_back(createMathInset(t.cs())); - parse(cell->back().nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE); + cell->push_back(createInsetMath(t.cs())); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, InsetMath::TEXT_MODE); } #if 0 else if (t.cs() == "infer") { MathArray ar; parse(ar, FLAG_OPTION, mode); - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse2(cell->back(), FLAG_ITEM, mode, false); } // Disabled else if (1 && t.cs() == "ar") { - auto_ptr p(new MathXYArrowInset); + auto_ptr p(new InsetMathXYArrow); // try to read target parse(p->cell(0), FLAG_OTPTION, mode); // try to read label @@ -1303,24 +1303,24 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, if (l->inset == "big") { skipSpaces(); string const delim = getToken().asInput(); - if (MathBigInset::isBigInsetDelim(delim)) + if (InsetMathBig::isBigInsetDelim(delim)) cell->push_back(MathAtom( - new MathBigInset(t.cs(), delim))); + new InsetMathBig(t.cs(), delim))); else { - cell->push_back(createMathInset(t.cs())); - cell->push_back(createMathInset( + cell->push_back(createInsetMath(t.cs())); + cell->push_back(createInsetMath( delim.substr(1))); } } else if (l->inset == "font") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, asMode(mode, l->extra)); } else if (l->inset == "oldfont") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse(cell->back().nucleus()->cell(0), flags | FLAG_ALIGN, asMode(mode, l->extra)); if (prevToken().cat() != catAlign && @@ -1330,7 +1330,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else if (l->inset == "style") { - cell->push_back(createMathInset(t.cs())); + cell->push_back(createInsetMath(t.cs())); parse(cell->back().nucleus()->cell(0), flags | FLAG_ALIGN, mode); if (prevToken().cat() != catAlign && @@ -1340,8 +1340,8 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else { - MathAtom at = createMathInset(t.cs()); - for (MathInset::idx_type i = 0; i < at->nargs(); ++i) + MathAtom at = createInsetMath(t.cs()); + for (InsetMath::idx_type i = 0; i < at->nargs(); ++i) parse(at.nucleus()->cell(i), FLAG_ITEM, asMode(mode, l->extra)); cell->push_back(at); @@ -1349,22 +1349,22 @@ void Parser::parse1(MathGridInset & grid, unsigned flags, } else { - MathAtom at = createMathInset(t.cs()); - MathInset::mode_type m = mode; - //if (m == MathInset::UNDECIDED_MODE) + MathAtom at = createInsetMath(t.cs()); + InsetMath::mode_type m = mode; + //if (m == InsetMath::UNDECIDED_MODE) //lyxerr << "default creation: m1: " << m << endl; - if (at->currentMode() != MathInset::UNDECIDED_MODE) + if (at->currentMode() != InsetMath::UNDECIDED_MODE) m = at->currentMode(); //lyxerr << "default creation: m2: " << m << endl; - MathInset::idx_type start = 0; + InsetMath::idx_type start = 0; // this fails on \bigg[...\bigg] //MathArray opt; - //parse(opt, FLAG_OPTION, MathInset::VERBATIM_MODE); + //parse(opt, FLAG_OPTION, InsetMath::VERBATIM_MODE); //if (opt.size()) { // start = 1; // at.nucleus()->cell(0) = opt; //} - for (MathInset::idx_type i = start; i < at->nargs(); ++i) { + for (InsetMath::idx_type i = start; i < at->nargs(); ++i) { parse(at.nucleus()->cell(i), FLAG_ITEM, m); skipSpaces(); } @@ -1394,7 +1394,7 @@ void mathed_parse_cell(MathArray & ar, string const & str) void mathed_parse_cell(MathArray & ar, istream & is) { - Parser(is).parse(ar, 0, MathInset::MATH_MODE); + Parser(is).parse(ar, 0, InsetMath::MATH_MODE); } @@ -1417,10 +1417,10 @@ bool mathed_parse_normal(MathAtom & t, LyXLex & lex) } -void mathed_parse_normal(MathGridInset & grid, string const & str) +void mathed_parse_normal(InsetMathGrid & grid, string const & str) { istringstream is(str); - Parser(is).parse1(grid, 0, MathInset::MATH_MODE, false); + Parser(is).parse1(grid, 0, InsetMath::MATH_MODE, false); } diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index e2321c6b31..422ddea788 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -18,7 +18,7 @@ class MathAtom; class MathArray; -class MathGridInset; +class InsetMathGrid; class LyXLex; @@ -50,7 +50,7 @@ bool mathed_parse_normal(MathAtom &, std::istream &); /// ... the LyX lexxer bool mathed_parse_normal(MathAtom &, LyXLex &); /// ... the LyX lexxer -void mathed_parse_normal(MathGridInset &, std::string const &); +void mathed_parse_normal(InsetMathGrid &, std::string const &); /// parse a single cell from a string void mathed_parse_cell(MathArray & ar, std::string const &); diff --git a/src/mathed/math_phantominset.C b/src/mathed/math_phantominset.C index 976fdb66fa..f87f357c71 100644 --- a/src/mathed/math_phantominset.C +++ b/src/mathed/math_phantominset.C @@ -21,18 +21,18 @@ #include "support/std_ostream.h" -MathPhantomInset::MathPhantomInset(Kind k) - : MathNestInset(1), kind_(k) +InsetMathPhantom::InsetMathPhantom(Kind k) + : InsetMathNest(1), kind_(k) {} -std::auto_ptr MathPhantomInset::doClone() const +std::auto_ptr InsetMathPhantom::doClone() const { - return std::auto_ptr(new MathPhantomInset(*this)); + return std::auto_ptr(new InsetMathPhantom(*this)); } -void MathPhantomInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathPhantom::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers(dim); @@ -40,7 +40,7 @@ void MathPhantomInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathPhantomInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const { static int const arrow_size = 4; @@ -118,7 +118,7 @@ void MathPhantomInset::draw(PainterInfo & pi, int x, int y) const } -void MathPhantomInset::write(WriteStream & os) const +void InsetMathPhantom::write(WriteStream & os) const { switch (kind_) { case phantom: @@ -135,7 +135,7 @@ void MathPhantomInset::write(WriteStream & os) const } -void MathPhantomInset::normalize(NormalStream & os) const +void InsetMathPhantom::normalize(NormalStream & os) const { switch (kind_) { case phantom: @@ -152,7 +152,7 @@ void MathPhantomInset::normalize(NormalStream & os) const } -void MathPhantomInset::infoize(std::ostream & os) const +void InsetMathPhantom::infoize(std::ostream & os) const { switch (kind_) { case phantom: diff --git a/src/mathed/math_phantominset.h b/src/mathed/math_phantominset.h index ef4ca6130e..ad5906afa9 100644 --- a/src/mathed/math_phantominset.h +++ b/src/mathed/math_phantominset.h @@ -14,7 +14,7 @@ #include "math_nestinset.h" -class MathPhantomInset : public MathNestInset { +class InsetMathPhantom : public InsetMathNest { public: /// enum Kind { @@ -23,7 +23,7 @@ public: hphantom }; /// - explicit MathPhantomInset(Kind); + explicit InsetMathPhantom(Kind); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_rootinset.C b/src/mathed/math_rootinset.C index 8822ae1bf5..ac38bad208 100644 --- a/src/mathed/math_rootinset.C +++ b/src/mathed/math_rootinset.C @@ -24,20 +24,20 @@ using std::auto_ptr; -MathRootInset::MathRootInset() - : MathNestInset(2) +InsetMathRoot::InsetMathRoot() + : InsetMathNest(2) {} -auto_ptr MathRootInset::doClone() const +auto_ptr InsetMathRoot::doClone() const { - return auto_ptr(new MathRootInset(*this)); + return auto_ptr(new InsetMathRoot(*this)); } -void MathRootInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const { - MathNestInset::metrics(mi); + InsetMathNest::metrics(mi); dim.asc = max(cell(0).ascent() + 5, cell(1).ascent()) + 2; dim.des = max(cell(1).descent() + 5, cell(0).descent()) + 2; dim.wid = cell(0).width() + cell(1).width() + 10; @@ -46,7 +46,7 @@ void MathRootInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathRootInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const { int const w = cell(0).width(); // the "exponent" @@ -68,19 +68,19 @@ void MathRootInset::draw(PainterInfo & pi, int x, int y) const } -void MathRootInset::write(WriteStream & os) const +void InsetMathRoot::write(WriteStream & os) const { os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}'; } -void MathRootInset::normalize(NormalStream & os) const +void InsetMathRoot::normalize(NormalStream & os) const { os << "[root " << cell(0) << ' ' << cell(1) << ']'; } -bool MathRootInset::idxUpDown(LCursor & cur, bool up) const +bool InsetMathRoot::idxUpDown(LCursor & cur, bool up) const { LCursor::idx_type const target = up ? 0 : 1; if (cur.idx() == target) @@ -91,19 +91,19 @@ bool MathRootInset::idxUpDown(LCursor & cur, bool up) const } -void MathRootInset::maple(MapleStream & os) const +void InsetMathRoot::maple(MapleStream & os) const { os << '(' << cell(1) << ")^(1/(" << cell(0) <<"))"; } -void MathRootInset::octave(OctaveStream & os) const +void InsetMathRoot::octave(OctaveStream & os) const { os << "root(" << cell(1) << ',' << cell(0) << ')'; } -void MathRootInset::mathmlize(MathMLStream & os) const +void InsetMathRoot::mathmlize(MathMLStream & os) const { os << MTag("mroot") << cell(1) << cell(0) << ETag("mroot"); } diff --git a/src/mathed/math_rootinset.h b/src/mathed/math_rootinset.h index 19e7629300..952401089b 100644 --- a/src/mathed/math_rootinset.h +++ b/src/mathed/math_rootinset.h @@ -17,10 +17,10 @@ /// The general n-th root inset. -class MathRootInset : public MathNestInset { +class InsetMathRoot : public InsetMathNest { public: /// - MathRootInset(); + InsetMathRoot(); /// bool idxUpDown(LCursor & cur, bool up) const; /// diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index d6bd64c06a..5c09f268c0 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -32,43 +32,43 @@ using std::endl; -MathScriptInset::MathScriptInset() - : MathNestInset(1), cell_1_is_up_(false), limits_(0) +InsetMathScript::InsetMathScript() + : InsetMathNest(1), cell_1_is_up_(false), limits_(0) {} -MathScriptInset::MathScriptInset(bool up) - : MathNestInset(2), cell_1_is_up_(up), limits_(0) +InsetMathScript::InsetMathScript(bool up) + : InsetMathNest(2), cell_1_is_up_(up), limits_(0) {} -MathScriptInset::MathScriptInset(MathAtom const & at, bool up) - : MathNestInset(2), cell_1_is_up_(up), limits_(0) +InsetMathScript::InsetMathScript(MathAtom const & at, bool up) + : InsetMathNest(2), cell_1_is_up_(up), limits_(0) { BOOST_ASSERT(nargs() >= 1); cell(0).push_back(at); } -auto_ptr MathScriptInset::doClone() const +auto_ptr InsetMathScript::doClone() const { - return auto_ptr(new MathScriptInset(*this)); + return auto_ptr(new InsetMathScript(*this)); } -MathScriptInset const * MathScriptInset::asScriptInset() const +InsetMathScript const * InsetMathScript::asScriptInset() const { return this; } -MathScriptInset * MathScriptInset::asScriptInset() +InsetMathScript * InsetMathScript::asScriptInset() { return this; } -bool MathScriptInset::idxFirst(LCursor & cur) const +bool InsetMathScript::idxFirst(LCursor & cur) const { cur.idx() = 0; cur.pos() = 0; @@ -76,7 +76,7 @@ bool MathScriptInset::idxFirst(LCursor & cur) const } -bool MathScriptInset::idxLast(LCursor & cur) const +bool InsetMathScript::idxLast(LCursor & cur) const { cur.idx() = 0; cur.pos() = nuc().size(); @@ -84,7 +84,7 @@ bool MathScriptInset::idxLast(LCursor & cur) const } -MathArray const & MathScriptInset::down() const +MathArray const & InsetMathScript::down() const { if (nargs() == 3) return cell(2); @@ -93,7 +93,7 @@ MathArray const & MathScriptInset::down() const } -MathArray & MathScriptInset::down() +MathArray & InsetMathScript::down() { if (nargs() == 3) return cell(2); @@ -102,21 +102,21 @@ MathArray & MathScriptInset::down() } -MathArray const & MathScriptInset::up() const +MathArray const & InsetMathScript::up() const { BOOST_ASSERT(nargs() > 1); return cell(1); } -MathArray & MathScriptInset::up() +MathArray & InsetMathScript::up() { BOOST_ASSERT(nargs() > 1); return cell(1); } -void MathScriptInset::ensure(bool up) +void InsetMathScript::ensure(bool up) { if (nargs() == 1) { // just nucleus so far @@ -133,19 +133,19 @@ void MathScriptInset::ensure(bool up) } -MathArray const & MathScriptInset::nuc() const +MathArray const & InsetMathScript::nuc() const { return cell(0); } -MathArray & MathScriptInset::nuc() +MathArray & InsetMathScript::nuc() { return cell(0); } -int MathScriptInset::dy0() const +int InsetMathScript::dy0() const { int nd = ndes(); if (!hasDown()) @@ -159,7 +159,7 @@ int MathScriptInset::dy0() const } -int MathScriptInset::dy1() const +int InsetMathScript::dy1() const { int na = nasc(); if (!hasUp()) @@ -174,45 +174,45 @@ int MathScriptInset::dy1() const } -int MathScriptInset::dx0() const +int InsetMathScript::dx0() const { BOOST_ASSERT(hasDown()); return hasLimits() ? (dim_.wid - down().width()) / 2 : nwid(); } -int MathScriptInset::dx1() const +int InsetMathScript::dx1() const { BOOST_ASSERT(hasUp()); return hasLimits() ? (dim_.wid - up().width()) / 2 : nwid(); } -int MathScriptInset::dxx() const +int InsetMathScript::dxx() const { return hasLimits() ? (dim_.wid - nwid()) / 2 : 0; } -int MathScriptInset::nwid() const +int InsetMathScript::nwid() const { return nuc().size() ? nuc().width() : 2; } -int MathScriptInset::nasc() const +int InsetMathScript::nasc() const { return nuc().size() ? nuc().ascent() : 5; } -int MathScriptInset::ndes() const +int InsetMathScript::ndes() const { return nuc().size() ? nuc().descent() : 0; } -void MathScriptInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathScript::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi); ScriptChanger dummy(mi.base); @@ -241,7 +241,7 @@ void MathScriptInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathScriptInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathScript::draw(PainterInfo & pi, int x, int y) const { if (nuc().size()) nuc().draw(pi, x + dxx(), y); @@ -259,7 +259,7 @@ void MathScriptInset::draw(PainterInfo & pi, int x, int y) const } -void MathScriptInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathScript::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { if (hasUp()) up().metricsT(mi, dim); @@ -269,7 +269,7 @@ void MathScriptInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) cons } -void MathScriptInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathScript::drawT(TextPainter & pain, int x, int y) const { if (nuc().size()) nuc().drawT(pain, x + dxx(), y); @@ -281,7 +281,7 @@ void MathScriptInset::drawT(TextPainter & pain, int x, int y) const -bool MathScriptInset::hasLimits() const +bool InsetMathScript::hasLimits() const { // obvious cases if (limits_ == 1) @@ -309,7 +309,7 @@ bool MathScriptInset::hasLimits() const } -void MathScriptInset::removeScript(bool up) +void InsetMathScript::removeScript(bool up) { if (nargs() == 2) { if (up == cell_1_is_up_) @@ -326,13 +326,13 @@ void MathScriptInset::removeScript(bool up) } -bool MathScriptInset::has(bool up) const +bool InsetMathScript::has(bool up) const { return idxOfScript(up); } -bool MathScriptInset::hasUp() const +bool InsetMathScript::hasUp() const { //lyxerr << "1up: " << bool(cell_1_is_up_) << endl; //lyxerr << "hasUp: " << bool(idxOfScript(true)) << endl; @@ -340,7 +340,7 @@ bool MathScriptInset::hasUp() const } -bool MathScriptInset::hasDown() const +bool InsetMathScript::hasDown() const { //lyxerr << "1up: " << bool(cell_1_is_up_) << endl; //lyxerr << "hasDown: " << bool(idxOfScript(false)) << endl; @@ -348,7 +348,7 @@ bool MathScriptInset::hasDown() const } -InsetBase::idx_type MathScriptInset::idxOfScript(bool up) const +InsetBase::idx_type InsetMathScript::idxOfScript(bool up) const { if (nargs() == 1) return 0; @@ -362,19 +362,19 @@ InsetBase::idx_type MathScriptInset::idxOfScript(bool up) const } -bool MathScriptInset::idxRight(LCursor &) const +bool InsetMathScript::idxRight(LCursor &) const { return false; } -bool MathScriptInset::idxLeft(LCursor &) const +bool InsetMathScript::idxLeft(LCursor &) const { return false; } -bool MathScriptInset::idxUpDown(LCursor & cur, bool up) const +bool InsetMathScript::idxUpDown(LCursor & cur, bool up) const { // in nucleus? if (cur.idx() == 0) { @@ -417,7 +417,7 @@ bool MathScriptInset::idxUpDown(LCursor & cur, bool up) const } -void MathScriptInset::write(WriteStream & os) const +void InsetMathScript::write(WriteStream & os) const { if (nuc().size()) { if (nuc().size() == 1 @@ -450,7 +450,7 @@ void MathScriptInset::write(WriteStream & os) const } -void MathScriptInset::normalize(NormalStream & os) const +void InsetMathScript::normalize(NormalStream & os) const { bool d = hasDown() && down().size(); bool u = hasUp() && up().size(); @@ -476,7 +476,7 @@ void MathScriptInset::normalize(NormalStream & os) const } -void MathScriptInset::maple(MapleStream & os) const +void InsetMathScript::maple(MapleStream & os) const { if (nuc().size()) os << nuc(); @@ -487,7 +487,7 @@ void MathScriptInset::maple(MapleStream & os) const } -void MathScriptInset::mathematica(MathematicaStream & os) const +void InsetMathScript::mathematica(MathematicaStream & os) const { bool d = hasDown() && down().size(); bool u = hasUp() && up().size(); @@ -509,7 +509,7 @@ void MathScriptInset::mathematica(MathematicaStream & os) const } -void MathScriptInset::mathmlize(MathMLStream & os) const +void InsetMathScript::mathmlize(MathMLStream & os) const { bool d = hasDown() && down().size(); bool u = hasUp() && up().size(); @@ -535,7 +535,7 @@ void MathScriptInset::mathmlize(MathMLStream & os) const } -void MathScriptInset::octave(OctaveStream & os) const +void InsetMathScript::octave(OctaveStream & os) const { if (nuc().size()) os << nuc(); @@ -546,24 +546,24 @@ void MathScriptInset::octave(OctaveStream & os) const } -void MathScriptInset::infoize(std::ostream & os) const +void InsetMathScript::infoize(std::ostream & os) const { os << "Scripts"; } -void MathScriptInset::infoize2(std::ostream & os) const +void InsetMathScript::infoize2(std::ostream & os) const { if (limits_) os << (limits_ == 1 ? ", Displayed limits" : ", Inlined limits"); } -bool MathScriptInset::notifyCursorLeaves(LCursor & cur) +bool InsetMathScript::notifyCursorLeaves(LCursor & cur) { - MathNestInset::notifyCursorLeaves(cur); + InsetMathNest::notifyCursorLeaves(cur); - //lyxerr << "MathScriptInset::notifyCursorLeaves: 1 " << cur << endl; + //lyxerr << "InsetMathScript::notifyCursorLeaves: 1 " << cur << endl; // remove empty scripts if possible if (nargs() > 2) { @@ -596,14 +596,14 @@ bool MathScriptInset::notifyCursorLeaves(LCursor & cur) return true; } - //lyxerr << "MathScriptInset::notifyCursorLeaves: 2 " << cur << endl; + //lyxerr << "InsetMathScript::notifyCursorLeaves: 2 " << cur << endl; return false; } -void MathScriptInset::doDispatch(LCursor & cur, FuncRequest & cmd) +void InsetMathScript::doDispatch(LCursor & cur, FuncRequest & cmd) { - //lyxerr << "MathScriptInset: request: " << cmd << std::endl; + //lyxerr << "InsetMathScript: request: " << cmd << std::endl; if (cmd.action == LFUN_MATH_LIMITS) { if (!cmd.argument().empty()) { @@ -620,5 +620,5 @@ void MathScriptInset::doDispatch(LCursor & cur, FuncRequest & cmd) return; } - MathNestInset::doDispatch(cur, cmd); + InsetMathNest::doDispatch(cur, cmd); } diff --git a/src/mathed/math_scriptinset.h b/src/mathed/math_scriptinset.h index dbd58f3b8a..88fc3b3d5f 100644 --- a/src/mathed/math_scriptinset.h +++ b/src/mathed/math_scriptinset.h @@ -19,14 +19,14 @@ // cell 0. If there is just one script, it's cell 1 and cell_1_is_up_ // is set accordingly. If both are used, cell 1 is up and cell 2 is down. -class MathScriptInset : public MathNestInset { +class InsetMathScript : public InsetMathNest { public: /// create inset without scripts - MathScriptInset(); + InsetMathScript(); /// create inset with single script - explicit MathScriptInset(bool up); + explicit InsetMathScript(bool up); /// create inset with single script and given nucleus - MathScriptInset(MathAtom const & at, bool up); + InsetMathScript(MathAtom const & at, bool up); /// mode_type currentMode() const { return MATH_MODE; } /// @@ -63,9 +63,9 @@ public: void octave(OctaveStream &) const; /// identifies scriptinsets - MathScriptInset const * asScriptInset() const; + InsetMathScript const * asScriptInset() const; /// - MathScriptInset * asScriptInset(); + InsetMathScript * asScriptInset(); /// set limits void limits(int lim) { limits_ = lim; } diff --git a/src/mathed/math_sizeinset.C b/src/mathed/math_sizeinset.C index 099e421694..ff098a0151 100644 --- a/src/mathed/math_sizeinset.C +++ b/src/mathed/math_sizeinset.C @@ -22,18 +22,18 @@ using std::auto_ptr; -MathSizeInset::MathSizeInset(latexkeys const * l) - : MathNestInset(1), key_(l), style_(Styles(convert(l->extra))) +InsetMathSize::InsetMathSize(latexkeys const * l) + : InsetMathNest(1), key_(l), style_(Styles(convert(l->extra))) {} -auto_ptr MathSizeInset::doClone() const +auto_ptr InsetMathSize::doClone() const { - return auto_ptr(new MathSizeInset(*this)); + return auto_ptr(new InsetMathSize(*this)); } -void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathSize::metrics(MetricsInfo & mi, Dimension & dim) const { StyleChanger dummy(mi.base, style_); cell(0).metrics(mi, dim); @@ -42,7 +42,7 @@ void MathSizeInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathSizeInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSize::draw(PainterInfo & pi, int x, int y) const { StyleChanger dummy(pi.base, style_); cell(0).draw(pi, x + 1, y); @@ -50,19 +50,19 @@ void MathSizeInset::draw(PainterInfo & pi, int x, int y) const } -void MathSizeInset::write(WriteStream & os) const +void InsetMathSize::write(WriteStream & os) const { os << "{\\" << key_->name << ' ' << cell(0) << '}'; } -void MathSizeInset::normalize(NormalStream & os) const +void InsetMathSize::normalize(NormalStream & os) const { os << '[' << key_->name << ' ' << cell(0) << ']'; } -void MathSizeInset::infoize(std::ostream & os) const +void InsetMathSize::infoize(std::ostream & os) const { os << "Size: " << key_->name; } diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index 5847ac1f1f..3864038d16 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -19,10 +19,10 @@ class latexkeys; /// An inset for \scriptsize etc. -class MathSizeInset : public MathNestInset { +class InsetMathSize : public InsetMathNest { public: /// - explicit MathSizeInset(latexkeys const * l); + explicit InsetMathSize(latexkeys const * l); /// we write extra braces in any case... bool extraBraces() const { return true; } /// diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index 8f71fa0f8e..6bb8a8c217 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -32,12 +32,12 @@ char const * latex_mathspace[] = { int const nSpace = sizeof(latex_mathspace)/sizeof(char *); -MathSpaceInset::MathSpaceInset(int sp) +InsetMathSpace::InsetMathSpace(int sp) : space_(sp) {} -MathSpaceInset::MathSpaceInset(string const & name) +InsetMathSpace::InsetMathSpace(string const & name) : space_(1) { for (int i = 0; i < nSpace; ++i) @@ -46,13 +46,13 @@ MathSpaceInset::MathSpaceInset(string const & name) } -auto_ptr MathSpaceInset::doClone() const +auto_ptr InsetMathSpace::doClone() const { - return auto_ptr(new MathSpaceInset(*this)); + return auto_ptr(new InsetMathSpace(*this)); } -int MathSpaceInset::width() const +int InsetMathSpace::width() const { switch (space_) { case 0: return 6; @@ -70,19 +70,19 @@ int MathSpaceInset::width() const } -int MathSpaceInset::ascent() const +int InsetMathSpace::ascent() const { return 4; } -int MathSpaceInset::descent() const +int InsetMathSpace::descent() const { return 0; } -void MathSpaceInset::metrics(MetricsInfo &, Dimension & dim) const +void InsetMathSpace::metrics(MetricsInfo &, Dimension & dim) const { dim.wid = width(); dim.asc = ascent(); @@ -90,7 +90,7 @@ void MathSpaceInset::metrics(MetricsInfo &, Dimension & dim) const } -void MathSpaceInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSpace::draw(PainterInfo & pi, int x, int y) const { // Sadly, HP-UX CC can't handle that kind of initialization. // XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}}; @@ -110,13 +110,13 @@ void MathSpaceInset::draw(PainterInfo & pi, int x, int y) const } -void MathSpaceInset::incSpace() +void InsetMathSpace::incSpace() { space_ = (space_ + 1) % (nSpace - 2); } -void MathSpaceInset::validate(LaTeXFeatures & features) const +void InsetMathSpace::validate(LaTeXFeatures & features) const { if (space_ >= 0 && space_< nSpace) { if ((latex_mathspace[space_] == string("negmedspace")) @@ -126,30 +126,30 @@ void MathSpaceInset::validate(LaTeXFeatures & features) const } -void MathSpaceInset::maple(MapleStream & os) const +void InsetMathSpace::maple(MapleStream & os) const { os << ' '; } -void MathSpaceInset::mathematica(MathematicaStream & os) const +void InsetMathSpace::mathematica(MathematicaStream & os) const { os << ' '; } -void MathSpaceInset::octave(OctaveStream & os) const +void InsetMathSpace::octave(OctaveStream & os) const { os << ' '; } -void MathSpaceInset::normalize(NormalStream & os) const +void InsetMathSpace::normalize(NormalStream & os) const { os << "[space " << int(space_) << "] "; } -void MathSpaceInset::write(WriteStream & os) const +void InsetMathSpace::write(WriteStream & os) const { if (space_ >= 0 && space_ < nSpace) { os << '\\' << latex_mathspace[space_]; diff --git a/src/mathed/math_spaceinset.h b/src/mathed/math_spaceinset.h index c6fad086d4..fd4d3b0aa7 100644 --- a/src/mathed/math_spaceinset.h +++ b/src/mathed/math_spaceinset.h @@ -16,16 +16,16 @@ /// Smart spaces -class MathSpaceInset : public MathInset { +class InsetMathSpace : public InsetMath { public: /// - explicit MathSpaceInset(int sp); + explicit InsetMathSpace(int sp); /// - explicit MathSpaceInset(std::string const & name); + explicit InsetMathSpace(std::string const & name); /// - MathSpaceInset const * asSpaceInset() const { return this; } + InsetMathSpace const * asSpaceInset() const { return this; } /// - MathSpaceInset * asSpaceInset() { return this; } + InsetMathSpace * asSpaceInset() { return this; } /// void incSpace(); /// diff --git a/src/mathed/math_splitinset.C b/src/mathed/math_splitinset.C index e1349cc926..c8fe0fa98f 100644 --- a/src/mathed/math_splitinset.C +++ b/src/mathed/math_splitinset.C @@ -30,20 +30,20 @@ using std::string; using std::auto_ptr; -MathSplitInset::MathSplitInset(string const & name) - : MathGridInset(1, 1), name_(name) +InsetMathSplit::InsetMathSplit(string const & name) + : InsetMathGrid(1, 1), name_(name) { setDefaults(); } -auto_ptr MathSplitInset::doClone() const +auto_ptr InsetMathSplit::doClone() const { - return auto_ptr(new MathSplitInset(*this)); + return auto_ptr(new InsetMathSplit(*this)); } -char MathSplitInset::defaultColAlign(col_type col) +char InsetMathSplit::defaultColAlign(col_type col) { if (name_ == "split") return 'l'; @@ -57,14 +57,14 @@ char MathSplitInset::defaultColAlign(col_type col) } -void MathSplitInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSplit::draw(PainterInfo & pi, int x, int y) const { - MathGridInset::draw(pi, x, y); + InsetMathGrid::draw(pi, x, y); setPosCache(pi, x, y); } -bool MathSplitInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathSplit::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action) { @@ -77,29 +77,29 @@ bool MathSplitInset::getStatus(LCursor & cur, FuncRequest const & cmd, flag.enabled(false); return true; } - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } default: - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } } -void MathSplitInset::write(WriteStream & ws) const +void InsetMathSplit::write(WriteStream & ws) const { if (ws.fragile()) ws << "\\protect"; ws << "\\begin{" << name_ << '}'; if (name_ == "alignedat") ws << '{' << static_cast((ncols() + 1)/2) << '}'; - MathGridInset::write(ws); + InsetMathGrid::write(ws); if (ws.fragile()) ws << "\\protect"; ws << "\\end{" << name_ << "}\n"; } -void MathSplitInset::infoize(std::ostream & os) const +void InsetMathSplit::infoize(std::ostream & os) const { string name = name_; name[0] = lyx::support::uppercase(name[0]); @@ -107,8 +107,8 @@ void MathSplitInset::infoize(std::ostream & os) const } -void MathSplitInset::validate(LaTeXFeatures & features) const +void InsetMathSplit::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_splitinset.h b/src/mathed/math_splitinset.h index db980147d1..41dd8d334f 100644 --- a/src/mathed/math_splitinset.h +++ b/src/mathed/math_splitinset.h @@ -15,10 +15,10 @@ #include "math_gridinset.h" -class MathSplitInset : public MathGridInset { +class InsetMathSplit : public InsetMathGrid { public: /// - explicit MathSplitInset(std::string const & name); + explicit InsetMathSplit(std::string const & name); /// void draw(PainterInfo & pi, int x, int y) const; diff --git a/src/mathed/math_sqrtinset.C b/src/mathed/math_sqrtinset.C index 4705ae7846..8e2a9eec3a 100644 --- a/src/mathed/math_sqrtinset.C +++ b/src/mathed/math_sqrtinset.C @@ -20,18 +20,18 @@ using std::auto_ptr; -MathSqrtInset::MathSqrtInset() - : MathNestInset(1) +InsetMathSqrt::InsetMathSqrt() + : InsetMathNest(1) {} -auto_ptr MathSqrtInset::doClone() const +auto_ptr InsetMathSqrt::doClone() const { - return auto_ptr(new MathSqrtInset(*this)); + return auto_ptr(new InsetMathSqrt(*this)); } -void MathSqrtInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathSqrt::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); dim.asc += 4; @@ -42,7 +42,7 @@ void MathSqrtInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathSqrtInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSqrt::draw(PainterInfo & pi, int x, int y) const { cell(0).draw(pi, x + 10, y); int const a = dim_.ascent(); @@ -58,7 +58,7 @@ void MathSqrtInset::draw(PainterInfo & pi, int x, int y) const } -void MathSqrtInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const +void InsetMathSqrt::metricsT(TextMetricsInfo const & mi, Dimension & dim) const { cell(0).metricsT(mi, dim); dim.asc += 1; @@ -66,7 +66,7 @@ void MathSqrtInset::metricsT(TextMetricsInfo const & mi, Dimension & dim) const } -void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const +void InsetMathSqrt::drawT(TextPainter & pain, int x, int y) const { cell(0).drawT(pain, x + 2, y); pain.horizontalLine(x + 2, y - cell(0).ascent(), cell(0).width(), '_'); @@ -75,35 +75,35 @@ void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const } -void MathSqrtInset::write(WriteStream & os) const +void InsetMathSqrt::write(WriteStream & os) const { os << "\\sqrt{" << cell(0) << '}'; } -void MathSqrtInset::normalize(NormalStream & os) const +void InsetMathSqrt::normalize(NormalStream & os) const { os << "[sqrt " << cell(0) << ']'; } -void MathSqrtInset::maple(MapleStream & os) const +void InsetMathSqrt::maple(MapleStream & os) const { os << "sqrt(" << cell(0) << ')'; } -void MathSqrtInset::mathematica(MathematicaStream & os) const +void InsetMathSqrt::mathematica(MathematicaStream & os) const { os << "Sqrt[" << cell(0) << ']'; } -void MathSqrtInset::octave(OctaveStream & os) const +void InsetMathSqrt::octave(OctaveStream & os) const { os << "sqrt(" << cell(0) << ')'; } -void MathSqrtInset::mathmlize(MathMLStream & os) const +void InsetMathSqrt::mathmlize(MathMLStream & os) const { os << MTag("msqrt") << cell(0) << ETag("msqrt"); } diff --git a/src/mathed/math_sqrtinset.h b/src/mathed/math_sqrtinset.h index b767926842..c61e9c842e 100644 --- a/src/mathed/math_sqrtinset.h +++ b/src/mathed/math_sqrtinset.h @@ -16,11 +16,11 @@ #include "math_nestinset.h" -/// \c MathSqrtInset The square root inset. -class MathSqrtInset : public MathNestInset { +/// \c InsetMathSqrt The square root inset. +class InsetMathSqrt : public InsetMathNest { public: /// - MathSqrtInset(); + InsetMathSqrt(); /// void draw(PainterInfo &, int x, int y) const; /// diff --git a/src/mathed/math_stackrelinset.C b/src/mathed/math_stackrelinset.C index d5a1c5bfb5..2274f11e9a 100644 --- a/src/mathed/math_stackrelinset.C +++ b/src/mathed/math_stackrelinset.C @@ -19,17 +19,17 @@ using std::max; using std::auto_ptr; -MathStackrelInset::MathStackrelInset() +InsetMathStackrel::InsetMathStackrel() {} -auto_ptr MathStackrelInset::doClone() const +auto_ptr InsetMathStackrel::doClone() const { - return auto_ptr(new MathStackrelInset(*this)); + return auto_ptr(new InsetMathStackrel(*this)); } -void MathStackrelInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathStackrel::metrics(MetricsInfo & mi, Dimension & dim) const { cell(1).metrics(mi); FracChanger dummy(mi.base); @@ -42,7 +42,7 @@ void MathStackrelInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathStackrelInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathStackrel::draw(PainterInfo & pi, int x, int y) const { int m = x + dim_.width() / 2; int yo = y - cell(1).ascent() - cell(0).descent() - 1; @@ -53,13 +53,13 @@ void MathStackrelInset::draw(PainterInfo & pi, int x, int y) const } -void MathStackrelInset::write(WriteStream & os) const +void InsetMathStackrel::write(WriteStream & os) const { os << "\\stackrel{" << cell(0) << "}{" << cell(1) << '}'; } -void MathStackrelInset::normalize(NormalStream & os) const +void InsetMathStackrel::normalize(NormalStream & os) const { os << "[stackrel " << cell(0) << ' ' << cell(1) << ']'; } diff --git a/src/mathed/math_stackrelinset.h b/src/mathed/math_stackrelinset.h index 31f33f4c86..baead40ab2 100644 --- a/src/mathed/math_stackrelinset.h +++ b/src/mathed/math_stackrelinset.h @@ -20,10 +20,10 @@ * * Full author contact details are available in file CREDITS. */ -class MathStackrelInset : public MathFracbaseInset { +class InsetMathStackrel : public InsetMathFracBase { public: /// - MathStackrelInset(); + InsetMathStackrel(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_stringinset.C b/src/mathed/math_stringinset.C index 79373f18ce..86a04606e7 100644 --- a/src/mathed/math_stringinset.C +++ b/src/mathed/math_stringinset.C @@ -21,24 +21,24 @@ using std::string; using std::auto_ptr; -MathStringInset::MathStringInset(string const & s) +InsetMathString::InsetMathString(string const & s) : str_(s) {} -auto_ptr MathStringInset::doClone() const +auto_ptr InsetMathString::doClone() const { - return auto_ptr(new MathStringInset(*this)); + return auto_ptr(new InsetMathString(*this)); } -void MathStringInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathString::metrics(MetricsInfo & mi, Dimension & dim) const { mathed_string_dim(mi.base.font, str_, dim); } -void MathStringInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathString::draw(PainterInfo & pi, int x, int y) const { //lyxerr << "drawing '" << str_ << "' code: " << code_ << endl; docstring dstr(str_.begin(), str_.end()); @@ -46,13 +46,13 @@ void MathStringInset::draw(PainterInfo & pi, int x, int y) const } -void MathStringInset::normalize(NormalStream & os) const +void InsetMathString::normalize(NormalStream & os) const { os << "[string " << str_ << ' ' << "mathalpha" << ']'; } -void MathStringInset::maple(MapleStream & os) const +void InsetMathString::maple(MapleStream & os) const { if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) { os << ' ' << str_ << ' '; @@ -66,13 +66,13 @@ void MathStringInset::maple(MapleStream & os) const } -void MathStringInset::mathematica(MathematicaStream & os) const +void InsetMathString::mathematica(MathematicaStream & os) const { os << ' ' << str_ << ' '; } -void MathStringInset::octave(OctaveStream & os) const +void InsetMathString::octave(OctaveStream & os) const { if (/*code_ != LM_TC_VAR ||*/ str_.size() <= 1) { os << ' ' << str_ << ' '; @@ -86,7 +86,7 @@ void MathStringInset::octave(OctaveStream & os) const } -void MathStringInset::mathmlize(MathMLStream & os) const +void InsetMathString::mathmlize(MathMLStream & os) const { /* if (code_ == LM_TC_VAR) @@ -101,7 +101,7 @@ void MathStringInset::mathmlize(MathMLStream & os) const } -void MathStringInset::write(WriteStream & os) const +void InsetMathString::write(WriteStream & os) const { os << str_; } diff --git a/src/mathed/math_stringinset.h b/src/mathed/math_stringinset.h index c3d6738b52..35a8baab78 100644 --- a/src/mathed/math_stringinset.h +++ b/src/mathed/math_stringinset.h @@ -19,10 +19,10 @@ * mainly for math-extern */ -class MathStringInset : public MathInset { +class InsetMathString : public InsetMath { public: /// - explicit MathStringInset(std::string const & s); + explicit InsetMathString(std::string const & s); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// @@ -30,9 +30,9 @@ public: /// std::string str() const { return str_; } /// - MathStringInset * asStringInset() { return this; } + InsetMathString * asStringInset() { return this; } /// - MathStringInset const * asStringInset() const { return this; } + InsetMathString const * asStringInset() const { return this; } /// void normalize(NormalStream &) const; diff --git a/src/mathed/math_substackinset.C b/src/mathed/math_substackinset.C index 3d1e48a8fa..748f3fdcc5 100644 --- a/src/mathed/math_substackinset.C +++ b/src/mathed/math_substackinset.C @@ -29,36 +29,36 @@ using std::string; using std::auto_ptr; -MathSubstackInset::MathSubstackInset() - : MathGridInset(1, 1) +InsetMathSubstack::InsetMathSubstack() + : InsetMathGrid(1, 1) {} -auto_ptr MathSubstackInset::doClone() const +auto_ptr InsetMathSubstack::doClone() const { - return auto_ptr(new MathSubstackInset(*this)); + return auto_ptr(new InsetMathSubstack(*this)); } -void MathSubstackInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathSubstack::metrics(MetricsInfo & mi, Dimension & dim) const { if (mi.base.style == LM_ST_DISPLAY) { StyleChanger dummy(mi.base, LM_ST_TEXT); - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); } else { - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); } dim_ = dim; } -void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSubstack::draw(PainterInfo & pi, int x, int y) const { - MathGridInset::draw(pi, x + 1, y); + InsetMathGrid::draw(pi, x + 1, y); } -bool MathSubstackInset::getStatus(LCursor & cur, FuncRequest const & cmd, +bool InsetMathSubstack::getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & flag) const { switch (cmd.action) { @@ -71,46 +71,46 @@ bool MathSubstackInset::getStatus(LCursor & cur, FuncRequest const & cmd, flag.enabled(false); return true; } - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } default: - return MathGridInset::getStatus(cur, cmd, flag); + return InsetMathGrid::getStatus(cur, cmd, flag); } } -void MathSubstackInset::infoize(std::ostream & os) const +void InsetMathSubstack::infoize(std::ostream & os) const { os << "Substack "; } -void MathSubstackInset::write(WriteStream & os) const +void InsetMathSubstack::write(WriteStream & os) const { os << "\\substack{"; - MathGridInset::write(os); + InsetMathGrid::write(os); os << "}\n"; } -void MathSubstackInset::normalize(NormalStream & os) const +void InsetMathSubstack::normalize(NormalStream & os) const { os << "[substack "; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathSubstackInset::maple(MapleStream & os) const +void InsetMathSubstack::maple(MapleStream & os) const { os << "substack("; - MathGridInset::maple(os); + InsetMathGrid::maple(os); os << ')'; } -void MathSubstackInset::validate(LaTeXFeatures & features) const +void InsetMathSubstack::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathGridInset::validate(features); + InsetMathGrid::validate(features); } diff --git a/src/mathed/math_substackinset.h b/src/mathed/math_substackinset.h index 36f6a4209a..cfb0f158d5 100644 --- a/src/mathed/math_substackinset.h +++ b/src/mathed/math_substackinset.h @@ -17,16 +17,16 @@ /// support for AMS's \\substack -class MathSubstackInset : public MathGridInset { +class InsetMathSubstack : public InsetMathGrid { public: /// - MathSubstackInset(); + InsetMathSubstack(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo & pi, int x, int y) const; /// - MathSubstackInset const * asSubstackInset() const { return this; } + InsetMathSubstack const * asSubstackInset() const { return this; } /// bool getStatus(LCursor & cur, FuncRequest const & cmd, diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index c4d02a7986..c3ab018ac5 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -702,7 +702,7 @@ void asArray(string const & str, MathArray & ar) } -string asString(MathInset const & inset) +string asString(InsetMath const & inset) { std::ostringstream os; WriteStream ws(os); diff --git a/src/mathed/math_support.h b/src/mathed/math_support.h index c21d9421e9..009d646252 100644 --- a/src/mathed/math_support.h +++ b/src/mathed/math_support.h @@ -20,7 +20,7 @@ class LyXFont; class Dimension; class MathArray; class MathAtom; -class MathInset; +class InsetMath; void mathed_char_dim(LyXFont const &, unsigned char c, Dimension & dim); @@ -46,7 +46,7 @@ bool isFontName(std::string const & name); // converts single cell to string std::string asString(MathArray const & ar); // converts single inset to string -std::string asString(MathInset const &); +std::string asString(InsetMath const &); std::string asString(MathAtom const &); // converts string to single cell void asArray(std::string const & str, MathArray & ar); diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index c6fec301de..e0c681f581 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -26,34 +26,34 @@ using std::string; using std::auto_ptr; -MathSymbolInset::MathSymbolInset(latexkeys const * l) +InsetMathSymbol::InsetMathSymbol(latexkeys const * l) : sym_(l), h_(0), width_(0), scriptable_(false) {} -MathSymbolInset::MathSymbolInset(char const * name) +InsetMathSymbol::InsetMathSymbol(char const * name) : sym_(in_word_set(name)), h_(0), width_(0), scriptable_(false) {} -MathSymbolInset::MathSymbolInset(string const & name) +InsetMathSymbol::InsetMathSymbol(string const & name) : sym_(in_word_set(name.c_str())), h_(0), width_(0), scriptable_(false) {} -auto_ptr MathSymbolInset::doClone() const +auto_ptr InsetMathSymbol::doClone() const { - return auto_ptr(new MathSymbolInset(*this)); + return auto_ptr(new InsetMathSymbol(*this)); } -string MathSymbolInset::name() const +string InsetMathSymbol::name() const { return sym_->name; } -void MathSymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathSymbol::metrics(MetricsInfo & mi, Dimension & dim) const { //lyxerr << "metrics: symbol: '" << sym_->name // << "' in font: '" << sym_->inset @@ -97,7 +97,7 @@ void MathSymbolInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathSymbolInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathSymbol::draw(PainterInfo & pi, int x, int y) const { //lyxerr << "metrics: symbol: '" << sym_->name // << "' in font: '" << sym_->inset @@ -116,19 +116,19 @@ void MathSymbolInset::draw(PainterInfo & pi, int x, int y) const } -bool MathSymbolInset::isRelOp() const +bool InsetMathSymbol::isRelOp() const { return sym_->extra == "mathrel"; } -bool MathSymbolInset::isScriptable() const +bool InsetMathSymbol::isScriptable() const { return scriptable_; } -bool MathSymbolInset::takesLimits() const +bool InsetMathSymbol::takesLimits() const { return sym_->inset == "cmex" || @@ -137,20 +137,20 @@ bool MathSymbolInset::takesLimits() const } -void MathSymbolInset::validate(LaTeXFeatures & features) const +void InsetMathSymbol::validate(LaTeXFeatures & features) const { if (!sym_->requires.empty()) features.require(sym_->requires); } -void MathSymbolInset::normalize(NormalStream & os) const +void InsetMathSymbol::normalize(NormalStream & os) const { os << "[symbol " << name() << ']'; } -void MathSymbolInset::maple(MapleStream & os) const +void InsetMathSymbol::maple(MapleStream & os) const { if (name() == "cdot") os << '*'; @@ -160,7 +160,7 @@ void MathSymbolInset::maple(MapleStream & os) const os << name(); } -void MathSymbolInset::maxima(MaximaStream & os) const +void InsetMathSymbol::maxima(MaximaStream & os) const { if (name() == "cdot") os << '*'; @@ -173,7 +173,7 @@ void MathSymbolInset::maxima(MaximaStream & os) const } -void MathSymbolInset::mathematica(MathematicaStream & os) const +void InsetMathSymbol::mathematica(MathematicaStream & os) const { if ( name() == "pi") { os << "Pi"; return;} if ( name() == "infty") { os << "Infinity"; return;} @@ -190,7 +190,7 @@ char const * MathMLtype(string const & s) } -void MathSymbolInset::mathmlize(MathMLStream & os) const +void InsetMathSymbol::mathmlize(MathMLStream & os) const { char const * type = MathMLtype(sym_->extra); os << '<' << type << "> "; @@ -202,7 +202,7 @@ void MathSymbolInset::mathmlize(MathMLStream & os) const } -void MathSymbolInset::octave(OctaveStream & os) const +void InsetMathSymbol::octave(OctaveStream & os) const { if (name() == "cdot") os << '*'; @@ -211,14 +211,14 @@ void MathSymbolInset::octave(OctaveStream & os) const } -void MathSymbolInset::write(WriteStream & os) const +void InsetMathSymbol::write(WriteStream & os) const { os << '\\' << name(); os.pendingSpace(true); } -void MathSymbolInset::infoize2(std::ostream & os) const +void InsetMathSymbol::infoize2(std::ostream & os) const { os << "Symbol: " << name(); } diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index d25260409a..996380fb40 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -20,14 +20,14 @@ class latexkeys; /** "normal" symbols that don't take limits and don't grow in displayed * formulae. */ -class MathSymbolInset : public MathInset { +class InsetMathSymbol : public InsetMath { public: /// - explicit MathSymbolInset(latexkeys const * l); + explicit InsetMathSymbol(latexkeys const * l); /// - explicit MathSymbolInset(char const * name); + explicit InsetMathSymbol(char const * name); /// - explicit MathSymbolInset(std::string const & name); + explicit InsetMathSymbol(std::string const & name); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// @@ -42,7 +42,7 @@ public: /// do we take \limits or \nolimits? bool takesLimits() const; /// identifies SymbolInset as such - MathSymbolInset const * asSymbolInset() const { return this; } + InsetMathSymbol const * asSymbolInset() const { return this; } /// the LaTeX name of the symbol (without the backslash) std::string name() const; /// request "external features" diff --git a/src/mathed/math_tabularinset.C b/src/mathed/math_tabularinset.C index eb4fe3e8eb..4f88f3a232 100644 --- a/src/mathed/math_tabularinset.C +++ b/src/mathed/math_tabularinset.C @@ -25,46 +25,46 @@ using std::string; using std::auto_ptr; -MathTabularInset::MathTabularInset(string const & name, int m, int n) - : MathGridInset(m, n), name_(name) +InsetMathTabular::InsetMathTabular(string const & name, int m, int n) + : InsetMathGrid(m, n), name_(name) {} -MathTabularInset::MathTabularInset(string const & name, int m, int n, +InsetMathTabular::InsetMathTabular(string const & name, int m, int n, char valign, string const & halign) - : MathGridInset(m, n, valign, halign), name_(name) + : InsetMathGrid(m, n, valign, halign), name_(name) {} -MathTabularInset::MathTabularInset(string const & name, char valign, +InsetMathTabular::InsetMathTabular(string const & name, char valign, string const & halign) - : MathGridInset(valign, halign), name_(name) + : InsetMathGrid(valign, halign), name_(name) {} -auto_ptr MathTabularInset::doClone() const +auto_ptr InsetMathTabular::doClone() const { - return auto_ptr(new MathTabularInset(*this)); + return auto_ptr(new InsetMathTabular(*this)); } -void MathTabularInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathTabular::metrics(MetricsInfo & mi, Dimension & dim) const { FontSetChanger dummy(mi.base, "textnormal"); - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); dim.wid += 6; dim_ = dim; } -void MathTabularInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathTabular::draw(PainterInfo & pi, int x, int y) const { FontSetChanger dummy(pi.base, "textnormal"); - MathGridInset::drawWithMargin(pi, x, y, 4, 2); + InsetMathGrid::drawWithMargin(pi, x, y, 4, 2); } -void MathTabularInset::write(WriteStream & os) const +void InsetMathTabular::write(WriteStream & os) const { if (os.fragile()) os << "\\protect"; @@ -74,7 +74,7 @@ void MathTabularInset::write(WriteStream & os) const os << '[' << char(v_align_) << ']'; os << '{' << halign() << "}\n"; - MathGridInset::write(os); + InsetMathGrid::write(os); if (os.fragile()) os << "\\protect"; @@ -84,7 +84,7 @@ void MathTabularInset::write(WriteStream & os) const } -void MathTabularInset::infoize(std::ostream & os) const +void InsetMathTabular::infoize(std::ostream & os) const { string name = name_; name[0] = lyx::support::uppercase(name[0]); @@ -92,17 +92,17 @@ void MathTabularInset::infoize(std::ostream & os) const } -void MathTabularInset::normalize(NormalStream & os) const +void InsetMathTabular::normalize(NormalStream & os) const { os << '[' << name_ << ' '; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathTabularInset::maple(MapleStream & os) const +void InsetMathTabular::maple(MapleStream & os) const { os << "array("; - MathGridInset::maple(os); + InsetMathGrid::maple(os); os << ')'; } diff --git a/src/mathed/math_tabularinset.h b/src/mathed/math_tabularinset.h index 469983dde2..66fb3580b6 100644 --- a/src/mathed/math_tabularinset.h +++ b/src/mathed/math_tabularinset.h @@ -16,23 +16,23 @@ /// Inset for things like \begin{tabular}...\end{tabular} -class MathTabularInset : public MathGridInset { +class InsetMathTabular : public InsetMathGrid { public: /// - MathTabularInset(std::string const &, int m, int n); + InsetMathTabular(std::string const &, int m, int n); /// - MathTabularInset(std::string const &, int m, int n, + InsetMathTabular(std::string const &, int m, int n, char valign, std::string const & halign); /// - MathTabularInset(std::string const &, char valign, std::string const & halign); + InsetMathTabular(std::string const &, char valign, std::string const & halign); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo & pi, int x, int y) const; /// - MathTabularInset * asTabularInset() { return this; } + InsetMathTabular * asTabularInset() { return this; } /// - MathTabularInset const * asTabularInset() const { return this; } + InsetMathTabular const * asTabularInset() const { return this; } /// void write(WriteStream & os) const; diff --git a/src/mathed/math_tfracinset.C b/src/mathed/math_tfracinset.C index cd55d5f285..48f5030e4e 100644 --- a/src/mathed/math_tfracinset.C +++ b/src/mathed/math_tfracinset.C @@ -26,18 +26,18 @@ using std::max; using std::auto_ptr; -MathTfracInset::MathTfracInset() - : MathFracInset() +InsetMathTFrac::InsetMathTFrac() + : InsetMathFrac() {} -auto_ptr MathTfracInset::doClone() const +auto_ptr InsetMathTFrac::doClone() const { - return auto_ptr(new MathTfracInset(*this)); + return auto_ptr(new InsetMathTFrac(*this)); } -void MathTfracInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathTFrac::metrics(MetricsInfo & mi, Dimension & dim) const { StyleChanger dummy(mi.base, LM_ST_SCRIPT); cell(0).metrics(mi); @@ -49,7 +49,7 @@ void MathTfracInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathTfracInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathTFrac::draw(PainterInfo & pi, int x, int y) const { StyleChanger dummy(pi.base, LM_ST_SCRIPT); int m = x + dim_.wid / 2; @@ -60,20 +60,20 @@ void MathTfracInset::draw(PainterInfo & pi, int x, int y) const } -string MathTfracInset::name() const +string InsetMathTFrac::name() const { return "tfrac"; } -void MathTfracInset::mathmlize(MathMLStream & os) const +void InsetMathTFrac::mathmlize(MathMLStream & os) const { os << MTag("mtfrac") << cell(0) << cell(1) << ETag("mtfrac"); } -void MathTfracInset::validate(LaTeXFeatures & features) const +void InsetMathTFrac::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_tfracinset.h b/src/mathed/math_tfracinset.h index c384f25667..5333716ca0 100644 --- a/src/mathed/math_tfracinset.h +++ b/src/mathed/math_tfracinset.h @@ -16,10 +16,10 @@ /// \dfrac support -class MathTfracInset : public MathFracInset { +class InsetMathTFrac : public InsetMathFrac { public: /// - MathTfracInset(); + InsetMathTFrac(); /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/math_undersetinset.C b/src/mathed/math_undersetinset.C index 5ba13ad186..764f0c1d3b 100644 --- a/src/mathed/math_undersetinset.C +++ b/src/mathed/math_undersetinset.C @@ -22,13 +22,13 @@ using std::auto_ptr; -auto_ptr MathUndersetInset::doClone() const +auto_ptr InsetMathUnderset::doClone() const { - return auto_ptr(new MathUndersetInset(*this)); + return auto_ptr(new InsetMathUnderset(*this)); } -void MathUndersetInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathUnderset::metrics(MetricsInfo & mi, Dimension & dim) const { cell(1).metrics(mi); FracChanger dummy(mi.base); @@ -41,7 +41,7 @@ void MathUndersetInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathUndersetInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathUnderset::draw(PainterInfo & pi, int x, int y) const { int m = x + width() / 2; int yo = y + cell(1).descent() + cell(0).ascent() + 1; @@ -52,7 +52,7 @@ void MathUndersetInset::draw(PainterInfo & pi, int x, int y) const } -bool MathUndersetInset::idxFirst(LCursor & cur) const +bool InsetMathUnderset::idxFirst(LCursor & cur) const { cur.idx() = 1; cur.pos() = 0; @@ -60,7 +60,7 @@ bool MathUndersetInset::idxFirst(LCursor & cur) const } -bool MathUndersetInset::idxLast(LCursor & cur) const +bool InsetMathUnderset::idxLast(LCursor & cur) const { cur.idx() = 1; cur.pos() = cur.lastpos(); @@ -68,7 +68,7 @@ bool MathUndersetInset::idxLast(LCursor & cur) const } -bool MathUndersetInset::idxUpDown(LCursor & cur, bool up) const +bool InsetMathUnderset::idxUpDown(LCursor & cur, bool up) const { idx_type target = up; // up ? 1 : 0, since upper cell has idx 1 if (cur.idx() == target) @@ -79,20 +79,20 @@ bool MathUndersetInset::idxUpDown(LCursor & cur, bool up) const } -void MathUndersetInset::write(WriteStream & os) const +void InsetMathUnderset::write(WriteStream & os) const { os << "\\underset{" << cell(0) << "}{" << cell(1) << '}'; } -void MathUndersetInset::normalize(NormalStream & os) const +void InsetMathUnderset::normalize(NormalStream & os) const { os << "[underset " << cell(0) << ' ' << cell(1) << ']'; } -void MathUndersetInset::validate(LaTeXFeatures & features) const +void InsetMathUnderset::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_undersetinset.h b/src/mathed/math_undersetinset.h index c80a23497e..dd5eb1d24b 100644 --- a/src/mathed/math_undersetinset.h +++ b/src/mathed/math_undersetinset.h @@ -16,7 +16,7 @@ #include "math_fracbase.h" /// Inset for underset -class MathUndersetInset : public MathFracbaseInset { +class InsetMathUnderset : public InsetMathFracBase { public: /// void metrics(MetricsInfo & mi, Dimension & dim) const; diff --git a/src/mathed/math_unknowninset.C b/src/mathed/math_unknowninset.C index 12a29cab56..3daf48edac 100644 --- a/src/mathed/math_unknowninset.C +++ b/src/mathed/math_unknowninset.C @@ -20,43 +20,43 @@ using std::string; using std::auto_ptr; -MathUnknownInset::MathUnknownInset(string const & nm, bool final, bool black) +InsetMathUnknown::InsetMathUnknown(string const & nm, bool final, bool black) : name_(nm), final_(final), black_(black) {} -auto_ptr MathUnknownInset::doClone() const +auto_ptr InsetMathUnknown::doClone() const { - return auto_ptr(new MathUnknownInset(*this)); + return auto_ptr(new InsetMathUnknown(*this)); } -string MathUnknownInset::name() const +string InsetMathUnknown::name() const { return name_; } -void MathUnknownInset::setName(string const & name) +void InsetMathUnknown::setName(string const & name) { name_ = name; } -void MathUnknownInset::normalize(NormalStream & os) const +void InsetMathUnknown::normalize(NormalStream & os) const { os << "[unknown " << name_ << ']'; } -void MathUnknownInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const { mathed_string_dim(mi.base.font, name_, dim); dim_ = dim; } -void MathUnknownInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathUnknown::draw(PainterInfo & pi, int x, int y) const { if (black_) drawStrBlack(pi, x, y, name_); @@ -66,37 +66,37 @@ void MathUnknownInset::draw(PainterInfo & pi, int x, int y) const } -void MathUnknownInset::finalize() +void InsetMathUnknown::finalize() { final_ = true; } -bool MathUnknownInset::final() const +bool InsetMathUnknown::final() const { return final_; } -void MathUnknownInset::maple(MapleStream & os) const +void InsetMathUnknown::maple(MapleStream & os) const { os << name_; } -void MathUnknownInset::mathematica(MathematicaStream & os) const +void InsetMathUnknown::mathematica(MathematicaStream & os) const { os << name_; } -void MathUnknownInset::mathmlize(MathMLStream & os) const +void InsetMathUnknown::mathmlize(MathMLStream & os) const { os << MTag("mi") << name_ << ETag("mi"); } -void MathUnknownInset::octave(OctaveStream & os) const +void InsetMathUnknown::octave(OctaveStream & os) const { os << name_; } diff --git a/src/mathed/math_unknowninset.h b/src/mathed/math_unknowninset.h index 0dcb683f32..eb5a0c819a 100644 --- a/src/mathed/math_unknowninset.h +++ b/src/mathed/math_unknowninset.h @@ -16,10 +16,10 @@ /// LaTeX names for objects that we really don't know -class MathUnknownInset : public MathDimInset { +class InsetMathUnknown : public InsetMathDim { public: /// - explicit MathUnknownInset(std::string const & name, + explicit InsetMathUnknown(std::string const & name, bool final = true, bool black = false); /// void metrics(MetricsInfo & mi, Dimension & dim) const; @@ -30,9 +30,9 @@ public: /// std::string name() const; /// identifies UnknownInsets - MathUnknownInset const * asUnknownInset() const { return this; } + InsetMathUnknown const * asUnknownInset() const { return this; } /// identifies UnknownInsets - MathUnknownInset * asUnknownInset() { return this; } + InsetMathUnknown * asUnknownInset() { return this; } /// void normalize(NormalStream &) const; diff --git a/src/mathed/math_xarrowinset.C b/src/mathed/math_xarrowinset.C index 744ff8dde8..6299e82688 100644 --- a/src/mathed/math_xarrowinset.C +++ b/src/mathed/math_xarrowinset.C @@ -22,18 +22,18 @@ using std::string; using std::auto_ptr; -MathXArrowInset::MathXArrowInset(string const & name) - : MathFracbaseInset(), name_(name) +InsetMathXArrow::InsetMathXArrow(string const & name) + : InsetMathFracBase(), name_(name) {} -auto_ptr MathXArrowInset::doClone() const +auto_ptr InsetMathXArrow::doClone() const { - return auto_ptr(new MathXArrowInset(*this)); + return auto_ptr(new InsetMathXArrow(*this)); } -void MathXArrowInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathXArrow::metrics(MetricsInfo & mi, Dimension & dim) const { ScriptChanger dummy(mi.base); cell(0).metrics(mi); @@ -46,7 +46,7 @@ void MathXArrowInset::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathXArrowInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathXArrow::draw(PainterInfo & pi, int x, int y) const { ScriptChanger dummy(pi.base); cell(0).draw(pi, x + 5, y - 10); @@ -56,7 +56,7 @@ void MathXArrowInset::draw(PainterInfo & pi, int x, int y) const } -void MathXArrowInset::write(WriteStream & os) const +void InsetMathXArrow::write(WriteStream & os) const { os << '\\' << name_; if (cell(1).size()) @@ -65,14 +65,14 @@ void MathXArrowInset::write(WriteStream & os) const } -void MathXArrowInset::normalize(NormalStream & os) const +void InsetMathXArrow::normalize(NormalStream & os) const { os << "[xarrow " << name_ << ' ' << cell(0) << ' ' << cell(1) << ']'; } -void MathXArrowInset::validate(LaTeXFeatures & features) const +void InsetMathXArrow::validate(LaTeXFeatures & features) const { features.require("amsmath"); - MathNestInset::validate(features); + InsetMathNest::validate(features); } diff --git a/src/mathed/math_xarrowinset.h b/src/mathed/math_xarrowinset.h index 0d00122e85..27f0fa4d04 100644 --- a/src/mathed/math_xarrowinset.h +++ b/src/mathed/math_xarrowinset.h @@ -16,10 +16,10 @@ /// Wide arrows like \xrightarrow -class MathXArrowInset : public MathFracbaseInset { +class InsetMathXArrow : public InsetMathFracBase { public: /// - explicit MathXArrowInset(std::string const & name); + explicit InsetMathXArrow(std::string const & name); /// void draw(PainterInfo & pi, int x, int y) const; /// diff --git a/src/mathed/math_xyarrowinset.C b/src/mathed/math_xyarrowinset.C index bb16eb90dd..afa4d22e97 100644 --- a/src/mathed/math_xyarrowinset.C +++ b/src/mathed/math_xyarrowinset.C @@ -21,27 +21,27 @@ using std::max; -MathXYArrowInset::MathXYArrowInset() - : MathNestInset(2) +InsetMathXYArrow::InsetMathXYArrow() + : InsetMathNest(2) {} -std::auto_ptr MathXYArrowInset::clone() const +std::auto_ptr InsetMathXYArrow::clone() const { - return std::auto_ptr(new MathXYArrowInset(*this)); + return std::auto_ptr(new InsetMathXYArrow(*this)); } -MathXYMatrixInset const * MathXYArrowInset::targetMatrix() const +InsetMathXYMatrix const * InsetMathXYArrow::targetMatrix() const { return target_; } -MathArray const & MathXYArrowInset::targetCell() const +MathArray const & InsetMathXYArrow::targetCell() const { #if 0 - MathXYMatrixInset const * p = targetMatrix(); + InsetMathXYMatrix const * p = targetMatrix(); int x = 0; int y = 0; MathArray const & t = cell(0); @@ -54,7 +54,7 @@ MathArray const & MathXYArrowInset::targetCell() const } } //lyxerr << "target: x: " << x << " y: " << y << endl; - MathInset::idx_type n = mi_.idx + p->ncols() * y + x; + InsetMath::idx_type n = mi_.idx + p->ncols() * y + x; if (n >= p->nargs()) { lyxerr << "source: n: " << mi_.idx << "\n" << "target: n: " << n << " out of range" << endl; @@ -68,7 +68,7 @@ MathArray const & MathXYArrowInset::targetCell() const } -MathArray const & MathXYArrowInset::sourceCell() const +MathArray const & InsetMathXYArrow::sourceCell() const { #if 0 return targetMatrix()->cell(mi_.idx); @@ -79,9 +79,9 @@ MathArray const & MathXYArrowInset::sourceCell() const } -void MathXYArrowInset::metrics(MetricsInfo & mi) const +void InsetMathXYArrow::metrics(MetricsInfo & mi) const { - MathNestInset::metrics(mi); + InsetMathNest::metrics(mi); mi_ = mi; FontSetChanger dummy(mi.base, "textrm"); #if 0 @@ -102,7 +102,7 @@ void MathXYArrowInset::metrics(MetricsInfo & mi) const } -void MathXYArrowInset::draw(PainterInfo & pi, int x, int y) const +void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const { metrics(mi_); FontSetChanger dummy(pi.base, "textrm"); @@ -138,7 +138,7 @@ void MathXYArrowInset::draw(PainterInfo & pi, int x, int y) const } -void MathXYArrowInset::write(WriteStream & os) const +void InsetMathXYArrow::write(WriteStream & os) const { os << "\\ar"; if (cell(0).size()) @@ -149,9 +149,9 @@ void MathXYArrowInset::write(WriteStream & os) const } -void MathXYArrowInset::normalize(NormalStream & os) const +void InsetMathXYArrow::normalize(NormalStream & os) const { os << "[xyarrow "; - MathNestInset::normalize(os); + InsetMathNest::normalize(os); os << ']'; } diff --git a/src/mathed/math_xyarrowinset.h b/src/mathed/math_xyarrowinset.h index fe69939be4..13613b2a20 100644 --- a/src/mathed/math_xyarrowinset.h +++ b/src/mathed/math_xyarrowinset.h @@ -18,12 +18,12 @@ // for the \ar stuff in \xymatrix -class MathXYMatrixInset; +class InsetMathXYMatrix; -class MathXYArrowInset : public MathNestInset { +class InsetMathXYArrow : public InsetMathNest { public: /// - MathXYArrowInset(); + InsetMathXYArrow(); /// virtual std::auto_ptr clone() const; /// @@ -31,7 +31,7 @@ public: /// void draw(PainterInfo & pi, int x, int y) const; /// - MathXYArrowInset * asXYArrowInset() { return this; } + InsetMathXYArrow * asXYArrowInset() { return this; } /// void normalize(); @@ -42,7 +42,7 @@ public: public: /// - MathXYMatrixInset const * targetMatrix() const; + InsetMathXYMatrix const * targetMatrix() const; /// MathArray const & targetCell() const; /// @@ -55,7 +55,7 @@ public: /// mutable LyXFont font_; /// - mutable MathXYMatrixInset const * target_; + mutable InsetMathXYMatrix const * target_; }; #endif diff --git a/src/mathed/math_xymatrixinset.C b/src/mathed/math_xymatrixinset.C index 581dab36ee..d4ac730411 100644 --- a/src/mathed/math_xymatrixinset.C +++ b/src/mathed/math_xymatrixinset.C @@ -18,63 +18,63 @@ #include "support/std_ostream.h" -MathXYMatrixInset::MathXYMatrixInset() - : MathGridInset(1, 1) +InsetMathXYMatrix::InsetMathXYMatrix() + : InsetMathGrid(1, 1) {} -std::auto_ptr MathXYMatrixInset::doClone() const +std::auto_ptr InsetMathXYMatrix::doClone() const { - return std::auto_ptr(new MathXYMatrixInset(*this)); + return std::auto_ptr(new InsetMathXYMatrix(*this)); } -int MathXYMatrixInset::colsep() const +int InsetMathXYMatrix::colsep() const { return 40; } -int MathXYMatrixInset::rowsep() const +int InsetMathXYMatrix::rowsep() const { return 40; } -void MathXYMatrixInset::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const { if (mi.base.style == LM_ST_DISPLAY) mi.base.style = LM_ST_TEXT; - MathGridInset::metrics(mi, dim); + InsetMathGrid::metrics(mi, dim); } -void MathXYMatrixInset::write(WriteStream & os) const +void InsetMathXYMatrix::write(WriteStream & os) const { os << "\\xymatrix{"; - MathGridInset::write(os); + InsetMathGrid::write(os); os << "}\n"; } -void MathXYMatrixInset::infoize(std::ostream & os) const +void InsetMathXYMatrix::infoize(std::ostream & os) const { os << "xymatrix "; - MathGridInset::infoize(os); + InsetMathGrid::infoize(os); } -void MathXYMatrixInset::normalize(NormalStream & os) const +void InsetMathXYMatrix::normalize(NormalStream & os) const { os << "[xymatrix "; - MathGridInset::normalize(os); + InsetMathGrid::normalize(os); os << ']'; } -void MathXYMatrixInset::maple(MapleStream & os) const +void InsetMathXYMatrix::maple(MapleStream & os) const { os << "xymatrix("; - MathGridInset::maple(os); + InsetMathGrid::maple(os); os << ')'; } diff --git a/src/mathed/math_xymatrixinset.h b/src/mathed/math_xymatrixinset.h index d27e3e3832..21a6499875 100644 --- a/src/mathed/math_xymatrixinset.h +++ b/src/mathed/math_xymatrixinset.h @@ -16,14 +16,14 @@ #include "math_gridinset.h" -class MathXYMatrixInset : public MathGridInset { +class InsetMathXYMatrix : public InsetMathGrid { public: /// - MathXYMatrixInset(); + InsetMathXYMatrix(); /// void metrics(MetricsInfo &, Dimension &) const; /// - MathXYMatrixInset const * asXYMatrixInset() const { return this; } + InsetMathXYMatrix const * asXYMatrixInset() const { return this; } /// virtual int colsep() const; /// diff --git a/src/mathed/ref_inset.C b/src/mathed/ref_inset.C index 0a0d227580..4111c01ccd 100644 --- a/src/mathed/ref_inset.C +++ b/src/mathed/ref_inset.C @@ -63,7 +63,7 @@ void RefInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_INSET_MODIFY: if (cmd.getArg(0) == "ref") { MathArray ar; - if (createMathInset_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) { + if (createInsetMath_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) { *this = *ar[0].nucleus()->asRefInset(); break; } diff --git a/src/text2.C b/src/text2.C index fdfd27f8e4..55bde061df 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1083,7 +1083,7 @@ bool LyXText::cursorUp(LCursor & cur) LCursor old = cur; // Go to middle of previous row. 16 found to work OK; // 12 = top/bottom margin of display math - int const margin = 3 * MathHullInset::displayMargin() / 2; + int const margin = 3 * InsetMathHull::displayMargin() / 2; editXY(cur, x, y - par.rows()[row].ascent() - margin); cur.clearSelection(); @@ -1131,7 +1131,7 @@ bool LyXText::cursorDown(LCursor & cur) int const y = bv_funcs::getPos(cur, cur.boundary()).y_; LCursor old = cur; // To middle of next row - int const margin = 3 * MathHullInset::displayMargin() / 2; + int const margin = 3 * InsetMathHull::displayMargin() / 2; editXY(cur, x, y + par.rows()[row].descent() + margin); cur.clearSelection(); diff --git a/src/text3.C b/src/text3.C index df1160075c..ebb0864f68 100644 --- a/src/text3.C +++ b/src/text3.C @@ -148,7 +148,7 @@ namespace { if (sel.empty()) { const int old_pos = cur.pos(); - cur.insert(new MathHullInset(hullSimple)); + cur.insert(new InsetMathHull(hullSimple)); BOOST_ASSERT(old_pos == cur.pos()); cur.nextInset()->edit(cur, true); // don't do that also for LFUN_MATH_MODE @@ -170,7 +170,7 @@ namespace { if (sel.find("\\newcommand") == string::npos && sel.find("\\def") == string::npos) { - MathHullInset * formula = new MathHullInset; + InsetMathHull * formula = new InsetMathHull; LyXLex lex(0, 0); lex.setStream(is); formula->read(cur.buffer(), lex); @@ -1230,7 +1230,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_MATH_MATRIX: case LFUN_MATH_DELIM: case LFUN_MATH_BIGDELIM: { - cur.insert(new MathHullInset(hullSimple)); + cur.insert(new InsetMathHull(hullSimple)); cur.dispatch(FuncRequest(LFUN_CHAR_FORWARD)); cur.dispatch(cmd); break; -- 2.39.5