61 #include <QLinkedList>
63 #include <QApplication>
65 #include <QMouseEvent>
67 #include <QMainWindow>
70 #include <QPainterPath>
77 #define POINTS_PER_INCH 72
85 #define DEFAULT_DPI 72
90 #define QT_DEFAULT_X 842
91 #define QT_DEFAULT_Y 595
110 void MasterChangedPage();
128 virtual void drawArc(
short x,
short y,
short width,
short height,
PLFLT angle1,
PLFLT angle2,
PLFLT rotate,
bool fill );
130 virtual void drawLine(
short x1,
short y1,
short x2,
short y2 );
131 virtual void drawPolyline(
short * x,
short * y,
PLINT npts );
132 virtual void drawPolygon(
short * x,
short * y,
PLINT npts );
133 virtual void drawText(
EscText* txt );
134 virtual void setColor(
int r,
int g,
int b,
double alpha );
136 virtual void setGradient(
int x1,
int x2,
int y1,
int y2,
137 unsigned char *r,
unsigned char *g,
138 unsigned char *b,
PLFLT *alpha,
PLINT ncol1 );
139 virtual void setWidthF(
PLFLT w );
141 virtual void setSolid();
151 void drawTextInPicture( QPainter*,
const QString& );
168 #if defined ( PLD_bmpqt ) || defined ( PLD_jpgqt ) || defined ( PLD_pngqt ) || defined ( PLD_ppmqt ) || defined ( PLD_tiffqt ) || defined ( PLD_memqt )
175 virtual ~QtRasterDevice();
177 virtual void setBackgroundColor(
int r,
int g,
int b,
double alpha );
178 void definePlotName(
const char*
fileName,
const char* format );
180 virtual void setResolution(
double dotsPerInch )
182 setDotsPerMeterX( (
int) ( ( dotsPerInch / 25.4 ) * 1000. ) );
183 setDotsPerMeterY( (
int) ( ( dotsPerInch / 25.4 ) * 1000. ) );
186 unsigned char *memory;
194 #if defined ( PLD_svgqt ) && QT_VERSION >= 0x040300
195 #include <QSvgGenerator>
203 virtual ~QtSVGDevice();
205 virtual void setBackgroundColor(
int r,
int g,
int b,
double alpha );
206 void definePlotName(
const char*
fileName );
213 #if defined ( PLD_epsqt ) || defined ( PLD_pdfqt )
219 #if QT_VERSION < 0x040400
220 QtEPSDevice(
int i_iWidth = -1,
int i_iHeight = -1 );
225 virtual ~QtEPSDevice();
227 virtual void setBackgroundColor(
int r,
int g,
int b,
double alpha );
228 void definePlotName(
const char*
fileName,
int ifeps );
235 #if defined ( PLD_qtwidget ) || defined ( PLD_extqt )
237 typedef enum ElementType_
293 QPolygonF * Polyline;
295 QLinearGradient * LinearGradient;
296 struct ColourStruct_* ColourStruct;
297 struct TextStruct_ * TextStruct;
298 struct ArcStruct_ * ArcStruct;
321 virtual ~QtPLWidget();
328 void drawArc(
short x,
short y,
short width,
short height,
PLFLT angle1,
PLFLT angle2,
PLFLT rotate,
bool fill );
329 void drawLine(
short x1,
short y1,
short x2,
short y2 );
330 void drawPolyline(
short * x,
short * y,
PLINT npts );
331 void drawPolygon(
short * x,
short * y,
PLINT npts );
332 void setColor(
int r,
int g,
int b,
double alpha );
333 void setBackgroundColor(
int r,
int g,
int b,
double alpha );
334 void setGradient(
int x1,
int x2,
int y1,
int y2,
335 unsigned char *r,
unsigned char *g,
336 unsigned char *b,
PLFLT *alpha,
PLINT ncol1 );
337 void setWidthF(
PLFLT r );
344 void resizeEvent( QResizeEvent* );
345 void paintEvent( QPaintEvent* );
346 void mouseEvent( QMouseEvent * event );
348 void getPlotParameters(
double & io_dXFact,
double & io_dYFact,
double & io_dXOffset,
double & io_dYOffset );
349 void doPlot( QPainter* p,
double x_fact,
double y_fact,
double x_offset,
double y_offset );
350 void renderText( QPainter* p,
struct TextStruct_* s,
double x_fact,
double x_offset,
double y_fact,
double y_offset );
351 void lookupButtonEvent( QMouseEvent * event );
354 void resetPensAndBrushes( QPainter* );
356 double m_dAspectRatio;
357 QPixmap * m_pixPixmap;
359 QLinkedList<BufferElement> m_listBuffer;
362 bool redrawFromLastFlush;
372 QLinkedList<BufferElement>::const_iterator start_iterator;
394 void mousePressEvent( QMouseEvent * event );
395 void mouseReleaseEvent( QMouseEvent * event );
396 void mouseMoveEvent( QMouseEvent * event );
397 void keyPressEvent( QKeyEvent* event );
398 void closeEvent( QCloseEvent* event );
404 #if defined ( PLD_extqt )
412 virtual ~QtExtWidget();
414 void captureMousePlotCoords(
PLFLT* x,
PLFLT* y );
418 void mouseMoveEvent( QMouseEvent* event );
419 void mouseReleaseEvent( QMouseEvent* event );
420 void mousePressEvent( QMouseEvent* event );
423 void paintEvent( QPaintEvent* );
428 double cursor_x, cursor_y;
448 #if defined ( plplot_pyqt4_EXPORTS )
449 #define initplplot_pyqt4 PLDLLIMPEXP_PYQT4 initplplot_pyqt4
452 #if defined ( plplot_pyqt5_EXPORTS )
453 #define initplplot_pyqt5 PLDLLIMPEXP_PYQT5 initplplot_pyqt5
QtPLDriver * masterDevice
virtual void setBackgroundColor(int, int, int, double)
PLDLLIMPEXP_CXX void fill(PLINT n, const PLFLT *x, const PLFLT *y)
static PLStream * pls[PL_NSTREAMS]
PLDLLIMPEXP_QT_DATA(int) vectorize
static const char * fileName