X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.h;h=aa31f91c96b5592d951b8e649463213dc8ebd91f;hb=d3c63f97c4fce4e091277ced6c1829473c311231;hp=25771d37837c1a2c330e593015d7bd7bd7d11098;hpb=e24f782eebe4e2bc218aa5500a92961f8de36f52;p=lyx.git diff --git a/src/Cursor.h b/src/Cursor.h index 25771d3783..aa31f91c96 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -95,19 +95,12 @@ public: protected: /// the anchor position DocIterator anchor_; - /// - mutable DispatchResult disp_; /// do we have a selection? bool selection_; /// are we on the way to get one? bool mark_; /// are we in word-selection mode? This is set when double clicking. bool word_selection_; - /// If true, we are behind the previous char, otherwise we are in front - // of the next char. This only make a difference when we are in front - // of a big inset spanning a whole row and computing coordinates for - // displaying the cursor. - bool logicalpos_; // FIXME: make them protected. public: @@ -168,8 +161,8 @@ public: // /// selection active? bool selection() const { return selection_; } - /// set selection; - void setSelection(bool sel) { selection_ = sel; } + /// set selection; this is lower level than (set|clear)Selection + void selection(bool sel) { selection_ = sel; } /// do we have a multicell selection? bool selIsMultiCell() const { return selection_ && selBegin().idx() != selEnd().idx(); } @@ -218,6 +211,9 @@ public: bool macromode() const { return macromode_; } /// are we entering a macro name? bool & macromode() { return macromode_; } + + /// returns true when all insets in cursor stack are in cache + bool inCoordCache() const; /// returns x,y position void getPos(int & x, int & y) const; /// return logical positions between which the cursor is situated @@ -296,10 +292,9 @@ public: /// access to normalized selection anchor CursorSlice normalAnchor() const; - // FIXME: this can't be a const & and a const function because - // LFUN_TAB_* wants to move the real anchor. /// access to real selection anchor - DocIterator & realAnchor(); + DocIterator const & realAnchor() const { return anchor_; } + DocIterator & realAnchor() { return anchor_; } /// sets anchor to cursor position void resetAnchor(); /// access to owning BufferView