X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpainter.h;fp=src%2Fpainter.h;h=c95b84adba32083b52f6fc2c229d847f28d943be;hb=7fde5a077bc9bbce28662fa2e5aa5043f3b4747f;hp=0000000000000000000000000000000000000000;hpb=0c01fa32c7e0629ae61992e0419f03724fc18487;p=ttedit diff --git a/src/painter.h b/src/painter.h new file mode 100644 index 0000000..c95b84a --- /dev/null +++ b/src/painter.h @@ -0,0 +1,63 @@ +#ifndef __PAINTER_H__ +#define __PAINTER_H__ + +#include +#include +#include "vector.h" +#include "glyphpoints.h" + +//#define SCREEN_ZOOM (1.0 / 4.0) + +// Forward declarations + +class Painter +{ + public: + Painter(QPainter * p = 0); + ~Painter(); + + void SetRenderHint(int); + void SetPen(QPen); + void SetPen(uint32_t, float size = 0, int style = 0); + void SetBrush(QBrush); + void SetBrush(uint32_t); + void SetFont(QFont); + void DrawAngledText(Vector, double, QString, double); + void DrawTextObject(Vector, QString, double, double angle = 0); + void DrawArc(Vector, double, double, double); + void DrawEllipse(Vector, double, double); + void DrawHandle(Vector); + void DrawArrowHandle(Vector, double); + void DrawArrowToLineHandle(Vector, double); + void DrawLine(int, int, int, int); + void DrawLine(Vector, Vector); + void DrawPoint(int, int); + void DrawRoundedRect(QRectF, double, double); + void DrawPaddedRect(QRectF); + void DrawRect(QRectF); + void DrawText(QRectF, int, QString); + void DrawArrowhead(Vector, Vector, double); + void DrawCrosshair(Vector); + void DrawInformativeText(QString); + void DrawBezier(Point, Point, Point); + void DrawBezier(IPoint, IPoint, IPoint); + void DrawSquareDot(Vector); + void DrawRoundDot(Vector); + void DrawSquareDotN(Vector, uint32_t); + void DrawRoundDotN(Vector, uint32_t); + + public: + static Vector CartesianToQtCoords(Vector); + static Vector QtToCartesianCoords(Vector); + + public: + // Class variables +// static Vector origin; // The window origin, not location of the origin +// static double zoom; // Window zoom factor +// static Vector screenSize; // Width & height of the window we're drawing on + + private: + QPainter * painter; +}; + +#endif // __PAINTER_H__