]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.h
Account for old versions of Pygments
[lyx.git] / src / BufferView.h
index 016423f87bfcf53faca39ee1c10925aa0f1a6a95..92e898735065ac2f8146fbb7b14fd8a3f43fac80 100644 (file)
@@ -16,6 +16,7 @@
 #define BUFFER_VIEW_H
 
 #include "DocumentClassPtr.h"
+#include "TexRow.h"
 #include "update_flags.h"
 
 #include "support/strfwd.h"
@@ -40,13 +41,13 @@ class FuncRequest;
 class FuncStatus;
 class Intl;
 class Inset;
+class Length;
 class PainterInfo;
 class ParIterator;
 class ParagraphMetrics;
 class Point;
 class TexRow;
 class Text;
-struct TextEntry;
 class TextMetrics;
 
 enum CursorStatus {
@@ -105,6 +106,14 @@ public:
        /// left margin
        int leftMargin() const;
 
+       /// return the on-screen size of this length
+       /*
+        *  This is a wrapper around Length::inPixels that uses the
+        *  bufferview width as width and the EM value of the default
+        *  document font.
+        */
+       int inPixels(Length const & len) const;
+
        /// \return true if the BufferView is at the top of the document.
        bool isTopScreen() const;
 
@@ -165,7 +174,7 @@ public:
        /// set the cursor based on the given TeX source row.
        bool setCursorFromRow(int row);
        /// set the cursor based on the given start and end TextEntries.
-       bool setCursorFromEntries(TextEntry start, TextEntry end);
+       bool setCursorFromEntries(TexRow::TextEntry start, TexRow::TextEntry end);
 
        /// set cursor to the given inset. Return true if found.
        bool setCursorFromInset(Inset const *);