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