2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team
10 * ====================================================== */
19 #include FORMS_H_LOCATION
30 typedef unsigned short Dimension;
33 /** The class LyXScreen is used for the main Textbody.
34 Concretely, the screen is held in a pixmap. This pixmap is kept up to
35 date and used to optimize drawing on the screen.
36 This class also handles the drawing of the cursor and partly the selection.
51 LyXScreen(WorkArea &);
53 /// Sets the cursor color to LColor::cursor.
54 void setCursorColor();
56 /** Draws the screen form textposition y. Uses as much of
57 the already printed pixmap as possible */
58 void Draw(LyXText *, BufferView *, unsigned int y);
60 /// Redraws the screen, without using existing pixmap
61 void Redraw(LyXText *, BufferView *);
63 /// Returns a new top so that the cursor is visible
64 unsigned int TopCursorVisible(LyXText const *);
65 /// Redraws the screen such that the cursor is visible
66 bool FitCursor(LyXText *, BufferView *);
68 void ShowCursor(LyXText const *, BufferView const *);
72 void CursorToggle(LyXText const *, BufferView const *);
74 void ShowManualCursor(LyXText const *, int x, int y,
77 /// returns 1 if first has changed, otherwise 0
78 bool FitManualCursor(LyXText *, BufferView *, int, int, int, int);
80 void ToggleSelection(LyXText *, BufferView *, bool = true,
81 int y_offset = 0, int x_offset = 0);
83 void ToggleToggle(LyXText *, BufferView *,
84 int y_offset = 0, int x_offset = 0);
86 /** Updates part of the screen. If text->status is
87 LyXText::NEED_MORE_REFRESH, we update from the
88 point of change and to the end of the screen.
89 If text->status is LyXText::NEED_VERY_LITTLE_REFRESH,
90 we only update the current row. */
91 void Update(LyXText *, BufferView *, int y_offset=0, int x_offset=0);
93 bool forceClear() const { return force_clear; }
98 /// Copies specified area of pixmap to screen
99 void expose(int x, int y, int exp_width, int exp_height);
101 /// y1 and y2 are coordinates of the screen
102 void DrawFromTo(LyXText *, BufferView *, int y1, int y2,
103 int y_offset = 0, int x_offset = 0);
105 /// y is a coordinate of the text
106 void DrawOneRow(LyXText *, BufferView *, Row * row,
107 int y_text, int y_offset = 0, int x_offset = 0);
113 Pixmap cursor_pixmap;