#include "gettext.h"
#include "debug.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "support/textutils.h"
#include <config.h>
-#include "LaTeXFeatures.h"
#include "InsetMathAMSArray.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
-#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
#include <config.h>
-#include "LaTeXFeatures.h"
#include "InsetMathArray.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathParser.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
#include "support/lstrings.h"
#include <config.h>
#include "InsetMathBig.h"
+
#include "MathSupport.h"
#include "MathStream.h"
-#include "MathStream.h"
+#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
#include <config.h>
#include "InsetMathBox.h"
+
#include "MathData.h"
#include "MathStream.h"
-#include "MathStream.h"
-#include "support/std_ostream.h"
+#include "MetricsInfo.h"
+
+#include <ostream>
namespace lyx {
#include <config.h>
#include "InsetMathBoxed.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
-#include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
-#include "support/std_ostream.h"
#include "frontends/Painter.h"
+#include <ostream>
+
namespace lyx {
#include <config.h>
#include "InsetMathBrace.h"
+
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
-#include "support/std_ostream.h"
+#include <ostream>
+
namespace lyx {
#include <config.h>
#include "InsetMathCases.h"
-#include "MathData.h"
-#include "MathStream.h"
-#include "MathSupport.h"
-#include "FuncStatus.h"
-#include "LaTeXFeatures.h"
-#include "support/std_ostream.h"
+
#include "Cursor.h"
#include "FuncRequest.h"
+#include "FuncStatus.h"
#include "gettext.h"
+#include "LaTeXFeatures.h"
+#include "MathData.h"
+#include "MathStream.h"
+#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "support/lstrings.h"
+#include <ostream>
+
namespace lyx {
#include <config.h>
#include "InsetMathChar.h"
+
#include "MathSupport.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
#include "debug.h"
#include "Dimension.h"
extern bool has_math_fonts;
-namespace {
-
- bool isBinaryOp(char_type c)
- {
- return support::contains("+-<>=/*", static_cast<char>(c));
- }
+static bool isBinaryOp(char_type c)
+{
+ return support::contains("+-<>=/*", static_cast<char>(c));
+}
- bool slanted(char_type c)
- {
- return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
- }
+static bool slanted(char_type c)
+{
+ return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}
#include <config.h>
#include "Color.h"
+
#include "InsetMathColor.h"
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
-#include "LaTeXFeatures.h"
+#include "MetricsInfo.h"
-#include "support/std_ostream.h"
+#include <ostream>
namespace lyx {
#include <config.h>
#include "InsetMathDecoration.h"
+
#include "MathData.h"
#include "MathParser.h"
#include "MathSupport.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
#include "LaTeXFeatures.h"
#include "debug.h"
-#include "support/std_ostream.h"
+#include <ostream>
namespace lyx {
#include <config.h>
#include "InsetMathDelim.h"
+
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
#include <config.h>
#include "InsetMathDots.h"
+
#include "MathStream.h"
#include "MathSupport.h"
#include "MathParser.h"
+#include "MetricsInfo.h"
#include "frontends/FontMetrics.h"
#include <config.h>
#include "InsetMathExFunc.h"
+
#include "MathData.h"
#include "MathStream.h"
-#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
+
+#include "support/docstream.h"
namespace lyx {
void InsetMathExFunc::mathmlize(MathStream & os) const
{
- os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
+ ++os.tab(); os.cr(); os.os() << '<' << name_ << '>';
+ os << cell(0);
+ os.cr(); --os.tab(); os.os() << "</" << name_ << '>';
}
#include <config.h>
#include "InsetMathFBox.h"
+
#include "MathData.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
-#include "support/std_ostream.h"
#include "frontends/Painter.h"
+#include <ostream>
+
namespace lyx {
#include <config.h>
#include "InsetMathFont.h"
+
+#include "LaTeXFeatures.h"
#include "MathData.h"
#include "MathStream.h"
#include "MathParser.h"
-#include "LaTeXFeatures.h"
-#include "support/std_ostream.h"
+#include "MetricsInfo.h"
+
+#include <ostream>
namespace lyx {
#include <config.h>
#include "InsetMathFontOld.h"
+
#include "MathData.h"
#include "MathStream.h"
#include "MathParser.h"
-#include "MathStream.h"
-#include "support/std_ostream.h"
+#include "MetricsInfo.h"
+
+#include <ostream>
namespace lyx {
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "TextPainter.h"
#include "frontends/Painter.h"
#include <config.h>
#include "InsetMathFrameBox.h"
+
#include "MathData.h"
#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
+
#include "frontends/Painter.h"
#include <config.h>
#include "InsetMathGrid.h"
+
#include "MathData.h"
#include "MathParser.h"
#include "MathStream.h"
+#include "MetricsInfo.h"
#include "BufferView.h"
#include "CutAndPaste.h"
#include "frontends/Painter.h"
#include "support/lstrings.h"
+#include "support/docstream.h"
#include <sstream>
docstring bname = name;
if (!label(0).empty())
bname += " id='" + sgml::cleanID(buf, runparams, label(0)) + "'";
- ms << MTag(bname);
+
+ ++ms.tab(); ms.cr(); ms.os() << '<' << bname << '>';
odocstringstream ls;
if (runparams.flavor == OutputParams::XML) {
- ms << MTag(from_ascii("alt role='tex' "));
+ ms << MTag("alt role='tex' ");
// Workaround for db2latex: db2latex always includes equations with
// \ensuremath{} or \begin{display}\end{display}
// so we strip LyX' math environment
WriteStream wi(ls, false, false);
InsetMathGrid::write(wi);
ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<"));
- ms << ETag(from_ascii("alt"));
- ms << MTag(from_ascii("math"));
- ms << ETag(from_ascii("alt"));
- ms << MTag(from_ascii("math"));
+ ms << ETag("alt");
+ ms << MTag("math");
+ ms << ETag("alt");
+ ms << MTag("math");
InsetMathGrid::mathmlize(ms);
- ms << ETag(from_ascii("math"));
+ ms << ETag("math");
} else {
- ms << MTag(from_ascii("alt role='tex'"));
+ ms << MTag("alt role='tex'");
res = latex(buf, ls, runparams);
ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<"));
- ms << ETag(from_ascii("alt"));
+ ms << ETag("alt");
}
ms << from_ascii("<graphic fileref=\"eqn/");
else
ms << from_ascii("\">");
- ms << ETag(name);
+ ms.cr(); --ms.tab(); ms.os() << "</" << name << '>';
+
return ms.line() + res;
}
#include "support/lstrings.h"
#include "support/textutils.h"
+#include "support/docstream.h"
#include "frontends/Clipboard.h"
#include "frontends/Painter.h"
#include <config.h>
#include "MathData.h"
+
#include "InsetMathBrace.h"
#include "InsetMathFont.h"
#include "InsetMathScript.h"
#include "MathMacro.h"
#include "MathStream.h"
#include "MathSupport.h"
+#include "MetricsInfo.h"
#include "ReplaceData.h"
#include "Buffer.h"
#include "Cursor.h"
#include "debug.h"
+#include "support/docstream.h"
+
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
#include <config.h>
#include "MathExtern.h"
+
+#include "debug.h"
#include "InsetMathArray.h"
#include "InsetMathChar.h"
#include "InsetMathDelim.h"
-#include "MathData.h"
#include "InsetMathDiff.h"
#include "InsetMathExFunc.h"
#include "InsetMathExInt.h"
#include "InsetMathFrac.h"
#include "InsetMathLim.h"
#include "InsetMathMatrix.h"
-#include "MathStream.h"
#include "InsetMathNumber.h"
#include "InsetMathScript.h"
#include "InsetMathString.h"
#include "InsetMathSymbol.h"
+#include "MathData.h"
#include "MathParser.h"
-#include "debug.h"
+#include "MathStream.h"
+
+#include "support/docstream.h"
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
/**
- * \file math_macrotemplate.C
+ * \file MathMacroTemplate.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
#include <config.h>
+#include "MathMacroTemplate.h"
+
#include "DocIterator.h"
#include "InsetMathBrace.h"
#include "InsetMathChar.h"
#include "InsetMathSqrt.h"
#include "MathMacro.h"
#include "MathMacroArgument.h"
-#include "MathMacroTemplate.h"
#include "MathStream.h"
#include "MathParser.h"
#include "MathSupport.h"
#include "frontends/Painter.h"
#include "support/convert.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "debug.h"
-#include <boost/assert.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-
#include <sstream>
}
-MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs, int optionals,
- docstring const & type,
- std::vector<MathData> const & optionalValues,
- MathData const & def, MathData const & display)
+MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
+ int optionals, docstring const & type,
+ std::vector<MathData> const & optionalValues,
+ MathData const & def, MathData const & display)
: InsetMathNest(optionals + 3), numargs_(numargs),
optionals_(optionals), optionalValues_(optionalValues), type_(type)
{
}
-bool MathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd,
+bool MathMacroTemplate::getStatus(Cursor & /*cur*/, FuncRequest const & cmd,
FuncStatus & flag) const
{
bool ret = true;
#include <config.h>
+#include "MathStream.h"
+
#include "InsetMath.h"
#include "MathData.h"
#include "MathExtern.h"
-#include "MathStream.h"
#include "support/textutils.h"
#include <algorithm>
+#include <ostream>
+
namespace lyx {
{
++ms.tab();
ms.cr();
- ms.os() << '<' << t.tag_ << '>';
+ ms.os() << '<' << from_ascii(t.tag_) << '>';
return ms;
}
ms.cr();
if (ms.tab() > 0)
--ms.tab();
- ms.os() << "</" << t.tag_ << '>';
+ ms.os() << "</" << from_ascii(t.tag_) << '>';
return ms;
}
#ifndef MATH_MATHMLSTREAM_H
#define MATH_MATHMLSTREAM_H
+#include "support/strfwd.h"
-// Please keep all four streams in one file until the interface has
-// settled.
-
-
+// FIXME: Move to individual insets
#include "MetricsInfo.h"
-#include "support/docstream.h"
-#include "support/docstring.h"
namespace lyx {
class MTag {
public:
///
- MTag(docstring const tag) : tag_(tag) {}
+ MTag(char const * const tag) : tag_(tag) {}
///
- MTag(char const * const tag) : tag_(from_ascii(tag)) {}
- ///
- docstring const tag_;
+ char const * const tag_;
};
class ETag {
public:
///
- ETag(docstring const tag) : tag_(tag) {}
- ///
- ETag(char const * const tag) : tag_(from_ascii(tag)) {}
+ ETag(char const * const tag) : tag_(tag) {}
///
- docstring const tag_;
+ char const * const tag_;
};
class MathStream {
#include <config.h>
+#include "MathSupport.h"
+
#include "InsetMath.h"
#include "MathData.h"
#include "MathParser.h"
#include "MathStream.h"
-#include "MathSupport.h"
#include "debug.h"
+#include "support/docstream.h"
+
#include "frontends/FontLoader.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
using std::max;
using std::endl;
-using std::vector;
///