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 "GWorkArea.h"
24 * Temporary wrapper around GWorkArea and GScreen.
25 * Please refer to the Qt4 implementation for a proper cleanup of the API.
27 class GuiWorkArea: public lyx::frontend::WorkArea {
29 GuiWorkArea(GScreen * screen, GWorkArea * work_area)
30 : old_screen_(screen), old_work_area_(work_area)
36 /// return the painter object for this work area
37 virtual lyx::frontend::Painter & getPainter()
39 return old_work_area_->getPainter();
42 /// return the width of the work area in pixels
43 virtual int width() const
45 return old_work_area_->workWidth();
48 /// return the height of the work area in pixels
49 virtual int height() const
51 return old_work_area_->workHeight();
55 * Update the scrollbar.
56 * @param height the total document height in pixels
57 * @param pos the current position in the document, in pixels
58 * @param line_height the line-scroll amount, in pixels
60 virtual void setScrollbarParams(int height, int pos, int line_height)
62 old_work_area_->setScrollbarParams(height, pos, line_height);
66 /// paint the cursor and store the background
67 virtual void showCursor(int x, int y, int h, CursorShape shape)
69 old_screen_->showCursor(x, y, h, shape);
73 virtual void removeCursor()
75 old_screen_->removeCursor();
79 /// cause the display of the given area of the work area
80 virtual void expose(int x, int y, int w, int h)
82 old_screen_->expose(x, y, w, h);
86 GScreen * old_screen_;
87 GWorkArea * old_work_area_;
90 } // namespace frontend