]> git.lyx.org Git - lyx.git/blobdiff - src/metricsinfo.h
Enable LyX to start up under Cygwin.
[lyx.git] / src / metricsinfo.h
index 951d5f6680bf582520ad965fee43af51851958e2..cd622ced2df9e86a4773b8b913424cf3e597f6fe 100644 (file)
@@ -13,7 +13,9 @@
 #define METRICSINFO_H
 
 #include "lyxfont.h"
-#include "support/std_string.h"
+#include "support/types.h"
+
+#include <string>
 
 class Painter;
 class BufferView;
@@ -48,14 +50,14 @@ struct MetricsBase {
        /// current math style (display/text/script/..)
        Styles style;
        /// name of current font - mathed specific
-       string fontname;
+       std::string fontname;
        /// This is the width available in pixels
        int textwidth;
 };
 
 
 //
-// This contains a Metricsbase and Information that's only relevant during
+// This contains a MetricsBase and information that's only relevant during
 // the first phase of the two-phase draw
 //
 struct MetricsInfo {
@@ -70,12 +72,12 @@ struct MetricsInfo {
 
 
 //
-// This contains a Metricsbase and Information that's only relevant during
+// This contains a MetricsBase and information that's only relevant during
 // the second phase of the two-phase draw
 //
 struct PainterInfo {
        ///
-       explicit PainterInfo(BufferView * bv);
+       PainterInfo(BufferView * bv, Painter & pain);
        ///
        void draw(int x, int y, char c);
 
@@ -83,14 +85,24 @@ struct PainterInfo {
        MetricsBase base;
        ///
        Painter & pain;
-       /// width of current item
-       int width;
+       /// Whether the text at this point is right-to-left (for InsetNewline)
+       bool ltr_pos;
 };
 
-
 struct TextMetricsInfo {};
 
 
+struct ViewMetricsInfo
+{
+       ViewMetricsInfo(lyx::pit_type p1, lyx::pit_type p2,
+                       int y1, int y2) : p1(p1), p2(p2), y1(y1), y2(y2) {}
+       lyx::pit_type p1;
+       lyx::pit_type p2;
+       int y1;
+       int y2;
+};
+
+
 // Generic base for temporarily changing things.
 // The original state gets restored when the Changer is destructed.
 
@@ -175,4 +187,12 @@ struct WidthChanger : public Changer<MetricsBase>
 };
 
 
+// temporarily change the used color
+struct ColorChanger : public Changer<LyXFont, std::string> {
+       ///
+       ColorChanger(LyXFont & font, std::string const & color);
+       ///
+       ~ColorChanger();
+};
+
 #endif