]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/xscreen.h
Introduce LFUN_PRINT.
[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
17 #include "screen.h"
18 #include <X11/Xlib.h> // for Pixmap, GC
19
20 class WorkArea;
21 class XWorkArea;
22
23
24 /** The class XScreen is used for the main Textbody.
25     Concretely, the screen is held in a pixmap.  This pixmap is kept up to
26     date and used to optimize drawing on the screen.
27     This class also handles the drawing of the cursor and partly the selection.
28  */
29 class XScreen : public LyXScreen {
30 public:
31         ///
32         XScreen(XWorkArea &);
33
34         ///
35         virtual ~XScreen();
36
37         /// Sets the cursor color to LColor::cursor.
38         virtual void setCursorColor();
39
40 protected:
41         /// get the work area
42         virtual WorkArea & workarea() const;
43
44         /// Copies specified area of pixmap to screen
45         virtual void expose(int x, int y, int w, int h);
46
47         /// paint the cursor and store the background
48         virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
49
50         /// hide the cursor
51         virtual void removeCursor();
52
53 private:
54         /// our owning widget
55         XWorkArea & owner_;
56
57         /// backing pixmap for cursor
58         Pixmap nocursor_pixmap_;
59         /// x of backing pixmap
60         int cursor_x_;
61         /// y of backing pixmap
62         int cursor_y_;
63         /// width of backing pixmap
64         int cursor_w_;
65         /// height of backing pixmap
66         int cursor_h_;
67         /// cursor cs
68         GC gc_copy;
69 };
70
71 #endif