2002-06-18 15:44:30 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file xscreen.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-06-18 15:44:30 +00:00
|
|
|
*
|
|
|
|
* \author unknown
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author John Levon
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-06-18 15:44:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef XSCREEN_H
|
|
|
|
#define XSCREEN_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "screen.h"
|
2002-09-27 08:35:55 +00:00
|
|
|
#include <X11/Xlib.h> // for Pixmap, GC
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2002-09-27 08:35:55 +00:00
|
|
|
class XWorkArea;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/** The class XScreen is used for the main Textbody.
|
|
|
|
Concretely, the screen is held in a pixmap. This pixmap is kept up to
|
|
|
|
date and used to optimize drawing on the screen.
|
|
|
|
This class also handles the drawing of the cursor and partly the selection.
|
|
|
|
*/
|
|
|
|
class XScreen : public LyXScreen {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
XScreen(XWorkArea &);
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual ~XScreen();
|
|
|
|
|
|
|
|
/// Sets the cursor color to LColor::cursor.
|
|
|
|
virtual void setCursorColor();
|
|
|
|
///
|
|
|
|
virtual void hideCursor();
|
|
|
|
///
|
|
|
|
virtual void showManualCursor(LyXText const *, int x, int y,
|
|
|
|
int asc, int desc,
|
|
|
|
Cursor_Shape shape);
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/** Draws the screen form textposition y. Uses as much of
|
|
|
|
the already printed pixmap as possible */
|
|
|
|
virtual void draw(LyXText *, BufferView *, unsigned int y);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/// get the work area
|
|
|
|
virtual WorkArea & workarea() const { return owner_; }
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
/// Copies specified area of pixmap to screen
|
2002-06-24 20:28:12 +00:00
|
|
|
virtual void expose(int x, int y, int w, int h);
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
private:
|
|
|
|
/// our owning widget
|
|
|
|
XWorkArea & owner_;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
///
|
|
|
|
Pixmap cursor_pixmap;
|
|
|
|
///
|
|
|
|
int cursor_pixmap_x;
|
|
|
|
///
|
|
|
|
int cursor_pixmap_y;
|
|
|
|
///
|
|
|
|
int cursor_pixmap_w;
|
|
|
|
///
|
|
|
|
int cursor_pixmap_h;
|
|
|
|
///
|
|
|
|
GC gc_copy;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|