#include <qsdrv.h>
Inheritance diagram for QSCanvasDrv:
Public Methods | |
double | toPixels (double points) |
double | toPoints (double pixels) |
QSCanvasDrv () | |
virtual | ~QSCanvasDrv () |
virtual QSCanvasDrv * | copy ()=0 |
virtual void | startDrawing () |
virtual void | stopDrawing () |
virtual void | drawLine (const QSPt2f &one, const QSPt2f &two)=0 |
virtual void | drawRect (const QSPt2f &p1, const QSPt2f &p2)=0 |
virtual void | drawPoly (const QSPt2f pts[], int npoints, const bool edges[]=NULL, int edgesAutoColor=0)=0 |
virtual void | drawEllipse (const QSPt2f &p1, const QSPt2f &p2)=0 |
virtual void | drawText (const QSPt2f &pos, const QString &text, int align=AlignLeft|AlignBottom)=0 |
virtual QSPt2f | textSize (const QString &text)=0 |
virtual void | drawRText (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)=0 |
virtual void | drawRTextBox (const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom) |
virtual void | getRTextBoundingPoly (QSPt2f outPts[4], const QSPt2f &pos, int angle, const QString &text, int align=AlignLeft|AlignBottom)=0 |
virtual QSPt2f | rTextSize (int angle, const QString &text) |
virtual void | drawPoint (const QSPt2f &pos, const QSGPoint &style) |
virtual void | drawDart (const QSPt2f &pos, double angle, const QSGArrow &style) |
virtual void | drawArrow (const QSPt2f &p1, const QSPt2f &p2, const QSGArrow &p1style, const QSGArrow &p2style) |
virtual void | setFill (const QSGFill &f)=0 |
virtual void | setFont (const QSGFont &f)=0 |
virtual void | setLine (const QSGLine &l)=0 |
virtual QSGFont | currentFont () |
virtual QSGFill | currentFill () |
virtual QSGLine | currentLine () |
virtual void | beginPolyline (const QSPt2f &pos)=0 |
virtual void | drawPolylineTo (const QSPt2f &pos)=0 |
virtual void | endPolyline () |
virtual QSPt2f | currPolylinePos () |
virtual void | getPixmapBuffer (PixmapBuffer *buff, int pwidth, int pheight) |
virtual void | drawPixmap (const QSPt2f &pos, PixmapBuffer *data) |
Public Attributes | |
double | dpi |
Most functions need to be reimplemented. Font, point, arrow sizes are in points, so 'dpi' must be used to convert it to pixels, line width is an exception. Despite all coordinates are float, they are pixel coordinates. Function startDrawing() is used to initialize the graphics driver, and function stopDrawing() is called when drawing is finished.
|
Constructor |
|
Destructor |
|
Starts to draw a polyline. Implemented in QSDrvHitTest. |
|
Returns a copy of this object. Implemented in QSDrv. |
|
This function should return the current fill. Reimplemented in QSDrvQt. |
|
This function should return the current font. Reimplemented in QSDrvQt. |
|
This function should return the current line. Reimplemented in QSDrvQt. |
|
Returns the current pen position. Reimplemented in QSDrvHitTest. |
|
Draws an arrow. It can change current fill and line settings. It has a default implementation already. |
|
Draws a line end. It can change current fill settings. It has a default implementation already. |
|
Draws a circle. Implemented in QSDrvHitTest. |
|
Draw a line. Implemented in QSDrvHitTest. |
|
Draw a pixmap. Notice that the pixmap buffer will be always the last requested one.'getPixmapBuffer' / 'drawPixmap' pair is always called together. Reimplemented in QSDrvHitTest. |
|
Draws a point. Because point contains its own color attr. it can change current fill and line settings It has a default implementation already. |
|
Draw a polygon defined by 'npoints' points in 'pts'. Can change the current line ( if edgeAuto color != 0 ) Implemented in QSDrvHitTest. |
|
Draw the next line segment. Wach out for setLine() call during drawPolyline2() Implemented in QSDrvHitTest. |
|
Draw a rectangle. Implemented in QSDrvHitTest. |
|
Draw a rotated text. This must be reimplemented. Implemented in QSDrvHitTest. |
|
Draw a rotated text. Aligns the bounding rectangle, not the bounding poly. No need to be reimplemented |
|
Draw a text. Implemented in QSDrvHitTest. |
|
Ends polyline. Reimplemented in QSDrvHitTest. |
|
This method is always called before QSDrv::drawPixmap. The struct 'PixmapBuffer' must be filled with correct values. Pixmap width is requested to be equal to 'pwidth', pixmap height must be lower or equal to pheight ( see field 'lines' in 'PixmapBuffer' ). Reimplemented in QSDrvHitTest. |
|
Return size of a rotated text. This must be reimplemented. Implemented in QSDrvQt. |
|
Returns the size of a roated text. Default implementation is provided using 'getRTextBoundingPoly' |
|
Set the current fill . Implemented in QSDrvHitTest. |
|
Set the current font. Implemented in QSDrvQt. |
|
Set the current line style. Implemented in QSDrvHitTest. |
|
This method is called to activate the graphics context when drawing starts. Reimplemented in QSDrv. |
|
This function is called when drawing ends. Reimplemented in QSDrv. |
|
Return the size of the text that will be printed by the corresponding QSDrv::drawText function. Implemented in QSDrvQt. |
|
Converts points to pixels - "pixels = points*dpi/72.0". |
|
Converts pixels to points |