]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GScreen.h
94f35afa3b45b3c4ee84c5b4fcdb7073f63c9f8f
[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/WorkArea.h"
16
17 #include <gtkmm.h>
18
19 // FIXME: defined in X.h, spuriously pulled in by some gui headers
20 #undef CursorShape
21
22 namespace lyx {
23 namespace frontend {
24
25 class GWorkArea;
26
27 /** The class GScreen 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 GScreen {
33 public:
34         ///
35         GScreen(GWorkArea &);
36
37         ///
38         virtual ~GScreen();
39
40         /// Sets the cursor color to LColor::cursor.
41         virtual void setCursorColor(Glib::RefPtr<Gdk::GC> gc);
42         ///
43         virtual void removeCursor();
44         ///
45         virtual void showCursor(int x, int y, int h, CursorShape shape);
46
47         /// Copies specified area of pixmap to screen
48         virtual void expose(int x, int y, int w, int h);
49 private:
50         /// our owning widget
51         GWorkArea & owner_;
52
53         ///
54         Glib::RefPtr<Gdk::Pixmap> cursorPixmap_;
55         ///
56         int cursorX_;
57         ///
58         int cursorY_;
59         ///
60         int cursorW_;
61         ///
62         int cursorH_;
63 };
64
65 } // namespace frontend
66 } // namespace lyx
67
68 #endif