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
29 typedef unsigned short Dimension;
32 /** The class LyXScreen is used for the main Textbody.
33 Concretely, the screen is held in a pixmap. This pixmap is kept up to
34 date and used to optimize drawing on the screen.
35 This class also handles the drawing of the cursor and partly the selection.
50 LyXScreen(WorkArea &);
52 /** Draws the screen form textposition y. Uses as much of
53 the already printed pixmap as possible */
54 void Draw(LyXText *, unsigned long y);
56 /// Redraws the screen, without using existing pixmap
57 void Redraw(LyXText *);
59 /// Returns a new top so that the cursor is visible
60 unsigned long TopCursorVisible(LyXText const *);
61 /// Redraws the screen such that the cursor is visible
62 bool FitCursor(LyXText *);
64 void ShowCursor(LyXText const *);
68 void CursorToggle(LyXText const *);
70 void ShowManualCursor(LyXText const *, long x, long y,
73 /// returns 1 if first has changed, otherwise 0
74 bool FitManualCursor(LyXText *, long, long, int, int);
76 void ToggleSelection(LyXText *, bool = true, int y_offset = 0,
79 void ToggleToggle(LyXText *, int y_offset = 0, int x_offset = 0);
81 /** Updates part of the screen. If text->status is
82 LyXText::NEED_MORE_REFRESH, we update from the
83 point of change and to the end of the screen.
84 If text->status is LyXText::NEED_VERY_LITTLE_REFRESH,
85 we only update the current row. */
86 void Update(LyXText *, int y_offset=0, int x_offset=0);
88 bool forceClear() const { return force_clear; }
93 /// Copies specified area of pixmap to screen
94 void expose(int x, int y, int exp_width, int exp_height);
96 /// y1 and y2 are coordinates of the screen
97 void DrawFromTo(LyXText *, int y1, int y2, int y_offset=0, int x_offset=0);
99 /// y is a coordinate of the text
100 void DrawOneRow(LyXText *, Row * row, long y_text, int y_offset=0,
107 Pixmap cursor_pixmap;