]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QWorkArea.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / QWorkArea.h
index aa1cf5b89c6407e2346e53928e5e05f713232fea..92bd7f57c5d818ec32e82152eade9869aa008fe1 100644 (file)
 #undef emit
 #endif
 
-#include "funcrequest.h"
-#include "frontends/Timeout.h"
-
 #include "WorkArea.h"
 #include "QLPainter.h"
 #include "LyXView.h"
 
+#include "funcrequest.h"
+#include "frontends/Timeout.h"
+
 #include <QAbstractScrollArea>
 #include <QMouseEvent>
 #include <QWheelEvent>
@@ -36,8 +36,8 @@
 #include <QKeyEvent>
 #include <QPaintEvent>
 #include <QTimer>
-
-#include <boost/scoped_ptr.hpp>
+#include <QImage>
+#include <QPixmap>
 
 #include <queue>
 
@@ -117,31 +117,38 @@ public:
 
        ///
        virtual std::string const getClipboard() const;
-       
+
        ///
        virtual void putClipboard(std::string const &) const;
-       
+
        ///
        virtual void dragEnterEvent(QDragEnterEvent * event);
-       
+
        ///
        virtual void dropEvent(QDropEvent* event);
-       
+
        /// return the widget's painter
        virtual Painter & getPainter() { return (Painter &) painter_; }
 
-       ///
-       //virtual QPaintDevice & paintDevice() { return content_->pixmap(); }
-
        /// return the backing pixmap
-       QPixmap * pixmap() const { return pixmap_.get(); }
+       QPaintDevice * paintDevice() { return &paint_device_; }
 
-       /// return the widget's painter
-       //virtual QLPainter & getQLPainter() const { return painter_; }
+       /// update the passed area.
+       void update(int x, int y, int w, int h);
+
+       /// return a screen copy of the defined area.
+       QPixmap copyScreen(int x, int y, int w, int h) const;
 
-       /// get the content pane widget
-       QWidget * getContent() const  { return viewport(); }
+       /// Draw a pixmap onto the backing pixmap.
+       /**
+       QPixmap is implicitely shared so no need to pass by reference.
+       */
+       void drawScreen(int x, int y, QPixmap pixmap);
 
+        LyXView & view()
+        {
+                return view_;
+        }
 protected:
 
        /// repaint part of the widget
@@ -164,29 +171,31 @@ protected:
 #if USE_INPUT_METHODS
 protected:
        /// IM events
-       void QWorkArea::inputMethodEvent(QInputMethodEvent * e) 
+       void QWorkArea::inputMethodEvent(QInputMethodEvent * e)
 #endif
 
 public slots:
-\r
-       /// Timeout event Slot for keyboard bufferring.\r
+
+       /// Timeout event Slot for keyboard bufferring.
        /// \todo This is not used currently in the code, remove?
-       void keyeventTimeout();\r
-\r
-       /// Adjust the LyX buffer view with the position of the scrollbar.\r
-       /**\r
-       * The action argument is not used in the the code, it is there\r
-       * only for the connection to the vertical srollbar signal which \r
-       * emits an 'int' action.\r
+       void keyeventTimeout();
+
+       /// Adjust the LyX buffer view with the position of the scrollbar.
+       /**
+       * The action argument is not used in the the code, it is there
+       * only for the connection to the vertical srollbar signal which
+       * emits an 'int' action.
        */
        void adjustViewWithScrollBar(int action = 0);
 
 private:
-
+        ///
+        LyXView & view_;
+        
        /// Buffer view width.
        int workWidth_;
-\r
-       /// Buffer view height.\r
+
+       /// Buffer view height.
        int workHeight_;
 
        /// Our painter.
@@ -195,16 +204,19 @@ private:
        /// The slot connected to SyntheticMouseEvent::timeout.
        void generateSyntheticMouseEvent();
 
-       ///\r
+       ///
        SyntheticMouseEvent synthetic_mouse_event_;
 
-       /// the double buffered pixmap
-       boost::scoped_ptr<QPixmap> pixmap_;
+       /// Our client side painting device.
+       QImage paint_device_;
 
-       /// \todo remove\r
+       /// Our server side painting device.
+       QPixmap screen_device_;
+
+       /// \todo remove
        QTimer step_timer_;
-\r
-       /// \todo remove\r
+
+       /// \todo remove
        std::queue<boost::shared_ptr<QKeyEvent> > keyeventQueue_;
 
        double_click dc_event_;