X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.h;h=588e9d0665133e4d0ccd1143915686e6099b1963;hb=2b927cbc2ee79f1d1f8a125f4d1a88162a1e5dfa;hp=aca6f852b22ab6b275a24dab5f0632159b5f8ba1;hpb=67805de7de949dbe8fd1468f4d17fc44f4171721;p=lyx.git diff --git a/src/BufferView.h b/src/BufferView.h index aca6f852b2..588e9d0665 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; -class 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; @@ -164,10 +173,8 @@ public: /// set the cursor based on the given TeX source row. bool setCursorFromRow(int row); - /// - bool setCursorFromRow(int row, TexRow const & texrow); /// 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 *); @@ -250,7 +257,7 @@ public: /// access to full cursor. Cursor const & cursor() const; /// sets cursor. - /// This will also open all relevant collapsable insets. + /// This will also open all relevant collapsible insets. void setCursor(DocIterator const &); /// set the selection up to dit. void setCursorSelectionTo(DocIterator const & dit);