1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-06-12 10:31:34 +00:00
|
|
|
/**
|
|
|
|
* \file screen.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2002-06-12 10:31:34 +00:00
|
|
|
* \author unknown
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author John Levon
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-18 15:44:30 +00:00
|
|
|
*/
|
1999-10-02 16:21:10 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
#ifndef SCREEN_H
|
|
|
|
#define SCREEN_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
class LyXText;
|
2004-01-13 14:13:51 +00:00
|
|
|
class CursorSlice;
|
2000-08-07 20:58:24 +00:00
|
|
|
class WorkArea;
|
2001-01-02 16:06:14 +00:00
|
|
|
class BufferView;
|
2000-08-07 20:58:24 +00:00
|
|
|
|
2002-06-12 10:31:34 +00:00
|
|
|
/**
|
2002-06-18 15:44:30 +00:00
|
|
|
* LyXScreen - document rendering management
|
2002-06-12 10:31:34 +00:00
|
|
|
*
|
2002-06-24 20:28:12 +00:00
|
|
|
* This class is used to manage the on-screen rendering inside the
|
2002-06-12 10:31:34 +00:00
|
|
|
* work area; it is responsible for deciding which LyXText rows
|
|
|
|
* need re-drawing.
|
|
|
|
*
|
|
|
|
* This class will arrange for LyXText to paint onto a pixmap
|
|
|
|
* provided by the WorkArea widget.
|
|
|
|
*
|
|
|
|
* The blinking cursor is also handled here.
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
2002-06-18 15:44:30 +00:00
|
|
|
class LyXScreen {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2002-06-18 15:44:30 +00:00
|
|
|
LyXScreen();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual ~LyXScreen();
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/// redraw the screen, without using existing pixmap
|
2003-08-01 14:51:09 +00:00
|
|
|
virtual void redraw(BufferView & bv);
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/**
|
|
|
|
* fitCursor - fit the cursor onto the work area
|
|
|
|
* @param bv the bufferview
|
|
|
|
* @return true if a change was necessary
|
|
|
|
*
|
2002-07-09 16:23:20 +00:00
|
|
|
* Scrolls the screen so that the cursor is visible
|
2002-06-18 15:44:30 +00:00
|
|
|
*/
|
2003-11-13 08:50:26 +00:00
|
|
|
virtual bool fitCursor(BufferView *);
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2003-05-03 18:05:53 +00:00
|
|
|
/// hide the visible cursor, if it is visible
|
|
|
|
void hideCursor();
|
2003-09-09 18:27:24 +00:00
|
|
|
|
2003-05-03 18:05:53 +00:00
|
|
|
/// show the cursor if it is not visible
|
|
|
|
void showCursor(BufferView & bv);
|
|
|
|
|
|
|
|
/// toggle the cursor's visibility
|
|
|
|
void toggleCursor(BufferView & bv);
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
protected:
|
2002-06-21 02:22:13 +00:00
|
|
|
/// cause the display of the given area of the work area
|
|
|
|
virtual void expose(int x, int y, int w, int h) = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/// get the work area
|
|
|
|
virtual WorkArea & workarea() const = 0;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2003-05-03 18:05:53 +00:00
|
|
|
/// types of cursor in work area
|
|
|
|
enum Cursor_Shape {
|
|
|
|
/// normal I-beam
|
|
|
|
BAR_SHAPE,
|
|
|
|
/// L-shape for locked insets of a different language
|
|
|
|
L_SHAPE,
|
|
|
|
/// reverse L-shape for RTL text
|
|
|
|
REVERSED_L_SHAPE
|
|
|
|
};
|
|
|
|
|
|
|
|
/// paint the cursor and store the background
|
|
|
|
virtual void showCursor(int x, int y, int h, Cursor_Shape shape) = 0;
|
|
|
|
|
|
|
|
/// hide the cursor
|
|
|
|
virtual void removeCursor() = 0;
|
|
|
|
|
2003-08-18 08:23:03 +00:00
|
|
|
private:
|
2002-06-18 15:44:30 +00:00
|
|
|
/// grey out (no buffer)
|
|
|
|
void greyOut();
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2003-05-03 18:05:53 +00:00
|
|
|
/// is the cursor currently displayed
|
|
|
|
bool cursor_visible_;
|
|
|
|
|
2003-02-26 12:49:01 +00:00
|
|
|
/// is the screen displaying text or the splash screen?
|
|
|
|
bool greyed_out_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
#endif // SCREEN_H
|