]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.h
Amend 6c3447c8: FindAdv: sometimes a space is added on some math symbols
[lyx.git] / src / Cursor.h
index 4ef5bc9d6cbde7b7500398c4f092a134766417f0..094a540f24e1dbb6c18609817b7db9a36b9c147f 100644 (file)
@@ -137,6 +137,7 @@ public:
        int countInsetsInSelection(InsetCode const & inset) const;
 
        /// access to normalized selection anchor
+       // FIXME: this should return a full DocIterator
        CursorSlice normalAnchor() const;
        /// access to real selection anchor
        DocIterator const & realAnchor() const { return anchor_; }
@@ -380,6 +381,12 @@ public:
        void setTargetX();
        /// clear targetX, i.e. set it to -1
        void clearTargetX();
+       /// return x position of latest mouse press or -1 if unset
+       int xClickPos() const { return x_clickpos_; }
+       /// return y position of latest mouse press or -1 if unset
+       int yClickPos() const { return y_clickpos_; }
+       /// register mouse press coordinates
+       void setClickPos(int x, int y);
        /// set offset to actual position - targetX
        void updateTextTargetOffset();
        /// distance between actual and targeted position during last up/down in text
@@ -469,6 +476,9 @@ private:
        int x_target_;
        /// if a x_target cannot be hit exactly in a text, put the difference here
        int textTargetOffset_;
+       /// Exact position of mouse click
+       int x_clickpos_;
+       int y_clickpos_;
        /// position before dispatch started
        DocIterator beforeDispatchCursor_;
        /// cursor screen coordinates before dispatch started
@@ -496,10 +506,8 @@ public:
        /// return true if fullscreen update is needed
        bool down();
        /// move up/down in a text inset, called for LFUN_UP/DOWN,
-       /// return true if the cursor has moved or can move, updateNeeded
-       /// set to true if fullscreen update is needed, otherwise it's not
-       /// touched
-       bool upDownInText(bool up, bool & updateNeeded);
+       /// return true if fullscreen update is needed
+       bool upDownInText(bool up);
        /// move up/down in math or any non text inset, call for LFUN_UP/DOWN
        /// return true if successful
        bool upDownInMath(bool up);