]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_metricsinfo.h
split inset -> inset + updatableinset
[lyx.git] / src / mathed / math_metricsinfo.h
index d607cc43393f43c9660380ed9c6ca2d0da6edc39..e9bbd9d7dd516ca0811a909ae2b920dd308daa7c 100644 (file)
@@ -1,12 +1,11 @@
 #ifndef MATH_METRICSINFO_H
 #define MATH_METRICSINFO_H
 
+
 #include "lyxfont.h"
-#include "math_defs.h"
+#include "LString.h"
 
-class BufferView;
 class Painter;
-class MathNestInset;
 
 
 /// Standard Math Sizes (Math mode styles)
@@ -31,7 +30,11 @@ struct MathMetricsBase {
        ///
        MathStyles style;
        ///
-       bool fontinset;
+       string fontname;
+       /// if this is set...
+       bool restrictwidth;
+       /// ... this is valid
+       int textwidth;
 };
 
 
@@ -42,19 +45,13 @@ struct MathMetricsInfo {
        ///
        MathMetricsBase base;
        ///
-       BufferView * view;
-       /// used to pass some info down
-       MathNestInset const * inset;
-       ///
-       int idx;
-       ///
        bool fullredraw;
 };
 
 
 struct MathPainterInfo {
        ///
-       MathPainterInfo(Painter & p);
+       MathPainterInfo(Painter & pain);
        ///
        void draw(int x, int y, char c);
 
@@ -69,7 +66,8 @@ struct TextMetricsInfo {};
 
 
 // Generic base for temporarily changing things.
-// The original state gets restored when the Changer is destructed
+// The original state gets restored when the Changer is destructed.
+
 template <class Struct, class Temp = Struct>
 struct MathChanger {
        ///
@@ -83,23 +81,6 @@ protected:
 
 
 
-struct MathScriptChanger : public MathChanger<MathMetricsBase> {
-       ///
-       MathScriptChanger(MathMetricsBase & orig);
-       ///
-       ~MathScriptChanger();
-};
-
-
-struct MathFracChanger : public MathChanger<MathMetricsBase> {
-       ///
-       MathFracChanger(MathMetricsBase & orig);
-       ///
-       ~MathFracChanger();
-};
-
-
-
 struct MathFontChanger : public MathChanger<LyXFont> {
        ///
        MathFontChanger(LyXFont & orig, char const * font);
@@ -124,6 +105,25 @@ struct MathStyleChanger : public MathChanger<MathMetricsBase> {
 };
 
 
+struct MathScriptChanger : public MathStyleChanger {
+       ///
+       MathScriptChanger(MathMetricsBase & mb);
+};
+
+
+struct MathFracChanger : public MathStyleChanger {
+       ///
+       MathFracChanger(MathMetricsBase & mb);
+};
+
+
+struct MathArrayChanger : public MathStyleChanger {
+       ///
+       MathArrayChanger(MathMetricsBase & mb);
+};
+
+
+
 struct MathShapeChanger : public MathChanger<LyXFont, LyXFont::FONT_SHAPE> {
        ///
        MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);
@@ -132,4 +132,13 @@ struct MathShapeChanger : public MathChanger<LyXFont, LyXFont::FONT_SHAPE> {
 };
 
 
+struct MathWidthChanger : public MathChanger<MathMetricsBase>
+{
+       ///
+       MathWidthChanger(MathMetricsBase & mb, int width);
+       ///
+       ~MathWidthChanger();
+};
+
+
 #endif