X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.h;h=92e898735065ac2f8146fbb7b14fd8a3f43fac80;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=016423f87bfcf53faca39ee1c10925aa0f1a6a95;hpb=2e45bade7abea57625319068f559a6b57150ffb5;p=lyx.git diff --git a/src/BufferView.h b/src/BufferView.h index 016423f87b..92e8987350 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -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 *);