]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea_Private.h
On Mac, moving down a paragraph should place the cursor at the end of the current...
[lyx.git] / src / frontends / qt4 / GuiWorkArea_Private.h
index 3058047f024016afafe98a2c833d1a869e1332e4..6d180dd175d8cd65036a1908111c2af573a716e4 100644 (file)
 #define WORKAREA_PRIVATE_H
 
 #include "FuncRequest.h"
-#include "qt_helpers.h"
+#include "LyXRC.h"
 
-#include "support/docstring.h"
 #include "support/Timeout.h"
 
-#include <QAbstractScrollArea>
 #include <QMouseEvent>
+#include <QImage>
 #include <QPixmap>
 #include <QTimer>
 
@@ -100,14 +99,11 @@ struct GuiWorkArea::Private
        void resizeBufferView();
 
        /// paint the cursor and store the background
-       virtual void showCursor(int x, int y, int h,
+       void showCursor(int x, int y, int h,
                bool l_shape, bool rtl, bool completable);
 
        /// hide the cursor
-       virtual void removeCursor();
-
-       /// This function should be called to update the buffer readonly status.
-       void setReadOnly(bool);
+       void removeCursor();
        ///
        void dispatch(FuncRequest const & cmd0, KeyModifier = NoModifier);
        /// hide the visible cursor, if it is visible
@@ -120,9 +116,21 @@ struct GuiWorkArea::Private
        void updateCursorShape();
        ///
        void setCursorShape(Qt::CursorShape shape);
+
+       void resetScreen()
+       {
+               delete screen_;
+               if (lyxrc.use_qimage) {
+                       screen_ = new QImage(p->viewport()->width(), p->viewport()->height(),
+                               QImage::Format_ARGB32_Premultiplied);
+               } else {
+                       screen_ = new QPixmap(p->viewport()->width(), p->viewport()->height());
+               }
+       }
        ///
        GuiWorkArea * p;
-
+       ///
+       QPaintDevice * screen_;
        ///
        BufferView * buffer_view_;
        /// Read only Buffer status cache.
@@ -142,8 +150,6 @@ struct GuiWorkArea::Private
        ///
        CursorWidget * cursor_;
        ///
-       QPixmap screen_;
-       ///
        bool need_resize_;
        ///
        bool schedule_redraw_;
@@ -160,7 +166,7 @@ struct GuiWorkArea::Private
        /// pressed. This is used to get the correct context menu 
        /// when the menu is actually shown (after releasing on Windows)
        /// and after the DEPM has done its job.
-       docstring context_menu_name_;
+       std::string context_menu_name_;
 }; // GuiWorkArea
 
 } // namespace frontend