]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
remove the focusInEvent() and focusOutEvent() that had so many bad side effect...
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index 9a041c00cc1aded6dc8050d11f670ffc55c99671..2f96ff7a6c448a96581087c54dd23bdf85d11e34 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
 
-#if (defined(Q_WS_X11) && QT_VERSION >= 0x030200)
-#define USE_INPUT_METHODS 1
-#endif
-
-#ifdef emit
-#undef emit
-#endif
-
-#include "frontends/LyXView.h"
 #include "frontends/WorkArea.h"
 
 #include "QLPainter.h"
@@ -52,12 +42,14 @@ class QMouseEvent;
 namespace lyx {
 namespace frontend {
 
+class GuiView;
+
 /// for emulating triple click
 class double_click {
 public:
        int x;
        int y;
-       Qt::ButtonState state;
+       Qt::MouseButton state;
        bool active;
 
        bool operator==(QMouseEvent const & e) {
@@ -98,20 +90,20 @@ 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(LyXView & owner, int w, int h);
+       GuiWorkArea(int width, int height, LyXView & lyx_view);
 
        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);
 
@@ -138,14 +130,12 @@ public:
        QPixmap is implicitely shared so no need to pass by reference.
        */
        void drawScreen(int x, int y, QPixmap pixmap);
-       
-       LyXView & view() { return view_; }
 
        /// copies specified area of pixmap to screen
        virtual void expose(int x, int y, int exp_width, int exp_height);
 
        /// paint the cursor and store the background
-       virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
+       virtual void showCursor(int x, int y, int h, CursorShape shape);
 
        /// hide the cursor
        virtual void removeCursor();
@@ -168,14 +158,10 @@ protected:
        void wheelEvent(QWheelEvent * e);
        /// key press
        void keyPressEvent(QKeyEvent * e);
-
-#if USE_INPUT_METHODS
-protected:
        /// IM events
        void inputMethodEvent(QInputMethodEvent * e);
-#endif
 
-public slots:
+public Q_SLOTS:
 
        /// Timeout event Slot for keyboard bufferring.
        /// \todo This is not used currently in the code, remove?
@@ -190,14 +176,6 @@ public slots:
        void adjustViewWithScrollBar(int action = 0);
 
 private:
-        ///
-        LyXView & view_;
-        
-       /// Buffer view width.
-       int workWidth_;
-
-       /// Buffer view height.
-       int workHeight_;
 
        /// Our painter.
        QLPainter painter_;
@@ -209,12 +187,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_;
 
@@ -244,7 +218,7 @@ private:
        ///
        QColor cursor_color_;
        ///
-       Cursor_Shape cursor_shape_;
+       CursorShape cursor_shape_;
 };
 
 } // namespace frontend