]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GScreen.h
8e9a1694548b5036fa61b25235530292059d77c9
[lyx.git] / src / frontends / gtk / GScreen.h
1 // -*- C++ -*-
2 /**
3  * \file GScreen.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Huang Ying
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GSCREEN_H
13 #define GSCREEN_H
14
15 #include "frontends/GuiCursor.h"
16
17 #include <gtkmm.h>
18
19 namespace lyx {
20 namespace frontend {
21
22 class GWorkArea;
23
24 /** The class GScreen 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 GScreen {
30 public:
31         ///
32         GScreen(GWorkArea &);
33
34         ///
35         virtual ~GScreen();
36
37         /// Sets the cursor color to LColor::cursor.
38         virtual void setCursorColor(Glib::RefPtr<Gdk::GC> gc);
39         ///
40         virtual void removeCursor();
41         ///
42         virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
43
44         /// Copies specified area of pixmap to screen
45         virtual void expose(int x, int y, int w, int h);
46 private:
47         /// our owning widget
48         GWorkArea & owner_;
49
50         ///
51         Glib::RefPtr<Gdk::Pixmap> cursorPixmap_;
52         ///
53         int cursorX_;
54         ///
55         int cursorY_;
56         ///
57         int cursorW_;
58         ///
59         int cursorH_;
60 };
61
62 } // namespace frontend
63 } // namespace lyx
64
65 #endif