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
24 typedef unsigned short Dimension;
29 /** The class LyXScreen is used for the main Textbody.
30 Concretely, the screen is held in a pixmap. This pixmap is kept up to
31 date and used to optimize drawing on the screen.
32 This class also handles the drawing of the cursor and partly the selection.
47 LyXScreen(WorkArea &); //, LyXText * text_ptr);
49 /** Draws the screen form textposition y. Uses as much of
50 the already printed pixmap as possible */
51 void Draw(LyXText *, unsigned long y);
53 /// Redraws the screen, without using existing pixmap
54 void Redraw(LyXText *);
56 /// Returns a new top so that the cursor is visible
57 unsigned long TopCursorVisible(LyXText const *);
58 /// Redraws the screen such that the cursor is visible
59 bool FitCursor(LyXText *);
61 void ShowCursor(LyXText const *);
65 void CursorToggle(LyXText const *);
67 void ShowManualCursor(LyXText const *, long x, long y, int asc, int desc,
69 /// returns 1 if first has changed, otherwise 0
70 bool FitManualCursor(LyXText *, long, long, int, int);
72 void ToggleSelection(LyXText *, int y_offset = 0, int x_offset = 0,
75 void ToggleToggle(LyXText *, int y_offset = 0, int x_offset = 0);
77 /** Updates part of the screen. If text->status is
78 LyXText::NEED_MORE_REFRESH, we update from the
79 point of change and to the end of the screen.
80 If text->status is LyXText::NEED_VERY_LITTLE_REFRESH,
81 we only update the current row. */
82 void Update(LyXText *, int y_offset=0, int x_offset=0);
87 /// Copies specified area of pixmap to screen
88 void expose(int x, int y, int exp_width, int exp_height);
90 /// y1 and y2 are coordinates of the screen
91 void DrawFromTo(LyXText *, int y1, int y2, int y_offset=0, int x_offset=0);
93 /// y is a coordinate of the text
94 void DrawOneRow(LyXText *, Row * row, long y_text, int y_offset=0,
101 Pixmap cursor_pixmap;