]> git.lyx.org Git - features.git/commitdiff
some consolidation
authorAndré Pönitz <poenitz@gmx.net>
Tue, 6 Nov 2007 20:57:29 +0000 (20:57 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 6 Nov 2007 20:57:29 +0000 (20:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21478 a592a061-630c-0410-9148-cb99ea01b6c8

src/Makefile.am
src/mathed/InsetMathBox.cpp
src/mathed/InsetMathBox.h
src/mathed/InsetMathBoxed.cpp [deleted file]
src/mathed/InsetMathBoxed.h [deleted file]
src/mathed/InsetMathFBox.cpp [deleted file]
src/mathed/InsetMathFBox.h [deleted file]
src/mathed/InsetMathFrameBox.cpp [deleted file]
src/mathed/InsetMathFrameBox.h [deleted file]
src/mathed/InsetMathMakebox.cpp [deleted file]
src/mathed/InsetMathMakebox.h [deleted file]

index 0ec29dfbc9193b84e50b91874baae4df91c2b937..a5ecd478a4e63f83d4f3e3dee32ed0f5a95bc758 100644 (file)
@@ -322,8 +322,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathBoldSymbol.cpp \
        mathed/InsetMathBoldSymbol.h \
        mathed/InsetMathBox.cpp \
-       mathed/InsetMathBoxed.cpp \
-       mathed/InsetMathBoxed.h \
        mathed/InsetMathBox.h \
        mathed/InsetMathBrace.cpp \
        mathed/InsetMathBrace.h \
@@ -352,16 +350,12 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathExFunc.h \
        mathed/InsetMathExInt.cpp \
        mathed/InsetMathExInt.h \
-       mathed/InsetMathFBox.cpp \
-       mathed/InsetMathFBox.h \
        mathed/InsetMathFont.cpp \
        mathed/InsetMathFont.h \
        mathed/InsetMathFontOld.cpp \
        mathed/InsetMathFontOld.h \
        mathed/InsetMathFrac.cpp \
        mathed/InsetMathFrac.h \
-       mathed/InsetMathFrameBox.cpp \
-       mathed/InsetMathFrameBox.h \
        mathed/InsetMathGrid.cpp \
        mathed/InsetMathGrid.h \
        mathed/InsetMath.h \
@@ -375,8 +369,6 @@ liblyxmathed_la_SOURCES = \
        mathed/InsetMathLim.h \
        mathed/MathMacro.cpp \
        mathed/MathMacro.h \
-       mathed/InsetMathMakebox.cpp \
-       mathed/InsetMathMakebox.h \
        mathed/InsetMathMatrix.cpp \
        mathed/InsetMathMatrix.h \
        mathed/InsetMathNest.cpp \
@@ -447,8 +439,6 @@ liblyxmathed_la_SOURCES = \
        mathed/MathSupport.h \
        mathed/TextPainter.cpp \
        mathed/TextPainter.h 
-#      mathed/InsetMathMBox.cpp
-#      mathed/InsetMathMBox.h
 
 ############################### Insets  ##############################
 
index 3056c72dbc14530d43a842512e790df03d0ace0a..013e35bd93f2ce1098e4fc5305e1aec0f874a610 100644 (file)
@@ -4,6 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author André Pönitz
+ * \author Ling Li (InsetMathMakebox)
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "InsetMathBox.h"
 
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
+#include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "frontends/Painter.h"
+
 #include <ostream>
 
 
 namespace lyx {
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathBox
+//
+/////////////////////////////////////////////////////////////////////
+
 InsetMathBox::InsetMathBox(docstring const & name)
        : InsetMathNest(1), name_(name)
 {}
 
 
-Inset * InsetMathBox::clone() const
-{
-       return new InsetMathBox(*this);
-}
-
-
 void InsetMathBox::write(WriteStream & os) const
 {
        os << '\\' << name_ << '{' << cell(0) << '}';
@@ -70,4 +75,255 @@ void InsetMathBox::infoize(odocstream & os) const
 }
 
 
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathFBox
+//
+/////////////////////////////////////////////////////////////////////
+
+
+InsetMathFBox::InsetMathFBox()
+       : InsetMathNest(1)
+{}
+
+
+void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       FontSetChanger dummy(mi.base, "textnormal");
+       cell(0).metrics(mi, dim);
+       metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
+{
+       Dimension const dim = dimension(*pi.base.bv);
+       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
+               dim.width() - 2, dim.height() - 2, Color_foreground);
+       FontSetChanger dummy(pi.base, "textnormal");
+       cell(0).draw(pi, x + 3, y);
+       setPosCache(pi, x, y);
+}
+
+
+void InsetMathFBox::write(WriteStream & os) const
+{
+       os << "\\fbox{" << cell(0) << '}';
+}
+
+
+void InsetMathFBox::normalize(NormalStream & os) const
+{
+       os << "[fbox " << cell(0) << ']';
+}
+
+
+void InsetMathFBox::infoize(odocstream & os) const
+{
+       os << "FBox: ";
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathFrameBox
+//
+/////////////////////////////////////////////////////////////////////
+
+
+InsetMathFrameBox::InsetMathFrameBox()
+       : InsetMathNest(3)
+{}
+
+
+void InsetMathFrameBox::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       FontSetChanger dummy(mi.base, "textnormal");
+       w_ = mathed_char_width(mi.base.font, '[');
+       InsetMathNest::metrics(mi);
+       dim  = cell(0).dimension(*mi.base.bv);
+       dim += cell(1).dimension(*mi.base.bv);
+       dim += cell(2).dimension(*mi.base.bv);
+       metricsMarkers(dim);
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const
+{
+       FontSetChanger dummy(pi.base, "textnormal");
+       Dimension const dim = dimension(*pi.base.bv);
+       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
+               dim.width() - 2, dim.height() - 2, Color_foreground);
+       x += 5;
+       BufferView const & bv = *pi.base.bv;
+
+       drawStrBlack(pi, x, y, from_ascii("["));
+       x += w_;
+       cell(0).draw(pi, x, y);
+       x += cell(0).dimension(bv).wid;
+       drawStrBlack(pi, x, y, from_ascii("]"));
+       x += w_ + 4;
+
+       drawStrBlack(pi, x, y, from_ascii("["));
+       x += w_;
+       cell(1).draw(pi, x, y);
+       x += cell(1).dimension(bv).wid;
+       drawStrBlack(pi, x, y, from_ascii("]"));
+       x += w_ + 4;
+
+       cell(2).draw(pi, x, y);
+       drawMarkers(pi, x, y);
+}
+
+
+void InsetMathFrameBox::write(WriteStream & os) const
+{
+       os << "\\framebox";
+       os << '[' << cell(0) << ']';
+       if (cell(1).size())
+               os << '[' << cell(1) << ']';
+       os << '{' << cell(2) << '}';
+}
+
+
+void InsetMathFrameBox::normalize(NormalStream & os) const
+{
+       os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';
+}
+
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathBoxed
+//
+/////////////////////////////////////////////////////////////////////
+
+InsetMathBoxed::InsetMathBoxed()
+       : InsetMathNest(1)
+{}
+
+
+void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       cell(0).metrics(mi, dim);
+       metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
+{
+       Dimension const dim = dimension(*pi.base.bv);
+       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
+               dim.width() - 2, dim.height() - 2, Color_foreground);
+       cell(0).draw(pi, x + 3, y);
+       setPosCache(pi, x, y);
+}
+
+
+void InsetMathBoxed::write(WriteStream & os) const
+{
+       os << "\\boxed{" << cell(0) << '}';
+}
+
+
+void InsetMathBoxed::normalize(NormalStream & os) const
+{
+       os << "[boxed " << cell(0) << ']';
+}
+
+
+void InsetMathBoxed::infoize(odocstream & os) const
+{
+       os << "Boxed: ";
+}
+
+
+void InsetMathBoxed::validate(LaTeXFeatures & features) const
+{
+       features.require("amsmath");
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// InsetMathMakebox
+//
+/////////////////////////////////////////////////////////////////////
+
+
+InsetMathMakebox::InsetMathMakebox()
+       : InsetMathNest(3)
+{}
+
+
+void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+       FontSetChanger dummy(mi.base, from_ascii("textnormal"));
+       w_ = mathed_char_width(mi.base.font, '[');
+       InsetMathNest::metrics(mi);
+       dim   = cell(0).dimension(*mi.base.bv);
+       dim  += cell(1).dimension(*mi.base.bv);
+       dim  += cell(2).dimension(*mi.base.bv);
+       dim.wid += 4 * w_ + 4;
+       metricsMarkers(dim);
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
+}
+
+
+void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const
+{
+       FontSetChanger dummy(pi.base, from_ascii("textnormal"));
+       drawMarkers(pi, x, y);
+
+       drawStrBlack(pi, x, y, from_ascii("["));
+       x += w_;
+       cell(0).draw(pi, x, y);
+       x += cell(0).dimension(*pi.base.bv).width();
+       drawStrBlack(pi, x, y, from_ascii("]"));
+       x += w_ + 2;
+
+       drawStrBlack(pi, x, y, from_ascii("["));
+       x += w_;
+       cell(1).draw(pi, x, y);
+       x += cell(1).dimension(*pi.base.bv).wid;
+       drawStrBlack(pi, x, y, from_ascii("]"));
+       x += w_ + 2;
+
+       cell(2).draw(pi, x, y);
+       setPosCache(pi, x, y);
+}
+
+
+void InsetMathMakebox::write(WriteStream & os) const
+{
+       os << "\\makebox";
+       os << '[' << cell(0) << ']';
+       if (cell(1).size())
+               os << '[' << cell(1) << ']';
+       os << '{' << cell(2) << '}';
+}
+
+
+void InsetMathMakebox::normalize(NormalStream & os) const
+{
+       os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';
+}
+
+
+void InsetMathMakebox::infoize(odocstream & os) const
+{
+       os << "Makebox (width: " << cell(0)
+           << " pos: " << cell(1) << ")";
+}
+
+
 } // namespace lyx
index c27aa3d0a26e05fd15ad5c025bf50afcf6fb9a56..9b40ba09519a76bcb2dcf9a9b26f875e76b70f81 100644 (file)
 
 namespace lyx {
 
-
-class Font;
-
 /// Support for \\mbox
-
 class InsetMathBox : public InsetMathNest {
 public:
        ///
@@ -42,13 +38,105 @@ public:
        void infoize(odocstream & os) const;
 
 private:
-       virtual Inset * clone() const;
+       Inset * clone() const { return new InsetMathBox(*this); }
        ///
        docstring name_;
 };
 
 
+/// Non-AMS-style frame
+class InsetMathFBox : public InsetMathNest {
+public:
+       ///
+       InsetMathFBox();
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       void infoize(odocstream & os) const;
+private:
+       ///
+       Inset * clone() const { return new InsetMathFBox(*this); }
+};
+
+
+/// Extra nesting
+class InsetMathFrameBox : public InsetMathNest {
+public:
+       ///
+       InsetMathFrameBox();
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+private:
+       Inset * clone() const { return new InsetMathFrameBox(*this); }
+       /// width of '[' in current font
+       mutable int w_;
+};
+
+
+/// Extra nesting: \\makebox.
+// consolidate with InsetMathFrameBox?
+class InsetMathMakebox : public InsetMathNest {
+public:
+       ///
+       InsetMathMakebox();
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+       ///
+       void infoize(odocstream & os) const;
+private:
+       Inset * clone() const { return new InsetMathMakebox(*this); }
+       /// width of '[' in current font
+       mutable int w_;
+};
+
+
+
+/// AMS-style frame
+class InsetMathBoxed : public InsetMathNest {
+public:
+       ///
+       InsetMathBoxed();
+       ///
+       void validate(LaTeXFeatures & features) const;
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       void infoize(odocstream & os) const;
+private:
+       Inset * clone() const { return new InsetMathBoxed(*this); }
+};
+
 
 } // namespace lyx
 
-#endif
+#endif // MATH_MBOX
diff --git a/src/mathed/InsetMathBoxed.cpp b/src/mathed/InsetMathBoxed.cpp
deleted file mode 100644 (file)
index ea4aabc..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * \file InsetMathBoxed.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 "InsetMathBoxed.h"
-
-#include "LaTeXFeatures.h"
-#include "MathData.h"
-#include "MathStream.h"
-#include "MetricsInfo.h"
-
-#include "frontends/Painter.h"
-
-#include <ostream>
-
-
-namespace lyx {
-
-InsetMathBoxed::InsetMathBoxed()
-       : InsetMathNest(1)
-{}
-
-
-Inset * InsetMathBoxed::clone() const
-{
-       return new InsetMathBoxed(*this);
-}
-
-
-void InsetMathBoxed::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       cell(0).metrics(mi, dim);
-       metricsMarkers2(dim, 3); // 1 pixel space, 1 frame, 1 space
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
-{
-       Dimension const dim = dimension(*pi.base.bv);
-       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color_foreground);
-       cell(0).draw(pi, x + 3, y);
-       setPosCache(pi, x, y);
-}
-
-
-void InsetMathBoxed::write(WriteStream & os) const
-{
-       os << "\\boxed{" << cell(0) << '}';
-}
-
-
-void InsetMathBoxed::normalize(NormalStream & os) const
-{
-       os << "[boxed " << cell(0) << ']';
-}
-
-
-void InsetMathBoxed::infoize(odocstream & os) const
-{
-       os << "Boxed: ";
-}
-
-
-void InsetMathBoxed::validate(LaTeXFeatures & features) const
-{
-       features.require("amsmath");
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathBoxed.h b/src/mathed/InsetMathBoxed.h
deleted file mode 100644 (file)
index 895a1a7..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathBoxed.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_BOXEDINSET_H
-#define MATH_BOXEDINSET_H
-
-#include "InsetMathNest.h"
-
-
-namespace lyx {
-
-
-/// Non-AMS-style frame
-class InsetMathBoxed : public InsetMathNest {
-public:
-       ///
-       InsetMathBoxed();
-       ///
-       void validate(LaTeXFeatures & features) const;
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       void write(WriteStream & os) const;
-       /// write normalized content
-       void normalize(NormalStream & ns) const;
-       ///
-       void infoize(odocstream & os) const;
-private:
-       virtual Inset * clone() const;
-};
-
-
-} // namespace lyx
-
-#endif
diff --git a/src/mathed/InsetMathFBox.cpp b/src/mathed/InsetMathFBox.cpp
deleted file mode 100644 (file)
index 2164ea7..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * \file InsetMathFBox.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 "InsetMathFBox.h"
-
-#include "MathData.h"
-#include "MathStream.h"
-#include "MetricsInfo.h"
-
-#include "frontends/Painter.h"
-
-#include <ostream>
-
-
-namespace lyx {
-
-InsetMathFBox::InsetMathFBox()
-       : InsetMathNest(1)
-{}
-
-
-Inset * InsetMathFBox::clone() const
-{
-       return new InsetMathFBox(*this);
-}
-
-
-InsetMath::mode_type InsetMathFBox::currentMode() const
-{
-       return TEXT_MODE;
-}
-
-
-void InsetMathFBox::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       FontSetChanger dummy(mi.base, "textnormal");
-       cell(0).metrics(mi, dim);
-       metricsMarkers(dim, 3); // 1 pixel space, 1 frame, 1 space
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
-{
-       Dimension const dim = dimension(*pi.base.bv);
-       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color_foreground);
-       FontSetChanger dummy(pi.base, "textnormal");
-       cell(0).draw(pi, x + 3, y);
-       setPosCache(pi, x, y);
-}
-
-
-void InsetMathFBox::write(WriteStream & os) const
-{
-       os << "\\fbox{" << cell(0) << '}';
-}
-
-
-void InsetMathFBox::normalize(NormalStream & os) const
-{
-       os << "[fbox " << cell(0) << ']';
-}
-
-
-void InsetMathFBox::infoize(odocstream & os) const
-{
-       os << "FBox: ";
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathFBox.h b/src/mathed/InsetMathFBox.h
deleted file mode 100644 (file)
index be14105..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathFBox.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_FBOXINSET_H
-#define MATH_FBOXINSET_H
-
-#include "InsetMathNest.h"
-
-
-namespace lyx {
-
-
-/// Non-AMS-style frame
-class InsetMathFBox : public InsetMathNest {
-public:
-       ///
-       InsetMathFBox();
-       ///
-       mode_type currentMode() const;
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       void write(WriteStream & os) const;
-       /// write normalized content
-       void normalize(NormalStream & ns) const;
-       ///
-       void infoize(odocstream & os) const;
-private:
-       virtual Inset * clone() const;
-};
-
-
-
-} // namespace lyx
-#endif
diff --git a/src/mathed/InsetMathFrameBox.cpp b/src/mathed/InsetMathFrameBox.cpp
deleted file mode 100644 (file)
index 4646f5e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * \file InsetMathFrameBox.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 "InsetMathFrameBox.h"
-
-#include "MathData.h"
-#include "MathStream.h"
-#include "MathSupport.h"
-#include "MetricsInfo.h"
-
-#include "frontends/Painter.h"
-
-
-namespace lyx {
-
-InsetMathFrameBox::InsetMathFrameBox()
-       : InsetMathNest(3)
-{}
-
-
-Inset * InsetMathFrameBox::clone() const
-{
-       return new InsetMathFrameBox(*this);
-}
-
-
-void InsetMathFrameBox::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       FontSetChanger dummy(mi.base, "textnormal");
-       w_ = mathed_char_width(mi.base.font, '[');
-       InsetMathNest::metrics(mi);
-       dim  = cell(0).dimension(*mi.base.bv);
-       dim += cell(1).dimension(*mi.base.bv);
-       dim += cell(2).dimension(*mi.base.bv);
-       metricsMarkers(dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathFrameBox::draw(PainterInfo & pi, int x, int y) const
-{
-       FontSetChanger dummy(pi.base, "textnormal");
-       Dimension const dim = dimension(*pi.base.bv);
-       pi.pain.rectangle(x + 1, y - dim.ascent() + 1,
-               dim.width() - 2, dim.height() - 2, Color_foreground);
-       x += 5;
-       BufferView const & bv = *pi.base.bv;
-
-       drawStrBlack(pi, x, y, from_ascii("["));
-       x += w_;
-       cell(0).draw(pi, x, y);
-       x += cell(0).dimension(bv).wid;
-       drawStrBlack(pi, x, y, from_ascii("]"));
-       x += w_ + 4;
-
-       drawStrBlack(pi, x, y, from_ascii("["));
-       x += w_;
-       cell(1).draw(pi, x, y);
-       x += cell(1).dimension(bv).wid;
-       drawStrBlack(pi, x, y, from_ascii("]"));
-       x += w_ + 4;
-
-       cell(2).draw(pi, x, y);
-       drawMarkers(pi, x, y);
-}
-
-
-void InsetMathFrameBox::write(WriteStream & os) const
-{
-       os << "\\framebox";
-       os << '[' << cell(0) << ']';
-       if (cell(1).size())
-               os << '[' << cell(1) << ']';
-       os << '{' << cell(2) << '}';
-}
-
-
-void InsetMathFrameBox::normalize(NormalStream & os) const
-{
-       os << "[framebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathFrameBox.h b/src/mathed/InsetMathFrameBox.h
deleted file mode 100644 (file)
index e670117..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathFrameBox.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_FRAMEBOXINSET_H
-#define MATH_FRAMEBOXINSET_H
-
-#include "InsetMathNest.h"
-
-
-namespace lyx {
-
-
-/// Extra nesting
-class InsetMathFrameBox : public InsetMathNest {
-public:
-       ///
-       InsetMathFrameBox();
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       void write(WriteStream & os) const;
-       /// write normalized content
-       void normalize(NormalStream & ns) const;
-       ///
-       mode_type currentMode() const { return TEXT_MODE; }
-private:
-       virtual Inset * clone() const;
-       /// width of '[' in current font
-       mutable int w_;
-};
-
-
-
-} // namespace lyx
-#endif
diff --git a/src/mathed/InsetMathMakebox.cpp b/src/mathed/InsetMathMakebox.cpp
deleted file mode 100644 (file)
index c8ba219..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * \file InsetMathMakebox.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Ling Li
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "InsetMathMakebox.h"
-#include "MathData.h"
-#include "MathStream.h"
-#include "MathSupport.h"
-
-#include "support/std_ostream.h"
-
-
-namespace lyx {
-
-InsetMathMakebox::InsetMathMakebox()
-       : InsetMathNest(3)
-{}
-
-
-Inset * InsetMathMakebox::clone() const
-{
-       return new InsetMathMakebox(*this);
-}
-
-
-void InsetMathMakebox::metrics(MetricsInfo & mi, Dimension & dim) const
-{
-       FontSetChanger dummy(mi.base, from_ascii("textnormal"));
-       w_ = mathed_char_width(mi.base.font, '[');
-       InsetMathNest::metrics(mi);
-       dim   = cell(0).dimension(*mi.base.bv);
-       dim  += cell(1).dimension(*mi.base.bv);
-       dim  += cell(2).dimension(*mi.base.bv);
-       dim.wid += 4 * w_ + 4;
-       metricsMarkers(dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
-}
-
-
-void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const
-{
-       FontSetChanger dummy(pi.base, from_ascii("textnormal"));
-       drawMarkers(pi, x, y);
-
-       drawStrBlack(pi, x, y, from_ascii("["));
-       x += w_;
-       cell(0).draw(pi, x, y);
-       x += cell(0).dimension(*pi.base.bv).width();
-       drawStrBlack(pi, x, y, from_ascii("]"));
-       x += w_ + 2;
-
-       drawStrBlack(pi, x, y, from_ascii("["));
-       x += w_;
-       cell(1).draw(pi, x, y);
-       x += cell(1).dimension(*pi.base.bv).wid;
-       drawStrBlack(pi, x, y, from_ascii("]"));
-       x += w_ + 2;
-
-       cell(2).draw(pi, x, y);
-       setPosCache(pi, x, y);
-}
-
-
-void InsetMathMakebox::write(WriteStream & os) const
-{
-       os << "\\makebox";
-       os << '[' << cell(0) << ']';
-       if (cell(1).size())
-               os << '[' << cell(1) << ']';
-       os << '{' << cell(2) << '}';
-}
-
-
-void InsetMathMakebox::normalize(NormalStream & os) const
-{
-       os << "[makebox " << cell(0) << ' ' << cell(1) << ' ' << cell(2) << ']';
-}
-
-
-void InsetMathMakebox::infoize(odocstream & os) const
-{
-       os << "Makebox (width: " << cell(0)
-           << " pos: " << cell(1) << ")";
-}
-
-
-} // namespace lyx
diff --git a/src/mathed/InsetMathMakebox.h b/src/mathed/InsetMathMakebox.h
deleted file mode 100644 (file)
index 56480ee..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// -*- C++ -*-
-/**
- * \file InsetMathMakebox.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Ling Li
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MATH_MAKEBOXINSET_H
-#define MATH_MAKEBOXINSET_H
-
-#include "InsetMathNest.h"
-
-
-namespace lyx {
-
-/// Extra nesting: \\makebox.
-// consolidate with InsetMathFrameBox?
-
-class InsetMathMakebox : public InsetMathNest {
-public:
-       ///
-       InsetMathMakebox();
-       ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       void write(WriteStream & os) const;
-       /// write normalized content
-       void normalize(NormalStream & ns) const;
-       ///
-       mode_type currentMode() const { return TEXT_MODE; }
-       ///
-       void infoize(odocstream & os) const;
-private:
-       virtual Inset * clone() const;
-       /// width of '[' in current font
-       mutable int w_;
-};
-
-
-
-} // namespace lyx
-#endif