]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/xscreen.h
fix crash with "save as"
[lyx.git] / src / frontends / xforms / xscreen.h
1 // -*- C++ -*-
2 /**
3  * \file xscreen.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 XSCREEN_H
14 #define XSCREEN_H
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "screen.h"
21 #include <X11/Xlib.h> // for Pixmap, GC
22
23 class XWorkArea;
24
25 /** The class XScreen is used for the main Textbody.
26     Concretely, the screen is held in a pixmap.  This pixmap is kept up to
27     date and used to optimize drawing on the screen.
28     This class also handles the drawing of the cursor and partly the selection.
29  */
30 class XScreen : public LyXScreen {
31 public:
32         ///
33         XScreen(XWorkArea &);
34
35         ///
36         virtual ~XScreen();
37
38         /// Sets the cursor color to LColor::cursor.
39         virtual void setCursorColor();
40         ///
41         virtual void hideCursor();
42         ///
43         virtual void showManualCursor(LyXText const *, int x, int y,
44                               int asc, int desc,
45                               Cursor_Shape shape);
46
47         /** Draws the screen form textposition y. Uses as much of
48             the already printed pixmap as possible */
49         virtual void draw(LyXText *, BufferView *, unsigned int y);
50
51 protected:
52         /// get the work area
53         virtual WorkArea & workarea() const { return owner_; }
54
55         /// Copies specified area of pixmap to screen
56         virtual void expose(int x, int y, int w, int h);
57
58 private:
59         /// our owning widget
60         XWorkArea & owner_;
61
62         ///
63         Pixmap cursor_pixmap;
64         ///
65         int cursor_pixmap_x;
66         ///
67         int cursor_pixmap_y;
68         ///
69         int cursor_pixmap_w;
70         ///
71         int cursor_pixmap_h;
72         ///
73         GC gc_copy;
74 };
75
76 #endif