]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
- LyX is dead slow, so the least we can do is use anti-alised text
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index 878f1869a8df31ca4b179a69192bf3cf7a3a066b..c8aaac8b8e94d2be3331a3277b11b3ae404b18cd 100644 (file)
@@ -4,7 +4,6 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author unknown
  * \author John Levon
  * \author Abdelrazak Younes
  *
 #ifndef WORKAREA_H
 #define WORKAREA_H
 
-#ifdef emit
-#undef emit
-#endif
-
 #include "frontends/WorkArea.h"
 
 #include "QLPainter.h"
 
 #include <QAbstractScrollArea>
 #include <QMouseEvent>
-#include <QWheelEvent>
 #include <QResizeEvent>
 #include <QKeyEvent>
-#include <QPaintEvent>
 #include <QTimer>
-#include <QImage>
 #include <QPixmap>
 
 #include <queue>
 
-class Painter;
-
 class QWidget;
 class QDragEnterEvent;
 class QDropEvent;
-class QMouseEvent;
+class QWheelEvent;
+class QPaintEvent;
 
 namespace lyx {
+
+class Painter;
+
 namespace frontend {
 
 class GuiView;
@@ -54,7 +48,7 @@ class double_click {
 public:
        int x;
        int y;
-       Qt::ButtonState state;
+       Qt::MouseButton state;
        bool active;
 
        bool operator==(QMouseEvent const & e) {
@@ -95,20 +89,18 @@ public:
  * Qt-specific implementation of the work area
  * (buffer view GUI)
 */
-class GuiWorkArea: public QAbstractScrollArea, public WorkArea {
-
+class GuiWorkArea: public QAbstractScrollArea, public WorkArea
+{
        Q_OBJECT
 
 public:
+       ///
+       GuiWorkArea(int width, int height, LyXView & lyx_view);
 
-       GuiWorkArea(int width, int height, QWidget * parent, BufferView * buffer_view = 0);
-
-       virtual ~GuiWorkArea();
        /// return the width of the content pane
-       virtual int width() const { return workWidth_; }
-
+       virtual int width() const { return viewport()->width(); }
        /// return the height of the content pane
-       virtual int height() const { return workHeight_; }
+       virtual int height() const { return viewport()->height(); }
        ///
        virtual void setScrollbarParams(int height, int pos, int line_height);
 
@@ -127,15 +119,6 @@ public:
        /// 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;
-
-       /// 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);
-
        /// copies specified area of pixmap to screen
        virtual void expose(int x, int y, int exp_width, int exp_height);
 
@@ -163,8 +146,6 @@ protected:
        void wheelEvent(QWheelEvent * e);
        /// key press
        void keyPressEvent(QKeyEvent * e);
-
-protected:
        /// IM events
        void inputMethodEvent(QInputMethodEvent * e);
 
@@ -183,11 +164,6 @@ public Q_SLOTS:
        void adjustViewWithScrollBar(int action = 0);
 
 private:
-       /// Buffer view width.
-       int workWidth_;
-
-       /// Buffer view height.
-       int workHeight_;
 
        /// Our painter.
        QLPainter painter_;
@@ -199,12 +175,8 @@ private:
        SyntheticMouseEvent synthetic_mouse_event_;
 
        /// Our client side painting device.
-       //QImage paint_device_;
        QPixmap paint_device_;
 
-       /// Our server side painting device.
-       //QPixmap screen_device_;
-
        /// \todo remove
        QTimer step_timer_;