]> git.lyx.org Git - features.git/commitdiff
Rename more instances of "cursor" to "caret"
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 24 Aug 2017 15:37:56 +0000 (17:37 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Sep 2017 14:57:22 +0000 (16:57 +0200)
Thanks to Pavel for the hint.

src/BufferView.cpp
src/BufferView.h
src/frontends/qt4/GuiWorkArea.cpp
src/frontends/qt4/GuiWorkArea.h
src/frontends/qt4/GuiWorkArea_Private.h

index 9e8faf93a616e3bb6a2c7237fe5703be2bd18683..1673de181799a5dcfc87ab67666709a553219cae 100644 (file)
@@ -2905,7 +2905,7 @@ bool BufferView::paragraphVisible(DocIterator const & dit) const
 }
 
 
-void BufferView::cursorPosAndHeight(Point & p, int & h) const
+void BufferView::caretPosAndHeight(Point & p, int & h) const
 {
        Cursor const & cur = cursor();
        Font const font = cur.real_current_font;
index 4b9f6be788bdd342ddd6f9ebb580bad132a58e3c..7de6985d44001d7e3c94d902671c975188398cbe 100644 (file)
@@ -307,8 +307,8 @@ public:
        bool paragraphVisible(DocIterator const & dit) const;
        /// is the cursor currently visible in the view
        bool cursorInView(Point const & p, int h) const;
-       /// get the position and height of the cursor
-       void cursorPosAndHeight(Point & p, int & h) const;
+       /// get the position and height of the caret
+       void caretPosAndHeight(Point & p, int & h) const;
 
        ///
        void draw(frontend::Painter & pain, bool paint_caret);
index 9459340b54d263ca9537825d4fb77e208ba69f23..bd3104c2509becef89527debc4aa3951f1fa410f 100644 (file)
@@ -198,6 +198,7 @@ public:
                                r = max(r, TabIndicatorWidth);
                }
 
+               //FIXME: LyXRC::cursor_width should be caret_width
                caret_width_ = lyxrc.cursor_width
                        ? lyxrc.cursor_width
                        : 1 + int((lyxrc.currentZoom + 50) / 200.0);
@@ -209,7 +210,7 @@ public:
        QRect const & rect() { return rect_; }
 
 private:
-       /// cursor is in RTL or LTR text
+       /// caret is in RTL or LTR text
        bool rtl_;
        /// indication for RTL or LTR
        bool l_shape_;
@@ -423,7 +424,7 @@ void GuiWorkArea::startBlinkingCaret()
 
        Point p;
        int h = 0;
-       d->buffer_view_->cursorPosAndHeight(p, h);
+       d->buffer_view_->caretPosAndHeight(p, h);
        // Don't start blinking if the cursor isn't on screen.
        if (!d->buffer_view_->cursorInView(p, h))
                return;
@@ -464,7 +465,7 @@ void GuiWorkArea::redraw(bool update_metrics)
                d->buffer_view_->cursor().fixIfBroken();
        }
 
-       // update cursor position, because otherwise it has to wait until
+       // update caret position, because otherwise it has to wait until
        // the blinking interval is over
        if (d->caret_visible_) {
                d->hideCaret();
@@ -507,7 +508,7 @@ void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
 
        // In order to avoid bad surprise in the middle of an operation,
        // we better stop the blinking caret...
-       // the cursor gets restarted in GuiView::restartCaret()
+       // the caret gets restarted in GuiView::restartCaret()
        stopBlinkingCaret();
        guiApp->processKeySym(key, mod);
 }
@@ -526,7 +527,7 @@ void GuiWorkArea::Private::dispatch(FuncRequest const & cmd)
                cmd.action() != LFUN_MOUSE_MOTION || cmd.button() != mouse_button::none;
 
        // In order to avoid bad surprise in the middle of an operation, we better stop
-       // the blinking cursor.
+       // the blinking caret.
        if (notJustMovingTheMouse)
                p->stopBlinkingCaret();
 
@@ -548,7 +549,7 @@ void GuiWorkArea::Private::dispatch(FuncRequest const & cmd)
                // FIXME: let GuiView take care of those.
                lyx_view_->clearMessage();
 
-               // Show the cursor immediately after any operation
+               // Show the caret immediately after any operation
                p->startBlinkingCaret();
        }
 
@@ -566,7 +567,7 @@ void GuiWorkArea::Private::resizeBufferView()
 
        Point point;
        int h = 0;
-       buffer_view_->cursorPosAndHeight(point, h);
+       buffer_view_->caretPosAndHeight(point, h);
        bool const caret_in_view = buffer_view_->cursorInView(point, h);
        buffer_view_->resize(p->viewport()->width(), p->viewport()->height());
        if (caret_in_view)
@@ -581,9 +582,9 @@ void GuiWorkArea::Private::resizeBufferView()
 
        need_resize_ = false;
        p->busy(false);
-       // Eventually, restart the cursor after the resize event.
+       // Eventually, restart the caret after the resize event.
        // We might be resizing even if the focus is on another widget so we only
-       // restart the cursor if we have the focus.
+       // restart the caret if we have the focus.
        if (p->hasFocus())
                QTimer::singleShot(50, p, SLOT(startBlinkingCaret()));
 }
@@ -596,7 +597,7 @@ void GuiWorkArea::Private::showCaret()
 
        Point point;
        int h = 0;
-       buffer_view_->cursorPosAndHeight(point, h);
+       buffer_view_->caretPosAndHeight(point, h);
        if (!buffer_view_->cursorInView(point, h))
                return;
 
@@ -614,7 +615,7 @@ void GuiWorkArea::Private::showCaret()
        if (realfont.language() == latex_language)
                l_shape = false;
 
-       // show cursor on screen
+       // show caret on screen
        Cursor & cur = buffer_view_->cursor();
        bool completable = cur.inset().showCompletionCursor()
                && completer_->completionAvailable()
@@ -623,7 +624,7 @@ void GuiWorkArea::Private::showCaret()
        caret_visible_ = true;
 
        //int cur_x = buffer_view_->getPos(cur).x_;
-       // We may have decided to slide the cursor row so that cursor
+       // We may have decided to slide the cursor row so that caret
        // is visible.
        point.x_ -= buffer_view_->horizScrollOffset();
 
@@ -683,7 +684,7 @@ void GuiWorkArea::scrollTo(int value)
                // FIXME: let GuiView take care of those.
                d->lyx_view_->updateLayoutList();
        }
-       // Show the cursor immediately after any operation.
+       // Show the caret immediately after any operation.
        startBlinkingCaret();
        // FIXME QT5
 #ifdef Q_WS_X11
@@ -1271,7 +1272,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
                viewport()->update();
        }
 
-       // Hide the cursor during the test transformation.
+       // Hide the caret during the test transformation.
        if (e->preeditString().isEmpty())
                startBlinkingCaret();
        else
@@ -1317,7 +1318,7 @@ QVariant GuiWorkArea::inputMethodQuery(Qt::InputMethodQuery query) const
                                cur_r.moveLeft(10);
                        cur_r.moveBottom(cur_r.bottom()
                                + cur_r.height() * (d->preedit_lines_ - 1));
-                       // return lower right of cursor in LyX.
+                       // return lower right of caret in LyX.
                        return cur_r;
                default:
                        return QWidget::inputMethodQuery(query);
index 4742757907bf057dafc894958aa049ce2b72fabc..2a875ad4ce39c2bfeb412a5694cff304c4843130 100644 (file)
@@ -109,7 +109,7 @@ private Q_SLOTS:
        void scrollTo(int value);
        /// timer to limit triple clicks
        void doubleClickTimeout();
-       /// toggle the cursor's visibility
+       /// toggle the caret's visibility
        void toggleCaret();
        /// close this work area.
        /// Slot for Buffer::closing signal.
index 7198c569feeab8498ebbcc27a94b02c4db9ed28e..199ce253d6c89e8ef593e29776de888a8e4456d7 100644 (file)
@@ -85,9 +85,9 @@ struct GuiWorkArea::Private
 
        ///
        void dispatch(FuncRequest const & cmd0);
-       /// hide the visible cursor, if it is visible
+       /// hide the visible caret, if it is visible
        void hideCaret();
-       /// show the cursor if it is not visible
+       /// show the caret if it is not visible
        void showCaret();
        /// Set the range and value of the scrollbar and connect to its valueChanged
        /// signal.
@@ -110,7 +110,7 @@ struct GuiWorkArea::Private
 
        ///
        CaretWidget * caret_;
-       /// is the cursor currently displayed
+       /// is the caret currently displayed
        bool caret_visible_;
        ///
        QTimer caret_timeout_;