]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.h
test-insets-basic.tex: remove (in my opinion) wrong parser test
[lyx.git] / src / BufferView.h
index a58d25172711e33e2101e6422eaf513222a70fdb..6aa2f067778cb41fe3d094a2fcd1c8cf520949e0 100644 (file)
@@ -18,7 +18,6 @@
 #include "DocumentClassPtr.h"
 #include "update_flags.h"
 
-#include "support/shared_ptr.h"
 #include "support/strfwd.h"
 #include "support/types.h"
 
@@ -33,6 +32,7 @@ class Buffer;
 class Change;
 class CoordCache;
 class Cursor;
+class CursorSlice;
 class DispatchResult;
 class DocIterator;
 class DocumentClass;
@@ -40,6 +40,7 @@ class FuncRequest;
 class FuncStatus;
 class Intl;
 class Inset;
+class PainterInfo;
 class ParIterator;
 class ParagraphMetrics;
 class Point;
@@ -119,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.
@@ -156,7 +168,7 @@ public:
        /// Ensure that the BufferView cursor is visible.
        /// This method will automatically scroll and update the BufferView
        /// if needed.
-       void showCursor(); 
+       void showCursor();
        /// Ensure the passed cursor \p dit is visible.
        /// This method will automatically scroll and update the BufferView
        /// if needed.
@@ -332,11 +344,18 @@ 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();
 
-       /// Search recursively for the the innermost inset that covers (x, y) position.
+       /// Search recursively for the innermost inset that covers (x, y) position.
        /// \retval 0 if no inset is found.
        Inset const * getCoveringInset(
                Text const & text, //< The Text where we start searching.