* 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"
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) {
* 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);
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();
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?
void adjustViewWithScrollBar(int action = 0);
private:
- ///
- LyXView & view_;
-
- /// Buffer view width.
- int workWidth_;
-
- /// Buffer view height.
- int workHeight_;
/// Our painter.
QLPainter painter_;
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_;
///
QColor cursor_color_;
///
- Cursor_Shape cursor_shape_;
+ CursorShape cursor_shape_;
};
} // namespace frontend