]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index f95ffaff37d9a9712e42200b383706216c851e07..c6ebce0b6867f7b9b7a4e3f891b26909c030e56a 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"
@@ -95,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(int width, int height, QWidget * parent, BufferView * buffer_view = 0);
+       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);
 
@@ -163,10 +158,12 @@ protected:
        void wheelEvent(QWheelEvent * e);
        /// key press
        void keyPressEvent(QKeyEvent * e);
-
-protected:
        /// IM events
        void inputMethodEvent(QInputMethodEvent * e);
+       /// focus in
+       void focusInEvent(QFocusEvent * ev);
+       /// focus out
+       void focusOutEvent(QFocusEvent * ev);
 
 public Q_SLOTS:
 
@@ -183,11 +180,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 +191,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_;