]> git.lyx.org Git - features.git/commitdiff
put \frac style stuff into a single unit. -161477.
authorAndré Pönitz <poenitz@gmx.net>
Thu, 25 Oct 2007 21:53:06 +0000 (21:53 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 25 Oct 2007 21:53:06 +0000 (21:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21208 a592a061-630c-0410-9148-cb99ea01b6c8

16 files changed:
src/Makefile.am
src/mathed/InsetMathBinom.cpp [deleted file]
src/mathed/InsetMathBinom.h [deleted file]
src/mathed/InsetMathDFrac.cpp [deleted file]
src/mathed/InsetMathDFrac.h [deleted file]
src/mathed/InsetMathFrac.cpp
src/mathed/InsetMathFrac.h
src/mathed/InsetMathFracBase.cpp [deleted file]
src/mathed/InsetMathFracBase.h [deleted file]
src/mathed/InsetMathOverset.h
src/mathed/InsetMathStackrel.h
src/mathed/InsetMathTFrac.cpp [deleted file]
src/mathed/InsetMathTFrac.h [deleted file]
src/mathed/InsetMathUnderset.h
src/mathed/InsetMathXArrow.h
src/mathed/MathFactory.cpp

index 3bd2e29e8ac66eb7ee049c144c2d3231ce539c76..7fabba5e8e1e5b6ad8a5e43acc781b5c84af4f96 100644 (file)
@@ -316,8 +316,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathArray.h \
        mathed/InsetMathBig.cpp \
        mathed/InsetMathBig.h \
-       mathed/InsetMathBinom.cpp \
-       mathed/InsetMathBinom.h \
        mathed/InsetMathBoldSymbol.cpp \
        mathed/InsetMathBoldSymbol.h \
        mathed/InsetMathBox.cpp \
@@ -341,8 +339,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathDecoration.h \
        mathed/InsetMathDelim.cpp \
        mathed/InsetMathDelim.h \
-       mathed/InsetMathDFrac.cpp \
-       mathed/InsetMathDFrac.h \
        mathed/InsetMathDiff.cpp \
        mathed/InsetMathDiff.h \
        mathed/InsetMathDots.cpp \
@@ -359,8 +355,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathFont.h \
        mathed/InsetMathFontOld.cpp \
        mathed/InsetMathFontOld.h \
-       mathed/InsetMathFracBase.cpp \
-       mathed/InsetMathFracBase.h \
        mathed/InsetMathFrac.cpp \
        mathed/InsetMathFrac.h \
        mathed/InsetMathFrameBox.cpp \
@@ -416,8 +410,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathSymbol.h \
        mathed/InsetMathTabular.cpp \
        mathed/InsetMathTabular.h \
-       mathed/InsetMathTFrac.cpp \
-       mathed/InsetMathTFrac.h \
        mathed/InsetMathUnderset.cpp \
        mathed/InsetMathUnderset.h \
        mathed/InsetMathUnknown.cpp \
diff --git a/src/mathed/InsetMathBinom.cpp b/src/mathed/InsetMathBinom.cpp
deleted file mode 100644 (file)
index 7f4873a..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * \file InsetMathBinom.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetMathBinom.h"
-#include "MathData.h"
-#include "MathSupport.h"
-#include "MathStream.h"
-
-
-namespace lyx {
-
-InsetMathBinom::InsetMathBinom(bool choose)
-       : choose_(choose)
-{}
-
-
-Inset * InsetMathBinom::clone() const
-{
-       return new InsetMathBinom(*this);
-}
-
-
-int InsetMathBinom::dw(int height) const
-{
-       int w = height / 5;
-       if (w > 15)
-               w = 15;
-       if (w < 6)
-               w = 6;
-       return w;
-}
-
-
-void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       ScriptChanger dummy(mi.base);
-       Dimension dim0, dim1;
-       cell(0).metrics(mi, dim0);
-       cell(1).metrics(mi, dim1);
-       dim.asc = dim0.height() + 4 + 5;
-       dim.des = dim1.height() + 4 - 5;
-       dim.wid = std::max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
-       metricsMarkers2(dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathBinom::draw(PainterInfo & pi, int x, int y) const
-{
-       Dimension const dim = dimension(*pi.base.bv);
-       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
-       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
-       int m = x + dim.width() / 2;
-       ScriptChanger dummy(pi.base);
-       cell(0).draw(pi, m - dim0.width() / 2, y - dim0.des - 3 - 5);
-       cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc  + 3 - 5);
-       mathed_draw_deco(pi, x, y - dim.ascent(), dw(dim.height()), dim.height(), from_ascii("("));
-       mathed_draw_deco(pi, x + dim.width() - dw(dim.height()), y - dim.ascent(),
-               dw(dim.height()), dim.height(), from_ascii(")"));
-       drawMarkers2(pi, x, y);
-}
-
-
-bool InsetMathBinom::extraBraces() const
-{
-       return choose_;
-}
-
-
-void InsetMathBinom::write(WriteStream & os) const
-{
-       if (choose_)
-               os << '{' << cell(0) << " \\choose " << cell(1) << '}';
-       else
-               os << "\\binom{" << cell(0) << "}{" << cell(1) << '}';
-}
-
-
-void InsetMathBinom::normalize(NormalStream & os) const
-{
-       os << "[binom " << cell(0) << ' ' << cell(1) << ']';
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathBinom.h b/src/mathed/InsetMathBinom.h
deleted file mode 100644 (file)
index 0f89a07..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathBinom.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MATH_BINOMINSET_H
-#define MATH_BINOMINSET_H
-
-#include "InsetMathFracBase.h"
-
-
-namespace lyx {
-
-
-/// Binom like objects
-class InsetMathBinom : public InsetMathFracBase {
-public:
-       ///
-       explicit InsetMathBinom(bool choose = false);
-       ///
-       void write(WriteStream & os) const;
-       ///
-       void normalize(NormalStream &) const;
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo &, int x, int y) const;
-       /// draw decorations.
-       void drawDecoration(PainterInfo & pi, int x, int y) const
-       { drawMarkers2(pi, x, y); }
-       ///
-       bool extraBraces() const;
-private:
-       virtual Inset * clone() const;
-       ///
-       int dw(int height) const;
-       ///
-       bool choose_;
-};
-
-
-} // namespace lyx
-
-#endif
diff --git a/src/mathed/InsetMathDFrac.cpp b/src/mathed/InsetMathDFrac.cpp
deleted file mode 100644 (file)
index e1f7ce7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * \file InsetMathDFrac.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetMathDFrac.h"
-#include "MathData.h"
-#include "MathStream.h"
-#include "LaTeXFeatures.h"
-#include "frontends/Painter.h"
-
-
-namespace lyx {
-
-InsetMathDFrac::InsetMathDFrac()
-       : InsetMathFrac()
-{}
-
-
-Inset * InsetMathDFrac::clone() const
-{
-       return new InsetMathDFrac(*this);
-}
-
-
-void InsetMathDFrac::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       Dimension dim0, dim1;
-       cell(0).metrics(mi, dim0);
-       cell(1).metrics(mi, dim1);
-       dim.wid = std::max(dim0.wid, dim1.wid) + 2;
-       dim.asc = dim0.height() + 2 + 5;
-       dim.des = dim1.height() + 2 - 5;
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathDFrac::draw(PainterInfo & pi, int x, int y) const
-{
-       Dimension const dim = dimension(*pi.base.bv);
-       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
-       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
-       int m = x + dim.wid / 2;
-       cell(0).draw(pi, m - dim0.wid / 2, y - dim0.des - 2 - 5);
-       cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc  + 2 - 5);
-       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
-       setPosCache(pi, x, y);
-}
-
-
-docstring InsetMathDFrac::name() const
-{
-       return from_ascii("dfrac");
-}
-
-
-void InsetMathDFrac::mathmlize(MathStream & os) const
-{
-       os << MTag("mdfrac") << cell(0) << cell(1) << ETag("mdfrac");
-}
-
-
-void InsetMathDFrac::validate(LaTeXFeatures & features) const
-{
-       features.require("amsmath");
-       InsetMathNest::validate(features);
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathDFrac.h b/src/mathed/InsetMathDFrac.h
deleted file mode 100644 (file)
index 9042123..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathFrac.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MATH_DFRACINSET_H
-#define MATH_DFRACINSET_H
-
-#include "InsetMathFrac.h"
-
-
-namespace lyx {
-
-
-/// \dfrac support
-class InsetMathDFrac : public InsetMathFrac {
-public:
-       ///
-       InsetMathDFrac();
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo &, int x, int y) const;
-       ///
-       docstring name() const;
-       ///
-       void mathmlize(MathStream &) const;
-       ///
-       void validate(LaTeXFeatures & features) const;
-private:
-       virtual Inset * clone() const;
-};
-
-
-} // namespace lyx
-
-#endif
index b2f55f56a2a84eb722539f86ecfc0eb39d83e1d0..0b832a83fcfea6931ca945a06070ad4e88018274 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file InsetMathFrac.cpp
+ * \file InsetMathFracBase.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 #include <config.h>
 
 #include "InsetMathFrac.h"
+
+#include "Cursor.h"
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
+#include "MathSupport.h"
 #include "TextPainter.h"
-#include "LaTeXFeatures.h"
-#include "Cursor.h"
+
 #include "frontends/Painter.h"
 
 
 namespace lyx {
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathFracBase
+//
+/////////////////////////////////////////////////////////////////////
+
+
+InsetMathFracBase::InsetMathFracBase(idx_type ncells)
+       : InsetMathNest(ncells)
+{}
+
+
+bool InsetMathFracBase::idxUpDown(Cursor & cur, bool up) const
+{
+       InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
+       if (cur.idx() == target)
+               return false;
+       cur.idx() = target;
+       cur.pos() = cell(target).x2pos(cur.x_target());
+       return true;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathFrac
+//
+/////////////////////////////////////////////////////////////////////
+
+
 InsetMathFrac::InsetMathFrac(Kind kind, InsetMath::idx_type ncells)
        : InsetMathFracBase(ncells), kind_(kind)
 {}
@@ -316,5 +350,203 @@ void InsetMathFrac::validate(LaTeXFeatures & features) const
 }
 
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathDFrac
+//
+/////////////////////////////////////////////////////////////////////
+
+
+Inset * InsetMathDFrac::clone() const
+{
+       return new InsetMathDFrac(*this);
+}
+
+
+void InsetMathDFrac::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       Dimension dim0, dim1;
+       cell(0).metrics(mi, dim0);
+       cell(1).metrics(mi, dim1);
+       dim.wid = std::max(dim0.wid, dim1.wid) + 2;
+       dim.asc = dim0.height() + 2 + 5;
+       dim.des = dim1.height() + 2 - 5;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathDFrac::draw(PainterInfo & pi, int x, int y) const
+{
+       Dimension const dim = dimension(*pi.base.bv);
+       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
+       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
+       int m = x + dim.wid / 2;
+       cell(0).draw(pi, m - dim0.wid / 2, y - dim0.des - 2 - 5);
+       cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc  + 2 - 5);
+       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
+       setPosCache(pi, x, y);
+}
+
+
+docstring InsetMathDFrac::name() const
+{
+       return from_ascii("dfrac");
+}
+
+
+void InsetMathDFrac::mathmlize(MathStream & os) const
+{
+       os << MTag("mdfrac") << cell(0) << cell(1) << ETag("mdfrac");
+}
+
+
+void InsetMathDFrac::validate(LaTeXFeatures & features) const
+{
+       features.require("amsmath");
+       InsetMathNest::validate(features);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathTFrac
+//
+/////////////////////////////////////////////////////////////////////
+
+
+Inset * InsetMathTFrac::clone() const
+{
+       return new InsetMathTFrac(*this);
+}
+
+
+void InsetMathTFrac::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       StyleChanger dummy(mi.base, LM_ST_SCRIPT);
+       Dimension dim0;
+       cell(0).metrics(mi, dim0);
+       Dimension dim1;
+       cell(1).metrics(mi, dim1);
+       dim.wid = std::max(dim0.width(), dim1.width()) + 2;
+       dim.asc = dim0.height() + 2 + 5;
+       dim.des = dim1.height() + 2 - 5;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathTFrac::draw(PainterInfo & pi, int x, int y) const
+{
+       StyleChanger dummy(pi.base, LM_ST_SCRIPT);
+       Dimension const dim = dimension(*pi.base.bv);
+       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
+       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
+       int m = x + dim.wid / 2;
+       cell(0).draw(pi, m - dim0.width() / 2, y - dim0.descent() - 2 - 5);
+       cell(1).draw(pi, m - dim1.width() / 2, y + dim1.ascent()  + 2 - 5);
+       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
+       setPosCache(pi, x, y);
+}
+
+
+docstring InsetMathTFrac::name() const
+{
+       return from_ascii("tfrac");
+}
+
+
+void InsetMathTFrac::mathmlize(MathStream & os) const
+{
+       os << MTag("mtfrac") << cell(0) << cell(1) << ETag("mtfrac");
+}
+
+
+void InsetMathTFrac::validate(LaTeXFeatures & features) const
+{
+       features.require("amsmath");
+       InsetMathNest::validate(features);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathBinom
+//
+/////////////////////////////////////////////////////////////////////
+
+
+InsetMathBinom::InsetMathBinom(bool choose)
+       : choose_(choose)
+{}
+
+
+Inset * InsetMathBinom::clone() const
+{
+       return new InsetMathBinom(*this);
+}
+
+
+int InsetMathBinom::dw(int height) const
+{
+       int w = height / 5;
+       if (w > 15)
+               w = 15;
+       if (w < 6)
+               w = 6;
+       return w;
+}
+
+
+void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       ScriptChanger dummy(mi.base);
+       Dimension dim0, dim1;
+       cell(0).metrics(mi, dim0);
+       cell(1).metrics(mi, dim1);
+       dim.asc = dim0.height() + 4 + 5;
+       dim.des = dim1.height() + 4 - 5;
+       dim.wid = std::max(dim0.width(), dim1.wid) + 2 * dw(dim.height()) + 4;
+       metricsMarkers2(dim);
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathBinom::draw(PainterInfo & pi, int x, int y) const
+{
+       Dimension const dim = dimension(*pi.base.bv);
+       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
+       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
+       int m = x + dim.width() / 2;
+       ScriptChanger dummy(pi.base);
+       cell(0).draw(pi, m - dim0.width() / 2, y - dim0.des - 3 - 5);
+       cell(1).draw(pi, m - dim1.wid / 2, y + dim1.asc  + 3 - 5);
+       mathed_draw_deco(pi, x, y - dim.ascent(), dw(dim.height()), dim.height(), from_ascii("("));
+       mathed_draw_deco(pi, x + dim.width() - dw(dim.height()), y - dim.ascent(),
+               dw(dim.height()), dim.height(), from_ascii(")"));
+       drawMarkers2(pi, x, y);
+}
+
+
+bool InsetMathBinom::extraBraces() const
+{
+       return choose_;
+}
+
+
+void InsetMathBinom::write(WriteStream & os) const
+{
+       if (choose_)
+               os << '{' << cell(0) << " \\choose " << cell(1) << '}';
+       else
+               os << "\\binom{" << cell(0) << "}{" << cell(1) << '}';
+}
+
+
+void InsetMathBinom::normalize(NormalStream & os) const
+{
+       os << "[binom " << cell(0) << ' ' << cell(1) << ']';
+}
 
 } // namespace lyx
index 5eb15d193d8d80afbc4149d13c074d83a29a8fa1..b5e99e82d77e91bb78553ecb8cdee5e9328fb4c4 100644 (file)
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef MATH_FRACINSET_H
-#define MATH_FRACINSET_H
+#ifndef MATH_FRAC_H
+#define MATH_FRAC_H
 
-#include "InsetMathFracBase.h"
+#include "InsetMathNest.h"
 
 
 namespace lyx {
 
 
+class InsetMathFracBase : public InsetMathNest {
+public:
+       ///
+       explicit InsetMathFracBase(idx_type ncells = 2);
+       ///
+       bool idxUpDown(Cursor &, bool up) const;
+       ///
+       bool idxLeft(Cursor &) const { return false; }
+       ///
+       bool idxRight(Cursor &) const { return false; }
+};
+
+
+
 /// Fraction like objects (frac, binom)
 class InsetMathFrac : public InsetMathFracBase {
 public:
@@ -68,12 +82,79 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
 public:
-       virtual Inset * clone() const;
+       Inset * clone() const;
        ///
        Kind kind_;
 };
 
 
+/// \dfrac support
+class InsetMathDFrac : public InsetMathFrac {
+public:
+       ///
+       InsetMathDFrac() {}
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo &, int x, int y) const;
+       ///
+       docstring name() const;
+       ///
+       void mathmlize(MathStream &) const;
+       ///
+       void validate(LaTeXFeatures & features) const;
+private:
+       Inset * clone() const;
+};
+
+
+/// \tfrac support
+class InsetMathTFrac : public InsetMathFrac {
+public:
+       ///
+       InsetMathTFrac() {}
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo &, int x, int y) const;
+       ///
+       docstring name() const;
+       ///
+       void mathmlize(MathStream &) const;
+       ///
+       void validate(LaTeXFeatures & features) const;
+private:
+       Inset * clone() const;
+};
+
+
+/// Binom like objects
+class InsetMathBinom : public InsetMathFracBase {
+public:
+       ///
+       explicit InsetMathBinom(bool choose = false);
+       ///
+       void write(WriteStream & os) const;
+       ///
+       void normalize(NormalStream &) const;
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo &, int x, int y) const;
+       /// draw decorations.
+       void drawDecoration(PainterInfo & pi, int x, int y) const
+       { drawMarkers2(pi, x, y); }
+       ///
+       bool extraBraces() const;
+private:
+       Inset * clone() const;
+       ///
+       int dw(int height) const;
+       ///
+       bool choose_;
+};
+
 
 } // namespace lyx
+
 #endif
diff --git a/src/mathed/InsetMathFracBase.cpp b/src/mathed/InsetMathFracBase.cpp
deleted file mode 100644 (file)
index 1138d65..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * \file InsetMathFracBase.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetMathFracBase.h"
-#include "MathData.h"
-#include "Cursor.h"
-
-
-namespace lyx {
-
-
-InsetMathFracBase::InsetMathFracBase(idx_type ncells)
-       : InsetMathNest(ncells)
-{}
-
-
-bool InsetMathFracBase::idxRight(Cursor &) const
-{
-       return false;
-}
-
-
-bool InsetMathFracBase::idxLeft(Cursor &) const
-{
-       return false;
-}
-
-
-bool InsetMathFracBase::idxUpDown(Cursor & cur, bool up) const
-{
-       InsetMath::idx_type target = !up; // up ? 0 : 1, since upper cell has idx 0
-       if (cur.idx() == target)
-               return false;
-       cur.idx() = target;
-       cur.pos() = cell(target).x2pos(cur.x_target());
-       return true;
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathFracBase.h b/src/mathed/InsetMathFracBase.h
deleted file mode 100644 (file)
index 88236a0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathFracBase.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MATH_FRACBASE_H
-#define MATH_FRACBASE_H
-
-#include "InsetMathNest.h"
-
-
-namespace lyx {
-
-
-class InsetMathFracBase : public InsetMathNest {
-public:
-       ///
-       explicit InsetMathFracBase(idx_type ncells = 2);
-       ///
-       bool idxUpDown(Cursor &, bool up) const;
-       ///
-       bool idxLeft(Cursor &) const;
-       ///
-       bool idxRight(Cursor &) const;
-};
-
-
-
-} // namespace lyx
-#endif
index f5ed46c16c464abaaaf8cd27d279f0b7f6fe4fce..c5e728188593fd4aa7d56260569f2e6942b2913d 100644 (file)
@@ -13,7 +13,7 @@
 #define MATH_OVERSETINSET_H
 
 
-#include "InsetMathFracBase.h"
+#include "InsetMathFrac.h"
 
 
 namespace lyx {
index af5b44888a29583f8246297a1a302e1fadc9eeda..834cc0c4e8f5dc6fa56ff387b3929e8992b028e3 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef MATH_STACKRELINSET_H
 #define MATH_STACKRELINSET_H
 
-#include "InsetMathFracBase.h"
+#include "InsetMathFrac.h"
 
 
 namespace lyx {
diff --git a/src/mathed/InsetMathTFrac.cpp b/src/mathed/InsetMathTFrac.cpp
deleted file mode 100644 (file)
index 2a08b20..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * \file InsetMathDFrac.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetMathTFrac.h"
-
-#include "MathData.h"
-#include "MathStream.h"
-
-#include "LaTeXFeatures.h"
-
-#include "frontends/Painter.h"
-
-
-namespace lyx {
-
-InsetMathTFrac::InsetMathTFrac()
-       : InsetMathFrac()
-{}
-
-
-Inset * InsetMathTFrac::clone() const
-{
-       return new InsetMathTFrac(*this);
-}
-
-
-void InsetMathTFrac::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       StyleChanger dummy(mi.base, LM_ST_SCRIPT);
-       Dimension dim0;
-       cell(0).metrics(mi, dim0);
-       Dimension dim1;
-       cell(1).metrics(mi, dim1);
-       dim.wid = std::max(dim0.width(), dim1.width()) + 2;
-       dim.asc = dim0.height() + 2 + 5;
-       dim.des = dim1.height() + 2 - 5;
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathTFrac::draw(PainterInfo & pi, int x, int y) const
-{
-       StyleChanger dummy(pi.base, LM_ST_SCRIPT);
-       Dimension const dim = dimension(*pi.base.bv);
-       Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
-       Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
-       int m = x + dim.wid / 2;
-       cell(0).draw(pi, m - dim0.width() / 2, y - dim0.descent() - 2 - 5);
-       cell(1).draw(pi, m - dim1.width() / 2, y + dim1.ascent()  + 2 - 5);
-       pi.pain.line(x + 1, y - 5, x + dim.wid - 2, y - 5, Color_math);
-       setPosCache(pi, x, y);
-}
-
-
-docstring InsetMathTFrac::name() const
-{
-       return from_ascii("tfrac");
-}
-
-
-void InsetMathTFrac::mathmlize(MathStream & os) const
-{
-       os << MTag("mtfrac") << cell(0) << cell(1) << ETag("mtfrac");
-}
-
-
-void InsetMathTFrac::validate(LaTeXFeatures & features) const
-{
-       features.require("amsmath");
-       InsetMathNest::validate(features);
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathTFrac.h b/src/mathed/InsetMathTFrac.h
deleted file mode 100644 (file)
index 57ed841..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathTFrac.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MATH_TFRACINSET_H
-#define MATH_TFRACINSET_H
-
-#include "InsetMathFrac.h"
-
-
-namespace lyx {
-
-
-/// \dfrac support
-class InsetMathTFrac : public InsetMathFrac {
-public:
-       ///
-       InsetMathTFrac();
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo &, int x, int y) const;
-       ///
-       docstring name() const;
-       ///
-       void mathmlize(MathStream &) const;
-       ///
-       void validate(LaTeXFeatures & features) const;
-private:
-       virtual Inset * clone() const;
-};
-
-
-
-} // namespace lyx
-#endif
index b28ef012b5768b9b816810e65785e429be79663b..d0a8492439bac9540c6cafd1ee1ad7c6ced2e251 100644 (file)
@@ -13,7 +13,7 @@
 #define MATH_UNDERSETINSET_H
 
 
-#include "InsetMathFracBase.h"
+#include "InsetMathFrac.h"
 
 
 namespace lyx {
index a3ebd3b5128a9cd3e6a2b753167cadb9a719c0c8..a239fd053232d037315f1467563873efa19ad848 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef MATH_XARROWINSET_H
 #define MATH_XARROWINSET_H
 
-#include "InsetMathFracBase.h"
+#include "InsetMathFrac.h"
 
 
 namespace lyx {
index 2127f65eb8f0469c75e4cdb26de85990c4bea847..370c6c6caa798966dbb4a26aa7f2e68fb1c62edc 100644 (file)
 
 #include "InsetMathAMSArray.h"
 #include "InsetMathArray.h"
-#include "InsetMathBinom.h"
 #include "InsetMathBoldSymbol.h"
 #include "InsetMathBoxed.h"
 #include "InsetMathBox.h"
 #include "InsetMathCases.h"
 #include "InsetMathColor.h"
 #include "InsetMathDecoration.h"
-#include "InsetMathDFrac.h"
 #include "InsetMathDots.h"
 #include "InsetMathFBox.h"
 #include "InsetMathFont.h"
@@ -44,7 +42,6 @@
 #include "InsetMathSubstack.h"
 #include "InsetMathSymbol.h"
 #include "InsetMathTabular.h"
-#include "InsetMathTFrac.h"
 #include "InsetMathUnderset.h"
 #include "InsetMathUnknown.h"
 #include "InsetMathXArrow.h"