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