]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/xscreen.h
*duck*
[lyx.git] / src / frontends / xforms / xscreen.h
1 // -*- C++ -*-
2 /**
3  * \file xscreen.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 XSCREEN_H
12 #define XSCREEN_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include <X11/Xlib.h>
19
20 #include "screen.h"
21
22 #include "XWorkArea.h"
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         virtual void hideCursor();
41         ///
42         virtual void showManualCursor(LyXText const *, int x, int y,
43                               int asc, int desc,
44                               Cursor_Shape shape);
45         
46         /** Draws the screen form textposition y. Uses as much of
47             the already printed pixmap as possible */
48         virtual void draw(LyXText *, BufferView *, unsigned int y);
49
50 protected:
51         /// get the work area
52         virtual WorkArea & workarea() const { return owner_; }
53  
54         /// Copies specified area of pixmap to screen
55         virtual void expose(int x, int y, int exp_width, int exp_height); 
56  
57 private:
58         /// our owning widget
59         XWorkArea & owner_;
60  
61         ///
62         Pixmap cursor_pixmap;
63         ///
64         int cursor_pixmap_x;
65         ///
66         int cursor_pixmap_y;
67         ///
68         int cursor_pixmap_w;
69         ///
70         int cursor_pixmap_h;
71         ///
72         GC gc_copy;
73 };
74
75 #endif