]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XWorkArea.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / XWorkArea.h
1 // -*- C++ -*-
2 /**
3  * \file XWorkArea.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef XWORKAREA_H
14 #define XWORKAREA_H
15
16 #include "frontends/WorkArea.h"
17 #include "XPainter.h"
18
19 #include "lyx_forms.h"
20
21
22 ///
23 class XWorkArea : public WorkArea {
24 public:
25         ///
26         XWorkArea(int xpos, int ypos, int width, int height);
27         ///
28         ~XWorkArea();
29         ///
30         virtual Painter & getPainter() { return painter_; }
31         ///
32         virtual int workWidth() const { return work_area->w; }
33         ///
34         virtual int workHeight() const { return work_area->h; }
35         ///
36         Window getWin() const { return work_area->form->window; }
37         ///
38         virtual void setScrollbarParams(int height, int pos, int line_height);
39         ///
40         Pixmap getPixmap() const { return workareapixmap; }
41         /// xforms callback
42         static int work_area_handler(FL_OBJECT *, int event,
43                                      FL_Coord, FL_Coord,
44                                      int /*key*/, void * xev);
45
46         /// return x position of window
47         int xpos() const { return work_area->x; }
48         /// return y position of window
49         int ypos() const { return work_area->y; }
50
51         /// xforms callback from scrollbar
52         void scroll_cb();
53         /// a selection exists
54         virtual void haveSelection(bool) const;
55         ///
56         virtual std::string const getClipboard() const;
57         ///
58         virtual void putClipboard(std::string const &) const;
59
60         /// handles SelectionRequest X Event, to fill the clipboard
61         int event_cb(XEvent * xev);
62 private:
63         /// generate the pixmap, and copy backing pixmap to it,
64         /// and send resize event if needed
65         void redraw(int, int);
66
67         /// GC used for copying to the screen
68         GC copy_gc;
69
70         /// the workarea free object
71         FL_OBJECT * work_area;
72         /// the scrollbar objcet
73         FL_OBJECT * scrollbar;
74         /// The pixmap overlay on the workarea
75         Pixmap workareapixmap;
76         /// the xforms-specific painter
77         XPainter painter_;
78         /// if we call redraw with true needed for locking-insets
79         bool screen_cleared;
80         /// the current document's height (for scrollbar)
81         int doc_height_;
82 };
83
84 #endif // XWORKAREA_H