4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
15 #include "frontends/WorkArea.h"
18 #include "QWorkArea.h"
23 typedef QScreen FScreen;
24 typedef QWorkArea FWorkArea;
27 * Temporary wrapper around QWorkArea and QScreen.
28 * Please refer to the Qt4 implementation for a proper cleanup of the API.
30 class GuiWorkArea: public lyx::frontend::WorkArea {
32 GuiWorkArea(LyXView & owner, int w, int h,
33 FScreen * screen, FWorkArea * work_area)
34 : lyx::frontend::WorkArea(owner, w, h),
35 old_screen_(screen), old_work_area_(work_area)
41 /// return the painter object for this work area
42 virtual lyx::frontend::Painter & getPainter()
44 return old_work_area_->getPainter();
47 /// return the width of the work area in pixels
48 virtual int width() const
50 return old_work_area_->workWidth();
53 /// return the height of the work area in pixels
54 virtual int height() const
56 return old_work_area_->workHeight();
60 * Update the scrollbar.
61 * @param height the total document height in pixels
62 * @param pos the current position in the document, in pixels
63 * @param line_height the line-scroll amount, in pixels
65 virtual void setScrollbarParams(int height, int pos, int line_height)
67 old_work_area_->setScrollbarParams(height, pos, line_height);
71 /// paint the cursor and store the background
72 virtual void showCursor(int x, int y, int h, Cursor_Shape shape)
74 old_screen_->showCursor(x, y, h, shape);
78 virtual void removeCursor()
80 old_screen_->removeCursor();
84 /// cause the display of the given area of the work area
85 virtual void expose(int x, int y, int w, int h)
87 old_screen_->expose(x, y, w, h);
91 FScreen * old_screen_;
92 FWorkArea * old_work_area_;
95 } // namespace frontend