X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.h;h=6aa2f067778cb41fe3d094a2fcd1c8cf520949e0;hb=429f4669b03cae0fd41e2abc6b0144d1c61bfe69;hp=a144aee136971a57368ce78feeeb6ff3998def24;hpb=8fb1aa51f8d14747bd21d9e113a8dd301a2f07dc;p=lyx.git diff --git a/src/BufferView.h b/src/BufferView.h index a144aee136..6aa2f06777 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -32,6 +32,7 @@ class Buffer; class Change; class CoordCache; class Cursor; +class CursorSlice; class DispatchResult; class DocIterator; class DocumentClass; @@ -39,6 +40,7 @@ class FuncRequest; class FuncStatus; class Intl; class Inset; +class PainterInfo; class ParIterator; class ParagraphMetrics; class Point; @@ -118,6 +120,17 @@ public: /// move the screen to fit the cursor. /// Only to be called with good y coordinates (after a bv::metrics) bool fitCursor(); + + // Returns the amount of horizontal scrolling applied to the + // top-level row where the cursor lies + int horizScrollOffset() const; + + // Points to the top-level row where the cursor lies (during draw). + CursorSlice const & currentRowSlice() const; + + // Points to the top-level row where the cursor lied at last draw event. + CursorSlice const & lastRowSlice() const; + /// reset the scrollbar to reflect current view position. void updateScrollbar(); /// return the Scrollbar Parameters. @@ -331,6 +344,13 @@ private: /// \return true if no further update is needed. bool singleParUpdate(); + // Set the row on which the cursor lives. + void setCurrentRowSlice(CursorSlice const & rowSlice); + + // Check whether the row where the cursor lives needs to be scrolled. + // Update the drawing strategy if needed. + void checkCursorScrollOffset(PainterInfo & pi); + /// The minimal size of the document that is visible. Used /// when it is allowed to scroll below the document. int minVisiblePart();