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