4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/WorkArea.h"
19 #include "LayoutEngine.h"
21 #include "lyx_forms.h"
28 class XWorkArea : public WorkArea {
31 XWorkArea(LyXView & owner, int width, int height);
35 virtual Painter & getPainter() { return painter_; }
37 virtual int workWidth() const { return work_area->w; }
39 virtual int workHeight() const { return work_area->h; }
41 Window getWin() const { return work_area->form->window; }
43 virtual void setScrollbarParams(int height, int pos, int line_height);
45 Pixmap getPixmap() const { return workareapixmap; }
47 static int work_area_handler(FL_OBJECT *, int event,
49 int /*key*/, void * xev);
51 /// return x position of window
52 int xpos() const { return work_area->x; }
53 /// return y position of window
54 int ypos() const { return work_area->y; }
56 /// xforms callback from scrollbar
58 /// a selection exists
59 virtual void haveSelection(bool) const;
61 virtual std::string const getClipboard() const;
63 virtual void putClipboard(std::string const &) const;
65 /// handles SelectionRequest X Event, to fill the clipboard
66 int event_cb(XEvent * xev);
68 /// generate the pixmap, and copy backing pixmap to it,
69 /// and send resize event if needed
70 void updateGeometry(int, int);
73 void paint(int x, int y, int w, int h);
75 /// GC used for copying to the screen
78 /// the workarea free object
79 FL_OBJECT * work_area;
80 /// the scrollbar objcet
81 FL_OBJECT * scrollbar;
82 /// The pixmap overlay on the workarea
83 Pixmap workareapixmap;
84 /// the xforms-specific painter
86 /// if we call redraw with true needed for locking-insets
88 /// the current document's height (for scrollbar)
91 boost::shared_ptr<Box> wa_box_;
96 } // namespace frontend