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