]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkArea.cpp
updated list of LyX translations
[lyx.git] / src / frontends / WorkArea.cpp
index c428821135b785f5fb565e2ff9675d32d39a826b..4e8187567c9ce6392994487f98d4ca9c1141ea82 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "FuncRequest.h"
 #include "LyXFunc.h"
-#include "Painter.h"
 
 #include "BufferView.h"
 #include "Buffer.h"
 #include "debug.h"
 #include "Language.h"
 #include "Color.h"
-#include "LyXFont.h"
+#include "Font.h"
 #include "LyXRC.h"
-#include "Row.h"
-#include "LyXText.h"
+#include "Text.h"
 #include "LyXView.h"
 #include "MetricsInfo.h"
-#include "Paragraph.h"
-#include "rowpainter.h"
 
 #include "gettext.h"
 #include "support/ForkedcallsController.h"
@@ -138,14 +134,23 @@ void WorkArea::redraw()
                return;
        }
 
-       // No need to do anything if this is the current view. The BufferView 
+       // No need to do anything if this is the current view. The BufferView
        // metrics are already up to date.
-       if (&lyx_view_ != theApp()->currentView())
+       if (&lyx_view_ != theApp()->currentView()) {
                // FIXME: it would be nice to optimize for the off-screen case.
                buffer_view_->updateMetrics(false);
+               buffer_view_->cursor().fixIfBroken();
+       }
 
        updateScrollbar();
 
+       // update cursor position, because otherwise it has to wait until
+       // the blinking interval is over
+       if (cursor_visible_) {
+               hideCursor();
+               showCursor();
+       }
+       
        ViewMetricsInfo const & vi = buffer_view_->viewMetricsInfo();
        greyed_out_ = false;
 
@@ -165,7 +170,7 @@ void WorkArea::redraw()
 }
 
 
-void WorkArea::processKeySym(LyXKeySymPtr key, key_modifier::state state)
+void WorkArea::processKeySym(KeySymbolPtr key, key_modifier::state state)
 {
        // In order to avoid bad surprise in the middle of an operation, we better stop
        // the blinking cursor.
@@ -206,7 +211,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
 
        // In order to avoid bad surprise in the middle of an operation, we better stop
        // the blinking cursor.
-       if (!(cmd.action == LFUN_MOUSE_MOTION 
+       if (!(cmd.action == LFUN_MOUSE_MOTION
                && cmd.button() == mouse_button::none))
                stopBlinkingCursor();
 
@@ -214,7 +219,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
 
        if (needRedraw)
                redraw();
-       
+
        // Skip these when selecting
        if (cmd.action != LFUN_MOUSE_MOTION) {
                lyx_view_.updateLayoutChoice();
@@ -223,7 +228,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
        }
 
        // GUI tweaks except with mouse motion with no button pressed.
-       if (!(cmd.action == LFUN_MOUSE_MOTION 
+       if (!(cmd.action == LFUN_MOUSE_MOTION
                && cmd.button() == mouse_button::none)) {
                // Slight hack: this is only called currently when we
                // clicked somewhere, so we force through the display
@@ -249,7 +254,7 @@ void WorkArea::resizeBufferView()
 
 void WorkArea::updateScrollbar()
 {
-       buffer_view_->updateScrollbar(); 
+       buffer_view_->updateScrollbar();
        ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
        setScrollbarParams(scroll_.height, scroll_.position,
                scroll_.lineScrollHeight);
@@ -280,8 +285,8 @@ void WorkArea::showCursor()
 
        CursorShape shape = BAR_SHAPE;
 
-       LyXText const & text = *buffer_view_->cursor().innerText();
-       LyXFont const & realfont = text.real_current_font;
+       Text const & text = *buffer_view_->cursor().innerText();
+       Font const & realfont = text.real_current_font;
        BufferParams const & bp = buffer_view_->buffer()->params();
        bool const samelang = realfont.language() == bp.language;
        bool const isrtl = realfont.isVisibleRightToLeft();
@@ -296,7 +301,7 @@ void WorkArea::showCursor()
        if (realfont.language() == latex_language)
                shape = BAR_SHAPE;
 
-       LyXFont const font = buffer_view_->cursor().getFont();
+       Font const font = buffer_view_->cursor().getFont();
        FontMetrics const & fm = theFontMetrics(font);
        int const asc = fm.maxAscent();
        int const des = fm.maxDescent();