00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PAINT_BUFFER_H
00011 #define QWT_PAINT_BUFFER_H 1
00012
00013 #include <qpixmap.h>
00014 #include "qwt_global.h"
00015
00016 class QPainter;
00017
00026 class QWT_EXPORT QwtPaintBuffer
00027 {
00028 public:
00029 QwtPaintBuffer();
00030 QwtPaintBuffer(QPaintDevice *, const QRect &, QPainter *p = NULL);
00031
00032 virtual ~QwtPaintBuffer();
00033
00034 void open(QPaintDevice *, const QRect &, QPainter *p = NULL);
00035 void close();
00036
00037 QPainter *painter();
00038 const QPaintDevice *device();
00039
00040 static void setEnabled(bool enable);
00041 static bool isEnabled();
00042
00044 const QPixmap &buffer() const { return d_pixBuffer; }
00045
00046 protected:
00047 void flush();
00048
00049 private:
00050 QPixmap d_pixBuffer;
00051 QRect d_rect;
00052
00053 QPaintDevice *d_device;
00054 QPainter *d_painter;
00055 QPainter *d_devicePainter;
00056
00057 static bool d_enabled;
00058 };
00059
00060 #endif