]> git.lyx.org Git - lyx.git/blob - src/frontends/screen.h
get rid of broken_header.h and some unneeded tests
[lyx.git] / src / frontends / screen.h
1 // -*- C++ -*-
2 /**
3  * \file screen.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 SCREEN_H
14 #define SCREEN_H
15
16
17 class LyXText;
18 class CursorSlice;
19 class WorkArea;
20 class BufferView;
21 class ViewMetricsInfo;
22
23
24 /**
25  * LyXScreen - document rendering management
26  *
27  * This class is used to manage the on-screen rendering inside the
28  * work area; it is responsible for deciding which LyXText rows
29  * need re-drawing.
30  *
31  * This class will arrange for LyXText to paint onto a pixmap
32  * provided by the WorkArea widget.
33  *
34  * The blinking cursor is also handled here.
35  */
36 class LyXScreen {
37 public:
38         LyXScreen();
39
40         virtual ~LyXScreen();
41
42         /// redraw the screen, without using existing pixmap
43         virtual void redraw(BufferView & bv, ViewMetricsInfo const & vi);
44
45         /// grey out (no buffer)
46         void greyOut();
47
48         /// hide the visible cursor, if it is visible
49         void hideCursor();
50
51         /// show the cursor if it is not visible
52         void showCursor(BufferView & bv);
53
54         /// toggle the cursor's visibility
55         void toggleCursor(BufferView & bv);
56
57 protected:
58         /// cause the display of the given area of the work area
59         virtual void expose(int x, int y, int w, int h) = 0;
60
61         /// get the work area
62         virtual WorkArea & workarea() const = 0;
63
64         /// types of cursor in work area
65         enum Cursor_Shape {
66                 /// normal I-beam
67                 BAR_SHAPE,
68                 /// L-shape for locked insets of a different language
69                 L_SHAPE,
70                 /// reverse L-shape for RTL text
71                 REVERSED_L_SHAPE
72         };
73
74         /// paint the cursor and store the background
75         virtual void showCursor(int x, int y, int h, Cursor_Shape shape) = 0;
76
77         /// hide the cursor
78         virtual void removeCursor() = 0;
79
80 private:
81         ///
82         void checkAndGreyOut();
83
84         ///
85         bool greyed_out_;
86
87         /// is the cursor currently displayed
88         bool cursor_visible_;
89 };
90
91 #endif // SCREEN_H