]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qscreen.h
incomplete key mapping stuff. Introduces some breakage.
[lyx.git] / src / frontends / qt2 / qscreen.h
1 // -*- C++ -*-
2 /**
3  * \file qscreen.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  */
9
10 #ifndef QSCREEN_H
11 #define QSCREEN_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include <boost/smart_ptr.hpp>
18  
19 #include "screen.h"
20 #include "QWorkArea.h"
21  
22 #include <qrect.h>
23  
24 /**
25  * Qt implementation of toolkit-specific parts of LyXScreen.
26  */
27 class QScreen : public LyXScreen {
28 public:
29         QScreen(QWorkArea &);
30
31         virtual ~QScreen();
32
33         /**
34          * draw the screen from a given position
35          * @param y the text position to draw from
36          *
37          * Uses as much of the already printed pixmap as possible 
38          */
39         virtual void draw(LyXText *, BufferView *, unsigned int y);
40  
41         /**
42          * showManualCursor - display the caret on the work area
43          * @param text the lyx text containing the cursor
44          * @param x the x position of the cursor
45          * @param y the y position of the row's baseline
46          * @param asc ascent of the row
47          * @param desc descent of the row
48          * @param shape the current shape
49          */
50         virtual void showManualCursor(LyXText const *, int x, int y,
51                               int asc, int desc,
52                               Cursor_Shape shape);
53         
54         /// unpaint the cursor painted by showManualCursor()
55         virtual void hideCursor();
56  
57 protected:
58         /// get the work area
59         virtual WorkArea & workarea() const { return owner_; }
60  
61         /// copies specified area of pixmap to screen
62         virtual void expose(int x, int y, int exp_width, int exp_height); 
63
64 private:
65         /// our owning widget
66         QWorkArea & owner_;
67  
68         /// the mini-pixmap used for backing store for the blinking cursor
69         boost::scoped_ptr<QPixmap> nocursor_pixmap_;
70
71         //{@ the cursor pixmap position/size
72         int cursor_x_;
73         int cursor_y_;
74         int cursor_w_;
75         int cursor_h_;
76         //@}
77 };
78
79 #endif // QSCREEN_H