4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
8 * \author John Levon <moz@compsoc.man.ac.uk>
29 * LScreen - document rendering management
31 * This class is used to manage the on-screen rendering inside the
32 * work area; it is responsible for deciding which LyXText rows
35 * This class will arrange for LyXText to paint onto a pixmap
36 * provided by the WorkArea widget.
38 * The blinking cursor is also handled here.
60 /// Sets the cursor color to LColor::cursor.
61 void setCursorColor();
63 /** Draws the screen form textposition y. Uses as much of
64 the already printed pixmap as possible */
65 void draw(LyXText *, BufferView *, unsigned int y);
67 /// Redraws the screen, without using existing pixmap
68 void redraw(LyXText *, BufferView *);
71 * topCursorVisible - get a new "top" to make the cursor visible
73 * @param top_y the current y location of the containing region
75 * This helper function calculates a new y co-ordinate for
76 * the top of the containing region such that the cursor contained
77 * within the LyXText is "nicely" visible.
79 unsigned int topCursorVisible(LyXCursor const & c, int top_y);
81 /// Redraws the screen such that the cursor is visible
82 bool fitCursor(LyXText *, BufferView *);
84 void showCursor(LyXText const *, BufferView const *);
88 void cursorToggle(BufferView *) const;
90 void showManualCursor(LyXText const *, int x, int y,
93 /// returns 1 if first has changed, otherwise 0
94 bool fitManualCursor(LyXText *, BufferView *, int, int, int, int);
96 void toggleSelection(LyXText *, BufferView *, bool = true,
97 int y_offset = 0, int x_offset = 0);
99 void toggleToggle(LyXText *, BufferView *,
100 int y_offset = 0, int x_offset = 0);
102 /** Updates part of the screen. If text->status is
103 LyXText::NEED_MORE_REFRESH, we update from the
104 point of change and to the end of the screen.
105 If text->status is LyXText::NEED_VERY_LITTLE_REFRESH,
106 we only update the current row. */
107 void update(LyXText *, BufferView *, int y_offset=0, int x_offset=0);
109 bool forceClear() const { return force_clear; }
114 /// Copies specified area of pixmap to screen
115 void expose(int x, int y, int exp_width, int exp_height);
117 /// y1 and y2 are coordinates of the screen
118 void drawFromTo(LyXText *, BufferView *, int y1, int y2,
119 int y_offset = 0, int x_offset = 0, bool internal=false);
121 /// y is a coordinate of the text
122 void drawOneRow(LyXText *, BufferView *, Row * row,
123 int y_text, int y_offset = 0, int x_offset = 0);
129 Pixmap cursor_pixmap;