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(FScreen * screen, FWorkArea * work_area)
33 : old_screen_(screen), old_work_area_(work_area)
39 /// return the painter object for this work area
40 virtual lyx::frontend::Painter & getPainter()
42 return old_work_area_->getPainter();
45 /// return the width of the work area in pixels
46 virtual int width() const
48 return old_work_area_->workWidth();
51 /// return the height of the work area in pixels
52 virtual int height() const
54 return old_work_area_->workHeight();
58 * Update the scrollbar.
59 * @param height the total document height in pixels
60 * @param pos the current position in the document, in pixels
61 * @param line_height the line-scroll amount, in pixels
63 virtual void setScrollbarParams(int height, int pos, int line_height)
65 old_work_area_->setScrollbarParams(height, pos, line_height);
69 /// paint the cursor and store the background
70 virtual void showCursor(int x, int y, int h, CursorShape shape)
72 old_screen_->showCursor(x, y, h, shape);
76 virtual void removeCursor()
78 old_screen_->removeCursor();
82 /// cause the display of the given area of the work area
83 virtual void expose(int x, int y, int w, int h)
85 old_screen_->expose(x, y, w, h);
89 FScreen * old_screen_;
90 FWorkArea * old_work_area_;
93 } // namespace frontend