#ifndef WORKAREA_PRIVATE_H
#define WORKAREA_PRIVATE_H
-// Comment out to use QImage backend instead of QPixmap. This won't have any
-// effect on Windows, MacOSX and most X11 environment when running locally.
-// When running remotely on X11, this may have a big performance penalty.
-//#define USE_QIMAGE
-
#include "FuncRequest.h"
#include "qt_helpers.h"
+#include "LyXRC.h"
#include "support/docstring.h"
#include "support/Timeout.h"
#include <QAbstractScrollArea>
#include <QMouseEvent>
-#ifdef USE_QIMAGE
#include <QImage>
-#else
#include <QPixmap>
-#endif
#include <QTimer>
class QContextMenuEvent;
void resizeBufferView();
/// paint the cursor and store the background
- virtual void showCursor(int x, int y, int h,
+ void showCursor(int x, int y, int h,
bool l_shape, bool rtl, bool completable);
/// hide the cursor
- virtual void removeCursor();
+ void removeCursor();
///
void dispatch(FuncRequest const & cmd0, KeyModifier = NoModifier);
/// hide the visible cursor, if it is visible
///
void setCursorShape(Qt::CursorShape shape);
-#ifdef USE_QIMAGE
- void resetScreen()
- {
- screen_ = QImage(p->viewport()->width(), p->viewport()->height(),
- QImage::Format_ARGB32_Premultiplied);
- }
-
- QImage screen_;
-#else
void resetScreen()
{
- screen_ = QPixmap(p->viewport()->width(), p->viewport()->height());
+ delete screen_;
+ if (lyxrc.use_qimage) {
+ screen_ = new QImage(p->viewport()->width(), p->viewport()->height(),
+ QImage::Format_ARGB32_Premultiplied);
+ } else {
+ screen_ = new QPixmap(p->viewport()->width(), p->viewport()->height());
+ }
}
-
- QPixmap screen_;
-#endif
///
GuiWorkArea * p;
-
+ ///
+ QPaintDevice * screen_;
///
BufferView * buffer_view_;
/// Read only Buffer status cache.
/// pressed. This is used to get the correct context menu
/// when the menu is actually shown (after releasing on Windows)
/// and after the DEPM has done its job.
- docstring context_menu_name_;
+ std::string context_menu_name_;
}; // GuiWorkArea
} // namespace frontend