]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.h
Avoid markers for macros without arguments
[lyx.git] / src / mathed / MathStream.h
index fe5c259a93786482c7f2c1f13e4868b276976233..271330ea0de201da5543cf332e457dd31ebe8708 100644 (file)
@@ -13,6 +13,8 @@
 #define MATH_MATHMLSTREAM_H
 
 #include "InsetMath.h"
+
+#include "TexRow.h"
 #include "texstream.h"
 
 #include "support/Changer.h"
@@ -26,7 +28,6 @@ class Encoding;
 class InsetMath;
 class MathAtom;
 class MathData;
-struct RowEntry;
 
 //
 // LaTeX/LyX
@@ -41,6 +42,12 @@ public:
                wsPreview
        };
        ///
+       enum UlemCmdType {
+               NONE,
+               UNDERLINE,
+               STRIKEOUT
+       };
+       ///
        explicit WriteStream(otexrowstream & os, bool fragile = false,
                             bool latex = false, OutputType output = wsDefault,
                             Encoding const * encoding = 0);
@@ -66,6 +73,18 @@ public:
        void canBreakLine(bool breakline) { canbreakline_ = breakline; }
        /// tell whether we can write an immediately following newline char
        bool canBreakLine() const { return canbreakline_; }
+       /// record whether we have to take care for striking out display math
+       void strikeoutMath(bool mathsout) { mathsout_ = mathsout; }
+       /// tell whether we have to take care for striking out display math
+       bool strikeoutMath() const { return mathsout_; }
+       /// record which ulem command type we are inside
+       void ulemCmd(UlemCmdType ulemcmd) { ulemcmd_ = ulemcmd; }
+       /// tell which ulem command type we are inside
+       UlemCmdType ulemCmd() const { return ulemcmd_; }
+       /// record whether we are in the argument of a math macro
+       void insideMacro(bool insidemacro) { insidemacro_ = insidemacro; }
+       /// tell whether we are in the argument of a math macro
+       bool insideMacro() const { return insidemacro_; }
        /// writes space if next thing is isalpha()
        void pendingSpace(bool how);
        /// writes space if next thing is isalpha()
@@ -90,7 +109,7 @@ public:
        Encoding const * encoding() const { return encoding_; }
 
        /// Temporarily change the TexRow information about the outer row entry.
-       Changer changeRowEntry(RowEntry entry);
+       Changer changeRowEntry(TexRow::RowEntry entry);
        /// TexRow::starts the innermost outer math inset
        /// returns true if the outer row entry will appear at this line
        bool startOuterRow();
@@ -105,6 +124,8 @@ private:
        int latex_;
        /// output type (default, source preview, instant preview)?
        OutputType output_;
+       /// are we in the argument of a math macro?
+       bool insidemacro_;
        /// do we have a space pending?
        bool pendingspace_;
        /// do we have a brace pending?
@@ -117,13 +138,16 @@ private:
        bool ascii_;
        /// are we allowed to output an immediately following newline?
        bool canbreakline_;
+       /// should we take care for striking out display math?
+       bool mathsout_;
+       /// what ulem command are we inside (none, underline, strikeout)?
+       UlemCmdType ulemcmd_;
        ///
        int line_;
        ///
        Encoding const * encoding_;
        /// Row entry we are in
-       /// (it is a pointer to allow forward-declaration)
-       unique_ptr<RowEntry> row_entry_;
+       TexRow::RowEntry row_entry_;
 };
 
 ///