2002-06-19 03:38:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file qscreen.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 03:38:44 +00:00
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-06-19 03:38:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QSCREEN_H
|
|
|
|
#define QSCREEN_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "screen.h"
|
|
|
|
#include <qrect.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
|
|
class WorkArea;
|
|
|
|
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/**
|
|
|
|
* Qt implementation of toolkit-specific parts of LyXScreen.
|
|
|
|
*/
|
|
|
|
class QScreen : public LyXScreen {
|
|
|
|
public:
|
|
|
|
QScreen(QWorkArea &);
|
|
|
|
|
|
|
|
virtual ~QScreen();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* draw the screen from a given position
|
|
|
|
* @param y the text position to draw from
|
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* Uses as much of the already printed pixmap as possible
|
2002-06-19 03:38:44 +00:00
|
|
|
*/
|
|
|
|
virtual void draw(LyXText *, BufferView *, unsigned int y);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/**
|
|
|
|
* showManualCursor - display the caret on the work area
|
|
|
|
* @param text the lyx text containing the cursor
|
|
|
|
* @param x the x position of the cursor
|
|
|
|
* @param y the y position of the row's baseline
|
|
|
|
* @param asc ascent of the row
|
|
|
|
* @param desc descent of the row
|
|
|
|
* @param shape the current shape
|
|
|
|
*/
|
|
|
|
virtual void showManualCursor(LyXText const *, int x, int y,
|
|
|
|
int asc, int desc,
|
|
|
|
Cursor_Shape shape);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// unpaint the cursor painted by showManualCursor()
|
|
|
|
virtual void hideCursor();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
protected:
|
|
|
|
/// get the work area
|
|
|
|
virtual WorkArea & workarea() const { return owner_; }
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-09-12 16:02:28 +00:00
|
|
|
/// repaint the whole content immediately
|
|
|
|
void repaint();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// copies specified area of pixmap to screen
|
2002-09-24 13:57:09 +00:00
|
|
|
virtual void expose(int x, int y, int exp_width, int exp_height);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// our owning widget
|
|
|
|
QWorkArea & owner_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-30 00:53:57 +00:00
|
|
|
/// the mini-pixmap used for backing store for the blinking cursor
|
2002-06-19 03:38:44 +00:00
|
|
|
boost::scoped_ptr<QPixmap> nocursor_pixmap_;
|
|
|
|
|
|
|
|
//{@ the cursor pixmap position/size
|
|
|
|
int cursor_x_;
|
|
|
|
int cursor_y_;
|
|
|
|
int cursor_w_;
|
|
|
|
int cursor_h_;
|
2002-07-30 00:53:57 +00:00
|
|
|
//@}
|
2002-06-19 03:38:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QSCREEN_H
|