* Created: January 1999
* Description: Root math object
*
- * Copyright: (c) 1999 Alejandro Aguilar Sierra
+ * Copyright: 1999 Alejandro Aguilar Sierra
*
* You are free to use and modify this code under the terms of
* the GNU General Public Licence version 2 or later.
#include "math_iter.h"
#include "math_root.h"
-MathRootInset::MathRootInset(short st): MathSqrtInset(st)
+using std::ostream;
+
+MathRootInset::MathRootInset(short st)
+ : MathSqrtInset(st)
{
idx = 1;
uroot = new MathParInset(LM_ST_TEXT);
}
-#ifdef USE_PAINTER
void MathRootInset::draw(Painter & pain, int x, int y)
{
int idxp = idx;
MathSqrtInset::draw(pain, x + wroot, y);
idx = idxp;
}
-#else
-void MathRootInset::Draw(int x, int y)
-{
- int idxp = idx;
-
- idx = 1;
- uroot->Draw(x, y - dh);
- MathSqrtInset::Draw(x+wroot, y);
- XFlush(fl_display);
- idx = idxp;
-}
-#endif
void MathRootInset::SetStyle(short st)
}
-void MathRootInset::Write(ostream & os)
-{
- string output;
- MathRootInset::Write(output);
- os << output;
-}
-
-
-void MathRootInset::Write(string &outf)
-{
- outf += '\\';
- outf += name;
- outf += '[';
- uroot->Write(outf);
- outf += "]{";
- MathParInset::Write(outf);
- outf += '}';
+void MathRootInset::Write(ostream & os, bool fragile)
+{
+ os << '\\' << name << '[';
+ uroot->Write(os, fragile);
+ os << "]{";
+ MathParInset::Write(os, fragile);
+ os << '}';
}